Skip to main content
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>"
}
'
{
  "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 an orderId 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

Authorization
string
required
Bearer token for the authenticated user. Format: Bearer <userAccessToken>
X-Client-ID
string
required
Your application’s client ID, issued during onboarding.
Content-Type
string
required
Must be application/json.

Body

productId
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"
paymentMethod
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

Response

200 — Success

The order has been created. Store orderId 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"
  }
}
requestId
string
An identifier for the payment request, used to correlate payment gateway callbacks back to this order. Example: "payment_1234"
orderId
string
required
Unique identifier for this order. Store this — you’ll need it to poll for the order outcome via GET /v1/order/:orderId.
paymentConfig
object
Payment routing details for the external crypto payment. Pass these values to your payment gateway to initiate the transaction.

Error Responses

The bearer token is missing, expired, or invalid. Ensure a valid user access token is included in the Authorization header.
The authenticated user does not have permission to perform this action.
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).
The X-Client-ID header value is not recognised. Verify your client ID.
The X-Client-ID header is absent from the request.
An unexpected error occurred on the server. Retry with exponential backoff. If the issue persists, contact Baanx support.