查询交易手续费
curl --request GET \
--url https://openplatform.gateapi.io/api/open/v1/pay/order/fee/query \
--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>'import requests
url = "https://openplatform.gateapi.io/api/open/v1/pay/order/fee/query"
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>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
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>'
}
};
fetch('https://openplatform.gateapi.io/api/open/v1/pay/order/fee/query', 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/api/open/v1/pay/order/fee/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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.get("https://openplatform.gateapi.io/api/open/v1/pay/order/fee/query")
.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>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/api/open/v1/pay/order/fee/query"
req, _ := http.NewRequest("GET", url, nil)
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>")
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/api/open/v1/pay/order/fee/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.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>'
response = http.request(request)
puts response.read_body{
"code": "000000",
"data": {
"merchantTradeNo": "M8017074206",
"orderCurrency": "USDC",
"orderAmount": "110.33",
"payAmount": "110.33",
"totalFeeAmount": "5.11",
"totalSettleAmount": "105.22",
"payDetails": [
{
"transactionId": "35717875766394895",
"payType": "GatePay",
"payTime": "1762858225978",
"payAmount": "0.11",
"payCurrency": "USDC",
"feeAmount": "0.11",
"settleAmount": "0",
"institutionFeeAmount": "0"
}
],
"totalInstitutionFeeAmount": "0"
},
"status": "SUCCESS",
"errorMessage": ""
}手续费
查询交易手续费
根据商户订单号查询订单的手续费、收益分成、支付明细及结算信息。本接口为 GET 请求,商户订单号通过 URL Query 参数 merchantTradeNo 传递。
GET
/
api
/
open
/
v1
/
pay
/
order
/
fee
/
query
查询交易手续费
curl --request GET \
--url https://openplatform.gateapi.io/api/open/v1/pay/order/fee/query \
--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>'import requests
url = "https://openplatform.gateapi.io/api/open/v1/pay/order/fee/query"
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>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
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>'
}
};
fetch('https://openplatform.gateapi.io/api/open/v1/pay/order/fee/query', 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/api/open/v1/pay/order/fee/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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.get("https://openplatform.gateapi.io/api/open/v1/pay/order/fee/query")
.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>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/api/open/v1/pay/order/fee/query"
req, _ := http.NewRequest("GET", url, nil)
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>")
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/api/open/v1/pay/order/fee/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.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>'
response = http.request(request)
puts response.read_body{
"code": "000000",
"data": {
"merchantTradeNo": "M8017074206",
"orderCurrency": "USDC",
"orderAmount": "110.33",
"payAmount": "110.33",
"totalFeeAmount": "5.11",
"totalSettleAmount": "105.22",
"payDetails": [
{
"transactionId": "35717875766394895",
"payType": "GatePay",
"payTime": "1762858225978",
"payAmount": "0.11",
"payCurrency": "USDC",
"feeAmount": "0.11",
"settleAmount": "0",
"institutionFeeAmount": "0"
}
],
"totalInstitutionFeeAmount": "0"
},
"status": "SUCCESS",
"errorMessage": ""
}概述
本页说明GET /api/open/v1/pay/order/fee/query 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。
说明
- 认证方式使用 GatePay 标准签名请求头。
- 本页展示普通商户接口。
- 本接口为 GET 请求,
merchantTradeNo通过 URL Query 参数传递,不要使用 POST Body 或 form-data。 - 响应
data新增totalInstitutionFeeAmount(累计已收取的收益分成);payDetails[]新增institutionFeeAmount(每笔支付流水的收益分成)。 - 字段文案:手续费由平台收取;收益分成为机构 markup 部分收益;结算金额指扣除手续费和收益分成后,最终结算至商户余额账户的金额。
- 存在清分中流水时,本接口继续返回错误(手续费计算中),不改为成功返回 pending 明细。
- 通用签名规则请参见 /api-reference/version/100/cn/common/securityAndSignature。
请求头
商户客户端ID
示例:
"4186d0c6-6a35-55a9-8dc6-5312769dbff8"
签名
示例:
"672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8"
毫秒级时间戳,与服务端时间偏差不得超过30秒
示例:
"1672905655498"
随机数
示例:
"9578"
查询参数
商户订单号
示例:
"M8017074206"
⌘I

