id is returned in the API response. This Payment Request ID is essential for monitoring payment status and retrieving customer payment details. This guide will show you how to use this ID to retrieve the full details and current status of any existing payment request.
What You’ll Achieve:
- Understand why and when to retrieve payment request information
- Successfully make an API request to fetch a specific payment request
- Interpret the comprehensive Payment Request response,including payment timeline
- Monitor customer payment progress and status changes
Prerequisites
Before you begin, ensure that 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).
Note: Only payment requests created with
dry_run: false can be
retrieved. Dry run requests are not persisted and will return a “not_found”
error.Step 1: Understand the Get Payment Request API Endpoint
To retrieve payment request information, you’ll use theGET method on the /v1/payments/{id} endpoint. This endpoint allows you to query the current state and details of a specific payment request by providing its unique ID.
Why Retrieve a Payment Request?
- Monitor Payment Status: Check if the customer has completed their cryptocurrency payment
- Get Payment Details: Retrieve the crypto address and amount for customer instructions
- Track Payment Timeline: Monitor progress through the payment flow steps
- Confirm Payment Completion: Verify when funds have been received
Step 2: Make the Request to Retrieve Payment Information
Use theGET request below, replacing the placeholders with your actual values.
To retrieve payment request information:
- Open your terminal or command prompt
- Construct a
GETrequest to the/v1/payments/{id}endpoint - Replace
YOUR_BASE_URLwith your chosen environment’s URL (e.g.,https://api.sandbox.busha.so) - Replace
{id}with the actual ID of the payment request you wish to retrieve (e.g.,PAYR_dGK3Xv7kCswk) - Replace
{YOUR_PUBLIC_KEY}with your actual Public API Key
Step 3: Interpret the Payment Request Response
Upon a successful request, the API will return the complete Payment Request object, including any status updates since creation. Expected Response:- status: Current payment status
- expires_at: When the payment request expires
- updated_at: Last time the payment request was modified
Troubleshooting
- Expired Quote: If
expires_atis in the past it can not be used. You will need to create a new payment request. - Not Found: Trying to retrieve a payment request created with
dry_run: truewill not be able to be retrieved, set it to false and try again. - 401 Unauthorized: Double-check that your secret API key is correct.
What’s Next?
Now that you can retrieve payment request information, you can use this ID:- How to Create 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