Overview #
The Get Transaction by ID API allows merchants to retrieve detailed information about a specific transaction using its unique transactionId.
The response provides transaction details including the transaction amount, payment method, card information, merchant and terminal information, transaction status, host response data, and available transaction actions.
Environment #
| Environment | Base URL |
|---|---|
| UAT / Stage | https://test.amwalpg.com:14443 |
| Production | https://webhook.amwalpg.com |
Endpoint #
POST
/Transaction/GetByTransactionId
Content Type #
application/json
Request #
Request Headers #
| Header | Required | Value |
|---|---|---|
Content-Type | Yes | application/json |
Request Method #
POST
Sample Request #
{
"transactionId": "7d8fcf50-f075-11ed-b792-9d1241b63248",
"merchantId": 74417,
"secureHashValue": "F4E6DA26CAA0A5B6C2EB5B350098E7E31BDD8C41E7BBD984091F36A87EBD6F54"
}
Request Parameters #
| Field | Required | Type | Constraints | Description | Example |
|---|---|---|---|---|---|
transactionId | Yes | String | — | Unique identifier of the transaction to retrieve. | 7d8fcf50-f075-11ed-b792-9d1241b63248 |
merchantId | Yes | Numeric | Maximum 19 characters | Unique identifier of the merchant associated with the transaction. | 74417 |
secureHashValue | Yes | String | — | Secure hash value used to validate the integrity and authenticity of the request. | F4E6DA26CAA0A5B6C2EB5B350098E7E31BDD8C41E7BBD984091F36A87EBD6F54 |
Response #
Successful Response #
A successful request returns success: true and transaction details in the data object.
Sample Success Response #
{
"success": true,
"responseCode": null,
"message": "Success",
"data": {
"idN": 344637,
"id": "7d8fcf50-f075-11ed-b792-9d1241b63248",
"transactionTime": "2023-05-18T15:00:44.8333333+00:00",
"amount": 3000,
"totalAmount": 0,
"tips": 0,
"convFees": 0,
"cardNumber": "400000000XXXXXXXXXXX0002",
"cardHolderName": "john doe",
"cardHolderEmail": null,
"cardHolderMobile": null,
"responseCode": "0",
"responseCodeName": "Approved",
"isRefunded": false,
"isCaptured": false,
"transactionMethodId": 4,
"hostId": 3,
"currencyId": 512,
"currency": "OMR",
"transactionTypeId": 2,
"transactionType": "Purchase",
"originalTransactionId": null,
"merchantBranchId": null,
"stan": null,
"terminalTypeId": 3,
"requestSourceId": 6,
"terminalType": null,
"channelType": 1,
"methodName": "Card ECommerce",
"bankId": null,
"aggregatorId": null,
"aggregator": null,
"transactionTypeDisplayName": "Purchase",
"amsTransactionStatusId": null,
"orderId": "6fa95e22-bdd8-4949-9857-9f2297804629",
"merchantName": "LuluMasqat",
"merchantId": 34440,
"terminalId": 169151,
"digitalTransaction": null,
"hostData": {
"HostName": "OmanNetPg",
"TransactionId": "2222222222222",
"Rrn": "123456789012",
"TrackId": "T12345",
"PaymentId": "11111111111111",
"Result": "00",
"Reason": "Transaction has been applied successfully."
},
"transactionActions": {
"canRefund": false,
"canVoid": false,
"canCapture": false
}
},
"errorList": null
}
Response Parameters #
General Response #
| Field | Type | Description | Example |
|---|---|---|---|
success | Boolean | Indicates whether the request was successfully processed. | true |
responseCode | String | Response code returned by the API. | 00 |
message | String | Response message describing the result. | Success |
data | Object | Contains the detailed transaction information. | Object |
errorList | String Array | List of errors. This should be empty or null for a successful response. | null |
Transaction Identification #
| Field | Type | Description | Example |
|---|---|---|---|
data.idN | Numeric | Numeric identifier associated with the transaction. | 344637 |
data.id | String | Unique identifier of the transaction. | 7d8fcf50-f075-11ed-b792-9d1241b63248 |
data.transactionTime | String | Date and time when the transaction occurred. | 2023-05-18T15:00:44.8333333+00:00 |
data.orderId | String | Order identifier associated with the transaction. | 6fa95e22-bdd8-4949-9857-9f2297804629 |
Transaction Amount and Fees #
| Field | Type | Description | Example |
|---|---|---|---|
data.amount | Numeric | Transaction amount before tips or fees. | 3000 |
data.totalAmount | Numeric | Total transaction amount including tips and fees. | 0 |
data.tips | Numeric | Amount of tips included in the transaction. | 0 |
data.convFees | Numeric | Convenience fees associated with the transaction. | 0 |
Cardholder Information #
| Field | Type | Description | Example |
|---|---|---|---|
data.cardNumber | String | Masked card number used for the transaction. | 400000000XXXXXXXXXXX0002 |
data.cardHolderName | String | Name of the cardholder. | john doe |
data.cardHolderEmail | String | Email address of the cardholder. | null |
data.cardHolderMobile | String | Mobile phone number of the cardholder. | null |
Security: Card information is returned in masked form. Merchants should not attempt to store or expose sensitive card information beyond applicable security and compliance requirements.
Transaction Status #
| Field | Type | Description | Example |
|---|---|---|---|
data.responseCode | String | Code indicating the outcome of the transaction. | 0 |
data.responseCodeName | String | Description associated with the transaction response code. | Approved |
data.isRefunded | Boolean | Indicates whether the transaction has been refunded. | false |
data.isCaptured | Boolean | Indicates whether the transaction has been captured. | false |
data.amsTransactionStatusId | Numeric | Identifier for the transaction status within AMS. | null |
Transaction Type and Payment Method #
| Field | Type | Description | Example |
|---|---|---|---|
data.transactionTypeId | Numeric | Identifier for the transaction type. | 2 |
data.transactionType | String | Description of the transaction type. | Purchase |
data.transactionTypeDisplayName | String | Display name of the transaction type. | Purchase |
data.transactionMethodId | Numeric | Identifier for the transaction method used. | 4 |
data.methodName | String | Name of the payment method used. | Card ECommerce |
data.originalTransactionId | String | Identifier of the original transaction, where applicable. | null |
Terminal and Channel Information #
| Field | Type | Description | Example |
|---|---|---|---|
data.terminalTypeId | Numeric | Identifier for the type of terminal used. | 3 |
data.terminalType | String | Description of the terminal type. | null |
data.terminalId | Numeric | Unique identifier of the terminal used. | 169151 |
data.channelType | Numeric | Communication channel through which the transaction was processed. | 1 |
data.requestSourceId | Numeric | Identifier for the source of the transaction request. | 6 |
data.hostId | Numeric | Identifier of the host system that processed the transaction. | 3 |
data.stan | String | System Transfer Authorization Number associated with the transaction. | null |
Merchant Information #
| Field | Type | Description | Example |
|---|---|---|---|
data.merchantName | String | Name of the merchant associated with the transaction. | LuluMasqat |
data.merchantId | Numeric | Unique identifier of the merchant. | 34440 |
data.merchantBranchId | Numeric | Identifier of the merchant branch where the transaction occurred. | null |
Currency Information #
| Field | Type | Description | Example |
|---|---|---|---|
data.currencyId | Numeric | Identifier of the currency used for the transaction. | 512 |
data.currency | String | Name or code of the currency used. | OMR |
Bank and Aggregator Information #
| Field | Type | Description | Example |
|---|---|---|---|
data.bankId | Numeric | Identifier of the bank associated with the transaction or card. | null |
data.aggregatorId | Numeric | Identifier of the payment aggregator involved in the transaction. | null |
data.aggregator | Object | Information about the payment aggregator involved in the transaction. | null |
Digital Transaction Information #
| Field | Type | Description | Example |
|---|---|---|---|
data.digitalTransaction | Object | Contains digital transaction information, when applicable. | null |
Host Response Data #
The data.hostData object contains information returned by the payment host.
| Field | Type | Description | Example |
|---|---|---|---|
data.hostData.HostName | String | Name of the host system that processed the transaction. | OmanNetPg |
data.hostData.TransactionId | String | Transaction identifier assigned by the host system. | 2222222222222 |
data.hostData.Rrn | String | Retrieval Reference Number associated with the transaction. | 123456789012 |
data.hostData.TrackId | String | Unique tracking identifier associated with the transaction. | T12345 |
data.hostData.PaymentId | String | Payment identifier assigned by the host system. | 11111111111111 |
data.hostData.Result | String | Result returned by the host system. | 00 |
data.hostData.Reason | String | Description or reason returned by the host system. | Transaction has been applied successfully. |
Host Response Example #
"hostData": {
"HostName": "OmanNetPg",
"TransactionId": "2222222222222",
"Rrn": "123456789012",
"TrackId": "T12345",
"PaymentId": "11111111111111",
"Result": "00",
"Reason": "Transaction has been applied successfully."
}
Transaction Actions #
The transactionActions object indicates which operations are currently available for the transaction.
| Field | Type | Description | Example |
|---|---|---|---|
data.transactionActions.canRefund | Boolean | Indicates whether the transaction can be refunded. | false |
data.transactionActions.canVoid | Boolean | Indicates whether the transaction can be voided. | false |
data.transactionActions.canCapture | Boolean | Indicates whether the transaction can be captured. | false |
Example #
"transactionActions": {
"canRefund": false,
"canVoid": false,
"canCapture": false
}
A value of true indicates that the corresponding transaction action is available.
Failure Response #
If the transaction cannot be retrieved, the API returns success: false along with a response code and error information.
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.
