Refund

Description

You use Refund to refund a successfully completed payment transaction. You can refund less than the amount paid. The default, however, is to refund the full amount to the sender.

Only the caller of the original transaction can perform a refund.

Request Parameters

ParameterDescription Required

CallerDescription

Description of this transaction for the caller.

Type: String

Default: None

Constraint: Max size = 160 characters

No

CallerReference

A value you provide that uniquely identifies the request. For more information, see Important Values to Store in Your Database.

Type: String

Default: None

Constraint: Max size = 128 characters

Yes

TransactionId

Transaction ID of the transaction to be refunded. The transaction ID must be one returned from a Pay or Settle action.

Type: String

Default: None

Constraint: Max size = 35 characters

Yes

RefundAmount

Specifies the amount to be refunded.

To understand how to correctly specify the amount in a REST request, see the example request at the end of this topic.

Type: Amount

Default: Original transaction amount or any amount remaining

Constraint: The total refund amount cannot exceed the original transaction amount.

No

For REST requests, you must also include parameters that are common to all requests. These parameters are included by default in SOAP requests. For more information, see Common Request Parameters.

Response Elements

ElementDescription

TransactionId

This is the ID (max size = 35 characters) of the transaction named in the request.

Type: String

TransactionStatus

Provides the status of the transaction.

Type: TransactionStatus

Responses also include elements common to all responses. For more information, see Common Response Elements.

Errors

This action can return the following errors:

Examples

Sample REST Request

https://fps.amazonaws.com/?
  Action=Refund&
  AWSAccessKeyId=0656Example83G2&
  SignatureVersion=1&
  Timestamp=2008-08-06T13%3A00%3A01Z&
  TransactionId=254656Example83987&
  CallerReference=2987SDQ98SDRF32&
  CallerDescription=WrongSize&
  RefundAmount.Value=1&
  RefundAmount.CurrencyCode=USD&
  Version=2008-09-17&
  Signature=<URL-encoded signature value>

Sample SOAP Request

<SOAP-ENV:Body wsu:id="body" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <ns2:Refund xmlns:ns2="http://fps.amazonaws.com/doc/2008-09-17/">
     <ns2:TransactionId>13N918VZH2QQ7O3I5MLSDUPU5V89QQF5QSU</ns2:TransactionId>
     <ns2:RefundAmount>
       <ns2:CurrencyCode>USD</ns2:CurrencyCode>
       <ns2:Amount>1</ns2:Amount>
     </ns2:RefundAmount>
     <ns2:CallerReference>ReferenceString????QW3t12275904723091</ns2:CallerReference>
   </ns2:Refund>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Sample Response to REST Request

<RefundResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
  <RefundResult>
  <TransactionId>254656Example83987</TransactionId>
    <TransactionStatus>Success</TransactionStatus>
  </RefundResult>
  <ResponseMetadata>
    <RequestId>6d63adbb-611e-40ee-9262-a29c30e8ecaa:0</RequestId>
  </ResponseMetadata>
</RefundResponse>

Sample Response to SOAP Request

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
 <SOAP-ENV:Header>
   <wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing">MESSAGE123</wsa:RelatesTo>
   <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</wsa:To>
   <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">Refund:Response</wsa:Action>
   <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">urn:uuid:6d63adbb-611e-40ee-9262-a29c30e8ecaa</wsa:MessageID>
 </SOAP-ENV:Header>
 <SOAP-ENV:Body>
   <RefundResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
     <RefundResult>
     <TransactionId>13N918VZH2QQ7O3I5MLSDUPU5V89QQF5QSU</TransactionId>
       <TransactionStatus>Success</TransactionStatus>
     </RefundResult>
     <ResponseMetadata>
       <RequestId>6d63adbb-611e-40ee-9262-a29c30e8ecaa:0</RequestId>
     </ResponseMetadata>
   </RefundResponse>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Related Actions