获取认证 URL
curl --request POST \
--url https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url \
--header 'Content-Type: application/json' \
--header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
--header 'X-GatePay-Merchant-Id: <x-gatepay-merchant-id>' \
--header 'X-GatePay-On-Behalf-Of: <x-gatepay-on-behalf-of>' \
--data '
{
"expireSeconds": 86400
}
'import requests
url = "https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url"
payload = { "expireSeconds": 86400 }
headers = {
"X-GatePay-On-Behalf-Of": "<x-gatepay-on-behalf-of>",
"X-GatePay-Merchant-Id": "<x-gatepay-merchant-id>",
"X-GatePay-Certificate-ClientId": "<x-gatepay-certificate-clientid>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-GatePay-On-Behalf-Of': '<x-gatepay-on-behalf-of>',
'X-GatePay-Merchant-Id': '<x-gatepay-merchant-id>',
'X-GatePay-Certificate-ClientId': '<x-gatepay-certificate-clientid>',
'Content-Type': 'application/json'
},
body: JSON.stringify({expireSeconds: 86400})
};
fetch('https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expireSeconds' => 86400
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>",
"X-GatePay-Merchant-Id: <x-gatepay-merchant-id>",
"X-GatePay-On-Behalf-Of: <x-gatepay-on-behalf-of>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url")
.header("X-GatePay-On-Behalf-Of", "<x-gatepay-on-behalf-of>")
.header("X-GatePay-Merchant-Id", "<x-gatepay-merchant-id>")
.header("X-GatePay-Certificate-ClientId", "<x-gatepay-certificate-clientid>")
.header("Content-Type", "application/json")
.body("{\n \"expireSeconds\": 86400\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url"
payload := strings.NewReader("{\n \"expireSeconds\": 86400\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-GatePay-On-Behalf-Of", "<x-gatepay-on-behalf-of>")
req.Header.Add("X-GatePay-Merchant-Id", "<x-gatepay-merchant-id>")
req.Header.Add("X-GatePay-Certificate-ClientId", "<x-gatepay-certificate-clientid>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-GatePay-On-Behalf-Of"] = '<x-gatepay-on-behalf-of>'
request["X-GatePay-Merchant-Id"] = '<x-gatepay-merchant-id>'
request["X-GatePay-Certificate-ClientId"] = '<x-gatepay-certificate-clientid>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expireSeconds\": 86400\n}"
response = http.request(request)
puts response.read_body{
"code": "0",
"message": "success",
"data": {
"authUrl": "<string>",
"subAccountId": 123,
"expireTime": 123,
"requestId": "<string>"
}
}子账户
获取认证 URL
以机构商户为主体,为指定的机构子账户申请一个合法的、有过期时间的「子账户 Onboarding 托管页面」URL,用于引导子账户持有人进行 KYB 认证。
POST
/
pay-cashier
/
open
/
v1
/
certification
/
url
获取认证 URL
curl --request POST \
--url https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url \
--header 'Content-Type: application/json' \
--header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
--header 'X-GatePay-Merchant-Id: <x-gatepay-merchant-id>' \
--header 'X-GatePay-On-Behalf-Of: <x-gatepay-on-behalf-of>' \
--data '
{
"expireSeconds": 86400
}
'import requests
url = "https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url"
payload = { "expireSeconds": 86400 }
headers = {
"X-GatePay-On-Behalf-Of": "<x-gatepay-on-behalf-of>",
"X-GatePay-Merchant-Id": "<x-gatepay-merchant-id>",
"X-GatePay-Certificate-ClientId": "<x-gatepay-certificate-clientid>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-GatePay-On-Behalf-Of': '<x-gatepay-on-behalf-of>',
'X-GatePay-Merchant-Id': '<x-gatepay-merchant-id>',
'X-GatePay-Certificate-ClientId': '<x-gatepay-certificate-clientid>',
'Content-Type': 'application/json'
},
body: JSON.stringify({expireSeconds: 86400})
};
fetch('https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expireSeconds' => 86400
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>",
"X-GatePay-Merchant-Id: <x-gatepay-merchant-id>",
"X-GatePay-On-Behalf-Of: <x-gatepay-on-behalf-of>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url")
.header("X-GatePay-On-Behalf-Of", "<x-gatepay-on-behalf-of>")
.header("X-GatePay-Merchant-Id", "<x-gatepay-merchant-id>")
.header("X-GatePay-Certificate-ClientId", "<x-gatepay-certificate-clientid>")
.header("Content-Type", "application/json")
.body("{\n \"expireSeconds\": 86400\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url"
payload := strings.NewReader("{\n \"expireSeconds\": 86400\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-GatePay-On-Behalf-Of", "<x-gatepay-on-behalf-of>")
req.Header.Add("X-GatePay-Merchant-Id", "<x-gatepay-merchant-id>")
req.Header.Add("X-GatePay-Certificate-ClientId", "<x-gatepay-certificate-clientid>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://openplatform.gateapi.io/pay-cashier/open/v1/certification/url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-GatePay-On-Behalf-Of"] = '<x-gatepay-on-behalf-of>'
request["X-GatePay-Merchant-Id"] = '<x-gatepay-merchant-id>'
request["X-GatePay-Certificate-ClientId"] = '<x-gatepay-certificate-clientid>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expireSeconds\": 86400\n}"
response = http.request(request)
puts response.read_body{
"code": "0",
"message": "success",
"data": {
"authUrl": "<string>",
"subAccountId": 123,
"expireTime": 123,
"requestId": "<string>"
}
}概述
本页说明「获取认证URL」接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。说明
- 认证方式使用 GatePay 标准签名请求头。
- 这个机构专属接口需要携带
X-GatePay-On-Behalf-Of。 - 通用签名规则请参见 /api-reference/version/100/cn/common/securityAndSignature。
注意事项
- 请求体必须包含
expireSeconds参数,用于指定认证URL过期时间 - URL 中的 token 参数包含认证信息,请妥善保管
请求头
机构子账户 ID
商户 ID
客户端 ID(证书专用)
⌘I

