Tracking a Buy Transaction
This page explains how to track, view, and confirm the status of your gift card purchases.
After creating a buy transaction, you can use this endpoint to check its current status, whether itβs still processing, completed, failed, or refunded.
π‘ Endpoint
GET /giftcard-trade/buy/history
This retrieves all your buy transactions, including their statuses and basic details.
π§Ύ Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
reference | String | No | (Optional) Use this if you want to fetch a single transaction by its reference ID. |
page | Number | No | For paginated results (default = 1). |
limit | Number | No | Number of transactions per page (default = 10). |
π¦ Example Request
GET /giftcard-trade/buy/history?page=1&limit=5or
GET /giftcard-trade/buy/history?reference=BGC-4287462729β
Example Response
{
"success": true,
"message": "Buy transaction history fetched successfully.",
"data": [
{
"reference": "BGC-4287462729",
"sku": 922,
"title": "Google Play Gift Card",
"amount": 50,
"quantity": 1,
"totalAmount": 50000,
"paymentMethod": "NAIRA",
"status": "COMPLETED",
"cardCode": "ABCD-1234-EFGH-5678",
"cardPin": "7890",
"cardImage": "https://cdn.prestmit.io/cards/googleplay.jpg",
"createdAt": "2024-02-12T10:24:05Z",
"updatedAt": "2024-02-12T10:30:30Z"
},
{
"reference": "BGC-4287462730",
"sku": 407,
"title": "Amazon Gift Card",
"amount": 25,
"quantity": 2,
"totalAmount": 25000,
"paymentMethod": "CEDIS",
"status": "PENDING",
"createdAt": "2024-02-12T10:31:50Z"
}
]
}π Understanding Transaction Status
| Status | Meaning |
|---|---|
PENDING | The transaction has been created and is being processed. |
PROCESSING | Payment confirmed; card delivery in progress. |
COMPLETED | Transaction successful, gift card delivered. |
FAILED | The purchase failed. No funds were deducted. |
REFUNDED | The transaction was reversed; funds returned to your wallet. |
π§ Tips for Implementation
- Always check the transaction
statusbefore marking an order as complete within your system. - The gift card code, or PIN will only appear when the transaction is
COMPLETED. - For webhook integration, use your webhook endpoint to automatically receive updates (see βManaging Webhooksβ page).
π Pro Tip
Itβs best to automate status updates in your app using webhooks. That way, your system stays updated in real time when a tradeβs status changes.
Learn how to set up webhooks here: Setting Up Webhooks β
Updated 5 months ago
Whatβs Next
Next... Let's discuss how our payment and commission work.