curl --request POST \
--url https://openplatform.gateapi.io/v1/pay/convert \
--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 '
{
"clientReqId": "181147",
"sellCurrency": "GT",
"buyCurrency": "USDT",
"buyAmount": "1",
"sellAmount": "0.04464002",
"quoteId": "PAY-2a5743d8"
}
'import requests
url = "https://openplatform.gateapi.io/v1/pay/convert"
payload = {
"clientReqId": "181147",
"sellCurrency": "GT",
"buyCurrency": "USDT",
"buyAmount": "1",
"sellAmount": "0.04464002",
"quoteId": "PAY-2a5743d8"
}
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({
clientReqId: '181147',
sellCurrency: 'GT',
buyCurrency: 'USDT',
buyAmount: '1',
sellAmount: '0.04464002',
quoteId: 'PAY-2a5743d8'
})
};
fetch('https://openplatform.gateapi.io/v1/pay/convert', 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/convert",
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([
'clientReqId' => '181147',
'sellCurrency' => 'GT',
'buyCurrency' => 'USDT',
'buyAmount' => '1',
'sellAmount' => '0.04464002',
'quoteId' => 'PAY-2a5743d8'
]),
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/convert")
.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 \"clientReqId\": \"181147\",\n \"sellCurrency\": \"GT\",\n \"buyCurrency\": \"USDT\",\n \"buyAmount\": \"1\",\n \"sellAmount\": \"0.04464002\",\n \"quoteId\": \"PAY-2a5743d8\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/v1/pay/convert"
payload := strings.NewReader("{\n \"clientReqId\": \"181147\",\n \"sellCurrency\": \"GT\",\n \"buyCurrency\": \"USDT\",\n \"buyAmount\": \"1\",\n \"sellAmount\": \"0.04464002\",\n \"quoteId\": \"PAY-2a5743d8\"\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/convert")
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 \"clientReqId\": \"181147\",\n \"sellCurrency\": \"GT\",\n \"buyCurrency\": \"USDT\",\n \"buyAmount\": \"1\",\n \"sellAmount\": \"0.04464002\",\n \"quoteId\": \"PAY-2a5743d8\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"order_id": "327196066546229248",
"userId": 10002,
"sellCurrency": "GT",
"buyCurrency": "USDT",
"sellAmount": "0.04464002",
"buyAmount": "1",
"status": 1,
"rate": "22.40142365527614",
"quoteId": "PAY-2a5743d8",
"createTime": 1739971221273
}
}Create Convert Order
Initiate convert.
curl --request POST \
--url https://openplatform.gateapi.io/v1/pay/convert \
--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 '
{
"clientReqId": "181147",
"sellCurrency": "GT",
"buyCurrency": "USDT",
"buyAmount": "1",
"sellAmount": "0.04464002",
"quoteId": "PAY-2a5743d8"
}
'import requests
url = "https://openplatform.gateapi.io/v1/pay/convert"
payload = {
"clientReqId": "181147",
"sellCurrency": "GT",
"buyCurrency": "USDT",
"buyAmount": "1",
"sellAmount": "0.04464002",
"quoteId": "PAY-2a5743d8"
}
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({
clientReqId: '181147',
sellCurrency: 'GT',
buyCurrency: 'USDT',
buyAmount: '1',
sellAmount: '0.04464002',
quoteId: 'PAY-2a5743d8'
})
};
fetch('https://openplatform.gateapi.io/v1/pay/convert', 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/convert",
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([
'clientReqId' => '181147',
'sellCurrency' => 'GT',
'buyCurrency' => 'USDT',
'buyAmount' => '1',
'sellAmount' => '0.04464002',
'quoteId' => 'PAY-2a5743d8'
]),
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/convert")
.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 \"clientReqId\": \"181147\",\n \"sellCurrency\": \"GT\",\n \"buyCurrency\": \"USDT\",\n \"buyAmount\": \"1\",\n \"sellAmount\": \"0.04464002\",\n \"quoteId\": \"PAY-2a5743d8\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openplatform.gateapi.io/v1/pay/convert"
payload := strings.NewReader("{\n \"clientReqId\": \"181147\",\n \"sellCurrency\": \"GT\",\n \"buyCurrency\": \"USDT\",\n \"buyAmount\": \"1\",\n \"sellAmount\": \"0.04464002\",\n \"quoteId\": \"PAY-2a5743d8\"\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/convert")
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 \"clientReqId\": \"181147\",\n \"sellCurrency\": \"GT\",\n \"buyCurrency\": \"USDT\",\n \"buyAmount\": \"1\",\n \"sellAmount\": \"0.04464002\",\n \"quoteId\": \"PAY-2a5743d8\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"code": "000000",
"errorMessage": "",
"data": {
"order_id": "327196066546229248",
"userId": 10002,
"sellCurrency": "GT",
"buyCurrency": "USDT",
"sellAmount": "0.04464002",
"buyAmount": "1",
"status": 1,
"rate": "22.40142365527614",
"quoteId": "PAY-2a5743d8",
"createTime": 1739971221273
}
}Overview
This page documents thePOST /v1/pay/convert 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 /global/api-reference/version/100/en/common/securityAndSignature.
Headers
Merchant client ID assigned when registering the application
"mZ96D37oKk-HrWJc"
Request signature for verification
"8504fe097f7297f8952c76e628ce59dbc93d1df64c95f26c73140ef365d4aa1471826ada0534315461682ec35c131d7e133c51d2ab0822fe7366650a111887ba"
Millisecond timestamp; the difference from server time must not exceed 30 seconds.
"1740019013818"
Random string, recommended length within 32 characters
"9722139164"
Body
Client request ID (randomly generated by the user to ensure idempotency)
Quote ID (must match the one returned by the preview interface)
Purchase amount (must match the one returned by the preview interface)
Purchase currency (must match the one returned by the preview interface)
Sell amount (must match the one returned by the preview interface)
Sell currency (must match the one returned by the preview interface)

