更新费用规则
curl --request POST \
--url https://openplatform.gateapi.io/rate/commission_rule/upgrade \
--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 '
{
"r_markup": 0.002,
"effective_date": "2026-05-01 00:00:00"
}
'import requests
url = "https://openplatform.gateapi.io/rate/commission_rule/upgrade"
payload = {
"r_markup": 0.002,
"effective_date": "2026-05-01 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({r_markup: 0.002, effective_date: '2026-05-01 00:00:00'})
};
fetch('https://openplatform.gateapi.io/rate/commission_rule/upgrade', 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/upgrade",
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([
'r_markup' => 0.002,
'effective_date' => '2026-05-01 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/upgrade")
.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 \"r_markup\": 0.002,\n \"effective_date\": \"2026-05-01 00:00:00\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/rate/commission_rule/upgrade"
payload := strings.NewReader("{\n \"r_markup\": 0.002,\n \"effective_date\": \"2026-05-01 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/upgrade")
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 \"r_markup\": 0.002,\n \"effective_date\": \"2026-05-01 00:00:00\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"config_id": "cfg_202605010001",
"previous_config_id": "cfg_existing_xxx",
"version_no": 2,
"sub_merchant_id": "123456789",
"r_markup": 0.002,
"f_markup": 1,
"status": "PENDING_EFFECTIVE",
"effective_date": "2026-05-01 00:00:00",
"due_date": null,
"created_at": "2026-04-17T09:00:00Z",
"updated_at": "2026-04-17T09:00:00Z"
}
}费用设置
更新费用规则
本接口将新建一条规则版本;创建成功不会立即变更当前生效规则,但会将未生效版本(如有)置为失效。新版本生效时,将整体替换当前生效规则。
POST
/
rate
/
commission_rule
/
upgrade
更新费用规则
curl --request POST \
--url https://openplatform.gateapi.io/rate/commission_rule/upgrade \
--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 '
{
"r_markup": 0.002,
"effective_date": "2026-05-01 00:00:00"
}
'import requests
url = "https://openplatform.gateapi.io/rate/commission_rule/upgrade"
payload = {
"r_markup": 0.002,
"effective_date": "2026-05-01 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({r_markup: 0.002, effective_date: '2026-05-01 00:00:00'})
};
fetch('https://openplatform.gateapi.io/rate/commission_rule/upgrade', 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/upgrade",
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([
'r_markup' => 0.002,
'effective_date' => '2026-05-01 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/upgrade")
.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 \"r_markup\": 0.002,\n \"effective_date\": \"2026-05-01 00:00:00\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/rate/commission_rule/upgrade"
payload := strings.NewReader("{\n \"r_markup\": 0.002,\n \"effective_date\": \"2026-05-01 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/upgrade")
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 \"r_markup\": 0.002,\n \"effective_date\": \"2026-05-01 00:00:00\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"config_id": "cfg_202605010001",
"previous_config_id": "cfg_existing_xxx",
"version_no": 2,
"sub_merchant_id": "123456789",
"r_markup": 0.002,
"f_markup": 1,
"status": "PENDING_EFFECTIVE",
"effective_date": "2026-05-01 00:00:00",
"due_date": null,
"created_at": "2026-04-17T09:00:00Z",
"updated_at": "2026-04-17T09:00:00Z"
}
}概述
本页介绍机构主商户通过新建版本方式更新子账户费用规则的接口。完整字段、请求体与响应示例由上方 OpenAPI 定义渲染。说明
- 本接口将新建一条规则版本;创建成功不会立即变更当前生效规则,但会将未生效版本(如有)置为失效。新版本生效时,将整体替换当前生效规则。
- 本接口使用
X-GatePay-MerchantId标识主商户上下文,不使用X-GatePay-On-Behalf-Of。 - 请求体中使用
sub_merchant_id指定待更新的子账户,不再使用config_id作为更新入参。
请求头
应用 ClientId。
使用 Payment API Secret 生成的 HMAC-SHA512 签名。
毫秒级时间戳,与服务端时间偏差不得超过30秒
随机字符串,用于防重放。
主商户 ID。该接口组通过此请求头声明当前机构主商户上下文。
请求体
application/json
⌘I

