The meCash Docs is live 🎉 🎉
Transactions
Get Transactions

Get Transaction API

Overview

This ** Transaction API** retrieves the details of a specific transaction using its unique transaction ID. The transaction ID is obtained from the Get All Transactions API.

Endpoint

GET https://{{baseURL}}/v1/transaction/{{transactionId}}

Headers

HeaderTypeDescriptionRequired
x-api-keyStringAPI key for authentication✅ Yes
content-typeStringMust be application/json✅ Yes

Sample cURL Request

curl --location --request GET 'https://{{baseURL}}/v1/transaction/{{transactionId}}' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'content-type: application/json'

Success Response (200 OK)

If the request is successful, the API returns the following JSON response:

response.json
 
{
    "message": "transaction fetched successfully",
    "status": "success",
    "data": {
        "id": "8c684c17-ef91-4133-a624-53f31514f059",
        "remark": "Tested",
        "reason": "Gift",
        "referenceNumber": "W1TDB6RWSQMKF",
        "type": "SEND",
        "state": "FAILED",
        "quote": {
            "id": "b39b64b9-3ca0-4566-b66b-a5fef8e81e7a",
            "source": {
                "currency": "NGN",
                "country": "NG",
                "amount": 15000
            },
            "target": {
                "currency": "CNY",
                "country": "CN",
                "amount": 59.28
            },
            "rate": 253.05,
            "fee": {
                "amount": 1850
            }
        },
        "recipient": {
            "name": "Zen Lui",
            "firstName": "Zen",
            "lastName": "Lui",
            "relationship": "SELF",
            "type": "MOBILE",
            "account": {
                "sortCode": "",
                "accountNumber": "8612343562723",
                "branchCode": "",
                "mobileProvider": ""
            },
            "paymentChannel": "ALI_PAY",
            "currency": "CNY",
            "country": "CN"
        },
        "created": "2025-02-27T14:17:48.038044",
        "processed": "2025-02-27T14:20:49.712685"
    }
}

Response Breakdown

General Information

FieldTypeDescription
messageStringResponse message
statusStringStatus of the response (success or error)

Transaction Details

FieldTypeDescription
idStringUnique transaction ID
remarkStringAdditional transaction remarks
reasonStringReason for the transaction (e.g., Gift)
referenceNumberStringUnique reference number for tracking
typeStringTransaction type (e.g., SEND)
stateStringTransaction status (COMPLETED, PENDING, etc.)
createdString (ISO 8601)Timestamp when the transaction was created
processedString (ISO 8601)Timestamp when the transaction was processed

Quote Details

FieldTypeDescription
quote.idStringUnique identifier for the quote
quote.source.currencyStringSource currency (e.g., NGN)
quote.source.countryStringSource country (e.g., NG)
quote.source.amountFloatAmount sent in source currency
quote.target.currencyStringTarget currency (e.g., CNY)
quote.target.countryStringTarget country (e.g., CN)
quote.target.amountFloatAmount received in target currency
quote.rateFloatExchange rate applied
quote.fee.amountFloatTransaction fee applied

Recipient Details

FieldTypeDescription
recipient.nameStringFull name of the recipient
recipient.firstNameStringFirst name of the recipient
recipient.lastNameStringLast name of the recipient
recipient.relationshipStringRelationship to the sender (e.g., SELF)
recipient.typeStringPayment type (e.g., MOBILE)
recipient.account.accountNumberStringAccount or mobile number
recipient.paymentChannelStringPayment method (e.g., ALI_PAY)
recipient.currencyStringRecipient's currency
recipient.countryStringRecipient's country

Payout States

The transaction can have one of the following states:

StateDescription
COMPLETEDThe transaction was successfully processed.
PENDINGThe transaction is still being processed.
REFUNDEDThe transaction has been refunded.
FAILEDThe transaction failed to process.

Error Handling

Status CodeMeaningExample Response
400Bad Request{ "message": "Invalid transaction ID" }
401Unauthorized{ "message": "Invalid API key" }
404Not Found{ "message": "Transaction not found" }
500Internal Server Error{ "message": "An internal error occurred" }

Best Practices

  • Include a valid API key (x-api-key) in the request headers for authentication.
  • Use the correct transaction ID obtained from the Get All Transactions API.