主动发起扣款
curl --request POST \
--url https://openplatform.gateapi.io/pay-subscription/open/v1/order/deduct \
--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 '
{
"merchantDeductNo": "DEDUCT_20260420_001",
"amount": 10.5,
"currency": "USDT"
}
'import requests
url = "https://openplatform.gateapi.io/pay-subscription/open/v1/order/deduct"
payload = {
"merchantDeductNo": "DEDUCT_20260420_001",
"amount": 10.5,
"currency": "USDT"
}
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({merchantDeductNo: 'DEDUCT_20260420_001', amount: 10.5, currency: 'USDT'})
};
fetch('https://openplatform.gateapi.io/pay-subscription/open/v1/order/deduct', 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/pay-subscription/open/v1/order/deduct",
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([
'merchantDeductNo' => 'DEDUCT_20260420_001',
'amount' => 10.5,
'currency' => 'USDT'
]),
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/pay-subscription/open/v1/order/deduct")
.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 \"merchantDeductNo\": \"DEDUCT_20260420_001\",\n \"amount\": 10.5,\n \"currency\": \"USDT\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/pay-subscription/open/v1/order/deduct"
payload := strings.NewReader("{\n \"merchantDeductNo\": \"DEDUCT_20260420_001\",\n \"amount\": 10.5,\n \"currency\": \"USDT\"\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/pay-subscription/open/v1/order/deduct")
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 \"merchantDeductNo\": \"DEDUCT_20260420_001\",\n \"amount\": 10.5,\n \"currency\": \"USDT\"\n}"
response = http.request(request)
puts response.read_body{
"code": "0",
"message": "",
"data": {
"deductOrderNo": "70778338049917033",
"merchantDeductNo": "DEDUCT_20260420_001",
"status": "SUCCESS",
"amount": "10.50000000",
"currency": "USDT",
"totalDeducted": "10.50000000",
"remainingAmount": "89.50000000",
"deductTime": 1773989575000
},
"success": true
}扣款
主动发起扣款
商户主动对订阅单发起扣款;subscriptionOrderNo 与 merchantSubscriptionOrderNo 须二选一传入。merchantDeductNo 在商户侧全局唯一,用于幂等。
POST
/
pay-subscription
/
open
/
v1
/
order
/
deduct
主动发起扣款
curl --request POST \
--url https://openplatform.gateapi.io/pay-subscription/open/v1/order/deduct \
--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 '
{
"merchantDeductNo": "DEDUCT_20260420_001",
"amount": 10.5,
"currency": "USDT"
}
'import requests
url = "https://openplatform.gateapi.io/pay-subscription/open/v1/order/deduct"
payload = {
"merchantDeductNo": "DEDUCT_20260420_001",
"amount": 10.5,
"currency": "USDT"
}
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({merchantDeductNo: 'DEDUCT_20260420_001', amount: 10.5, currency: 'USDT'})
};
fetch('https://openplatform.gateapi.io/pay-subscription/open/v1/order/deduct', 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/pay-subscription/open/v1/order/deduct",
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([
'merchantDeductNo' => 'DEDUCT_20260420_001',
'amount' => 10.5,
'currency' => 'USDT'
]),
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/pay-subscription/open/v1/order/deduct")
.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 \"merchantDeductNo\": \"DEDUCT_20260420_001\",\n \"amount\": 10.5,\n \"currency\": \"USDT\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/pay-subscription/open/v1/order/deduct"
payload := strings.NewReader("{\n \"merchantDeductNo\": \"DEDUCT_20260420_001\",\n \"amount\": 10.5,\n \"currency\": \"USDT\"\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/pay-subscription/open/v1/order/deduct")
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 \"merchantDeductNo\": \"DEDUCT_20260420_001\",\n \"amount\": 10.5,\n \"currency\": \"USDT\"\n}"
response = http.request(request)
puts response.read_body{
"code": "0",
"message": "",
"data": {
"deductOrderNo": "70778338049917033",
"merchantDeductNo": "DEDUCT_20260420_001",
"status": "SUCCESS",
"amount": "10.50000000",
"currency": "USDT",
"totalDeducted": "10.50000000",
"remainingAmount": "89.50000000",
"deductTime": 1773989575000
},
"success": true
}概述
本页说明POST /pay-subscription/open/v1/order/deduct 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。
说明
- 鉴权使用 GatePay 标准签名请求头。
- 本页为商户开放平台路径说明。
- 签名与验签规则见 /global/api-reference/version/100/cn/common/securityAndSignature。
请求头
请求体
application/json
主动扣款请求体

