Get Transaction By RefNumber
Use this endpoint to retrieve transaction details using refNumber aka reference number as a query parameter. This is the value specified in the purchase request and should match the one provided in the purchase request exactly. This helps fetch transaction-specific data for auditing, reconciliation, support, or record-keeping purposes.
GET
baseUrl/api/v1/transactions/Headers
Authorization: Bearer {{accessToken}}(Include the token obtained from the Authentication API)Content-Type: application/json
- Parameters
- Response
You can use refNumber as a query parameter to fetch the transaction:
| Parameter | Type | Required | Description |
|---|---|---|---|
refNumber | string | No | The unique reference number for the transaction |
A successful response returns a JSON object with the same structure as the Purchase API response. For a full list of response fields and their descriptions, see the Purchase API documentation.
Example Response
{
"id": null,
"merchantNameAr": "313233343536",
"merchantNameEn": "RAJB Testing NeoLeap",
"addressAr": "333231",
"addressEn": "KAFD",
"startDate": "26/07/2023",
"startTime": "22:16:17",
"startDateTime": "26/07/2023 22:16:17",
"endDateTime": "26/07/2023 22:16:17",
"acquirerCode": "RAJB",
"merchantId": "803000000324 ",
"terminalId": "1560127620231203",
"merchantCategoryCode": "3014",
"stan": "004671",
"appVersion": "1.2.63",
"rrn": "620422004671",
"cardSchemeId": "P1",
"cardSchemeAr": "مدى",
"cardSchemeEn": "mada",
"applicationLabelAr": null,
"applicationLabelEn": "mada",
"pan": "442463******9008",
"cardExpiration": "27/02",
"transactionTypeAr": "مبلغ الشراء",
"transactionTypeEn": "Purchase",
"amountAuthorized": "1.00",
"amountAuthorizedAr": "مبلغ الشراء",
"amountAuthorizedEn": "PURCHASE AMOUNT",
"statusMessageAr": "مقبولة",
"statusMessageEn": "APPROVED",
"verificationMethodAr": "لا يتطلب التحقق",
"verificationMethodEn": "NO VERIFICATION REQUIRED",
"approvalCodeAr": "رمز الموافقة",
"approvalCodeEn": "Approval Code",
"approvalCode": "U5MUZ5",
"endTime": "22:16:17",
"endDate": "26/07/2023",
"entryMode": "CONTACTLESS",
"switchResponseCode": "000",
"applicationIdentifier": "A0000002282010",
"terminalVerificationResult": "0000000000",
"transactionStateInformation": "0000",
"cardholderVerificationResult": null,
"cryptogramInformationData": null,
"applicationCryptogram": "80",
"kernelId": "03",
"paymentAccountReference": null,
"thanksMessageAr": "شكرا لاستخدامكم مدى",
"thanksMessageEn": "Thank you for using mada",
"saveReceiptMessageAr": "يرجى الاحتفاظ بالفاتورة",
"saveReceiptMessageEn": "please retain receipt",
"providerResponseCode": "00",
"ecrToken": "ff5945da80c9c5f222ac13cc1d30d5845eb77dc08f3d41e55e9e4cb7f5ce"
}
Error Handling
If the transaction is not found or another error occurs, you may receive an error response:
Example Error
{
"status": "failed",
"msg": "Transaction not found"
}
Usage Tips
- Token Authorization: Always ensure your token is valid before making a request. Include it in the
Authorizationheader in the format:Authorization: Bearer <accessToken>. - Reference Number: Should match the one passed during the original purchase request.
- Reference: For more details on the response fields, refer to the Purchase API.