curl --request POST \
--url https://external.dev.onboardpay.co/transactions/v2/offramp/initiate \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--data '
{
"offerId": "<string>",
"unitAmount": "<string>",
"offerToken": "<string>",
"rate": 123,
"fiatAmount": 123,
"tradeRequestBroadcastId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentMethodId": "<string>",
"paymentChannelId": "<string>",
"buyerPaymentMethodId": "<string>",
"customerWallet": {
"walletAddress": 0,
"networkId": "bsc_testnet",
"walletName": "My Trust Wallet"
},
"apiKey": "<string>",
"thirdPartyOrderTradeId": "<string>",
"cexOrderId": "<string>"
}
'import requests
url = "https://external.dev.onboardpay.co/transactions/v2/offramp/initiate"
payload = {
"offerId": "<string>",
"unitAmount": "<string>",
"offerToken": "<string>",
"rate": 123,
"fiatAmount": 123,
"tradeRequestBroadcastId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentMethodId": "<string>",
"paymentChannelId": "<string>",
"buyerPaymentMethodId": "<string>",
"customerWallet": {
"walletAddress": 0,
"networkId": "bsc_testnet",
"walletName": "My Trust Wallet"
},
"apiKey": "<string>",
"thirdPartyOrderTradeId": "<string>",
"cexOrderId": "<string>"
}
headers = {
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-auth-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
offerId: '<string>',
unitAmount: '<string>',
offerToken: '<string>',
rate: 123,
fiatAmount: 123,
tradeRequestBroadcastId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
paymentMethodId: '<string>',
paymentChannelId: '<string>',
buyerPaymentMethodId: '<string>',
customerWallet: {walletAddress: 0, networkId: 'bsc_testnet', walletName: 'My Trust Wallet'},
apiKey: '<string>',
thirdPartyOrderTradeId: '<string>',
cexOrderId: '<string>'
})
};
fetch('https://external.dev.onboardpay.co/transactions/v2/offramp/initiate', 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://external.dev.onboardpay.co/transactions/v2/offramp/initiate",
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([
'offerId' => '<string>',
'unitAmount' => '<string>',
'offerToken' => '<string>',
'rate' => 123,
'fiatAmount' => 123,
'tradeRequestBroadcastId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'paymentMethodId' => '<string>',
'paymentChannelId' => '<string>',
'buyerPaymentMethodId' => '<string>',
'customerWallet' => [
'walletAddress' => 0,
'networkId' => 'bsc_testnet',
'walletName' => 'My Trust Wallet'
],
'apiKey' => '<string>',
'thirdPartyOrderTradeId' => '<string>',
'cexOrderId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://external.dev.onboardpay.co/transactions/v2/offramp/initiate"
payload := strings.NewReader("{\n \"offerId\": \"<string>\",\n \"unitAmount\": \"<string>\",\n \"offerToken\": \"<string>\",\n \"rate\": 123,\n \"fiatAmount\": 123,\n \"tradeRequestBroadcastId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paymentMethodId\": \"<string>\",\n \"paymentChannelId\": \"<string>\",\n \"buyerPaymentMethodId\": \"<string>\",\n \"customerWallet\": {\n \"walletAddress\": 0,\n \"networkId\": \"bsc_testnet\",\n \"walletName\": \"My Trust Wallet\"\n },\n \"apiKey\": \"<string>\",\n \"thirdPartyOrderTradeId\": \"<string>\",\n \"cexOrderId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-auth-token", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://external.dev.onboardpay.co/transactions/v2/offramp/initiate")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"offerId\": \"<string>\",\n \"unitAmount\": \"<string>\",\n \"offerToken\": \"<string>\",\n \"rate\": 123,\n \"fiatAmount\": 123,\n \"tradeRequestBroadcastId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paymentMethodId\": \"<string>\",\n \"paymentChannelId\": \"<string>\",\n \"buyerPaymentMethodId\": \"<string>\",\n \"customerWallet\": {\n \"walletAddress\": 0,\n \"networkId\": \"bsc_testnet\",\n \"walletName\": \"My Trust Wallet\"\n },\n \"apiKey\": \"<string>\",\n \"thirdPartyOrderTradeId\": \"<string>\",\n \"cexOrderId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.dev.onboardpay.co/transactions/v2/offramp/initiate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"offerId\": \"<string>\",\n \"unitAmount\": \"<string>\",\n \"offerToken\": \"<string>\",\n \"rate\": 123,\n \"fiatAmount\": 123,\n \"tradeRequestBroadcastId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paymentMethodId\": \"<string>\",\n \"paymentChannelId\": \"<string>\",\n \"buyerPaymentMethodId\": \"<string>\",\n \"customerWallet\": {\n \"walletAddress\": 0,\n \"networkId\": \"bsc_testnet\",\n \"walletName\": \"My Trust Wallet\"\n },\n \"apiKey\": \"<string>\",\n \"thirdPartyOrderTradeId\": \"<string>\",\n \"cexOrderId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "0165359005113074501885",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fee": {
"asToken": "1000.0",
"asFiat": 123
},
"customerName": "John Doe",
"offer": {
"partnerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rate": 0.32,
"networkId": "TRC20",
"token": "USDT",
"tokenAmount": 120.5,
"instantPayEnabled": true,
"offerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fiatSymbol": "NGN",
"fiatAmount": 120.5,
"usdAmount": 120.5,
"partnerDisplayName": "John Doe",
"adNote": "Guaranteed fast payment",
"instantPayPaymentAccountId": "<string>"
},
"escrowAddress": 1.2869144918162796e+48,
"paymentChannelId": "BANK_TRANSFER_NIGERIA",
"paymentMethod": {},
"buyerPaymentMethod": {},
"customerWallet": {
"walletAddress": 0,
"networkId": "bsc_testnet",
"walletName": "My Trust Wallet"
},
"tokenAddress": 0,
"createdAt": "2023-11-07T05:31:56Z",
"initiatedAt": "2023-11-07T05:31:56Z",
"depositedAt": "2023-11-07T05:31:56Z",
"confirmedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"cancellationReason": "<string>",
"disputeId": "null",
"timeout": {
"startTime": "2023-11-07T05:31:56Z",
"duration": 123,
"timeLeft": 123
},
"lockHash": "null",
"confirmationHash": "null",
"cancellationHash": "null",
"isPartnerAcknowledged": false,
"rating": 3,
"isCexOrder": false,
"tradeValue": 123,
"merchantTokenValue": 123,
"customerTokenValue": 123,
"payableAmount": 123,
"thirdpartyOrderInfo": {
"businessId": "<string>",
"tradeId": "<string>",
"product": "<string>",
"blockchainOrderId": 123,
"externalOrderReference": "<string>"
},
"isNoKyc": true,
"paymentReceiptUploadId": "null",
"suppressCustomerNotifications": false,
"chatUnavailable": false
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}Initiate offramp (native API)
curl --request POST \
--url https://external.dev.onboardpay.co/transactions/v2/offramp/initiate \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--data '
{
"offerId": "<string>",
"unitAmount": "<string>",
"offerToken": "<string>",
"rate": 123,
"fiatAmount": 123,
"tradeRequestBroadcastId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentMethodId": "<string>",
"paymentChannelId": "<string>",
"buyerPaymentMethodId": "<string>",
"customerWallet": {
"walletAddress": 0,
"networkId": "bsc_testnet",
"walletName": "My Trust Wallet"
},
"apiKey": "<string>",
"thirdPartyOrderTradeId": "<string>",
"cexOrderId": "<string>"
}
'import requests
url = "https://external.dev.onboardpay.co/transactions/v2/offramp/initiate"
payload = {
"offerId": "<string>",
"unitAmount": "<string>",
"offerToken": "<string>",
"rate": 123,
"fiatAmount": 123,
"tradeRequestBroadcastId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentMethodId": "<string>",
"paymentChannelId": "<string>",
"buyerPaymentMethodId": "<string>",
"customerWallet": {
"walletAddress": 0,
"networkId": "bsc_testnet",
"walletName": "My Trust Wallet"
},
"apiKey": "<string>",
"thirdPartyOrderTradeId": "<string>",
"cexOrderId": "<string>"
}
headers = {
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-auth-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
offerId: '<string>',
unitAmount: '<string>',
offerToken: '<string>',
rate: 123,
fiatAmount: 123,
tradeRequestBroadcastId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
paymentMethodId: '<string>',
paymentChannelId: '<string>',
buyerPaymentMethodId: '<string>',
customerWallet: {walletAddress: 0, networkId: 'bsc_testnet', walletName: 'My Trust Wallet'},
apiKey: '<string>',
thirdPartyOrderTradeId: '<string>',
cexOrderId: '<string>'
})
};
fetch('https://external.dev.onboardpay.co/transactions/v2/offramp/initiate', 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://external.dev.onboardpay.co/transactions/v2/offramp/initiate",
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([
'offerId' => '<string>',
'unitAmount' => '<string>',
'offerToken' => '<string>',
'rate' => 123,
'fiatAmount' => 123,
'tradeRequestBroadcastId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'paymentMethodId' => '<string>',
'paymentChannelId' => '<string>',
'buyerPaymentMethodId' => '<string>',
'customerWallet' => [
'walletAddress' => 0,
'networkId' => 'bsc_testnet',
'walletName' => 'My Trust Wallet'
],
'apiKey' => '<string>',
'thirdPartyOrderTradeId' => '<string>',
'cexOrderId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://external.dev.onboardpay.co/transactions/v2/offramp/initiate"
payload := strings.NewReader("{\n \"offerId\": \"<string>\",\n \"unitAmount\": \"<string>\",\n \"offerToken\": \"<string>\",\n \"rate\": 123,\n \"fiatAmount\": 123,\n \"tradeRequestBroadcastId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paymentMethodId\": \"<string>\",\n \"paymentChannelId\": \"<string>\",\n \"buyerPaymentMethodId\": \"<string>\",\n \"customerWallet\": {\n \"walletAddress\": 0,\n \"networkId\": \"bsc_testnet\",\n \"walletName\": \"My Trust Wallet\"\n },\n \"apiKey\": \"<string>\",\n \"thirdPartyOrderTradeId\": \"<string>\",\n \"cexOrderId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-auth-token", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://external.dev.onboardpay.co/transactions/v2/offramp/initiate")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"offerId\": \"<string>\",\n \"unitAmount\": \"<string>\",\n \"offerToken\": \"<string>\",\n \"rate\": 123,\n \"fiatAmount\": 123,\n \"tradeRequestBroadcastId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paymentMethodId\": \"<string>\",\n \"paymentChannelId\": \"<string>\",\n \"buyerPaymentMethodId\": \"<string>\",\n \"customerWallet\": {\n \"walletAddress\": 0,\n \"networkId\": \"bsc_testnet\",\n \"walletName\": \"My Trust Wallet\"\n },\n \"apiKey\": \"<string>\",\n \"thirdPartyOrderTradeId\": \"<string>\",\n \"cexOrderId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.dev.onboardpay.co/transactions/v2/offramp/initiate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"offerId\": \"<string>\",\n \"unitAmount\": \"<string>\",\n \"offerToken\": \"<string>\",\n \"rate\": 123,\n \"fiatAmount\": 123,\n \"tradeRequestBroadcastId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paymentMethodId\": \"<string>\",\n \"paymentChannelId\": \"<string>\",\n \"buyerPaymentMethodId\": \"<string>\",\n \"customerWallet\": {\n \"walletAddress\": 0,\n \"networkId\": \"bsc_testnet\",\n \"walletName\": \"My Trust Wallet\"\n },\n \"apiKey\": \"<string>\",\n \"thirdPartyOrderTradeId\": \"<string>\",\n \"cexOrderId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "0165359005113074501885",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fee": {
"asToken": "1000.0",
"asFiat": 123
},
"customerName": "John Doe",
"offer": {
"partnerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rate": 0.32,
"networkId": "TRC20",
"token": "USDT",
"tokenAmount": 120.5,
"instantPayEnabled": true,
"offerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fiatSymbol": "NGN",
"fiatAmount": 120.5,
"usdAmount": 120.5,
"partnerDisplayName": "John Doe",
"adNote": "Guaranteed fast payment",
"instantPayPaymentAccountId": "<string>"
},
"escrowAddress": 1.2869144918162796e+48,
"paymentChannelId": "BANK_TRANSFER_NIGERIA",
"paymentMethod": {},
"buyerPaymentMethod": {},
"customerWallet": {
"walletAddress": 0,
"networkId": "bsc_testnet",
"walletName": "My Trust Wallet"
},
"tokenAddress": 0,
"createdAt": "2023-11-07T05:31:56Z",
"initiatedAt": "2023-11-07T05:31:56Z",
"depositedAt": "2023-11-07T05:31:56Z",
"confirmedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"cancellationReason": "<string>",
"disputeId": "null",
"timeout": {
"startTime": "2023-11-07T05:31:56Z",
"duration": 123,
"timeLeft": 123
},
"lockHash": "null",
"confirmationHash": "null",
"cancellationHash": "null",
"isPartnerAcknowledged": false,
"rating": 3,
"isCexOrder": false,
"tradeValue": 123,
"merchantTokenValue": 123,
"customerTokenValue": 123,
"payableAmount": 123,
"thirdpartyOrderInfo": {
"businessId": "<string>",
"tradeId": "<string>",
"product": "<string>",
"blockchainOrderId": 123,
"externalOrderReference": "<string>"
},
"isNoKyc": true,
"paymentReceiptUploadId": "null",
"suppressCustomerNotifications": false,
"chatUnavailable": false
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}Authorizations
Body
id of offer to make unit reservation from
unit to be reserved
Token used to access private ads.
rate to make reservation at
fiat equivalent of reserved unit
Show child attributes
Show child attributes
Response
Success
"0165359005113074501885"
Order transaction status
INITIATED, DEPOSITED, CONFIRMED, COMPLETED, PENDING, CANCELLED, IN_DISPUTE, AWAITING_ACCEPTANCE Show child attributes
Show child attributes
"John Doe"
Show child attributes
Show child attributes
Escrow address
1.2869144918162796e+48
"BANK_TRANSFER_NIGERIA"
Show child attributes
Show child attributes
0
Show child attributes
Show child attributes
Type of user/role of user in transaction
CUSTOMER, PARTNER 3
false
PENDING_IP_REPORT, IN_PROGRESS, FAILURE, SUCCESS Actual token amount that is to be traded
Actual token value that is to be traded by merchant less any fees
Actual token value that is to be traded by customer less any fees
Actual fiat amount that is to be paid.
Show child attributes
Show child attributes
Flag showing if order is a no kyc order
Upload ID for receipt uploaded on storage bucket
Flag to indicate if notifications should be sent to the customer or not during the lifetime of this transaction
Flag to indicate if chat is unavailable for this transaction
STANDARD_TRADE, INTERNAL_RAIL