Scenario
A user wants to sell Bitcoin (via Lightning Network) and receive cash in their local bank account (e.g., Brazil PIX) immediately using a single streamlined flow.Workflow
1. Add Beneficiary Bank Account
First, add the destination bank account as a beneficiary. This is where the funds will be sent after the crypto is received.See the Add Beneficiary API reference for full details.
2. Initiate Crypto Offramp
Initiate the offramp by specifying the recipient (beneficiary ID) and the amount in the destination currency. The API will generate a Lightning invoice that the user needs to pay.See the Offramp Crypto API reference for full details.
lightningInvoice- The Lightning invoice that the user needs to paylightningAmount- The amount of satoshis to paytargetAmountReceivable- The amount the user will receive (after fees)totalFees- Total fees charged for the transaction
3. User Pays Lightning Invoice
The user pays the Lightning invoice using their Bitcoin Lightning wallet. Once the invoice is paid, Bullring automatically processes the withdrawal to the beneficiary’s bank account.4. Check Offramp Status
You can check the status of the offramp transaction at any time using the offramp ID.See the Get Offramp Status API reference for full details.
pending- Waiting for Lightning invoice to be paidprocessing- Invoice paid, withdrawal being processedcompleted- Funds successfully sent to beneficiaryfailed- Transaction failed (seeerrorMessagefor details)
Advantages
This streamlined offramp flow offers several benefits:- Single API Call: Generate the Lightning invoice and initiate the withdrawal in one request
- Automatic Processing: Once the Lightning invoice is paid, the withdrawal is automatically processed
- Real-time Exchange Rates: Get the current exchange rate and fees upfront
- Simple Integration: No need to manage separate deposit and withdrawal flows