What You’ll Achieve:
- Create payment requests that generate crypto payment addresses
- Handle common errors when creating requests
- Learn the different essential parameters of a payment request
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).
Important Note: Payment Requests use your Public API Key, not your Secret
API Key, as they’re designed for customer-facing payment flows.
Step 1: Understand Payment Request Parameters
Payment Requests are fundamentally different from Quotes because they’re fiat-first: you specify the fiat amount you want to collect, and Busha calculates the equivalent crypto amount at current market rates. Essential Parameters| Parameter | Data Type | Required/Optional | Description |
|---|---|---|---|
quote_currency | string | Required | The fiat currency for the payment amount |
quote_amount | string | Required | The fiat amount you’re collecting from the customer |
source_currency | string | Required | The cryptocurrency the customer will pay with |
target_currency | string | Required | The cryptocurrency you’ll receive |
pay_in | object | Required | Details about how the customer will pay |
additional_info | object | Required | Customer contact information |
dry_run | boolean | Optional |
Step 2: Create Your First Payment Request
Let’s create a payment request where a customer pays 50000 NGN worth of USDT. To create a payment request:- Open your terminal or command prompt
- Use the
POSTrequest below to the/v1/paymentsendpoint - Replace
YOUR_BASE_URLwith your chosen environment’s URL - Replace
{YOUR_PUBLIC_KEY}with your actual Public API Key
- id: The unique payment request ID
- pay_in.address: The crypto address where customers send payment
- source_amount: The calculated crypto amount customer must pay
- expires_at: When the payment request expires
- dry_run: When set to true, returns calculated amounts and fees but doesn’t generate a retrievable payment request
Understanding the Payment Timeline
Payment Requests include a timeline object showing the payment progress:- Step 1: “Transfer Started” - Payment request created, waiting for customer payment
- Step 2: “Payment Received” - Customer has sent the cryptocurrency to the provided address
Monitor the
timeline.current_step to track payment progress using a Webhook.Troubleshooting
- Offline Product: “This pair is currently unavailable to trade.” Try a different
source_currencyor check the Pairs API for currently available pairs. - Not Found: Payment requests with
dry_runset to True can not be retrieved. 401 Unauthorized: Double-check that your secret API key is correct.
What’s Next?
Now that you have successfully created a payment request, check out the following guides:- How to Retrieve Payment Requests
- How to Set Up Webhooks
- How to Create A Quote
- Supported Currencies Reference: See available cryptocurrency and fiat pairs
- API Reference: Payment Request Object: For a complete list of all parameters, sub-fields for a payment request