Skip to Content
TransactionsGet Transaction by ID

Get Transaction by ID

Retrieve a specific transaction using its unique ID.

Endpoint

GET https://api.cashonrails.com/api/v1/{id}

Headers

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

Path Parameters

ParameterTypeRequiredDescription
idintegerYesThe unique transaction ID

Sample Request

GET https://api.cashonrails.com/api/v1/{id}

Sample cURL Request

curl -X GET "https://api.cashonrails.com/api/v1/{id}" \ -H "Authorization: Bearer YOUR_SECRET_KEY" \ -H "Content-Type: application/json"

Sample Response

{ "status": true, "message": "Transactions retrieved", "data": { "id": 204404, "domain": "live", "status": "success", "reference": "100004251010120646142810790227", "amount": "1000", "gateway_response": null, "paid_at": "2025-10-10 13:07:03", "created_at": "2025-10-10T12:07:03.000000Z", "channel": "banktransfer", "currency": "NGN", "ip_address": "162.158.230.113" }, "log": { "time_spent": 0, "attempts": 0, "authentication": null, "errors": 0, "success": true, "channel": "banktransfer", "history": [] }, "fees": "10", "customer": { "id": 998, "customer_code": "CUS_yhlknqpurtkar5p", "first_name": "Sunday", "last_name": "Akinlabi", "email": "akinlabisamson15@gmail.com", "phone": "07040237649", "metadata": "{}" }, "plan": null, "paid_at": "2025-10-10 13:07:03", "created_at": "2025-10-10T12:07:03.000000Z", "requested_amount": "1000" }

Response Fields

FieldTypeDescription
statusbooleanIndicates if the request was successful
messagestringHuman-readable message
dataobjectTransaction details
logobjectProcessing log information
feesstringTransaction fees charged
customerobjectCustomer information
planobjectSubscription plan (if applicable)
paid_atstringPayment completion timestamp
created_atstringTransaction creation timestamp
requested_amountstringOriginally requested amount

Transaction Data Fields

FieldTypeDescription
idintegerUnique transaction ID
domainstringEnvironment (live/test)
statusstringTransaction status
referencestringUnique transaction reference
amountstringTransaction amount
gateway_responsestringGateway response message
paid_atstringPayment completion timestamp
created_atstringTransaction creation timestamp
channelstringPayment channel used
currencystringTransaction currency
ip_addressstringCustomer’s IP address

Customer Object Fields

FieldTypeDescription
idintegerUnique customer ID
customer_codestringUnique customer code
first_namestringCustomer’s first name
last_namestringCustomer’s last name
emailstringCustomer’s email address
phonestringCustomer’s phone number
metadatastringAdditional customer metadata

Log Object Fields

FieldTypeDescription
time_spentintegerProcessing time in seconds
attemptsintegerNumber of processing attempts
authenticationstringAuthentication details
errorsintegerNumber of errors encountered
successbooleanWhether processing was successful
channelstringPayment channel used
historyarrayProcessing history events

Error Responses

Transaction Not Found

{ "status": false, "message": "Transaction not found", "data": null }

This error occurs when the specified transaction ID does not exist in your account.

Use this endpoint to retrieve detailed information about a specific transaction, including comprehensive customer data and processing logs.

Last updated on