试算商户手续费
curl --request POST \
--url https://openplatform.gateapi.io/payment/open/institution/payClearing/clearing/previewMerchantFee \
--header 'Content-Type: application/json' \
--header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
--header 'X-GatePay-Nonce: <x-gatepay-nonce>' \
--header 'X-GatePay-On-Behalf-Of: <x-gatepay-on-behalf-of>' \
--header 'X-GatePay-Signature: <x-gatepay-signature>' \
--header 'X-GatePay-Timestamp: <x-gatepay-timestamp>' \
--data '
{
"orderCurrency": "USDT",
"accessMode": 0,
"scenario": 0,
"orderAmount": "100.00"
}
'import requests
url = "https://openplatform.gateapi.io/payment/open/institution/payClearing/clearing/previewMerchantFee"
payload = {
"orderCurrency": "USDT",
"accessMode": 0,
"scenario": 0,
"orderAmount": "100.00"
}
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>",
"X-GatePay-On-Behalf-Of": "<x-gatepay-on-behalf-of>",
"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>',
'X-GatePay-On-Behalf-Of': '<x-gatepay-on-behalf-of>',
'Content-Type': 'application/json'
},
body: JSON.stringify({orderCurrency: 'USDT', accessMode: 0, scenario: 0, orderAmount: '100.00'})
};
fetch('https://openplatform.gateapi.io/payment/open/institution/payClearing/clearing/previewMerchantFee', 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/institution/payClearing/clearing/previewMerchantFee",
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([
'orderCurrency' => 'USDT',
'accessMode' => 0,
'scenario' => 0,
'orderAmount' => '100.00'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>",
"X-GatePay-Nonce: <x-gatepay-nonce>",
"X-GatePay-On-Behalf-Of: <x-gatepay-on-behalf-of>",
"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/institution/payClearing/clearing/previewMerchantFee")
.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("X-GatePay-On-Behalf-Of", "<x-gatepay-on-behalf-of>")
.header("Content-Type", "application/json")
.body("{\n \"orderCurrency\": \"USDT\",\n \"accessMode\": 0,\n \"scenario\": 0,\n \"orderAmount\": \"100.00\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/payment/open/institution/payClearing/clearing/previewMerchantFee"
payload := strings.NewReader("{\n \"orderCurrency\": \"USDT\",\n \"accessMode\": 0,\n \"scenario\": 0,\n \"orderAmount\": \"100.00\"\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("X-GatePay-On-Behalf-Of", "<x-gatepay-on-behalf-of>")
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/institution/payClearing/clearing/previewMerchantFee")
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["X-GatePay-On-Behalf-Of"] = '<x-gatepay-on-behalf-of>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderCurrency\": \"USDT\",\n \"accessMode\": 0,\n \"scenario\": 0,\n \"orderAmount\": \"100.00\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": "000000",
"errorMessage": "",
"data": {
"merchantId": "123456789",
"merchantType": 1,
"accessMode": 0,
"orderCurrency": "USDT",
"orderAmount": 100,
"orderFee": 2.5,
"institutionFeeAmount": 2.5,
"settleAmount": 95
}
}手续费
试算商户手续费
本接口用于根据商户信息、订单金额等参数,试算该笔交易的手续费、收益分成及结算金额。仅限 Gate Pay 商户调用。
POST
/
payment
/
open
/
institution
/
payClearing
/
clearing
/
previewMerchantFee
试算商户手续费
curl --request POST \
--url https://openplatform.gateapi.io/payment/open/institution/payClearing/clearing/previewMerchantFee \
--header 'Content-Type: application/json' \
--header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
--header 'X-GatePay-Nonce: <x-gatepay-nonce>' \
--header 'X-GatePay-On-Behalf-Of: <x-gatepay-on-behalf-of>' \
--header 'X-GatePay-Signature: <x-gatepay-signature>' \
--header 'X-GatePay-Timestamp: <x-gatepay-timestamp>' \
--data '
{
"orderCurrency": "USDT",
"accessMode": 0,
"scenario": 0,
"orderAmount": "100.00"
}
'import requests
url = "https://openplatform.gateapi.io/payment/open/institution/payClearing/clearing/previewMerchantFee"
payload = {
"orderCurrency": "USDT",
"accessMode": 0,
"scenario": 0,
"orderAmount": "100.00"
}
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>",
"X-GatePay-On-Behalf-Of": "<x-gatepay-on-behalf-of>",
"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>',
'X-GatePay-On-Behalf-Of': '<x-gatepay-on-behalf-of>',
'Content-Type': 'application/json'
},
body: JSON.stringify({orderCurrency: 'USDT', accessMode: 0, scenario: 0, orderAmount: '100.00'})
};
fetch('https://openplatform.gateapi.io/payment/open/institution/payClearing/clearing/previewMerchantFee', 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/institution/payClearing/clearing/previewMerchantFee",
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([
'orderCurrency' => 'USDT',
'accessMode' => 0,
'scenario' => 0,
'orderAmount' => '100.00'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>",
"X-GatePay-Nonce: <x-gatepay-nonce>",
"X-GatePay-On-Behalf-Of: <x-gatepay-on-behalf-of>",
"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/institution/payClearing/clearing/previewMerchantFee")
.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("X-GatePay-On-Behalf-Of", "<x-gatepay-on-behalf-of>")
.header("Content-Type", "application/json")
.body("{\n \"orderCurrency\": \"USDT\",\n \"accessMode\": 0,\n \"scenario\": 0,\n \"orderAmount\": \"100.00\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/payment/open/institution/payClearing/clearing/previewMerchantFee"
payload := strings.NewReader("{\n \"orderCurrency\": \"USDT\",\n \"accessMode\": 0,\n \"scenario\": 0,\n \"orderAmount\": \"100.00\"\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("X-GatePay-On-Behalf-Of", "<x-gatepay-on-behalf-of>")
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/institution/payClearing/clearing/previewMerchantFee")
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["X-GatePay-On-Behalf-Of"] = '<x-gatepay-on-behalf-of>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderCurrency\": \"USDT\",\n \"accessMode\": 0,\n \"scenario\": 0,\n \"orderAmount\": \"100.00\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": "000000",
"errorMessage": "",
"data": {
"merchantId": "123456789",
"merchantType": 1,
"accessMode": 0,
"orderCurrency": "USDT",
"orderAmount": 100,
"orderFee": 2.5,
"institutionFeeAmount": 2.5,
"settleAmount": 95
}
}概述
本页说明POST /payment/open/institution/payClearing/clearing/previewMerchantFee 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。
说明
- 认证方式使用 GatePay 标准签名请求头。
- 本页展示同一接口的机构路径版本。
- 除创建子账户、查询子账户详情、分页查询子账户外,机构侧请求需携带
X-GatePay-On-Behalf-Of。 - 请求体可传
orderType(订单类型,非必填);请求头可传X-GatePay-Sub-MerchantId(机构子账户,非必填;仅传时试算收益分成)。 - 响应新增
institutionFeeAmount(收益分成)与settleAmount(结算金额)。 - 通用签名规则请参见 /api-reference/version/100/cn/common/securityAndSignature。
请求头
商户ID
示例:
"mZ96D37oKk-HrWJc"
签名
示例:
"601d560c54d53412aca5901256f101e7078b5779f61f30bedfe9a5f0b92f049589952a151ea477371e4a99ac0e1c3cc8dec62654b3c6a1794ef981efe19232bc"
毫秒级时间戳,与服务端时间偏差不得超过30秒
示例:
"1726027137585"
随机数
示例:
"2290830087"
必填代理归属请求头。请填写本次请求的发起方账户 ID;在机构代理商户 API 中通常填写目标子账户 ID,在机构代扣与划转接口中可填写机构账户 ID 或子账户 ID。
子账户 UID,用于传输机构子账户,以便试算时考虑收益分成(Markup)。非必填;仅传子账户时计算收益分成。
示例:
"2124674730"
请求体
application/json
试算商户手续费请求参数
订单币种,如:USDT、USDC等
示例:
"USDT"
接入模式:0=中心化支付,1=Web3支付
可用选项:
0, 1 示例:
0
交易类型(场景):0=收款
可用选项:
0 示例:
0
订单金额,必须大于等于0
示例:
"100.00"
订单类型。可选范围:0-地址支付、1-收银台支付、2-静态收款码、3-账单支付、4-AI支付。非必填,不填则取兜底费率计算。
可用选项:
0, 1, 2, 3, 4 示例:
0
⌘I

