curl --request POST \
--url https://openplatform.gateapi.io/v1/pay/withdraw/query \
--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 '
{
"batch_id": "237394559478075555",
"detail_status": "ALL"
}
'import requests
url = "https://openplatform.gateapi.io/v1/pay/withdraw/query"
payload = {
"batch_id": "237394559478075555",
"detail_status": "ALL"
}
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({batch_id: '237394559478075555', detail_status: 'ALL'})
};
fetch('https://openplatform.gateapi.io/v1/pay/withdraw/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/v1/pay/withdraw/query",
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([
'batch_id' => '237394559478075555',
'detail_status' => 'ALL'
]),
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/v1/pay/withdraw/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>")
.header("Content-Type", "application/json")
.body("{\n \"batch_id\": \"237394559478075555\",\n \"detail_status\": \"ALL\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/v1/pay/withdraw/query"
payload := strings.NewReader("{\n \"batch_id\": \"237394559478075555\",\n \"detail_status\": \"ALL\"\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/v1/pay/withdraw/query")
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 \"batch_id\": \"237394559478075555\",\n \"detail_status\": \"ALL\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"batch_id": "237394559478075350",
"merchant_id": 10002,
"client_id": "mZ96D37oKk-HrWJc",
"status": "FAIL",
"create_time": 1726055849126,
"channel_id": "123456",
"withdraw_list": [
{
"id": 35,
"batch_id": "237394559478075350",
"merchant_id": 10002,
"suborder_id": "268830764354768896",
"chain": "ETH",
"address": "0x1234567890abcdef",
"currency": "USDT",
"amount": "1",
"fee": "0",
"tx_id": "",
"timestamp": 0,
"memo": "Payment for services-1",
"status": "FAIL",
"merchant_withdraw_id": "M137394559478075550",
"err_msg": "unexpected http code error",
"client_id": "mZ96D37oKk-HrWJc",
"create_time": 1726055848856,
"update_time": 1726055856011,
"channel_id": "123456",
"done_amount": "1"
},
{
"id": 36,
"batch_id": "237394559478075350",
"merchant_id": 10002,
"suborder_id": "268830764354768897",
"chain": "ETH",
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"currency": "USDT",
"amount": "0.001",
"fee": "0",
"tx_id": "",
"timestamp": 0,
"memo": "Payment for services-1",
"status": "FAIL",
"merchant_withdraw_id": "M137394559478075551",
"err_msg": "unexpected http code error",
"client_id": "mZ96D37oKk-HrWJc",
"create_time": 1726055848856,
"update_time": 1726055856010,
"channel_id": "123456",
"done_amount": "0.001"
}
]
}
}Query Withdrawal Status
Query the status and details of a batch withdrawal order and its sub-orders by batch ID and detail status.
curl --request POST \
--url https://openplatform.gateapi.io/v1/pay/withdraw/query \
--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 '
{
"batch_id": "237394559478075555",
"detail_status": "ALL"
}
'import requests
url = "https://openplatform.gateapi.io/v1/pay/withdraw/query"
payload = {
"batch_id": "237394559478075555",
"detail_status": "ALL"
}
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({batch_id: '237394559478075555', detail_status: 'ALL'})
};
fetch('https://openplatform.gateapi.io/v1/pay/withdraw/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/v1/pay/withdraw/query",
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([
'batch_id' => '237394559478075555',
'detail_status' => 'ALL'
]),
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/v1/pay/withdraw/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>")
.header("Content-Type", "application/json")
.body("{\n \"batch_id\": \"237394559478075555\",\n \"detail_status\": \"ALL\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/v1/pay/withdraw/query"
payload := strings.NewReader("{\n \"batch_id\": \"237394559478075555\",\n \"detail_status\": \"ALL\"\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/v1/pay/withdraw/query")
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 \"batch_id\": \"237394559478075555\",\n \"detail_status\": \"ALL\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"batch_id": "237394559478075350",
"merchant_id": 10002,
"client_id": "mZ96D37oKk-HrWJc",
"status": "FAIL",
"create_time": 1726055849126,
"channel_id": "123456",
"withdraw_list": [
{
"id": 35,
"batch_id": "237394559478075350",
"merchant_id": 10002,
"suborder_id": "268830764354768896",
"chain": "ETH",
"address": "0x1234567890abcdef",
"currency": "USDT",
"amount": "1",
"fee": "0",
"tx_id": "",
"timestamp": 0,
"memo": "Payment for services-1",
"status": "FAIL",
"merchant_withdraw_id": "M137394559478075550",
"err_msg": "unexpected http code error",
"client_id": "mZ96D37oKk-HrWJc",
"create_time": 1726055848856,
"update_time": 1726055856011,
"channel_id": "123456",
"done_amount": "1"
},
{
"id": 36,
"batch_id": "237394559478075350",
"merchant_id": 10002,
"suborder_id": "268830764354768897",
"chain": "ETH",
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"currency": "USDT",
"amount": "0.001",
"fee": "0",
"tx_id": "",
"timestamp": 0,
"memo": "Payment for services-1",
"status": "FAIL",
"merchant_withdraw_id": "M137394559478075551",
"err_msg": "unexpected http code error",
"client_id": "mZ96D37oKk-HrWJc",
"create_time": 1726055848856,
"update_time": 1726055856010,
"channel_id": "123456",
"done_amount": "0.001"
}
]
}
}Overview
This page documents thePOST /v1/pay/withdraw/query endpoint. The full schema, parameters, and examples are rendered from the linked OpenAPI definition above.
Notes
- Authentication uses the standard GatePay signed headers.
- This page documents the standard merchant endpoint.
- For shared signing rules, see /api-reference/version/100/en/common/securityAndSignature.
Headers
The clientId assigned when the merchant registers an application in the Gate merchant console.
"4186d0c6-6a35-55a9-8dc6-5312769dbff8"
Request signature. GatePay uses this signature to verify whether the request is valid.
Millisecond timestamp; the difference from server time must not exceed 30 seconds.
"1672905655498"
Random string. Must comply with HTTP header rules; recommended length is within 32 characters, composed of digits and letters.
"9578"
Body
Request body for querying batch withdrawal status.
Unique batch ID generated by the merchant at /v1/pay/withdraw.
Query status of sub-orders
ALL: all sub-orders
INIT :new added sub-orders
PENDING: pending sub-orders
PROCESSING: submitted withdrawal request, pending confirmation
CHECK: in review
FAIL: failed sub-orders
DONE: successful sub-orders.
Response
Withdrawal batch details
Response body for querying batch withdrawal status.
Main order status: INIT (newly created order), PROCESSING (newly created payout order is in processing), PARTIAL (partially successful), FAIL (fully failed), SUCCESS (fully successful)
Error code
Error message
Batch withdrawal details
Show child attributes
Show child attributes

