Overview
Call this endpoint before creating an order to discover which products are available to the authenticated user and whether they are currently eligible to purchase each one. Use the returned id values as the productId when calling POST /v1/order .
Request
Bearer token for the authenticated user. Format: Bearer <userAccessToken>
Your application’s client ID, issued during onboarding.
Example Request
const response = await fetch ( 'https://api.baanx.com/v1/order/products/available' , {
headers: {
'X-Client-ID' : 'your_client_id' ,
'Authorization' : `Bearer ${ userAccessToken } `
}
});
const products = await response . json ();
const eligible = products . filter ( p => p . isEligible );
Response
200 — Success
Returns an array of available products. Each item includes an eligibility flag indicating whether the current user can order it.
[
{
"id" : "PREMIUM_SUBSCRIPTION" ,
"description" : "Premium subscription" ,
"isEligible" : true
}
]
The unique product identifier. Pass this value as productId when calling POST /v1/order.
A human-readable description of the product. Suitable for display in your UI.
Whether the current user is eligible to order this product. If false, the user does not meet the requirements (e.g. KYC status, existing subscription) — do not allow them to initiate an order for this product.
Error Responses
401 — Authentication Error
The bearer token is missing, expired, or invalid.
403 — Authorization Error
The authenticated user does not have permission to access this resource.
The X-Client-ID header value is not recognised.
The X-Client-ID header is absent from the request.
500 — Internal Server Error
An unexpected server error occurred. Retry with exponential backoff.
Create Order Initiate a new order using a product id returned by this endpoint.
Get Order Status Poll for the outcome of a previously created order.