Create OTC Withdrawal Order
curl --request POST \
--url https://openplatform.gateapi.io/withdraw/open/otc/api/order/create \
--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 '
{
"quoteToken": "<string>",
"bankAccountId": "<string>",
"cryptoCurrency": "<string>",
"fiatCurrency": "<string>",
"cryptoAmount": "<string>",
"fiatAmount": "<string>",
"type": "<string>",
"clientOrderId": "<string>"
}
'import requests
url = "https://openplatform.gateapi.io/withdraw/open/otc/api/order/create"
payload = {
"quoteToken": "<string>",
"bankAccountId": "<string>",
"cryptoCurrency": "<string>",
"fiatCurrency": "<string>",
"cryptoAmount": "<string>",
"fiatAmount": "<string>",
"type": "<string>",
"clientOrderId": "<string>"
}
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({
quoteToken: '<string>',
bankAccountId: '<string>',
cryptoCurrency: '<string>',
fiatCurrency: '<string>',
cryptoAmount: '<string>',
fiatAmount: '<string>',
type: '<string>',
clientOrderId: '<string>'
})
};
fetch('https://openplatform.gateapi.io/withdraw/open/otc/api/order/create', 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/withdraw/open/otc/api/order/create",
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([
'quoteToken' => '<string>',
'bankAccountId' => '<string>',
'cryptoCurrency' => '<string>',
'fiatCurrency' => '<string>',
'cryptoAmount' => '<string>',
'fiatAmount' => '<string>',
'type' => '<string>',
'clientOrderId' => '<string>'
]),
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/withdraw/open/otc/api/order/create")
.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 \"quoteToken\": \"<string>\",\n \"bankAccountId\": \"<string>\",\n \"cryptoCurrency\": \"<string>\",\n \"fiatCurrency\": \"<string>\",\n \"cryptoAmount\": \"<string>\",\n \"fiatAmount\": \"<string>\",\n \"type\": \"<string>\",\n \"clientOrderId\": \"<string>\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/withdraw/open/otc/api/order/create"
payload := strings.NewReader("{\n \"quoteToken\": \"<string>\",\n \"bankAccountId\": \"<string>\",\n \"cryptoCurrency\": \"<string>\",\n \"fiatCurrency\": \"<string>\",\n \"cryptoAmount\": \"<string>\",\n \"fiatAmount\": \"<string>\",\n \"type\": \"<string>\",\n \"clientOrderId\": \"<string>\"\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/withdraw/open/otc/api/order/create")
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 \"quoteToken\": \"<string>\",\n \"bankAccountId\": \"<string>\",\n \"cryptoCurrency\": \"<string>\",\n \"fiatCurrency\": \"<string>\",\n \"cryptoAmount\": \"<string>\",\n \"fiatAmount\": \"<string>\",\n \"type\": \"<string>\",\n \"clientOrderId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"status": "<string>",
"errorMessage": "<string>",
"data": {
"orderId": "<string>",
"status": "<string>",
"cryptoCurrency": "<string>",
"fiatCurrency": "<string>",
"cryptoAmount": "<string>",
"fiatAmount": "<string>",
"fiatRate": "<string>",
"bankAccountId": "<string>",
"clientOrderId": "<string>",
"type": "<string>",
"createTime": 123,
"updateTime": 123,
"errMsg": "<string>",
"tradeFee": "<string>",
"finalFiatAmount": "<string>",
"bankSlipInfo": "<string>",
"promCode": "<string>"
}
}Off-ramp
Create Withdrawal Order
Create an OTC withdrawal order after obtaining a quote.
POST
/
withdraw
/
open
/
otc
/
api
/
order
/
create
Create OTC Withdrawal Order
curl --request POST \
--url https://openplatform.gateapi.io/withdraw/open/otc/api/order/create \
--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 '
{
"quoteToken": "<string>",
"bankAccountId": "<string>",
"cryptoCurrency": "<string>",
"fiatCurrency": "<string>",
"cryptoAmount": "<string>",
"fiatAmount": "<string>",
"type": "<string>",
"clientOrderId": "<string>"
}
'import requests
url = "https://openplatform.gateapi.io/withdraw/open/otc/api/order/create"
payload = {
"quoteToken": "<string>",
"bankAccountId": "<string>",
"cryptoCurrency": "<string>",
"fiatCurrency": "<string>",
"cryptoAmount": "<string>",
"fiatAmount": "<string>",
"type": "<string>",
"clientOrderId": "<string>"
}
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({
quoteToken: '<string>',
bankAccountId: '<string>',
cryptoCurrency: '<string>',
fiatCurrency: '<string>',
cryptoAmount: '<string>',
fiatAmount: '<string>',
type: '<string>',
clientOrderId: '<string>'
})
};
fetch('https://openplatform.gateapi.io/withdraw/open/otc/api/order/create', 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/withdraw/open/otc/api/order/create",
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([
'quoteToken' => '<string>',
'bankAccountId' => '<string>',
'cryptoCurrency' => '<string>',
'fiatCurrency' => '<string>',
'cryptoAmount' => '<string>',
'fiatAmount' => '<string>',
'type' => '<string>',
'clientOrderId' => '<string>'
]),
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/withdraw/open/otc/api/order/create")
.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 \"quoteToken\": \"<string>\",\n \"bankAccountId\": \"<string>\",\n \"cryptoCurrency\": \"<string>\",\n \"fiatCurrency\": \"<string>\",\n \"cryptoAmount\": \"<string>\",\n \"fiatAmount\": \"<string>\",\n \"type\": \"<string>\",\n \"clientOrderId\": \"<string>\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/withdraw/open/otc/api/order/create"
payload := strings.NewReader("{\n \"quoteToken\": \"<string>\",\n \"bankAccountId\": \"<string>\",\n \"cryptoCurrency\": \"<string>\",\n \"fiatCurrency\": \"<string>\",\n \"cryptoAmount\": \"<string>\",\n \"fiatAmount\": \"<string>\",\n \"type\": \"<string>\",\n \"clientOrderId\": \"<string>\"\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/withdraw/open/otc/api/order/create")
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 \"quoteToken\": \"<string>\",\n \"bankAccountId\": \"<string>\",\n \"cryptoCurrency\": \"<string>\",\n \"fiatCurrency\": \"<string>\",\n \"cryptoAmount\": \"<string>\",\n \"fiatAmount\": \"<string>\",\n \"type\": \"<string>\",\n \"clientOrderId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"status": "<string>",
"errorMessage": "<string>",
"data": {
"orderId": "<string>",
"status": "<string>",
"cryptoCurrency": "<string>",
"fiatCurrency": "<string>",
"cryptoAmount": "<string>",
"fiatAmount": "<string>",
"fiatRate": "<string>",
"bankAccountId": "<string>",
"clientOrderId": "<string>",
"type": "<string>",
"createTime": 123,
"updateTime": 123,
"errMsg": "<string>",
"tradeFee": "<string>",
"finalFiatAmount": "<string>",
"bankSlipInfo": "<string>",
"promCode": "<string>"
}
}Overview
This page documents thePOST /withdraw/open/otc/api/order/create 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.
Usage Guidance
- Create the order with a fresh quote token.
- Make sure the bank account used in the request is already approved and available for settlement.
- Store the expected fiat amount, trade fee fields, and final settlement information for reconciliation.
- Use callback plus detail query rather than relying on creation response alone.
Headers
Merchant application client ID used to identify the calling app.
HMAC signature generated from the request according to GatePay signing rules.
Millisecond timestamp; the difference from server time must not exceed 30 seconds.
Random nonce used together with the timestamp to prevent replay attacks.
Body
application/json
Quote token returned by the quote API.
Destination bank account ID for fiat settlement.
Cryptocurrency being sold. Currently supported: USDT, USDC.
Fiat currency to be settled out. Currently supported: USD.
Crypto amount for the withdrawal order.
Expected fiat settlement amount.
Order type. Use SELL for off-ramp.
Merchant-defined unique order ID.
⌘I

