Refund API
Method: POST
Path: https://amazonpay.amazon.in/v1/payments/refund
ContentType: application/json
Description: This API enables the refund of a transaction based on the value passed in the request.
Request Parameters
| Parameter Name | Data Type | Description | Mandatory | Constraints |
|---|---|---|---|---|
| merchantId | String | Merchant ID provided by Amazon | Yes | |
| amount | String | Refund amount | Yes | Minimum value = 0.01 Note: Refund amount should be less than or equal to the order amount |
| currencyCode | String | Currency of the order | Yes | Allowed Value: "INR" |
| refundId | String | Unique Refund Order ID generated by the merchant | Yes | Maximum 32 characters Allowed values: lowercase a-z uppercase A-Z numbers 0-9 dash (-) underscore (_) |
| chargeIdType | Set | Order Type | Yes | Possible Values: - AmazonTxnId - MerchantTxnId |
| chargeId | String | Identifier corresponding to the type specified in chargeIdType field | Yes | |
| noteToCustomer | String | Message to be displayed to customer regarding refund | Yes | |
| softDescriptor | String | Reason for the refund | Yes |
Sample JSON for Request
{
"merchantId": "A2UOYLUXLC6NR3",
"refundId": "M04-3581290-6586191",
"chargeIdType": "AmazonTxnId",
"chargeId": "P04-0249917-0735882",
"amount": "2.00",
"currencyCode": "INR",
"noteToCustomer": "string",
"softDescriptor": "string"
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| refundId | String | Unique id generated for the refund request |
| amazonRefundId | String | Amazon-generated identifier for the refund transaction |
| amount | String | Amount requested to be refunded |
| refundedFee | String | The capture fee that has been refunded |
| currencyCode | String | Will always be INR |
| status | String | Transaction status (Approved, Pending, Declined) |
| createTime | String | Creation timestamp |
| updateTime | String | Last update timestamp |
Sample Response
| HTTP Status Code | Description | Response Payload |
|---|---|---|
| 200 OK | Success | |
| 400 | Error | |
| 500 | Amazon Pay server issue, try again |
Common Errors
| Error | Resolution |
|---|---|
| Invalid refundId | Please pass a valid refundId based on the constraints specified. |
| Transient error in API response | If you encounter any transient error, please try the API call again after 30 minutes to one hour. |
For more errors, refer to this.