Skip to content
logo
  • Products
    • Amwal Checkout
    • Merchant App
    • Merchant Control Panel
  • Pricing
  • Developers
  • About us
  • Contact Us
Edit Content
  • Products
    • Amwal Checkout
    • Merchant App
    • Merchant Control Panel
  • Pricing
  • Developers
  • About us
  • Contact Us
Login
Get Started
Login
Get Started
BA Booking

BA Booking

2
  • BA Booking overview
  • BA Booking Installation
amwalpay woocommerce

Woocommerce

2
  • Overview
  • Woocommerce Installation
CS-Cart

CS Cart

2
  • CS-Cart Overview
  • CS CART Installation
Shopify

Shopify

2
  • Shopify Overview
  • Shopify Installation
odoo

Odoo

2
  • Odoo Overview
  • Odoo Installation
whmcs

WHMCS

2
  • WHMCS Overview
  • WHMCS Installation
Magento

Magento

2
  • Magento 2 Overview
  • Magento Installation
Opencart

Opencart

2
  • OpenCart Overview
  • Opencart Installtion
ZenCart

ZenCart

2
  • ZenCart Overview
  • Zencart Installation
Drupal

Drupal

2
  • Drupal Overview
  • Drupal Installation
PrestaShop

PrestaShop

2
  • PrestaShop Overview
  • PrestaShop Installation
Contact Form 7

Contact Form 7

2
  • Contact Form 7 Overview
  • Contact Form 7 Installation
Joomla

Joomla

2
  • Joomla Overview
  • Joomla Installation
AMWAL INTEGRATED PAYMENT LINK

Integrated Payment Link

1
  • Implementation
Android SDk

Native Android SDK

2
  • Pre Requisites
  • Implementation
ios SDk

Native iOS SDK

3
  • Apple Pay Specific Configuration
  • Pre Requisites
  • Implementation
React SDk

React Native SDK

1
  • Implementation

Laravel Package

2
  • Installation
  • Configuration

Flutter SDK

2
  • Implementation
  • Flutter SDK Overview

SMARTBOX

4
  • Express ApplePay Implementation
  • Offsite Implementation
  • Pre Requisites
  • Implementation

Merchant Cloud Notification

1
  • Merchant Cloud Notification Integration Guide

Secure Hash Calculation

1
  • Secure Hash Calculation

Wp Travel Engine

1
  • Installation

Webhooks

11
  • Get Transaction by Merchant Reference
  • Acquiring Session Token
  • Initialize Payment
  • Encryption and Decryption
  • Refund Payment
  • Void Payment
  • Get Transaction by ID
  • Transactions with Statistics
  • Transactions Summary
  • Delete Customer Token
  • Pay by Token
View Categories
  • Home
  • Amwal Pay Developer Portal
  • Webhooks
  • Get Transaction by Merchant Reference

Get Transaction by Merchant Reference

Retrieve Purchase transaction details using the merchant reference associated with the transaction.

1. Environments #

EnvironmentBase URLFull Endpoint
UAT / Testhttps://test.amwalpg.com:14443https://test.amwalpg.com:14443/Transaction/GetByMerchantReference
Productionhttps://webhook.amwalpg.comhttps://webhook.amwalpg.com/Transaction/GetByMerchantReference

Note: Complete all development and certification against the UAT environment. Switch to the Production base URL only after AMWAL Pay confirms that this API has been enabled for your merchant profile.


2. Prerequisites #

Before using this API, ensure that:

  • Your merchant account is active and enabled for webhook APIs.
  • You have a valid numeric merchantId.
  • You have received a Merchant Secure Hash Key from AMWAL Pay.
  • The secure-hash key is provided as a hex-encoded HMAC key.
  • GetByMerchantReference is enabled in your merchant’s webhook API list.
  • Requests are sent over HTTPS.
  • The request body uses application/json.

3. Authentication & Secure Hash #

Every request must include a valid secureHashValue.

The gateway rejects requests when:

  • secureHashValue is missing.
  • The hash is invalid.
  • The request timestamp is stale.
  • The merchant is not authorized to use the API.
  • The API is not enabled for the merchant.

3.1 Secure Hash Algorithm #

Generate the secureHashValue using the following process:

  1. Collect all JSON request fields except secureHashValue.
  2. Exclude fields with null values.
  3. Sort the field names in ascending alphabetical order.
  4. Concatenate the fields using the format:
key1=value1&key2=value2&key3=value3
  1. Calculate HMAC-SHA256 using the merchant secure-hash key.
  2. Decode the merchant secure-hash key from hex to bytes before using it.
  3. Convert the resulting digest to uppercase hexadecimal.
  4. Send the resulting value as secureHashValue.

3.2 Fields Included in the Hash #

For a standard request, the hash string is:

merchantId={merchantId}&merchantReference={merchantReference}&requestDateTime={requestDateTime}

The alphabetical field order is:

merchantId
merchantReference
requestDateTime

For example:

merchantId=123456&merchantReference=ORD-001&requestDateTime=20260824105500

Important: Hash only the fields that you send in the request. Do not hash a gateway-generated or enriched request envelope.

3.3 Request Date Time #

The requestDateTime must use the following format:

yyyyMMddHHmmss

Example:

20260824105500

The timestamp should be close to the current UTC time. Stale timestamps may be rejected as part of replay protection.

Security: Never expose or log your secure-hash key in client-side applications.


4. Endpoint Specification #

PropertyValue
HTTP MethodPOST
Path/Transaction/GetByMerchantReference
Content-Typeapplication/json
Success HTTP Status200

UAT #

https://test.amwalpg.com:14443/Transaction/GetByMerchantReference

Production #

https://webhook.amwalpg.com/Transaction/GetByMerchantReference

5. Request #

Send only the following fields in the request body.

5.1 Request Parameters #

FieldTypeRequiredDescription
merchantIdNumberYesAMWAL Pay merchant identifier. Used to identify the merchant and validate the secure hash.
merchantReferenceStringYesYour order or invoice reference. The value must exactly match the stored transaction merchant reference.
requestDateTimeStringYesRequest timestamp in yyyyMMddHHmmss format.
secureHashValueStringYesHMAC-SHA256 hexadecimal digest generated according to the secure-hash algorithm.

5.2 Sample Request #

{
  "merchantId": 123456,
  "merchantReference": "ORD-001",
  "requestDateTime": "20260824105500",
  "secureHashValue": "A1B2C3D4E5F6..."
}

6. Transaction Matching Rules #

After the request is enriched by the gateway, the following rules are applied:

  • The merchantReference must match exactly.
  • The transaction is scoped to the authenticated merchant.
  • Only Purchase transactions are returned.
  • Results are ordered by idN in descending order.
  • The highest idN transaction is returned first.

If there are no matching Purchase transactions, the API returns an empty data array.


7. Response #

The response follows the standard AMWAL Pay webhook API response envelope.

7.1 Response Envelope #

FieldTypeDescription
successBooleanIndicates whether the API request was processed successfully.
responseCodeStringAMWAL Pay response code. 00 indicates success.
messageStringHuman-readable response message.
errorListString[]Validation or processing errors. Empty on success.
dataArrayList of matching Purchase transactions.

7.2 Transaction Object #

Each object inside the data array contains transaction information.

FieldTypeDescription
idString (GUID)Unique AMWAL Pay transaction identifier. Use this value with Get Transaction by ID and follow-up transaction operations.
idNNumberInternal numeric transaction identifier.
transactionTimeStringTransaction time in the AMWAL Pay default system format.
transactionDateTimeDateTimeTransaction timestamp.
transferDateTimeDateTime / NullDate and time when the transaction was transferred/settled. null when not transferred.
amountNumberTransaction amount in major currency units.
totalAmountNumberTotal transaction amount, including applicable aggregator amounts.
tipsNumberTip amount, when applicable.
convFeesNumberConvenience fee, when applicable.
currencyIdNumberISO numeric currency code. For example, 512 = OMR.
currencyStringCurrency name.
responseCodeStringHost or processor response code.
responseCodeNameStringHuman-readable response description.
transactionTypeIdNumberTransaction type identifier. This API returns Purchase transactions.
transactionTypeStringTransaction type name.
transactionTypeDisplayNameStringLocalized transaction type display name.
merchantReferenceStringMerchant reference used in the lookup.
merchantIdNumberMerchant identifier.
merchantNameStringMerchant name.
terminalIdNumberTerminal identifier, when available.
stanStringSystem Trace Audit Number.
cardNumberStringMasked card number, when applicable.
cardHolderNameStringCardholder name, when available.
gatewayTransactionReferenceStringHost or gateway transaction reference, such as a processor transaction ID or OmanNet RRN.
orderIdString (GUID) / NullLinked merchant order ID, when the transaction was created from an order.
isRefundedBooleanIndicates whether a refund has been applied.
isCapturedBooleanIndicates whether the transaction has been captured.
isTransferredBooleanIndicates whether settlement/withdrawal has occurred.
channelTypeNumberPayment channel type.
methodNameStringPayment method name.
amountAvailableForRefundOrCompletionNumberRemaining amount available for refund or completion, when applicable.
transactionActionsObjectIndicates which transaction actions are currently available.
hostDataObject / NullHost-specific transaction details.
digitalTransactionObject / NullDigital wallet or other digital transaction details, when applicable.

7.3 Transaction Actions #

The transactionActions object contains the operations currently available for the transaction.

FieldTypeDescription
canRefundBooleanWhether the transaction can be refunded.
canVoidBooleanWhether the transaction can be voided.
canCaptureBooleanWhether the transaction can be captured.
canPartialRefundBooleanWhether a partial refund is allowed.
canPartialVoidBooleanWhether a partial void is allowed.
canPartialCompletionBooleanWhether a partial completion is allowed.
canSplitTransactionBooleanWhether the transaction can be split.

8. Sample Responses #

8.1 Successful Response #

The following example shows a successful lookup containing a Purchase transaction:

{
  "success": true,
  "responseCode": "00",
  "message": "Success",
  "errorList": [],
  "data": [
    {
      "id": "8f3c1a2e-4b91-4d77-9c10-2a8e5b6d1c44",
      "idN": 2045821,
      "transactionTime": "24/08/2026 10:12:01",
      "transactionDateTime": "2026-08-24T10:12:01Z",
      "transferDateTime": "2026-08-25T08:30:00Z",
      "amount": 10.500,
      "totalAmount": 10.500,
      "currencyId": 512,
      "currency": "OMR",
      "responseCode": "00",
      "responseCodeName": "Approved",
      "transactionTypeId": 2,
      "transactionType": "Purchase",
      "merchantReference": "ORD-001",
      "merchantId": 123456,
      "stan": "000123",
      "gatewayTransactionReference": "723456789012345",
      "isRefunded": false,
      "isCaptured": true,
      "transactionActions": {
        "canRefund": true,
        "canVoid": false,
        "canCapture": false,
        "canPartialRefund": true,
        "canPartialVoid": false,
        "canPartialCompletion": false,
        "canSplitTransaction": false
      }
    }
  ]
}

Success Response #

A response with:

"success": true,
"responseCode": "00"

indicates that the lookup request was successfully processed.


8.2 Successful Response with No Matching Transaction #

If no Purchase transaction matches the supplied merchantReference, the API still returns a successful response:

{
  "success": true,
  "responseCode": "00",
  "message": "Success",
  "errorList": [],
  "data": []
}

Important: An empty data array is a successful lookup with no matching Purchase transactions. It is not a transport or API error.


9. cURL Examples #

9.1 UAT #

curl -X POST 'https://test.amwalpg.com:14443/Transaction/GetByMerchantReference' \
  -H 'Content-Type: application/json' \
  -d '{
    "merchantId": 123456,
    "merchantReference": "ORD-001",
    "requestDateTime": "20260824105500",
    "secureHashValue": "YOUR_SECURE_HASH"
  }'

9.2 Production #

curl -X POST 'https://webhook.amwalpg.com/Transaction/GetByMerchantReference' \
  -H 'Content-Type: application/json' \
  -d '{
    "merchantId": 123456,
    "merchantReference": "ORD-001",
    "requestDateTime": "20260824105500",
    "secureHashValue": "YOUR_SECURE_HASH"
  }'

Replace the following values with your actual merchant information:

  • merchantId
  • merchantReference
  • requestDateTime
  • secureHashValue

Generate a new secure hash for every request, because requestDateTime changes for each request.


10. Error Handling #

SituationTypical OutcomeRecommended Action
Missing or invalid merchantIdGateway rejects the requestConfirm the merchantId with AMWAL Pay.
Invalid secureHashValueGateway rejects the requestRecalculate the HMAC using the exact request fields and verify the secure-hash key.
Replay protection failureRequest rejectedGenerate a new requestDateTime using the current UTC time.
Stale requestDateTimeRequest rejectedUse the current UTC timestamp in yyyyMMddHHmmss format.
API not enabledGateway unauthorizedAsk AMWAL Pay to enable GetByMerchantReference for your merchant webhook profile.
Blank merchantReferenceBusiness validation errorSend a non-empty merchantReference.
No matching Purchase transactionHTTP 200, success: true, data: []Treat the response as a successful lookup with no matching transaction.
Updated on August 24, 2026

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Acquiring Session Token
Table of Contents
  • 1. Environments
  • 2. Prerequisites
  • 3. Authentication & Secure Hash
    • 3.1 Secure Hash Algorithm
    • 3.2 Fields Included in the Hash
    • 3.3 Request Date Time
  • 4. Endpoint Specification
    • UAT
    • Production
  • 5. Request
    • 5.1 Request Parameters
    • 5.2 Sample Request
  • 6. Transaction Matching Rules
  • 7. Response
    • 7.1 Response Envelope
    • 7.2 Transaction Object
    • 7.3 Transaction Actions
  • 8. Sample Responses
    • 8.1 Successful Response
      • Success Response
    • 8.2 Successful Response with No Matching Transaction
  • 9. cURL Examples
    • 9.1 UAT
    • 9.2 Production
  • 10. Error Handling

Secure. Seamless – Powering Payments for Every Business.

Sign Up
Support

4th Floor, Majan Tower Building
North Al Ghubrah, P.O. Box 233, P.C 118
Muscat, Sultanate of Oman

: support@amwal-pay.com

📞 : +96824121845

Resources
  • Developers
  • Careers
Company
  • About us
  • Contact Us
  • Contact Sales
  • Partners

2026 © AmwalPay. All Rights Reserved.

  • Terms & Conditions
  • Privacy Policy