Buy crypto
curl --request POST \
--url https://merchant.bitliva.com/api/v1/crypto/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "<string>",
"currency": "<string>",
"amount": 123,
"reference": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '<string>',
currency: '<string>',
amount: 123,
reference: '<string>'
})
};
fetch('https://merchant.bitliva.com/api/v1/crypto/buy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://merchant.bitliva.com/api/v1/crypto/buy"
payload = {
"customer_id": "<string>",
"currency": "<string>",
"amount": 123,
"reference": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://merchant.bitliva.com/api/v1/crypto/buy",
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([
'customer_id' => '<string>',
'currency' => '<string>',
'amount' => 123,
'reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": "success",
"message": "Purchase successful.",
"data": {
"transaction": {
"id": "9d3c5a1e-5b7e-4c2a-9f43-0c6c1b7a2d10",
"type": "crypto_buy",
"status": "successful",
"amount": "100000.00",
"fee": "0.00",
"currency": "NGN",
"reference": "order-1042",
"customer_id": "2f6d1c0a-8a3e-4d59-b8a1-71e0c4d5f9a3",
"details": null,
"crypto": {
"currency": "btc",
"amount": "0.00098019"
},
"created_at": "2026-10-18T10:15:00+01:00"
}
}
}{
"status": "error",
"message": "Invalid or missing API key.",
"code": "invalid_api_key"
}{
"status": "error",
"message": "Invalid or missing API key.",
"code": "invalid_api_key"
}{
"status": "error",
"message": "Invalid or missing API key.",
"code": "invalid_api_key"
}{
"status": "error",
"message": "Invalid or missing API key.",
"code": "invalid_api_key"
}{
"status": "error",
"message": "Invalid or missing API key.",
"code": "invalid_api_key"
}Crypto trading
Buy crypto
May stay pending briefly; the webhook fires when it completes.
POST
/
crypto
/
buy
Buy crypto
curl --request POST \
--url https://merchant.bitliva.com/api/v1/crypto/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "<string>",
"currency": "<string>",
"amount": 123,
"reference": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '<string>',
currency: '<string>',
amount: 123,
reference: '<string>'
})
};
fetch('https://merchant.bitliva.com/api/v1/crypto/buy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://merchant.bitliva.com/api/v1/crypto/buy"
payload = {
"customer_id": "<string>",
"currency": "<string>",
"amount": 123,
"reference": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://merchant.bitliva.com/api/v1/crypto/buy",
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([
'customer_id' => '<string>',
'currency' => '<string>',
'amount' => 123,
'reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": "success",
"message": "Purchase successful.",
"data": {
"transaction": {
"id": "9d3c5a1e-5b7e-4c2a-9f43-0c6c1b7a2d10",
"type": "crypto_buy",
"status": "successful",
"amount": "100000.00",
"fee": "0.00",
"currency": "NGN",
"reference": "order-1042",
"customer_id": "2f6d1c0a-8a3e-4d59-b8a1-71e0c4d5f9a3",
"details": null,
"crypto": {
"currency": "btc",
"amount": "0.00098019"
},
"created_at": "2026-10-18T10:15:00+01:00"
}
}
}{
"status": "error",
"message": "Invalid or missing API key.",
"code": "invalid_api_key"
}{
"status": "error",
"message": "Invalid or missing API key.",
"code": "invalid_api_key"
}{
"status": "error",
"message": "Invalid or missing API key.",
"code": "invalid_api_key"
}{
"status": "error",
"message": "Invalid or missing API key.",
"code": "invalid_api_key"
}{
"status": "error",
"message": "Invalid or missing API key.",
"code": "invalid_api_key"
}Authorizations
Your API key.
Body
application/json
The customer's id. They need an address for the coin first.
One of btc, eth, usdt, sol, trx, bnb, ltc, usdc.
Naira to pay from your wallet, up to 2 decimal places.
Your own unique id for this purchase (up to 64 letters, numbers and . _ : -). Sending the same reference again returns the original instead of doing it twice.

