TransactionsGet Transaction Details

Fetch Transaction Details

This endpoint allows you to retrieve the details of a specific transaction using its unique identifier.

API Endpoint

GET https://backendapi.sayswitchgroup.com/api/v1/transaction/:id

Path Parameter:

  • id: The unique identifier of the transaction you want to retrieve (e.g., 2280).

Request Headers

Sample Request

curl -X GET https://backendapi.sayswitchgroup.com/api/v1/transaction/2280 
  -H "Authorization: Bearer YOUR_SECRET_KEY"

Sample Response

  {
    "success": true,
    "message": "Transactions retrieved",
    "data": {
        "id": 2280,
        "domain": "test",
        "status": "pending",
        "reference": "SSW_17471703346211972",
        "amount": "100",
        "gateway_response": null,
        "paid_at": null,
        "created_at": "2025-05-13T21:05:34.000000Z",
        "channel": null,
        "currency": "NGN",
        "ip_address": null
    },
    "log": {
        "time_spent": 0,
        "attempts": 0,
        "authentication": null,
        "errors": 0,
        "success": false,
        "channel": null,
        "history": []
    },
    "fees": "1.2",
    "customer": {
        "id": 330,
        "customer_code": "CUS_8n9f689gok7obwg",
        "first_name": "Rosemond",
        "last_name": "Oyeniyi",
        "email": "test@email.com",
        "phone": "08159994269",
        "metadata": "{}"
    },
    "plan": null,
    "paid_at": null,
    "created_at": "2025-05-13T21:05:34.000000Z",
    "requested_amount": "100"
}

Explanation of the Response

FieldTypeDescription
successbooleanIndicates if the API request was successful.
messagestringA descriptive message about the API request status.
dataobjectContains the main details of the transaction:
idintegerThe unique identifier of the transaction.
domainstringThe environment or domain this transaction belongs to (e.g., “test”).
statusstringThe current status of the transaction (e.g., “pending”, “successful”, “failed”).
referencestringA unique reference code for this transaction.
amountstringThe amount of the transaction (in the smallest currency unit).
gateway_responsemixedThe raw response from the payment gateway, if applicable (may be null).
paid_atstringThe timestamp indicating when the transaction was successfully paid (may be null).
created_atstringThe timestamp indicating when the transaction was initiated (ISO 8601 format).
channelstringThe channel used for the transaction (e.g., “card”, “bank”).
currencystringThe currency of the transaction (e.g., “NGN”).
ip_addressstringThe IP address of the user who initiated the transaction (may be null).
logobjectContains logging information about the transaction:
log.time_spentintegerThe time spent processing the transaction (in milliseconds).
log.attemptsintegerThe number of attempts made for this transaction.
log.authenticationmixedInformation related to authentication, if applicable (may be null).
log.errorsintegerThe number of errors encountered during the transaction.
log.successbooleanIndicates if the transaction was ultimately successful within the logging context.
log.channelstringThe channel used for the transaction (mirrors channel).
log.historyarrayAn array containing a history of events related to the transaction.
feesstringThe fees charged for this transaction.
customerobjectInformation about the customer involved in the transaction: id, customer_code, first_name, last_name, email, phone, metadata.
planmixedInformation about any associated plan, if applicable (may be null).
paid_atstringThe timestamp indicating when the transaction was successfully paid (mirrors paid_at).
created_atstringThe timestamp indicating when the transaction was initiated (mirrors created_at).
requested_amountstringThe initial amount requested for the transaction.