Get Status API
Method: GET
Path: https://amazonpay.amazon.in/v1/payments/charge
Description: This API determines the status of a charge, refund, or top-up transaction by passing the appropriate order ID and type.
Request Parameters
| Parameter Name | Data Type | Description | Mandatory | Constraints |
|---|---|---|---|---|
| merchantId | String | Merchant ID provided by Amazon | Yes | |
| txnIdType | String | Transaction Type | Yes | Possible values: |
| txnId | String | For Charge & Topup: pass the appropriate captureId depending on the type. For Refund: pass either amazonRefundId or refundId based on the type. |
Yes |
Request Samples
Charge
https://{{ endpoint}}/v1/payments/charge?merchantId=A2UOYLUXLC6NR3&txnIdType=AmazonTxnId&txnId=P04-4734274-8283393
Refund
https://{{endpoint}}/v1/payments/charge?merchantId=A2UOYLUXLC6NR3&txnIdType=AmazonTxnId&txnId=P04-0572904-1255078-R073442
Top-Up
https://{{endpoint}}/v1/payments/charge?merchantId=A2UOYLUXLC6NR3&txnIdType=AmazonTxnId&txnId=TEST-7529519-0685907-R4
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| merchantId | String | Your merchant ID with Amazon Pay |
| chargeId | String | Unique ID sent in the charge request |
| amazonChargeId | String | Amazon-generated unique order ID |
| refundId | String | Refund ID shared for the refund request |
| amazonRefundId | String | Amazon-generated identifier for refund transaction |
| status | String | Transaction status (CapturePending, CaptureApproved, Failed, Pending, Approved, Declined) |
| requestedAmount | String | Amount requested as part of the request (for charge status response) |
| approvedAmount | String | Approved amount from Amazon Pay (for charge status response) |
| amount | String | Amount of the transaction ID passed or the refund amount |
| refundedFee | String | The fee refunded (for refund status response) |
| currencyCode | String | Will always be INR |
| customData | String | Optional custom data sent in the request |
| createTime | String | Creation timestamp |
| updateTime | String | Last update timestamp |
Sample Response for Charge
{
"merchantId": "A2UOYLUXLC6NR3",
"chargeId": "ve7v676dsdsde7f",
"amazonChargeId": "P04-7502344-4500241",
"status": "CapturePending/CaptureApproved/Failed",
"requestedAmount": "0.01",
"approvedAmount": "0.01",
"currencyCode": "INR",
"customData": "data",
"createTime": "2020-01-18T11:11:41.511Z",
"updateTime": "2020-01-18T11:12:52.661Z"
}
Sample Response for Refund
{
"refundId": "ve7vdsd99sde7f",
"amazonRefundId": "P04-0249917-0735882-R8908908",
"amount": 0.01,
"refundedFee": 0.01,
"currencyCode": "INR",
"status": "Approved/Pending/Declined",
"createTime": "2020-01-18T11:11:41.511Z",
"updateTime": "2020-01-18T11:12:52.661Z"
}
Common Errors
| Error | Resolution |
|---|---|
| Invalid chargeId | Please pass a valid chargeId based on the constraints specified and the response from the API call. |
| Invalid refundId | Please pass a valid refundId based on the constraints specified and the response from the API call. |