What You’ll Achieve:
- Understand the prerequisites of creating a recipient for payouts.
- Generate a specific Quote for a crypto-to-crypto payout.
- Execute the payout transfer from your Busha crypto balance to your crypto wallet.
- Monitor the status of your payout.
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 Make Your First Request Guide).
- A conceptual understanding of Quotes (from the Understanding Quotes Overview).
- Familiarity with creating basic quotes (from the How to Create Your First Quote Guide).
For payout 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.How to Process Crypto to Crypto Payouts
1
Prepare Your Quote Object
For crypto payouts, Busha requires a valid address, network and memo (for networks that mandate a memo for cryptocurrency transactions) in the
pay_out object of your quote.Your pay_out object should look like this:The network type must be in uppercase, e.g., BTC, USDT, TRX.
2
Create a Payout Quote
The next step is to create a Quote for your payout. This quote will specify the cryptocurrency you’re withdrawing from (Expected Quote ResponseA successful response will return a Quote object, detailing the
source_currency), the cryptocurrency the recipient will receive (target_currency), the amount, and importantly, the pay_out object with the recipient details.To create a payout quote:- Open your terminal or command prompt.
- Construct a
POSTrequest to the/v1/quotesendpoint. - Set the type to “withdrawal”.
- Specify
source_currency(e.g., BTC),target_currency(e.g., BTC), and eithersource_amountortarget_amount(e.g.,target_amount: "100"the recipient should receive). - Include the
pay_outobject you prepared in Step 1. - Replace placeholders like
YOUR_BASE_URLandYOUR_SECRET_KEY.
For sandbox requests, you can obtain test addresses from any of the providers
listed in the Test Addresses reference.
id of the quote, the calculated source_amount (how much crypto you’ll need to send if you provided target_amount), the rate, associated fees, and the expires_at timestamp. Importantly, the pay_out object will include recipient_details confirming the destination account information.3
Create the Payout Transfer
This is the final step where you initiate the actual withdrawal from your Busha crypto balance to the specified crypto wallet. You do this by creating a Transfer using the Expected Transfer ResponseA successful response will return a Transfer object, containing the same information as the quote, plus the
quote_id obtained in Step 2.To create the payout transfer:- Use the
POSTrequest below to the/v1/transfersendpoint. - Include the
quote_idobtained from Step 2 in the request body. - Replace
YOUR_BASE_URLandYOUR_SECRET_KEYwith your actual details.
id of the transfer (e.g., TRF_tYZ1y5bmXv4N5IhXSMbWJ) and its current status. For payouts, the status will typically start as pending and change as the payout is processed.4
Monitor Payout Status
For payouts, it’s crucial to monitor the transfer’s status to confirm successful delivery of funds to the recipient.To monitor payout status:Expected Transfer Statuses
-
Webhooks (Recommended): Set up a webhook endpoint to receive real-time notifications from Busha when the transfer status changes (e.g., from
pendingtocompletedorfailed). This is the most efficient method for real-time updates. Refer to the How to Set Up Webhooks Guide for detailed instructions. -
Polling (Less Recommended): Periodically GET the transfer status using the transfer
id(TRF_tYZ1y5bmXv4N5IhXSMbWJin the example). While possible, this is less efficient and can lead to rate limiting if done too frequently.
- pending: Transfer initiated, awaiting user bank transfer.
- processing: This means the funds has been received, and is being handled.
- funds_delivered: Funds have been successfully received and credited to your Busha balance.
- cancelled: The transfer has been cancelled, and will not continue.
Troubleshooting
Common Payout Issues:- “Quote expired” during transfer creation: Always generate a fresh quote immediately before attempting to create the transfer.
- “Insufficient balance”: Ensure your Busha account has enough
source_currencyto cover thesource_amountin the quote. 401 Unauthorized: Verify your Authorization header and API key.