Get Last Transaction
The Get Last Transaction API allows the user to retrieve the most recent transaction processed by a specific terminal. This is useful for the cashier to verify the latest payment activity, status tracking, etc.
GET
baseUrl/api/v1/transactions/latestHeaders
Authorization: Bearer {{accessToken}}(Include the token obtained from the Authentication API)Content-Type: application/json
- Parameters
- Response
This endpoint takes no additional parameters beyond the required headers — it returns the latest transaction for the terminal identified by your access token.
Key Attributes
| Field | Type | Description |
|---|---|---|
| id | Integer | Transaction ID in the database |
| amountAuthorized | Integer | Transaction amount in sub-units (e.g., halalas) |
| statusMessageEn/Ar | String | Current transaction status (e.g., INITIALIZED, APPROVED) |
| startDateTime/endDateTime | Timestamp | Date and time the transaction was initiated and ended |
| rrn | String | Retrieval Reference Number (RRN) |
| terminalId | String | Unique identifier of the POS terminal |
| acquirerCode | String | Code of the acquiring bank |
| merchantEn | String | Merchant name (English) |
| merchantAr | String | Merchant name (Arabic) |
| addEn | String | Merchant address (English) |
| addAr | String | Merchant address (Arabic) |
| merchantId | String | Merchant ID assigned by the bank/acquirer |
| cardSchemeEn | String | Card scheme in English (e.g., mada) |
| transactionTypeEn | String | Type of transaction (e.g., PURCHASE) |
| pan | String | Masked Primary Account Number |
| approvalCodeValue | String | Approval code from acquirer |
| entryMode | String | Method of card entry (e.g., CONTACTLESS, CHIP) |
| statusMessageEn | String | Result message for the transaction |
| verificationMethodEn | String | How cardholder was verified |
Example Response
{
"id": null,
"merchantNameAr": "313233343536",
"merchantNameEn": "RAJB Testing NeoLeap",
"addressAr": "333231",
"addressEn": "KAFD",
"startDate": "26/07/2023",
"startTime": "22:13:01",
"startDateTime": "26/07/2023 22:13:01",
"endDateTime": "26/07/2023 22:13:01",
"acquirerCode": "RAJB",
"merchantId": "803000000324 ",
"terminalId": "1560127620231203",
"merchantCategoryCode": "3014",
"stan": "004670",
"appVersion": "1.2.63",
"rrn": "620422004670",
"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:13:01",
"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": "bf5f57291536edabe9d6bd72d721a06ac3462d6676368e1e58599f3f168b633"
}
Usage Tips
- This API is ideal for fetching receipt data after a successful transaction, or for reconfirming recent POS activity.
- If a transaction does not appear as confirmed on the client app due to a connectivity issue, use the
statusandstatusMessageEnfields to validate transaction success before printing receipts or showing confirmation. - Be sure to securely store or display the masked PAN only (e.g.,
535825******5490), never the full card number.