A Refund allows you (the merchant) to refund some or all of a previously-captured Charge to the buyer. A refund can only be initiated on a previously-captured Charge, and multiple Refunds can be initiated on a single Charge.
Amazon Pay processes refunds asynchronously. Refunds start in a Pending state before moving to a Completed or Declined state, depending on whether or not the operation was successful. You must set up instant payment notifications (IPNs), or implement a polling mechanism to query Get Refund API for updates. See asynchronous processing for more information.
Note: You should only refund the buyer if you’ve received the returned good, or if the order was captured but you haven’t shipped it yet. For digital goods, before refunding, make sure the digital good has not been used and can’t be used anymore by the customer.
Note: If your publicKeyId does not have an environment prefix (does not begin with 'SANDBOX' or 'LIVE') follow these instructions instead.
Note: If your publicKeyId has an environment prefix (for example: SANDBOX-AFVX7ULWSGBZ5535PCUQOY7B) follow these instructions instead.
Amount to be refunded. Refund amount can be either 15% or 75 USD/GBP/EUR and 8400 JPY (whichever is less) above the captured amount
Maximum value: 150,000 USD/GBP/EUR and 10,000,000 JPY
softDescriptor
Type: string
Description shown on the buyer payment instrument statement
Do not store sensitive data about the buyer or the transaction in this field. Sensitive data includes, but is not limited to: government-issued identification, bank account numbers, or credit card numbers
The soft descriptor sent to the payment processor is: "AMZ* <soft descriptor here>"
Default: "AMZ*<SELLER_NAME> pay.amazon.com" Max length: 16 characters/bytes
creationTimestamp
Type: dateTime
UTC date and time when the refund was created in ISO 8601 format
The environment the Refund object was created in (either Sandbox or Live)
Type: price
Parameter
Description
amount
Type: string
Transaction amount
currencyCode
Type: string
Transaction currency code in ISO 4217 format
Example: USD
Type: statusDetails
Parameter
Description
state
Type: string
Current object state
reasonCode
Type: string
Reason code for current state
reasonDescription
Type: string
An optional description of the refund state
lastUpdatedTimestamp
Type: dateTime
UTC date and time when the state was created in ISO 8601 format
States and reason code
State
Description
Reason code
RefundInitiated
A Refund object is in Pending state until it is processed by Amazon
Allowed operation: GET Refund
-
Declined
Amazon has declined the refund because maximum amount has been refunded or there was some other issue
Allowed operation: GET Refund
AmazonRejected - Amazon has rejected the refund, potentially due to a negative balance in your merchant account. To resolve this, you should repay the negative seller balance (NSB) to Amazon, then attempt the refund again or issue a refund to the buyer in an alternate manner (for example, a gift card or store credit).
ProcessingFailure - Amazon could not process the transaction because of an internal processing error, or because the buyer has already received a refund from an A-to-z claim, or a chargeback. You should only retry the refund if the Capture object is in the Completed state. Otherwise, you should refund the buyer in an alternative way (for example, a store credit or a check)
Refunded
Refund request has been processed and funds will be refunded to the buyer
Allowed operation: GET Refund
-
Operations
Create Refund
Initiate a full or partial refund for a charge. At your discretion, you can also choose to overcompensate the buyer and refund more than the original Charge amount by either 15% or 75 USD/GBP/EUR or 8,400 YEN (whichever is less). The response for Create Refund will include a Refund ID. This is the only time this value will ever be returned. You must store the ID in order to retrieve Refund details at a later date.
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore.Refund;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
public class Sample
{
public WebStoreClient InitiateClient()
{
// set up config
var payConfiguration = new ApiConfiguration
(
region: Region.YOUR_REGION_CODE,
publicKeyId: "YOUR_PUBLIC_KEY_ID",
privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
algorithm: AmazonSignatureAlgorithm.V2
);
// init API client
var client = new WebStoreClient(payConfiguration);
}
public void CreateRefund(string chargeId)
{
// prepare the request
var request = new CreateRefundRequest(chargeId, 14.00M, Currency.USD);
// send the request
RefundResponse result = client.CreateRefund(request);
// check if API call was successful
if (!result.Success)
{
// do something, e.g. throw an error
}
}
}
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore.Refund;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
public class Sample
{
public WebStoreClient InitiateClient()
{
// set up config
var payConfiguration = new ApiConfiguration
(
region: Region.YOUR_REGION_CODE,
environment: Environment.Sandbox,
publicKeyId: "YOUR_PUBLIC_KEY_ID",
privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
algorithm: AmazonSignatureAlgorithm.V2
);
// init API client
var client = new WebStoreClient(payConfiguration);
}
public void CreateRefund(string chargeId)
{
// prepare the request
var request = new CreateRefundRequest(chargeId, 14.00M, Currency.USD);
// send the request
RefundResponse result = client.CreateRefund(request);
// check if API call was successful
if (!result.Success)
{
// do something, e.g. throw an error
}
}
}
You've exceeded the maximum refund amount allowed for this Refund
422 UNPROCESSABLE_ENTITY
InvalidChargeStatus
You tried to call a Refund operation on a Charge that is not in a Completed state. Check the Charge status for more information
422 UNPROCESSABLE_ENTITY
TransactionCountExceeded
You've exceeded the maximum limit of 10 Refunds per Charge
422 UNPROCESSABLE_ENTITY
AmazonRejected
Amazon has rejected the refund. You should issue a refund to the buyer in an alternate manner (for example, a gift card or store credit)
500 INTERNAL_SERVER_ERROR
ProcessingFailure
Amazon could not process the transaction because of an internal processing error or because the buyer has already received a refund from an A-to-z claim or a chargeback. You should only retry the Refund if the Charge object is in the Captured state. Otherwise, you should refund the buyer in an alternative way (for example, a store credit or a check)
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Refund;
using Amazon.Pay.API.WebStore.Types;
public class Sample
{
public WebStoreClient InitiateClient()
{
// set up config
var payConfiguration = new ApiConfiguration
(
region: Region.YOUR_REGION_CODE,
publicKeyId: "YOUR_PUBLIC_KEY_ID",
privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
algorithm: AmazonSignatureAlgorithm.V2
);
// init API client
var client = new WebStoreClient(payConfiguration);
}
public void GetRefund(string refundId)
{
// send the request
RefundResponse result = client.GetRefund(refundId);
// check if API call was successful
if (!result.Success)
{
// handle the API error (use Status field to get the numeric error code)
}
// do something with the result, for instance:
string refundState = result.StatusDetails.State;
}
}
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Refund;
using Amazon.Pay.API.WebStore.Types;
public class Sample
{
public WebStoreClient InitiateClient()
{
// set up config
var payConfiguration = new ApiConfiguration
(
region: Region.YOUR_REGION_CODE,
environment: Environment.Sandbox,
publicKeyId: "YOUR_PUBLIC_KEY_ID",
privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
algorithm: AmazonSignatureAlgorithm.V2
);
// init API client
var client = new WebStoreClient(payConfiguration);
}
public void GetRefund(string refundId)
{
// send the request
RefundResponse result = client.GetRefund(refundId);
// check if API call was successful
if (!result.Success)
{
// handle the API error (use Status field to get the numeric error code)
}
// do something with the result, for instance:
string refundState = result.StatusDetails.State;
}
}