Skip to content

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
{
  "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"
}
400 Error
{
"code": "InvalidArguments",
"message": "merchantId field is mandatory, cannot be null or blank"
}
500 Amazon Pay server issue, try again
{
    "code": "InternalServerError",
    "message": "An internal server error has occurred. Try your request again later."
}

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.