Verify Transaction
Verify the status and details of a transaction using its reference number. This endpoint provides comprehensive transaction verification including additional banking details.
Endpoint
GET https://api.cashonrails.com/api/v1/transaction/verify/{reference}
Headers
| Header | Type | Description |
|---|---|---|
| Authorization | string | Bearer token with your secret key |
| Content-Type | string | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
reference | string | Yes | The unique transaction reference to verify |
Sample Request
GET https://api.cashonrails.com/api/v1/transaction/verify/{reference}Sample cURL Request
curl -X GET "https://api.cashonrails.com/api/v1/transaction/verify/{reference}" \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json"Sample Response
{
"status": true,
"message": "Verification successful",
"data": {
"id": 204404,
"amount": "1000",
"currency": "NGN",
"status": "success",
"transaction_date": "2025-10-10 13:07:03",
"reference": "100004251010120646142810790227",
"domain": "live",
"gateway_response": null,
"channel": "banktransfer",
"ip_address": "162.158.230.113",
"originator_name": "",
"originator_account_number": "",
"originator_bank_name": "",
"originator_bank_code": "",
"originator_session_id": "",
"originator_narration": "",
"receiver_account_name": "",
"receiver_account_number": "",
"fees": null,
"plan": null,
"requested_amount": "1000"
},
"customer": {
"id": 998,
"customer_code": "CUS_yhlknqpurtkar5p",
"first_name": "Sunday",
"last_name": "Akinlabi",
"email": "akinlabisamson15@gmail.com"
},
"log": {
"time_spent": 0,
"attempts": 0,
"authentication": null,
"errors": 0,
"success": true,
"channel": "banktransfer",
"history": []
}
}Use Cases
The verify endpoint is ideal for:
- Payment Confirmation - Confirm that a payment has been successfully processed
- Webhook Validation - Verify transaction details received through webhooks
- Customer Support - Help customers confirm their payment status
- Fraud Detection - Check transaction authenticity and details
- Reconciliation - Match payments with your internal accounting records
- Real-time Status - Get the most up-to-date transaction status
Response Fields
| Field | Type | Description |
|---|---|---|
status | boolean | Indicates if the verification was successful |
message | string | Human-readable verification message |
data | object | Comprehensive transaction details |
customer | object | Customer information |
log | object | Processing log information |
Verification Data Fields
| Field | Type | Description |
|---|---|---|
id | integer | Unique transaction ID |
amount | string | Transaction amount |
currency | string | Transaction currency |
status | string | Current transaction status e.g (success, pending, failed, abandoned) |
transaction_date | string | When the transaction was completed |
reference | string | Unique transaction reference |
domain | string | Environment (live/test) |
gateway_response | string | Payment gateway response |
channel | string | Payment channel used |
ip_address | string | Customer’s IP address |
fees | string | Transaction fees |
requested_amount | string | Originally requested amount |
Banking Details (when available)
| Field | Type | Description |
|---|---|---|
originator_name | string | Name of the account holder who sent the payment |
originator_account_number | string | Account number of the sender |
originator_bank_name | string | Name of the sender’s bank |
originator_bank_code | string | Bank code of the sender’s bank |
originator_session_id | string | Session ID from the originating bank |
originator_narration | string | Payment narration from sender |
receiver_account_name | string | Name on the receiving account |
receiver_account_number | string | Receiving account number |
Customer Information
| Field | Type | Description |
|---|---|---|
id | integer | Unique customer ID |
customer_code | string | Unique customer code |
first_name | string | Customer’s first name |
last_name | string | Customer’s last name |
email | string | Customer’s email address |
Transaction Statuses
| Status | Description |
|---|---|
success | Transaction completed successfully |
pending | Transaction is still being processed |
failed | Transaction failed to complete |
abandoned | Transaction was started but not completed |
Error Responses
Transaction Not Found
{
"status": false,
"message": "Transaction not found",
"data": null
}Invalid Reference
{
"status": false,
"message": "Invalid transaction reference",
"data": null
}Best Practices
- Regular Verification - Verify important transactions periodically to ensure accuracy
- Webhook Integration - Use verification to confirm webhook notifications
- Error Handling - Always check the
statusfield before processing verification results - Rate Limiting - Be mindful of API rate limits when verifying multiple transactions
- Logging - Log verification results for audit trails and debugging
Last updated on