收银台下单
curl --request POST \
--url https://openplatform.gateapi.io/v1/pay/checkout/order \
--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 '
{
"merchantTradeNo": "163",
"env": {
"terminalType": "APP"
},
"merchantUserId": 123,
"goods": {
"goodsType": "02",
"goodsName": "Sipariş Ödemesi - 177",
"goodsDetail": "Sipariş No : 160"
},
"chain": "MATIC",
"fullCurrType": "USDT_MATIC"
}
'import requests
url = "https://openplatform.gateapi.io/v1/pay/checkout/order"
payload = {
"merchantTradeNo": "163",
"env": { "terminalType": "APP" },
"merchantUserId": 123,
"goods": {
"goodsType": "02",
"goodsName": "Sipariş Ödemesi - 177",
"goodsDetail": "Sipariş No : 160"
},
"chain": "MATIC",
"fullCurrType": "USDT_MATIC"
}
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({
merchantTradeNo: '163',
env: {terminalType: 'APP'},
merchantUserId: 123,
goods: {
goodsType: '02',
goodsName: 'Sipariş Ödemesi - 177',
goodsDetail: 'Sipariş No : 160'
},
chain: 'MATIC',
fullCurrType: 'USDT_MATIC'
})
};
fetch('https://openplatform.gateapi.io/v1/pay/checkout/order', 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/v1/pay/checkout/order",
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([
'merchantTradeNo' => '163',
'env' => [
'terminalType' => 'APP'
],
'merchantUserId' => 123,
'goods' => [
'goodsType' => '02',
'goodsName' => 'Sipariş Ödemesi - 177',
'goodsDetail' => 'Sipariş No : 160'
],
'chain' => 'MATIC',
'fullCurrType' => 'USDT_MATIC'
]),
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/v1/pay/checkout/order")
.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 \"merchantTradeNo\": \"163\",\n \"env\": {\n \"terminalType\": \"APP\"\n },\n \"merchantUserId\": 123,\n \"goods\": {\n \"goodsType\": \"02\",\n \"goodsName\": \"Sipariş Ödemesi - 177\",\n \"goodsDetail\": \"Sipariş No : 160\"\n },\n \"chain\": \"MATIC\",\n \"fullCurrType\": \"USDT_MATIC\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/v1/pay/checkout/order"
payload := strings.NewReader("{\n \"merchantTradeNo\": \"163\",\n \"env\": {\n \"terminalType\": \"APP\"\n },\n \"merchantUserId\": 123,\n \"goods\": {\n \"goodsType\": \"02\",\n \"goodsName\": \"Sipariş Ödemesi - 177\",\n \"goodsDetail\": \"Sipariş No : 160\"\n },\n \"chain\": \"MATIC\",\n \"fullCurrType\": \"USDT_MATIC\"\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/v1/pay/checkout/order")
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 \"merchantTradeNo\": \"163\",\n \"env\": {\n \"terminalType\": \"APP\"\n },\n \"merchantUserId\": 123,\n \"goods\": {\n \"goodsType\": \"02\",\n \"goodsName\": \"Sipariş Ödemesi - 177\",\n \"goodsDetail\": \"Sipariş No : 160\"\n },\n \"chain\": \"MATIC\",\n \"fullCurrType\": \"USDT_MATIC\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"prepayId": "65466648727916544",
"orderAmount": "1",
"surchargeAmount": "0",
"currency": "USDT",
"fiatCurrency": "",
"fiatAmount": "",
"terminalType": "APP",
"expireTime": 1677573665219,
"qrContent": "http://openplatform.gate.io/qr/GA0cskPehKxQpshvm3Goeve8dHpwCl6yCHLSWUYrLqo=",
"location": "https://www.gate.com/cashier?prepayid=65466648727916544",
"payCurrency": "USDT",
"payAmount": "1",
"chain": {
"chain_type": "BSC",
"address": "0x86608d3C9f979b98a3b2417216eD859d313E339D",
"fullCurrType": "USDT_EOS"
},
"channelId": "123456",
"goodsName": "charge",
"inUsdt": "93.99"
}
}收银台
收银台下单
创建收银台预订单,指定订单金额、币种、商品信息等。
POST
/
v1
/
pay
/
checkout
/
order
收银台下单
curl --request POST \
--url https://openplatform.gateapi.io/v1/pay/checkout/order \
--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 '
{
"merchantTradeNo": "163",
"env": {
"terminalType": "APP"
},
"merchantUserId": 123,
"goods": {
"goodsType": "02",
"goodsName": "Sipariş Ödemesi - 177",
"goodsDetail": "Sipariş No : 160"
},
"chain": "MATIC",
"fullCurrType": "USDT_MATIC"
}
'import requests
url = "https://openplatform.gateapi.io/v1/pay/checkout/order"
payload = {
"merchantTradeNo": "163",
"env": { "terminalType": "APP" },
"merchantUserId": 123,
"goods": {
"goodsType": "02",
"goodsName": "Sipariş Ödemesi - 177",
"goodsDetail": "Sipariş No : 160"
},
"chain": "MATIC",
"fullCurrType": "USDT_MATIC"
}
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({
merchantTradeNo: '163',
env: {terminalType: 'APP'},
merchantUserId: 123,
goods: {
goodsType: '02',
goodsName: 'Sipariş Ödemesi - 177',
goodsDetail: 'Sipariş No : 160'
},
chain: 'MATIC',
fullCurrType: 'USDT_MATIC'
})
};
fetch('https://openplatform.gateapi.io/v1/pay/checkout/order', 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/v1/pay/checkout/order",
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([
'merchantTradeNo' => '163',
'env' => [
'terminalType' => 'APP'
],
'merchantUserId' => 123,
'goods' => [
'goodsType' => '02',
'goodsName' => 'Sipariş Ödemesi - 177',
'goodsDetail' => 'Sipariş No : 160'
],
'chain' => 'MATIC',
'fullCurrType' => 'USDT_MATIC'
]),
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/v1/pay/checkout/order")
.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 \"merchantTradeNo\": \"163\",\n \"env\": {\n \"terminalType\": \"APP\"\n },\n \"merchantUserId\": 123,\n \"goods\": {\n \"goodsType\": \"02\",\n \"goodsName\": \"Sipariş Ödemesi - 177\",\n \"goodsDetail\": \"Sipariş No : 160\"\n },\n \"chain\": \"MATIC\",\n \"fullCurrType\": \"USDT_MATIC\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/v1/pay/checkout/order"
payload := strings.NewReader("{\n \"merchantTradeNo\": \"163\",\n \"env\": {\n \"terminalType\": \"APP\"\n },\n \"merchantUserId\": 123,\n \"goods\": {\n \"goodsType\": \"02\",\n \"goodsName\": \"Sipariş Ödemesi - 177\",\n \"goodsDetail\": \"Sipariş No : 160\"\n },\n \"chain\": \"MATIC\",\n \"fullCurrType\": \"USDT_MATIC\"\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/v1/pay/checkout/order")
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 \"merchantTradeNo\": \"163\",\n \"env\": {\n \"terminalType\": \"APP\"\n },\n \"merchantUserId\": 123,\n \"goods\": {\n \"goodsType\": \"02\",\n \"goodsName\": \"Sipariş Ödemesi - 177\",\n \"goodsDetail\": \"Sipariş No : 160\"\n },\n \"chain\": \"MATIC\",\n \"fullCurrType\": \"USDT_MATIC\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"prepayId": "65466648727916544",
"orderAmount": "1",
"surchargeAmount": "0",
"currency": "USDT",
"fiatCurrency": "",
"fiatAmount": "",
"terminalType": "APP",
"expireTime": 1677573665219,
"qrContent": "http://openplatform.gate.io/qr/GA0cskPehKxQpshvm3Goeve8dHpwCl6yCHLSWUYrLqo=",
"location": "https://www.gate.com/cashier?prepayid=65466648727916544",
"payCurrency": "USDT",
"payAmount": "1",
"chain": {
"chain_type": "BSC",
"address": "0x86608d3C9f979b98a3b2417216eD859d313E339D",
"fullCurrType": "USDT_EOS"
},
"channelId": "123456",
"goodsName": "charge",
"inUsdt": "93.99"
}
}概述
本页说明POST /v1/pay/checkout/order 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。
说明
- 认证方式使用 GatePay 标准签名请求头。
- 本页展示普通商户接口。
- 这是收银台支付链路的起点接口,通常后续会搭配
GET /v2/pay/order/query与支付回调一起使用。 - 成功响应中请重点保存
prepayId,并使用返回的location跳转用户,不要手动拼接页面地址。 - 通用签名规则请参见 /api-reference/version/100/cn/common/securityAndSignature。
请求头
商户客户端ID
示例:
"mZ96D37oKk-HrWJc"
签名
时间戳(毫秒)
示例:
"1695611256106"
随机数
示例:
"1260554069"
请求体
application/json
收银台下单请求参数
商户订单号
示例:
"163"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
支付者在商户平台注册时的唯一ID
示例:
123
所选链名字
示例:
"MATIC"
包含链名字的币种字段
示例:
"USDT_MATIC"
加密货币币种
示例:
"USDT"
加密货币订单金额,最小值0.000001,最高精度为6位
示例:
"118.75"
附加费,指由消费者承担的费用
容差金额
法币币种
法币订单金额,最小值0.01,最高精度为2位
地址支付的付款币种
订单过期绝对时间单位毫秒
订单支付成功后返回跳转地址
示例:
"https://lotkeys.com/tr/gate-payment-response"
订单支付失败后返回跳转地址
示例:
"https://lotkeys.com/tr/gate-payment-response"
客户名称
示例:
"123456"
Actual settlement currency
Payment amount
Blockchain address
⌘I

