Skip to main content

Reconciliation

Use the Reconciliation API to reconcile terminal transactions and retrieve detailed reconciliation reports.

Endpoint

Method: GET
URL: baseUrl/api/v1/transactions/terminal-reconciliation/{terminalId}

Headers

  • Authorization: Bearer {{accessToken}} (Include the token obtained from the Authentication API)

Response

A successful request returns a JSON object containing reconciliation details:

FieldTypeDescription
successBooleanIndicates if the reconciliation process was successful.
messageStringHuman-readable status message of the reconciliation.
data.idIntegerUnique identifier for the reconciliation attempt.
data.bankIdStringCode of the acquiring bank (e.g., RAJB).
data.merchantIdStringUnique merchant identifier assigned by the bank.
data.madaTerminalIdStringTerminal ID used for the Mada network.
data.mccStringMerchant Category Code (MCC).
data.stanStringSystem Trace Audit Number — a unique identifier for the reconciliation request.
data.versionStringVersion of the reconciliation protocol or application used.
data.rrnStringRetrieval Reference Number associated with the reconciliation session.
data.transactionTypeEnStringTransaction type in English (e.g., "Reconciliation").
data.transactionTypeArStringTransaction type in Arabic (e.g., "موازنة").
data.statusStringDescribes reconciliation status (e.g., "COMPLETED IN BALANCE").
data.startDateTimeString (timestamp)Start time of the reconciliation session (UNIX epoch in milliseconds).
data.endDateTimeString (timestamp)End time of the reconciliation session.
data.scheduledTimeString / nullIf reconciliation was scheduled, this shows the scheduled time.
data.executionTimeString / nullActual time of execution if scheduled.
data.reconTotalsArrayList of scheme-wise totals from both host and terminal for reconciliation.

Response Example:

{
"success": true,
"message": "Reconciliation success",
"data": {
"id": 108,
"bankId": "RAJB",
"merchantId": "123456789123",
"madaTerminalId": "1234567891234567",
"mcc": "4900",
"stan": "000138",
"version": "1.2.57",
"rrn": "514712140284",
"transactionTypeEn": "Reconciliation",
"transactionTypeAr": "موازنة",
"status": "RECONCILIATION COMPLETED IN BALANCE",
"startDateTime": "1748341289985",
"endDateTime": "1748341290985",
"scheduledTime": null,
"executionTime": null,
"reconTotals": [
{
"id": null,
"channel": {
"id": 1,
"nameAr": "",
"nameEn": "mada HOST"
},
"cardScheme": {
"id": "P1",
"nameEn": "mada",
"nameAr": null
},
"countCr": 1,
"countDb": 0,
"totalAmountCr": 10000,
"totalAmountDb": 0
},
{
"id": null,
"channel": {
"id": 2,
"nameAr": null,
"nameEn": "POS TERMINAL"
},
"cardScheme": {
"id": "P1",
"nameEn": "mada",
"nameAr": null
},
"countCr": 1,
"countDb": 0,
"totalAmountCr": 10000,
"totalAmountDb": 0
}
]
}
}

Usage Tips

  1. Terminal ID: Ensure the terminalId in the path is valid and matches an active terminal.
  2. Reconciliation Status: Monitor the status field to confirm if reconciliation is successfully completed and whether it resulted in a balance or unbalanced status.
  3. Scheme Balancing: Check reconTotals for payment scheme-specific balancing insights.

Error Handling

If the reconciliation request fails, an error response may be returned:

Error ScenarioPossible MessageAction Required
Invalid TokenUnauthorizedRe-authenticate to obtain a valid token.
Missing Terminal IDBad RequestInclude the terminalId in the URL path.
Invalid Terminal IDTerminal Not FoundVerify the terminalId is correct.