Overview #
The Transactions with Statistics API allows merchants to retrieve transaction records along with aggregated transaction statistics for a specified date range.
The response provides:
- Total sales for the requested period
- Total number of transactions
- Available merchant balance
- Detailed transaction records
- Transaction status information
- Available transaction actions
- Pagination information
Environment #
| Environment | Base URL |
|---|---|
| UAT / Stage | https://test.amwalpg.com:14443 |
| Production | https://webhook.amwalpg.com |
Endpoint #
POST
/Transaction/GetTransactionsWithStatistics
Content Type #
application/json
Request #
Request Headers #
| Header | Required | Value |
|---|---|---|
Content-Type | Yes | application/json |
Request Method #
POST
Sample Request #
{
"currentPage": 1,
"dateFrom": "22/02/2022",
"dateTo": "22/04/2023",
"merchantId": "62142",
"pageSize": 10,
"requestDateTime": "2024-04-22 19:42:16",
"secureHashValue": "DA1757DDC762454D447CE31ECF1CC1A16DE1737924A9FD0ED0D6454CDFC2672B"
}
Request Parameters #
| Field | Required | Type | Constraints | Description | Example |
|---|---|---|---|---|---|
merchantId | Yes | Numeric | Maximum 19 characters | Unique identifier of the merchant. | 74417 |
currentPage | No | Numeric | Maximum 10 characters | Page number to retrieve. Starts from 1. Default value is 1. | 1 |
pageSize | No | Numeric | Maximum 10 characters | Number of records returned per page. Default value is 20. | 20 |
dateFrom | Yes | String | Valid date in dd/MM/yyyy format | Start date used to filter transactions. | 08/05/2023 |
dateTo | Yes | String | Valid date in dd/MM/yyyy format | End date used to filter transactions. | 09/10/2023 |
requestDateTime | Yes | String | Valid UTC date/time | Date and time when the request was generated. | 2023-03-08T20:51:38.401Z |
secureHashValue | Yes | String | — | Secure hash value used to validate the integrity and authenticity of the request. | 84EB3BF8F62EF25717D1E9E13C3CFB719A890980BBF2631AFD8965182ADE1754 |
Date Format:
dateFromanddateTomust be provided indd/MM/yyyyformat.
Pagination:
currentPagestarts from1. IfcurrentPageandpageSizeare not provided, their default values are1and20, respectively.
Response #
Successful Response #
A successful request returns the transaction statistics and a paginated collection of transaction records.
Sample Success Response #
{
"success": true,
"responseCode": null,
"message": "Success",
"data": {
"transactionsSummary": {
"totalSale": 1000,
"totalSaleFormatted": "1000.000",
"numberOfTransactions": 2,
"availableBalance": 1994,
"availableBalanceFormatted": "1994.000"
},
"records": [
{
"id": "3f461f43-a01b-49a7-b000-5f951a3ebb8c",
"idN": 344928,
"transactionTypeName": "Purchase",
"transactionDateTime": "2023-07-22T23:39:30.1227703+03:00",
"amount": 500,
"currency": "OMR",
"responseCodeName": "Approved",
"merchantName": "74417-LuluMasqatGrocery",
"transactionTypeDisplayName": "Purchase",
"merchantRefNumber": 10020,
"merchantId": 74417,
"terminalId": 380024,
"dueAmount": 497,
"isSettled": false,
"isRefunded": false,
"isCaptured": false,
"isCredit": true,
"transactionActions": {
"canRefund": false,
"canVoid": true,
"canCapture": false
}
},
{
"id": "d61e92aa-6709-471f-866d-0d43ca5186c0",
"idN": 344926,
"transactionTypeName": "Purchase",
"transactionDateTime": "2023-07-22T23:38:01.0719229+03:00",
"amount": 500,
"currency": "OMR",
"responseCodeName": "Approved",
"merchantName": "74417-LuluMasqatGrocery",
"transactionTypeDisplayName": "Purchase",
"merchantRefNumber": 10020,
"merchantId": 74417,
"terminalId": 380024,
"dueAmount": 497,
"isSettled": false,
"isRefunded": false,
"isCaptured": false,
"isCredit": true,
"transactionActions": {
"canRefund": false,
"canVoid": true,
"canCapture": false
}
}
],
"total": 2,
"hasNext": false
},
"errorList": null
}
Response Parameters #
General Response #
| Field | Type | Description | Example |
|---|---|---|---|
success | Boolean | Indicates whether the request was processed successfully. | true |
responseCode | String | Response code returned by the API. | 00 |
message | String | Response message describing the result. | Success |
data | Object | Contains transaction statistics, records, and pagination information. | Object |
errorList | String Array | List of errors. This should be empty or null for a successful response. | null |
Transaction Summary #
The data.transactionsSummary object contains aggregated transaction information for the specified date range.
| Field | Type | Description | Example |
|---|---|---|---|
data.transactionsSummary.totalSale | Numeric | Total sales transaction amount for the specified period. | 1000 |
data.transactionsSummary.totalSaleFormatted | String | Formatted total sales transaction amount for the specified period. | 1000.000 |
data.transactionsSummary.numberOfTransactions | Numeric | Total number of sales transactions for the specified period. | 15 |
data.transactionsSummary.availableBalance | Numeric | Available merchant balance. | 854.224 |
data.transactionsSummary.availableBalanceFormatted | String | Formatted available merchant balance. | 854.224 |
Transaction Records #
The data.records array contains the individual transaction records returned for the requested period and page.
| Field | Type | Description | Example |
|---|---|---|---|
data.records.id | String | Unique identifier of the transaction record. | 3f461f43-a01b-49a7-b000-5f951a3ebb8c |
data.records.idN | Numeric | Numeric identifier of the transaction record. | 344928 |
data.records.transactionTypeName | String | Type of transaction. | Purchase |
data.records.transactionDateTime | String | Date and time when the transaction was processed. | 2023-07-22T23:39:30.1227703+03:00 |
data.records.amount | Numeric | Amount of the transaction. | 500 |
data.records.currency | String | Currency of the transaction. | OMR |
data.records.responseCodeName | String | Response received from the payment gateway. | Approved |
data.records.merchantName | String | Name of the merchant. | 74417-LuluMasqatGrocery |
data.records.transactionTypeDisplayName | String | Display name of the transaction type. | Purchase |
data.records.merchantRefNumber | Numeric | Merchant reference number associated with the transaction. | 10020 |
data.records.merchantId | Numeric | Unique identifier of the merchant. | 74417 |
data.records.terminalId | Numeric | Unique identifier of the terminal used for the transaction. | 380024 |
data.records.dueAmount | Numeric | Total net amount of the executed transaction. | 497 |
Transaction Status #
The transaction record contains Boolean fields indicating its current status.
| Field | Type | Description | Example |
|---|---|---|---|
data.records.isSettled | Boolean | Indicates whether the transaction has been settled. | false |
data.records.isRefunded | Boolean | Indicates whether the transaction has been refunded. | false |
data.records.isCaptured | Boolean | Indicates whether the transaction has been captured. | false |
data.records.isCredit | Boolean | Indicates whether the transaction has been credited. | true |
Transaction Actions #
The transactionActions object indicates which operations are currently available for each transaction.
| Field | Type | Description | Example |
|---|---|---|---|
data.records.transactionActions.canRefund | Boolean | Indicates whether the transaction can be refunded. | false |
data.records.transactionActions.canVoid | Boolean | Indicates whether the transaction can be voided. | true |
data.records.transactionActions.canCapture | Boolean | Indicates whether the transaction can be captured. | false |
Example #
"transactionActions": {
"canRefund": false,
"canVoid": true,
"canCapture": false
}
A value of true indicates that the corresponding action is available for the transaction.
Pagination #
The API supports pagination through the currentPage and pageSize request parameters.
The response provides additional pagination information in the data object.
| Field | Type | Description | Example |
|---|---|---|---|
data.total | Numeric | Total number of transaction records matching the request criteria. | 2 |
data.hasNext | Boolean | Indicates whether another page of transaction records is available. | false |
Pagination Example #
"data": {
"records": [],
"total": 2,
"hasNext": false
}
When hasNext is true, the merchant can request the next page by incrementing the currentPage value.
Failure Response #
If the request cannot be processed, the API returns success: false along with a response code and error details.
Sample Failure Response #
{
"success": false,
"responseCode": "02",
"message": "Merchant Not Found",
"data": null,
"errorList": [
"Merchant Not Found"
]
}
Failure Response Parameters #
| Field | Type | Description | Example |
|---|---|---|---|
success | Boolean | Indicates whether the request was successfully processed. | false |
responseCode | String | Response code returned by the API. | 02 |
message | String | Response message describing the failure. | Merchant Not Found |
data | Object | Transaction data. This is null when the request fails. | null |
errorList | String Array | List containing one or more errors describing the failure. | ["Merchant Not Found"] |
Common Failure Example #
Merchant Not Found #
{
"success": false,
"responseCode": "02",
"message": "Merchant Not Found",
"data": null,
"errorList": [
"Merchant Not Found"
]
}
The Merchant Not Found error indicates that the supplied merchantId could not be identified or is not valid for the requested operation.
Note: Use the appropriate merchant credentials and environment-specific configuration when switching between UAT and Production.
