Exchange Crypto to Fiat Buy/Sell Orders Endpoints to process crypto exchange orders and retrieve their details.
If you are a neobank or fintech app, reach out to our team to activate the pool_balance
features.
Create a New Order
POST
https://live.betaapp.com/v1/order/exchange
Beta will freeze the quote for this order for 20 minutes.
If the User deposits a different amount/asset than requested or after this timeframe, our platform will automatically trigger workflows for the payer to top-up the remaining amount or receive a refund for its deposit.
Request Body
Asset that user wants to provide in the transaction. It could be any Fiat or Crypto.
Asset that user wants to receive in the transaction. It could be any Fiat or Crypto.
Amount that payer wants to deposit
Amount that payer wants to receive
200: OK Sucess 400: Bad Request Error message
Copy {
"amount" : 0 ,
"asset" : {
"large_image_url" : "string" ,
"medium_image_url" : "string" ,
"name" : "string" ,
"small_image_url" : "string" ,
"symbol" : "string" ,
"type" : "string"
} ,
"date_time" : "string" ,
"deposit" : true ,
"exp_time" : 0 ,
"message" : "string" ,
"network" : "string" ,
"tag" : "string" ,
"wallet_address" : "string"
}
Copy {
"message" : "string"
}
If Target Asset is a FIAT currency, it means the subaccount is selling crypto. However, if it is a CRYPTO asset, it means the subaccount is purchasing crypto.
Request Example:
Copy curl -X 'POST' \
'https: //live.betaapp.com/v1/order/exchange' \
-H 'accept: application/json' \
-H 'X-sub-account-id: 22376 b 76 -fe 59-4 f 91 -bce 3-4 cef 3543083 b' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI 1 NiIsInR 5 cCI 6 IkpXVCIsImtpZCI 6 InJlaEF 1 NURPY...ctfx 2 I 4 g' \
-H 'Content-Type: application/json' \
-d '{
"network" : "bitcoin" ,
"pool_balance" : true ,
"source_amount" : 12000 ,
"source_asset" : "MXN" ,
"target_amount" : 0 ,
"target_asset" : "BTC"
}'
Response Example:
Copy {
"asset" : {
"name" : "Mexican Peso" ,
"type" : "" ,
"small_image_url" : "https://storage.googleapis.com/cryptoassets_images/20px/MXN-20.png" ,
"medium_image_url" : "https://storage.googleapis.com/cryptoassets_images/35px/MXN-35.png" ,
"large_image_url" : "https://storage.googleapis.com/cryptoassets_images/69px/MXN-69.png"
} ,
"amount" : 0.017672 ,
"network" : "bitcoin" ,
"exp_time" : 1200 ,
"deposit" : false ,
"date_time" : "2023-11-22T13:09:33.079445313Z"
}
Here is an example of how the New Order Response could be displayed on the Front-End.
Retrieve Order List
GET
https://live.betaapp.com/v1/order
This endpoint retrieves the Order List of a specific subaccount_id
.
Query Parameters
Parameters: open, pending, confirmed, canceled.
could be the e-mail or order description
Parameters: id, recipient_email, description, created_at, status
Page number for this query
Number of items per page for this query
200: OK Sucess 400: Bad Request Error message
Copy {
"message" : "string" ,
"orders" : [
{
"account_id" : "string" ,
"created_at" : "string" ,
"description" : "string" ,
"id" : "string" ,
"recipient_email" : "string" ,
"status" : "string" ,
"target_amount" : 0 ,
"target_asset" : "string" ,
"valid_until" : "string"
}
]
}
Copy {
"message" : "string"
}
Request Example:
Copy curl -X 'GET' \
'https: //live.betaapp.com/v1/order?page=10&size=2' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI 1 NiIsInR 5 cCI 6 IkpXVCIsImtpZCI 6 InJlaEF 1 NURPY...ctfx 2 I 4 g'
Response Example:
Copy {
"orders" : [
{
"id" : "dd299198-f1b4-4b82-8daa-9c16b1da7fb1" ,
"account_id" : "39b745ba...847f49" ,
"sub_account_id" : "94850a8c...881047" ,
"recipient_email" : "testing@betaapp.com" ,
"description" : "" ,
"status" : "confirmed" ,
"source_asset" : "XOF" ,
"source_amount" : 1000000 ,
"target_asset" : "BTC" ,
"target_amount" : 0.039094 ,
"valid_until" : "2023-11-14T14:56:43.615066Z" ,
"created_at" : "2023-11-13T14:56:43.615066Z"
} ,
{
"id" : "3e9bb519-58a4-454f-8474-c3ca4cf9c3d8" ,
"account_id" : "39b745ba...847f49" ,
"sub_account_id" : "94850a8c...881047" ,
"recipient_email" : "testing@betaapp.com" ,
"description" : "" ,
"status" : "confirmed" ,
"source_asset" : "XOF" ,
"source_amount" : 1000000 ,
"target_asset" : "BTC" ,
"target_amount" : 0.039193 ,
"valid_until" : "2023-11-14T14:47:08.137369Z" ,
"created_at" : "2023-11-13T14:47:08.137369Z"
}
] ,
"page" : 10 ,
"size" : 2 ,
"total_page" : 12 ,
"total_row" : 23
}
Retrieve Order Details
GET
https://live.betaapp.com/v1/orders/details/{id}
This endpoint provides the details of a specific payment.
Query Parameters
Your user's subaccount_id
200: OK Sucess 400: Bad Request Error message
Copy {
"created_at" : "string" ,
"description" : "string" ,
"id" : "string" ,
"message" : "string" ,
"recipient_email" : "string" ,
"status" : "string" ,
"target_amount" : 0 ,
"target_asset" : "string" ,
"timelines" : [
{
"comments" : "string" ,
"executed" : true ,
"executed_at" : "string" ,
"order_step" : "string"
}
]
}
Copy {
"message" : "string"
}
Request Example:
Copy curl -X 'GET' \
'https: //live.betaapp.com/v1/order/details/e6282263-f947-48c8-9c25-334696a4940e' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI 1 NiIsInR 5 cCI 6 IkpXVCIsImtpZCI 6 InJlaEF 1 NURPY...ctfx 2 I 4 g'
Response Example:
Copy {
"id" : "e6282263-f947-48c8-9c25-334696a4940e" ,
"source_asset" : "XRP" ,
"source_amount" : 64.76 ,
"target_asset" : "BRL" ,
"target_amount" : 200 ,
"description" : "Testing Order" ,
"recipient_email" : "testing@betaapp.com" ,
"status" : "canceled" ,
"settlement_status" : "" ,
"created_at" : "2023-11-13T15:14:46.847698Z" ,
"timelines" : [
{
"order_step" : "Order Created" ,
"executed" : true ,
"comments" : "" ,
"executed_at" : "2023-11-13T15:14:46.847698Z"
} ,
{
"order_step" : "Payment Link Opened" ,
"executed" : true ,
"comments" : "" ,
"executed_at" : "2023-11-13T15:14:49.078719Z"
} ,
{
"order_step" : "Deposit Initiated" ,
"executed" : true ,
"comments" : "" ,
"executed_at" : "2023-11-13T15:14:51.371398Z"
} ,
{
"order_step" : "Paid" ,
"executed" : false ,
"comments" : "" ,
"executed_at" : "0001-01-01T00:00:00Z"
} ,
{
"order_step" : "Settlement" ,
"executed" : false ,
"comments" : "" ,
"executed_at" : "0001-01-01T00:00:00Z"
}
]
}