This API retrieves orders associated with a specific merchantReference.
1. Environments #
| Environment | Base URL | Full Endpoint |
|---|---|---|
| UAT / Test | https://test.amwalpg.com:14443 | https://test.amwalpg.com:14443/GetOrderByMerchantReference |
| Production | https://webhook.amwalpg.com | https://webhook.amwalpg.com/GetOrderByMerchantReference |
Note: Complete all development and certification against the UAT environment. Switch to the production URL only after AMWAL Pay confirms production enablement for this API on your merchant profile.
2. Endpoint #
HTTP Method: POST
Path:
/GetOrderByMerchantReference
UAT #
https://test.amwalpg.com:14443/GetOrderByMerchantReference
Production #
https://webhook.amwalpg.com/GetOrderByMerchantReference
3. Prerequisites #
Before using this API, ensure that:
- You have an active AMWAL Pay merchant account.
- A valid numeric
merchantIdis available. - Your merchant is enabled to use the required webhook/API functionality.
- A valid merchant secure-hash key has been provided by AMWAL Pay.
- Requests are sent over HTTPS.
- The request uses
Content-Type: application/json.
4. Headers #
| Header | Required | Value |
|---|---|---|
Content-Type | Yes | application/json |
5. Request #
The request requires the merchant ID, merchant reference, request timestamp, and a valid secureHashValue.
Sample Request #
{
"merchantId": 182121,
"merchantReference": "344223",
"requestDateTime": "20260824105500",
"secureHashValue": "YOUR_SECURE_HASH"
}
Request Parameters #
| Field Name | Type | Required | Description | Sample Value |
|---|---|---|---|---|
merchantId | Integer | Yes | Unique AMWAL Pay merchant identifier. | 182121 |
merchantReference | String | Yes | Merchant’s order/invoice reference. The API searches for orders matching this value. | 344223 |
requestDateTime | String | Yes | Request timestamp used for authentication and replay protection. | 20260824105500 |
secureHashValue | String | Yes | HMAC-SHA256 secure hash generated using the merchant secure-hash key. | 1370505A11CB... |
6. Secure Hash Generation #
Every request must include a valid secureHashValue.
Hash Input #
Exclude secureHashValue from the hash calculation.
The fields should be sorted alphabetically and concatenated in the following format:
merchantId={merchantId}&merchantReference={merchantReference}&requestDateTime={requestDateTime}
For the sample request:
merchantId=182117&merchantReference=344223&requestDateTime=20260824105500
Generate an HMAC-SHA256 hash using the merchant secure-hash key and convert the resulting digest to uppercase hexadecimal.
Example:
{
"secureHashValue": "YOUR_GENERATED_HASH"
}
Security: Never expose or store the merchant secure-hash key in client-side JavaScript, mobile applications, or other publicly accessible code.
7. API Response #
The API returns a standard response envelope containing the matching orders in the data array.
A single merchantReference may return multiple orders.
Sample Successful Response #
{
"success": true,
"responseCode": null,
"message": "Success",
"data": [
{
"orderId": "4ef3bb32-d320-42fc-8466-edc5cdfd85df",
"orderIdN": 27000,
"orderKey": "4QNJ8KOMG5",
"merchantReference": "432",
"amount": 1.501,
"currency": 512,
"currencyName": "OMR",
"isPaid": true,
"status": "Paid",
"expireDateTime": "2026-09-01T19:22:14.731558",
"payerName": "",
"requestDateTime": "2026-09-03T16:48:11.163431",
"captureDatetime": "2026-09-03T16:51:44.371479",
"serviceDescription": null,
"udf": "{\"v1\":\"test value 1\",\"v2\":\"test value 2\",\"v3\":\"test value 3\",\"v4\":\"test value 4\"}",
"receiptNumber": "624915651668",
"cardNumber": "40000000*****002",
"cardType": "VISA",
"authCode": "293030"
}
],
"errorList": null
}
8. Response Parameters #
8.1 Response Envelope #
| Field Name | Type | Description | Sample Value |
|---|---|---|---|
success | Boolean | Indicates whether the API request was successfully processed. | true |
responseCode | String / Null | AMWAL Pay response code. May be null for a successful response. | null |
message | String | Human-readable response message. | Success |
data | Array | Contains the list of orders matching the supplied merchantReference. | [...] |
errorList | Array / Null | Contains validation or processing errors. | null |
8.2 Order Object #
Each object inside the data array represents an order.
| Field Name | Type | Description | Sample Value |
|---|---|---|---|
orderId | String (GUID) | Unique identifier of the order. | 3e072b86-4921-467b-85e0-4a7750c38505 |
orderIdN | Integer | Internal numeric order identifier. | 26990 |
orderKey | String | Unique order key generated by AMWAL Pay. | O053KVCNME |
merchantReference | String | Merchant reference associated with the order. | 344223 |
amount | Decimal | Order amount in major currency units. | 1.501 |
currency | Integer | Numeric currency identifier. | 512 |
currencyName | String | Currency name corresponding to the currency ID. | OMR |
isPaid | Boolean | Indicates whether the order has been successfully paid. | true |
status | String | Indicates whether the order has been Paid, Not Paid, or Cancelled by customer. | Paid |
expireDateTime | String (DateTime) | Date and time when the order/payment link expires. | 2026-09-01T18:03:32.641189 |
payerName | String | Name of the payer, when available. | "" |
serviceDescription | String / Null | Description of the service/order, when available. | null |
| udf | String (JSON) | User-defined field containing custom merchant data passed during payment initialization. | {"v1":"test value 1","v2":"test value 2","v3":"test value 3","v4":"test value 4"} |
| receiptNumber | Numeric | Unique receipt number associated with the payment | 624915651668 |
| cardNumber | Numeric | Card number used for payment | 400000******0002 |
| cardType | String | Card type used for payment | Visa |
| authCode | Numeric | Authorization code | 293030 |
| requestDateTime | String (DateTime) | Order creation datetime | 2026-09-03T16:48:11.163431 |
| captureDatetime | String (DateTime) | Payment paid datetime | 2026-09-03T16:51:44.371479 |
#
11. cURL Example #
UAT #
curl --location 'https://test.amwalpg.com:14443/GetOrderByMerchantReference' \
--header 'Content-Type: application/json' \
--data '{
"merchantId": 182131,
"merchantReference": "344223",
"requestDateTime": "20260824105500",
"secureHashValue": "YOUR_SECURE_HASH"
}'
Production #
curl --location 'https://webhook.amwalpg.com/GetOrderByMerchantReference' \
--header 'Content-Type: application/json' \
--data '{
"merchantId": 182131,
"merchantReference": "344223",
"requestDateTime": "20260824105500",
"secureHashValue": "YOUR_SECURE_HASH"
}'
