Skip to Content
TransactionsVerify Transaction

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

HeaderTypeDescription
AuthorizationstringBearer token with your secret key
Content-Typestringapplication/json

Path Parameters

ParameterTypeRequiredDescription
referencestringYesThe 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

FieldTypeDescription
statusbooleanIndicates if the verification was successful
messagestringHuman-readable verification message
dataobjectComprehensive transaction details
customerobjectCustomer information
logobjectProcessing log information

Verification Data Fields

FieldTypeDescription
idintegerUnique transaction ID
amountstringTransaction amount
currencystringTransaction currency
statusstringCurrent transaction status e.g (success, pending, failed, abandoned)
transaction_datestringWhen the transaction was completed
referencestringUnique transaction reference
domainstringEnvironment (live/test)
gateway_responsestringPayment gateway response
channelstringPayment channel used
ip_addressstringCustomer’s IP address
feesstringTransaction fees
requested_amountstringOriginally requested amount

Banking Details (when available)

FieldTypeDescription
originator_namestringName of the account holder who sent the payment
originator_account_numberstringAccount number of the sender
originator_bank_namestringName of the sender’s bank
originator_bank_codestringBank code of the sender’s bank
originator_session_idstringSession ID from the originating bank
originator_narrationstringPayment narration from sender
receiver_account_namestringName on the receiving account
receiver_account_numberstringReceiving account number

Customer Information

FieldTypeDescription
idintegerUnique customer ID
customer_codestringUnique customer code
first_namestringCustomer’s first name
last_namestringCustomer’s last name
emailstringCustomer’s email address

Transaction Statuses

StatusDescription
successTransaction completed successfully
pendingTransaction is still being processed
failedTransaction failed to complete
abandonedTransaction 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

  1. Regular Verification - Verify important transactions periodically to ensure accuracy
  2. Webhook Integration - Use verification to confirm webhook notifications
  3. Error Handling - Always check the status field before processing verification results
  4. Rate Limiting - Be mindful of API rate limits when verifying multiple transactions
  5. Logging - Log verification results for audit trails and debugging
Last updated on