Create a new Quote
curl --request POST \
--url https://api.sandbox.busha.so/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_currency": "BTC",
"target_currency": "BTC",
"quote_currency": "NGN",
"quote_amount": "100",
"reversal_policy": "conversion_only",
"reference": "QUO_123456abc",
"source_amount": "100",
"target_amount": "100"
}
'import requests
url = "https://api.sandbox.busha.so/v1/quotes"
payload = {
"source_currency": "BTC",
"target_currency": "BTC",
"quote_currency": "NGN",
"quote_amount": "100",
"reversal_policy": "conversion_only",
"reference": "QUO_123456abc",
"source_amount": "100",
"target_amount": "100"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_currency: 'BTC',
target_currency: 'BTC',
quote_currency: 'NGN',
quote_amount: '100',
reversal_policy: 'conversion_only',
reference: 'QUO_123456abc',
source_amount: '100',
target_amount: '100'
})
};
fetch('https://api.sandbox.busha.so/v1/quotes', 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.sandbox.busha.so/v1/quotes",
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([
'source_currency' => 'BTC',
'target_currency' => 'BTC',
'quote_currency' => 'NGN',
'quote_amount' => '100',
'reversal_policy' => 'conversion_only',
'reference' => 'QUO_123456abc',
'source_amount' => '100',
'target_amount' => '100'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.busha.so/v1/quotes"
payload := strings.NewReader("{\n \"source_currency\": \"BTC\",\n \"target_currency\": \"BTC\",\n \"quote_currency\": \"NGN\",\n \"quote_amount\": \"100\",\n \"reversal_policy\": \"conversion_only\",\n \"reference\": \"QUO_123456abc\",\n \"source_amount\": \"100\",\n \"target_amount\": \"100\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.sandbox.busha.so/v1/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_currency\": \"BTC\",\n \"target_currency\": \"BTC\",\n \"quote_currency\": \"NGN\",\n \"quote_amount\": \"100\",\n \"reversal_policy\": \"conversion_only\",\n \"reference\": \"QUO_123456abc\",\n \"source_amount\": \"100\",\n \"target_amount\": \"100\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.busha.so/v1/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_currency\": \"BTC\",\n \"target_currency\": \"BTC\",\n \"quote_currency\": \"NGN\",\n \"quote_amount\": \"100\",\n \"reversal_policy\": \"conversion_only\",\n \"reference\": \"QUO_123456abc\",\n \"source_amount\": \"100\",\n \"target_amount\": \"100\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "message for success",
"data": {
"id": "bus_123456789",
"source_currency": "BTC",
"target_currency": "BTC",
"source_amount": "100",
"target_amount": "100",
"profile_id": "bus_123456789",
"rate": {
"product": "BTCUSDT",
"rate_explained": "1 BTC = 1000 USDT",
"source_currency": "BTC",
"target_currency": "BTC",
"rate": "100",
"side": "sell",
"type": "FIXED"
},
"fees": [
{
"name": "processing_fee",
"amount": {
"amount": "100",
"currency": "BTC"
},
"type": "FIXED",
"converted_amount": {
"amount": "100",
"currency": "BTC"
}
}
],
"reference": "QUO_123456abc",
"status": "pending",
"created_at": "2023-10-15T12:15:30Z",
"updated_at": "2023-10-15T12:20:45Z",
"pay_in": {
"type": "address",
"recipient_id": "64ae8c26ea1033204c805a8a",
"address": "tb1qj4263506wyu8khrz2dwce0agk8lhyjgy269rxr",
"network": "BTC",
"memo": "address memo",
"narration": "Payment for services",
"payment_invoice_url": "https://example.com/invoice.pdf",
"profile_id": "profile-id-1234",
"recipient_details": {
"account_name": "<string>",
"bank_name": "<string>",
"account_number": "<string>",
"country_code": "NG",
"provider": "<string>",
"iban": "NG12345678901234567890",
"currency": "<string>",
"phone_number": "<string>",
"name": "<string>",
"email": "sbsbs@busha.co",
"bank_code": "100020"
},
"blockchain_hash": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"blockchain_url": "https://explorer.com/tx/31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"session_id": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"from_address": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"expires_at": "2023-10-15T12:15:30Z"
},
"pay_out": {
"type": "address",
"recipient_id": "64ae8c26ea1033204c805a8a",
"address": "tb1qj4263506wyu8khrz2dwce0agk8lhyjgy269rxr",
"network": "BTC",
"memo": "address memo",
"narration": "Payment for services",
"payment_invoice_url": "https://example.com/invoice.pdf",
"profile_id": "profile-id-1234",
"recipient_details": {
"account_name": "<string>",
"bank_name": "<string>",
"account_number": "<string>",
"country_code": "NG",
"provider": "<string>",
"iban": "NG12345678901234567890",
"currency": "<string>",
"phone_number": "<string>",
"name": "<string>",
"email": "sbsbs@busha.co",
"bank_code": "100020"
},
"blockchain_hash": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"blockchain_url": "https://explorer.com/tx/31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"session_id": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"from_address": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"expires_at": "2023-10-15T12:15:30Z"
},
"expires_at": "2023-12-01T15:04:05Z",
"two_step": {
"type": "authenticator",
"message": "Enter your 2FA code to continue",
"resend_allowed": false
},
"quote_rate": {
"product": "BTCUSDT",
"rate_explained": "1 BTC = 1000 USDT",
"source_currency": "BTC",
"target_currency": "BTC",
"rate": "100",
"side": "sell",
"type": "FIXED"
}
}
}Quotes
Create a new Quote
Create Quote
POST
/
v1
/
quotes
Create a new Quote
curl --request POST \
--url https://api.sandbox.busha.so/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_currency": "BTC",
"target_currency": "BTC",
"quote_currency": "NGN",
"quote_amount": "100",
"reversal_policy": "conversion_only",
"reference": "QUO_123456abc",
"source_amount": "100",
"target_amount": "100"
}
'import requests
url = "https://api.sandbox.busha.so/v1/quotes"
payload = {
"source_currency": "BTC",
"target_currency": "BTC",
"quote_currency": "NGN",
"quote_amount": "100",
"reversal_policy": "conversion_only",
"reference": "QUO_123456abc",
"source_amount": "100",
"target_amount": "100"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_currency: 'BTC',
target_currency: 'BTC',
quote_currency: 'NGN',
quote_amount: '100',
reversal_policy: 'conversion_only',
reference: 'QUO_123456abc',
source_amount: '100',
target_amount: '100'
})
};
fetch('https://api.sandbox.busha.so/v1/quotes', 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.sandbox.busha.so/v1/quotes",
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([
'source_currency' => 'BTC',
'target_currency' => 'BTC',
'quote_currency' => 'NGN',
'quote_amount' => '100',
'reversal_policy' => 'conversion_only',
'reference' => 'QUO_123456abc',
'source_amount' => '100',
'target_amount' => '100'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.busha.so/v1/quotes"
payload := strings.NewReader("{\n \"source_currency\": \"BTC\",\n \"target_currency\": \"BTC\",\n \"quote_currency\": \"NGN\",\n \"quote_amount\": \"100\",\n \"reversal_policy\": \"conversion_only\",\n \"reference\": \"QUO_123456abc\",\n \"source_amount\": \"100\",\n \"target_amount\": \"100\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.sandbox.busha.so/v1/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_currency\": \"BTC\",\n \"target_currency\": \"BTC\",\n \"quote_currency\": \"NGN\",\n \"quote_amount\": \"100\",\n \"reversal_policy\": \"conversion_only\",\n \"reference\": \"QUO_123456abc\",\n \"source_amount\": \"100\",\n \"target_amount\": \"100\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.busha.so/v1/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_currency\": \"BTC\",\n \"target_currency\": \"BTC\",\n \"quote_currency\": \"NGN\",\n \"quote_amount\": \"100\",\n \"reversal_policy\": \"conversion_only\",\n \"reference\": \"QUO_123456abc\",\n \"source_amount\": \"100\",\n \"target_amount\": \"100\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "message for success",
"data": {
"id": "bus_123456789",
"source_currency": "BTC",
"target_currency": "BTC",
"source_amount": "100",
"target_amount": "100",
"profile_id": "bus_123456789",
"rate": {
"product": "BTCUSDT",
"rate_explained": "1 BTC = 1000 USDT",
"source_currency": "BTC",
"target_currency": "BTC",
"rate": "100",
"side": "sell",
"type": "FIXED"
},
"fees": [
{
"name": "processing_fee",
"amount": {
"amount": "100",
"currency": "BTC"
},
"type": "FIXED",
"converted_amount": {
"amount": "100",
"currency": "BTC"
}
}
],
"reference": "QUO_123456abc",
"status": "pending",
"created_at": "2023-10-15T12:15:30Z",
"updated_at": "2023-10-15T12:20:45Z",
"pay_in": {
"type": "address",
"recipient_id": "64ae8c26ea1033204c805a8a",
"address": "tb1qj4263506wyu8khrz2dwce0agk8lhyjgy269rxr",
"network": "BTC",
"memo": "address memo",
"narration": "Payment for services",
"payment_invoice_url": "https://example.com/invoice.pdf",
"profile_id": "profile-id-1234",
"recipient_details": {
"account_name": "<string>",
"bank_name": "<string>",
"account_number": "<string>",
"country_code": "NG",
"provider": "<string>",
"iban": "NG12345678901234567890",
"currency": "<string>",
"phone_number": "<string>",
"name": "<string>",
"email": "sbsbs@busha.co",
"bank_code": "100020"
},
"blockchain_hash": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"blockchain_url": "https://explorer.com/tx/31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"session_id": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"from_address": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"expires_at": "2023-10-15T12:15:30Z"
},
"pay_out": {
"type": "address",
"recipient_id": "64ae8c26ea1033204c805a8a",
"address": "tb1qj4263506wyu8khrz2dwce0agk8lhyjgy269rxr",
"network": "BTC",
"memo": "address memo",
"narration": "Payment for services",
"payment_invoice_url": "https://example.com/invoice.pdf",
"profile_id": "profile-id-1234",
"recipient_details": {
"account_name": "<string>",
"bank_name": "<string>",
"account_number": "<string>",
"country_code": "NG",
"provider": "<string>",
"iban": "NG12345678901234567890",
"currency": "<string>",
"phone_number": "<string>",
"name": "<string>",
"email": "sbsbs@busha.co",
"bank_code": "100020"
},
"blockchain_hash": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"blockchain_url": "https://explorer.com/tx/31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"session_id": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"from_address": "31b99c79e2fb7554d0a9421867a53a80e6810cdfd2b06826eec1b2a22974b171",
"expires_at": "2023-10-15T12:15:30Z"
},
"expires_at": "2023-12-01T15:04:05Z",
"two_step": {
"type": "authenticator",
"message": "Enter your 2FA code to continue",
"resend_allowed": false
},
"quote_rate": {
"product": "BTCUSDT",
"rate_explained": "1 BTC = 1000 USDT",
"source_currency": "BTC",
"target_currency": "BTC",
"rate": "100",
"side": "sell",
"type": "FIXED"
}
}
}Authorizations
Bearer Authentication
Headers
User profile header
Example:
"BUS_YOK8tp5Zga01qOKEsqp07"
Example:
"pub_uibaidu930ani"
Body
application/json
Create a new Quote
A valid currency
Required string length:
1 - 10Example:
"BTC"
A valid currency
Required string length:
1 - 10Example:
"BTC"
This optional field specifies the currency to price the quote in, which is converted from the source amount
Required string length:
1 - 10Example:
"NGN"
The amount in the pricing currency. Required when quote_currency is provided
Example:
"100"
This optional field specifies the reversal policy for the conversion. Allowed values are 'conversion_only'.
Available options:
conversion_only Required string length:
12 - 64Example:
"QUO_123456abc"
Source Amount. Either source_amount or target_amount must be set.
Example:
"100"
Target Amount. Either source_amount or target_amount must be set.
Example:
"100"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I