Only fiat currencies are supported for quote_currency
quote_currency and quote_amount fields, allowing for transactions where the original value is denominated in a different FIAT currency than the source and target cryptocurrencies.
What You’ll Achieve:
- Understand the specific parameters for this type of transaction.
- Generate a deposit quote that provisions a crypto pay in address
Prerequisites
Before you begin, ensure you have:- A Busha Business Account and Secret API Key (from the Quick Start Tutorial).
- An understanding of API Environments (Sandbox vs. Production) and their base URLs (from the Making Your First Request Guide).
- A conceptual understanding of Quotes.
- Familiarity with creating basic quotes (from the Creating A Quote Guide).
For deposit requests involving a customer, the
X-BU-PROFILE-ID field should
be included in the request header, and its value should be set to the customer
ID for whom the request is performed on their behalf.Get a Quote for the Deposit
A deposit is initiated by creating a Quote. In this guide, we’re going to define the original currency for which the quote is being prepared which is fiat using thequote_currency field, as well as the amount of the quote_currency to be transacted.
This is useful for scenarios where a business wants a customer to pay for
services in a currency of their choice while still maintaining the original
price of the service regardless of the payment currency.
-
Identify the
quote_currencyandquote_amount:-
The
quote_currencyis the original currency for which the quote is being prepared (e.g., NGN, KES). -
The
quote_amountis the amount of thequote_currencyto be transacted (e.g., 50000).
-
The
-
Specify
source_currencyandtarget_currency:-
The
source_currencyis the cryptocurrency the user will use to pay (e.g., USDT). -
The
target_currencyis the cryptocurrency you want to receive and store (e.g., USDT).
-
The
-
Define the
pay_inobject:- Set type to “address” as the medium of payment is a cryptocurrency address.
-
Specify the network for the chosen
source_currency(e.g., “TRX” for USDT).
-
Set the
pay_outobject:- Set type to “balance” as the destination of the received funds is your Busha balance.
POST request to the /v1/quotes endpoint:
-
Locate the “
data” object within the response. -
Note the
idof the returned Quote. -
Extract the value from the “
source_amount” field. This value represents the exact amount of cryptocurrency (e.g., USDT) the use needs to pay, which is calculated internally by Busha based on thequote_currency,quote_amount, and the current exchange rate. -
Note the “
target_amount” field, which indicates the amount of cryptocurrency you will receive. In this specific scenario,source_amountandtarget_amountwill be the same.
Finalize the Deposit Transfer
To initiate the transfer process and obtain the unique cryptocurrency address for the user payment:-
Create a transfer via the
/v1/transfersendpoint with the quote ID retrieved from the response. -
The API response for creating a transfer will contain a “
pay_in” object. -
Within the “
pay_in” object, retrieve the “address” field. This is the unique cryptocurrency address where the user should send their payment.
Note the “expires_at” field, which indicates when the payment address will
expire. Ensure the user completes the transaction before this time.
Monitoring Deposit Status
After the user has made the payment to the provided address, you can query the transfer status using the transfer ID. To monitor deposit status:-
** Webhooks (Recommended):** Set up a webhook endpoint to receive real-time notifications from Busha when the transfer status changes. This is the most efficient method for real-time updates.
- Refer to the Setting Up Webhook Guide for detailed instructions.
-
Polling (Less Recommended): Periodically GET the transfer status using the transfer id (
TRF_LJB2GQb55Cs98LbpqgRGxin the example). While possible, this is less efficient and can lead to rate limiting if done too frequently.
-
pending: Transfer initiated, awaiting user deposit. -
funds_received: Funds have been successfully received and credited to your Busha balance. -
cancelled: the transfer has been cancelled, and will not continue.
Troubleshooting Common Fiat Deposit Issues
- “Quote expired” during transfer finalization: Always create a fresh quote immediately before attempting to finalize the transfer.
- Deposit not reflecting: Check the transfer status via API/webhooks. If still pending after an extended period, contact Busha support with the TRF_ ID.
What’s Next?
Now that you know how to process deposits usingquote_currency and quote_amount, consider:
- Processing Fiat Deposits with Regular Quotes.
- Processing Crypto Deposits
- Processing Payouts
- Exploring all relevant API endpoints: Quotes API Reference, Transfers API Reference.