创建费用规则
curl --request POST \
--url https://openplatform.gateapi.io/rate/commission_rule \
--header 'Content-Type: application/json' \
--header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
--header 'X-GatePay-MerchantId: <x-gatepay-merchantid>' \
--header 'X-GatePay-Nonce: <x-gatepay-nonce>' \
--header 'X-GatePay-Signature: <x-gatepay-signature>' \
--header 'X-GatePay-Timestamp: <x-gatepay-timestamp>' \
--data '
{
"sub_merchant_id": "123456789",
"r_markup": 0.001,
"effective_date": "2026-04-17 00:00:00"
}
'import requests
url = "https://openplatform.gateapi.io/rate/commission_rule"
payload = {
"sub_merchant_id": "123456789",
"r_markup": 0.001,
"effective_date": "2026-04-17 00:00: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-MerchantId": "<x-gatepay-merchantid>",
"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-MerchantId': '<x-gatepay-merchantid>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sub_merchant_id: '123456789',
r_markup: 0.001,
effective_date: '2026-04-17 00:00:00'
})
};
fetch('https://openplatform.gateapi.io/rate/commission_rule', 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/rate/commission_rule",
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([
'sub_merchant_id' => '123456789',
'r_markup' => 0.001,
'effective_date' => '2026-04-17 00:00:00'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>",
"X-GatePay-MerchantId: <x-gatepay-merchantid>",
"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/rate/commission_rule")
.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-MerchantId", "<x-gatepay-merchantid>")
.header("Content-Type", "application/json")
.body("{\n \"sub_merchant_id\": \"123456789\",\n \"r_markup\": 0.001,\n \"effective_date\": \"2026-04-17 00:00:00\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/rate/commission_rule"
payload := strings.NewReader("{\n \"sub_merchant_id\": \"123456789\",\n \"r_markup\": 0.001,\n \"effective_date\": \"2026-04-17 00:00: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-MerchantId", "<x-gatepay-merchantid>")
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/rate/commission_rule")
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-MerchantId"] = '<x-gatepay-merchantid>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sub_merchant_id\": \"123456789\",\n \"r_markup\": 0.001,\n \"effective_date\": \"2026-04-17 00:00:00\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"config_id": "cfg_202604170001",
"previous_config_id": null,
"version_no": 1,
"sub_merchant_id": "123456789",
"r_markup": 0.001,
"f_markup": 0,
"status": "PENDING_EFFECTIVE",
"effective_date": "2026-04-17 00:00:00",
"due_date": "2026-12-31 23:59:59",
"created_at": "2026-04-16T16:10:00Z",
"updated_at": "2026-04-16T16:10:00Z"
}
}费用设置
创建费用规则
为指定子账户首次创建加价(下文统称为 Markup)规则。创建成功后,该子账户交易将在底价基础上叠加 Markup 计费。
POST
/
rate
/
commission_rule
创建费用规则
curl --request POST \
--url https://openplatform.gateapi.io/rate/commission_rule \
--header 'Content-Type: application/json' \
--header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
--header 'X-GatePay-MerchantId: <x-gatepay-merchantid>' \
--header 'X-GatePay-Nonce: <x-gatepay-nonce>' \
--header 'X-GatePay-Signature: <x-gatepay-signature>' \
--header 'X-GatePay-Timestamp: <x-gatepay-timestamp>' \
--data '
{
"sub_merchant_id": "123456789",
"r_markup": 0.001,
"effective_date": "2026-04-17 00:00:00"
}
'import requests
url = "https://openplatform.gateapi.io/rate/commission_rule"
payload = {
"sub_merchant_id": "123456789",
"r_markup": 0.001,
"effective_date": "2026-04-17 00:00: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-MerchantId": "<x-gatepay-merchantid>",
"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-MerchantId': '<x-gatepay-merchantid>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sub_merchant_id: '123456789',
r_markup: 0.001,
effective_date: '2026-04-17 00:00:00'
})
};
fetch('https://openplatform.gateapi.io/rate/commission_rule', 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/rate/commission_rule",
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([
'sub_merchant_id' => '123456789',
'r_markup' => 0.001,
'effective_date' => '2026-04-17 00:00:00'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>",
"X-GatePay-MerchantId: <x-gatepay-merchantid>",
"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/rate/commission_rule")
.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-MerchantId", "<x-gatepay-merchantid>")
.header("Content-Type", "application/json")
.body("{\n \"sub_merchant_id\": \"123456789\",\n \"r_markup\": 0.001,\n \"effective_date\": \"2026-04-17 00:00:00\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/rate/commission_rule"
payload := strings.NewReader("{\n \"sub_merchant_id\": \"123456789\",\n \"r_markup\": 0.001,\n \"effective_date\": \"2026-04-17 00:00: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-MerchantId", "<x-gatepay-merchantid>")
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/rate/commission_rule")
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-MerchantId"] = '<x-gatepay-merchantid>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sub_merchant_id\": \"123456789\",\n \"r_markup\": 0.001,\n \"effective_date\": \"2026-04-17 00:00:00\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"config_id": "cfg_202604170001",
"previous_config_id": null,
"version_no": 1,
"sub_merchant_id": "123456789",
"r_markup": 0.001,
"f_markup": 0,
"status": "PENDING_EFFECTIVE",
"effective_date": "2026-04-17 00:00:00",
"due_date": "2026-12-31 23:59:59",
"created_at": "2026-04-16T16:10:00Z",
"updated_at": "2026-04-16T16:10:00Z"
}
}概述
本页介绍机构主商户首次为子账户创建 Markup 规则的接口。完整字段、请求体与响应示例由上方 OpenAPI 定义渲染。说明
- 为指定子账户首次创建加价(下文统称为 Markup)规则。创建成功后,该子账户交易将在底价基础上叠加 Markup 计费。
- 本接口使用
X-GatePay-MerchantId标识主商户上下文,不使用X-GatePay-On-Behalf-Of。 - 若该子账户已存在生效中或待生效规则,应改用“升级费用规则版本”接口。
请求头
应用 ClientId。
使用 Payment API Secret 生成的 HMAC-SHA512 签名。
毫秒级时间戳,与服务端时间偏差不得超过30秒
随机字符串,用于防重放。
主商户 ID。该接口组通过此请求头声明当前机构主商户上下文。
请求体
application/json
⌘I

