Create Order
curl --request POST \
--url https://api.example.com/v1/order \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'X-Client-ID: <x-client-id>' \
--data '
{
"productId": "<string>",
"paymentMethod": "<string>"
}
'import requests
url = "https://api.example.com/v1/order"
payload = {
"productId": "<string>",
"paymentMethod": "<string>"
}
headers = {
"Authorization": "<authorization>",
"X-Client-ID": "<x-client-id>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'X-Client-ID': '<x-client-id>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({productId: '<string>', paymentMethod: '<string>'})
};
fetch('https://api.example.com/v1/order', 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://api.example.com/v1/order",
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([
'productId' => '<string>',
'paymentMethod' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>",
"X-Client-ID: <x-client-id>"
],
]);
$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://api.example.com/v1/order"
payload := strings.NewReader("{\n \"productId\": \"<string>\",\n \"paymentMethod\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Client-ID", "<x-client-id>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/order")
.header("Authorization", "<authorization>")
.header("X-Client-ID", "<x-client-id>")
.header("Content-Type", "<content-type>")
.body("{\n \"productId\": \"<string>\",\n \"paymentMethod\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["X-Client-ID"] = '<x-client-id>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"productId\": \"<string>\",\n \"paymentMethod\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"requestId": "<string>",
"orderId": "<string>",
"paymentConfig": {
"paymentConfig.paymentAmount": 123,
"paymentConfig.paymentCurrency": "<string>",
"paymentConfig.destinationAddress": "<string>",
"paymentConfig.destinationChainId": "<string>",
"paymentConfig.destinationTokenSymbol": "<string>",
"paymentConfig.destinationTokenAddress": "<string>"
}
}Orders
Create Order
Initiate an order for a product such as a premium account upgrade or metal card. Returns a unique order reference to pass to your payment gateway.
POST
/
v1
/
order
Create Order
curl --request POST \
--url https://api.example.com/v1/order \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'X-Client-ID: <x-client-id>' \
--data '
{
"productId": "<string>",
"paymentMethod": "<string>"
}
'import requests
url = "https://api.example.com/v1/order"
payload = {
"productId": "<string>",
"paymentMethod": "<string>"
}
headers = {
"Authorization": "<authorization>",
"X-Client-ID": "<x-client-id>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'X-Client-ID': '<x-client-id>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({productId: '<string>', paymentMethod: '<string>'})
};
fetch('https://api.example.com/v1/order', 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://api.example.com/v1/order",
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([
'productId' => '<string>',
'paymentMethod' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>",
"X-Client-ID: <x-client-id>"
],
]);
$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://api.example.com/v1/order"
payload := strings.NewReader("{\n \"productId\": \"<string>\",\n \"paymentMethod\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Client-ID", "<x-client-id>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/order")
.header("Authorization", "<authorization>")
.header("X-Client-ID", "<x-client-id>")
.header("Content-Type", "<content-type>")
.body("{\n \"productId\": \"<string>\",\n \"paymentMethod\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["X-Client-ID"] = '<x-client-id>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"productId\": \"<string>\",\n \"paymentMethod\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"requestId": "<string>",
"orderId": "<string>",
"paymentConfig": {
"paymentConfig.paymentAmount": 123,
"paymentConfig.paymentCurrency": "<string>",
"paymentConfig.destinationAddress": "<string>",
"paymentConfig.destinationChainId": "<string>",
"paymentConfig.destinationTokenSymbol": "<string>",
"paymentConfig.destinationTokenAddress": "<string>"
}
}Overview
Use this endpoint to start a new order for a product — for example, a premium account upgrade or a metal card. The response includes anorderId and, where applicable, a paymentConfig object containing everything needed to route the user through an external crypto payment flow.
Once you have an orderId, pass it to your payment gateway. After payment is submitted, poll GET /v1/order/:orderId to confirm the final outcome.
Not sure which
productId to use? Call GET /v1/order/products/available first to retrieve the list of products available and eligible for the current user.Request
Headers
string
required
Bearer token for the authenticated user. Format:
Bearer <userAccessToken>string
required
Your application’s client ID, issued during onboarding.
string
required
Must be
application/json.Body
string
required
The unique identifier of the product to order. Valid values are partner-specific and returned by
GET /v1/order/products/available. Example: "PRODUCT_ID_ABC"string
required
The payment method to use for this order. Supported values:
CRYPTO_EXTERNAL_DAIMO
Example Request
const response = await fetch('https://api.baanx.com/v1/order', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Client-ID': 'your_client_id',
'Authorization': `Bearer ${userAccessToken}`
},
body: JSON.stringify({
productId: 'PRODUCT_ID_ABC',
paymentMethod: 'CRYPTO_EXTERNAL_DAIMO'
})
});
const { orderId, requestId, paymentConfig } = await response.json();
// Pass orderId and paymentConfig to your payment gateway
import requests
response = requests.post(
'https://api.baanx.com/v1/order',
headers={
'Content-Type': 'application/json',
'X-Client-ID': 'your_client_id',
'Authorization': f'Bearer {user_access_token}'
},
json={
'productId': 'PRODUCT_ID_ABC',
'paymentMethod': 'CRYPTO_EXTERNAL_DAIMO'
}
)
data = response.json()
order_id = data['orderId']
payment_config = data.get('paymentConfig')
curl --request POST \
--url https://api.baanx.com/v1/order \
--header 'Authorization: Bearer <userAccessToken>' \
--header 'Content-Type: application/json' \
--header 'X-Client-ID: your_client_id' \
--data '{
"productId": "PRODUCT_ID_ABC",
"paymentMethod": "CRYPTO_EXTERNAL_DAIMO"
}'
Response
200 — Success
The order has been created. StoreorderId to track the order status. Use paymentConfig to initiate payment via your gateway.
{
"requestId": "payment_1234",
"orderId": "abcd_1234",
"paymentConfig": {
"paymentAmount": 199,
"paymentCurrency": "USD",
"destinationAddress": "0x3a11a86cf218c448be519728cd3ac5c741fb3424",
"destinationChainId": "59144",
"destinationTokenSymbol": "USDC",
"destinationTokenAddress": "0x176211869cA2b568f2A7D4EE941E073a821EE1ff"
}
}
string
An identifier for the payment request, used to correlate payment gateway callbacks back to this order. Example:
"payment_1234"string
required
Unique identifier for this order. Store this — you’ll need it to poll for the order outcome via
GET /v1/order/:orderId.object
Payment routing details for the external crypto payment. Pass these values to your payment gateway to initiate the transaction.
Show paymentConfig fields
Show paymentConfig fields
number
The amount to be paid, denominated in
paymentCurrency. Example: 199string
The fiat currency for the payment amount. Example:
"USD"string
The on-chain wallet address to send the payment to.
string
The EVM chain ID for the destination network. Example:
"59144" (Linea mainnet)string
The token symbol to pay with. Example:
"USDC"string
The contract address of the destination token on the specified chain.
Error Responses
401 — Authentication Error
401 — Authentication Error
The bearer token is missing, expired, or invalid. Ensure a valid user access token is included in the
Authorization header.403 — Authorization Error
403 — Authorization Error
The authenticated user does not have permission to perform this action.
422 — Validation Error
422 — Validation Error
One or more required fields failed validation. Check that
productId and paymentMethod are both present and that paymentMethod is a supported enum value (CRYPTO_EXTERNAL_DAIMO).498 — Invalid Client Key
498 — Invalid Client Key
The
X-Client-ID header value is not recognised. Verify your client ID.499 — Missing Client Key
499 — Missing Client Key
The
X-Client-ID header is absent from the request.500 — Internal Server Error
500 — Internal Server Error
An unexpected error occurred on the server. Retry with exponential backoff. If the issue persists, contact Baanx support.
Related Endpoints
Get Available Products
Retrieve the products available and eligible for the current user before placing an order.
Get Order Status
Poll for the async completion of a payment and confirm the order outcome.
Was this page helpful?