创建 OTC 入金订单
curl --request POST \
--url https://openplatform.gateapi.io/payment/open/otc/api/recharge \
--header 'Content-Type: application/json' \
--header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
--header 'X-GatePay-Nonce: <x-gatepay-nonce>' \
--header 'X-GatePay-Signature: <x-gatepay-signature>' \
--header 'X-GatePay-Timestamp: <x-gatepay-timestamp>' \
--data '
{
"quoteToken": "qt_01JXYZABCDEF",
"bankId": "ba_123456789",
"currency": "USDT",
"amount": "1088.42",
"fiatCurrency": "USD",
"fiatAmount": "1000"
}
'import requests
url = "https://openplatform.gateapi.io/payment/open/otc/api/recharge"
payload = {
"quoteToken": "qt_01JXYZABCDEF",
"bankId": "ba_123456789",
"currency": "USDT",
"amount": "1088.42",
"fiatCurrency": "USD",
"fiatAmount": "1000"
}
headers = {
"X-GatePay-Certificate-ClientId": "<x-gatepay-certificate-clientid>",
"X-GatePay-Signature": "<x-gatepay-signature>",
"X-GatePay-Timestamp": "<x-gatepay-timestamp>",
"X-GatePay-Nonce": "<x-gatepay-nonce>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-GatePay-Certificate-ClientId': '<x-gatepay-certificate-clientid>',
'X-GatePay-Signature': '<x-gatepay-signature>',
'X-GatePay-Timestamp': '<x-gatepay-timestamp>',
'X-GatePay-Nonce': '<x-gatepay-nonce>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quoteToken: 'qt_01JXYZABCDEF',
bankId: 'ba_123456789',
currency: 'USDT',
amount: '1088.42',
fiatCurrency: 'USD',
fiatAmount: '1000'
})
};
fetch('https://openplatform.gateapi.io/payment/open/otc/api/recharge', 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/payment/open/otc/api/recharge",
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([
'quoteToken' => 'qt_01JXYZABCDEF',
'bankId' => 'ba_123456789',
'currency' => 'USDT',
'amount' => '1088.42',
'fiatCurrency' => 'USD',
'fiatAmount' => '1000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>",
"X-GatePay-Nonce: <x-gatepay-nonce>",
"X-GatePay-Signature: <x-gatepay-signature>",
"X-GatePay-Timestamp: <x-gatepay-timestamp>"
],
]);
$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/payment/open/otc/api/recharge")
.header("X-GatePay-Certificate-ClientId", "<x-gatepay-certificate-clientid>")
.header("X-GatePay-Signature", "<x-gatepay-signature>")
.header("X-GatePay-Timestamp", "<x-gatepay-timestamp>")
.header("X-GatePay-Nonce", "<x-gatepay-nonce>")
.header("Content-Type", "application/json")
.body("{\n \"quoteToken\": \"qt_01JXYZABCDEF\",\n \"bankId\": \"ba_123456789\",\n \"currency\": \"USDT\",\n \"amount\": \"1088.42\",\n \"fiatCurrency\": \"USD\",\n \"fiatAmount\": \"1000\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/payment/open/otc/api/recharge"
payload := strings.NewReader("{\n \"quoteToken\": \"qt_01JXYZABCDEF\",\n \"bankId\": \"ba_123456789\",\n \"currency\": \"USDT\",\n \"amount\": \"1088.42\",\n \"fiatCurrency\": \"USD\",\n \"fiatAmount\": \"1000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-GatePay-Certificate-ClientId", "<x-gatepay-certificate-clientid>")
req.Header.Add("X-GatePay-Signature", "<x-gatepay-signature>")
req.Header.Add("X-GatePay-Timestamp", "<x-gatepay-timestamp>")
req.Header.Add("X-GatePay-Nonce", "<x-gatepay-nonce>")
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/payment/open/otc/api/recharge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-GatePay-Certificate-ClientId"] = '<x-gatepay-certificate-clientid>'
request["X-GatePay-Signature"] = '<x-gatepay-signature>'
request["X-GatePay-Timestamp"] = '<x-gatepay-timestamp>'
request["X-GatePay-Nonce"] = '<x-gatepay-nonce>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteToken\": \"qt_01JXYZABCDEF\",\n \"bankId\": \"ba_123456789\",\n \"currency\": \"USDT\",\n \"amount\": \"1088.42\",\n \"fiatCurrency\": \"USD\",\n \"fiatAmount\": \"1000\"\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"status": "<string>",
"errorMessage": "<string>",
"data": {
"orderId": "<string>",
"otcOrderId": "<string>",
"currency": "<string>",
"amount": "<string>",
"fiatCurrency": "<string>",
"fiatAmount": "<string>",
"cfRate": "<string>",
"bankId": "<string>",
"bankNumber": "<string>",
"paid": true,
"status": "<string>",
"card_info": {
"id": 123,
"uid": 123,
"entity": "<string>",
"bank_account_name": "<string>",
"bank_name": "<string>",
"bank_country": "<string>",
"bank_address": "<string>",
"bank_code": "<string>",
"branch_code": "<string>",
"iban": "<string>",
"swift": "<string>",
"remittance_line_number": "<string>",
"agent_bank_name": "<string>",
"agent_bank_swift": "<string>",
"transferRemark": "<string>",
"memo": "<string>",
"is_default": true,
"bank_id": "<string>"
},
"createTime": 123,
"promoCode": "<string>",
"transferRemark": "<string>"
}
}入金
创建入金订单
创建 OTC 法币入金订单。
POST
/
payment
/
open
/
otc
/
api
/
recharge
创建 OTC 入金订单
curl --request POST \
--url https://openplatform.gateapi.io/payment/open/otc/api/recharge \
--header 'Content-Type: application/json' \
--header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
--header 'X-GatePay-Nonce: <x-gatepay-nonce>' \
--header 'X-GatePay-Signature: <x-gatepay-signature>' \
--header 'X-GatePay-Timestamp: <x-gatepay-timestamp>' \
--data '
{
"quoteToken": "qt_01JXYZABCDEF",
"bankId": "ba_123456789",
"currency": "USDT",
"amount": "1088.42",
"fiatCurrency": "USD",
"fiatAmount": "1000"
}
'import requests
url = "https://openplatform.gateapi.io/payment/open/otc/api/recharge"
payload = {
"quoteToken": "qt_01JXYZABCDEF",
"bankId": "ba_123456789",
"currency": "USDT",
"amount": "1088.42",
"fiatCurrency": "USD",
"fiatAmount": "1000"
}
headers = {
"X-GatePay-Certificate-ClientId": "<x-gatepay-certificate-clientid>",
"X-GatePay-Signature": "<x-gatepay-signature>",
"X-GatePay-Timestamp": "<x-gatepay-timestamp>",
"X-GatePay-Nonce": "<x-gatepay-nonce>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-GatePay-Certificate-ClientId': '<x-gatepay-certificate-clientid>',
'X-GatePay-Signature': '<x-gatepay-signature>',
'X-GatePay-Timestamp': '<x-gatepay-timestamp>',
'X-GatePay-Nonce': '<x-gatepay-nonce>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quoteToken: 'qt_01JXYZABCDEF',
bankId: 'ba_123456789',
currency: 'USDT',
amount: '1088.42',
fiatCurrency: 'USD',
fiatAmount: '1000'
})
};
fetch('https://openplatform.gateapi.io/payment/open/otc/api/recharge', 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/payment/open/otc/api/recharge",
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([
'quoteToken' => 'qt_01JXYZABCDEF',
'bankId' => 'ba_123456789',
'currency' => 'USDT',
'amount' => '1088.42',
'fiatCurrency' => 'USD',
'fiatAmount' => '1000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>",
"X-GatePay-Nonce: <x-gatepay-nonce>",
"X-GatePay-Signature: <x-gatepay-signature>",
"X-GatePay-Timestamp: <x-gatepay-timestamp>"
],
]);
$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/payment/open/otc/api/recharge")
.header("X-GatePay-Certificate-ClientId", "<x-gatepay-certificate-clientid>")
.header("X-GatePay-Signature", "<x-gatepay-signature>")
.header("X-GatePay-Timestamp", "<x-gatepay-timestamp>")
.header("X-GatePay-Nonce", "<x-gatepay-nonce>")
.header("Content-Type", "application/json")
.body("{\n \"quoteToken\": \"qt_01JXYZABCDEF\",\n \"bankId\": \"ba_123456789\",\n \"currency\": \"USDT\",\n \"amount\": \"1088.42\",\n \"fiatCurrency\": \"USD\",\n \"fiatAmount\": \"1000\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/payment/open/otc/api/recharge"
payload := strings.NewReader("{\n \"quoteToken\": \"qt_01JXYZABCDEF\",\n \"bankId\": \"ba_123456789\",\n \"currency\": \"USDT\",\n \"amount\": \"1088.42\",\n \"fiatCurrency\": \"USD\",\n \"fiatAmount\": \"1000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-GatePay-Certificate-ClientId", "<x-gatepay-certificate-clientid>")
req.Header.Add("X-GatePay-Signature", "<x-gatepay-signature>")
req.Header.Add("X-GatePay-Timestamp", "<x-gatepay-timestamp>")
req.Header.Add("X-GatePay-Nonce", "<x-gatepay-nonce>")
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/payment/open/otc/api/recharge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-GatePay-Certificate-ClientId"] = '<x-gatepay-certificate-clientid>'
request["X-GatePay-Signature"] = '<x-gatepay-signature>'
request["X-GatePay-Timestamp"] = '<x-gatepay-timestamp>'
request["X-GatePay-Nonce"] = '<x-gatepay-nonce>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteToken\": \"qt_01JXYZABCDEF\",\n \"bankId\": \"ba_123456789\",\n \"currency\": \"USDT\",\n \"amount\": \"1088.42\",\n \"fiatCurrency\": \"USD\",\n \"fiatAmount\": \"1000\"\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"status": "<string>",
"errorMessage": "<string>",
"data": {
"orderId": "<string>",
"otcOrderId": "<string>",
"currency": "<string>",
"amount": "<string>",
"fiatCurrency": "<string>",
"fiatAmount": "<string>",
"cfRate": "<string>",
"bankId": "<string>",
"bankNumber": "<string>",
"paid": true,
"status": "<string>",
"card_info": {
"id": 123,
"uid": 123,
"entity": "<string>",
"bank_account_name": "<string>",
"bank_name": "<string>",
"bank_country": "<string>",
"bank_address": "<string>",
"bank_code": "<string>",
"branch_code": "<string>",
"iban": "<string>",
"swift": "<string>",
"remittance_line_number": "<string>",
"agent_bank_name": "<string>",
"agent_bank_swift": "<string>",
"transferRemark": "<string>",
"memo": "<string>",
"is_default": true,
"bank_id": "<string>"
},
"createTime": 123,
"promoCode": "<string>",
"transferRemark": "<string>"
}
}概述
本页说明POST /payment/open/otc/api/recharge 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。
说明
- 认证方式使用 GatePay 标准签名请求头。
- 本页展示普通商户接口。
- 通用签名规则请参见 /api-reference/version/100/cn/common/securityAndSignature。
使用建议
- 调用该接口前,应先获取仍在有效期内的 OTC 报价。
- 建议同时持久化保存
orderId,便于后续对账与查询。 - 接口返回的银行信息应视为结算指令,与订单快照一起保存。
- 不要把”创建订单”理解为”付款完成”,后续仍需线下汇款并确认已付款。
- 机构子账户:在创建机构子账户的OTC入金订单前,必须先完成机构子账户KYB 认证。具体详见:获取认证URL。
请求头
用于标识调用应用的商户应用 ClientId。
按 GatePay 签名规则生成的 HMAC 签名。
毫秒级时间戳,与服务端时间偏差不得超过30秒
与时间戳配合使用的随机串,用于防止重放攻击。
机构子账户 UID。仅在机构代替子账户发起业务请求时传输;直连商户请求时不需要传输。
请求体
application/json
⌘I

