Endpoint
GET /merchants/transactions/status/{transaction_id}
Description
Retrieves the current status of the specified transaction. This endpoint is useful when:
- Your webhook notification was not received
- You need to verify a transaction’s current state
- You want to poll for transaction completion
- You need to reconcile transactions
Path Parameters
ID of the transaction to check statusThis is the transaction_id returned when the transaction was initiated
Response
Unique identifier for the transaction
Merchant-provided reference ID (if provided during transaction creation)
Current status of the transactionPossible values:
pending - Transaction is being processed
completed - Transaction completed successfully
failed - Transaction failed
Transaction amount (returned as a string)
Currency code (e.g., “USD”)
Reason for transaction failure (only present when transaction_status is “failed”, otherwise null)
Example Request
curl --request GET \
--url https://sandbox.dcash.africa/merchants/transactions/status/skjr3 \
--header 'x-api-key: YOUR_MERCHANT_API_KEY'
Example Response
{
"transaction_id": "skjr3",
"reference_id": "abcd",
"transaction_status": "pending",
"amount": "37.00",
"currency": "USD",
"failure_reason": null
}
Best Practices
Polling Strategy
If polling for status, use exponential backoff to avoid overwhelming the API
Webhook First
Always implement webhooks as the primary notification method. Use this endpoint as a fallback
Reference IDs
Use reference_id to match transactions to your internal systems
Error Handling
Handle all three status states (pending, completed, failed) appropriately
This endpoint does not require user authentication (no Authorization header), only your merchant API key.
Error Codes
| Code | Message |
|---|
missing_api_key | please provide an api key |
invalid_api_key | api key does not exist |
transaction_not_found | transaction not found |
transaction_access_forbidden | you are not allowed to view the status of this transaction |
internal_server_error | internal server error |