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

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

TransactionId

Transaction ID of the transaction to be refunded.

Type: String

Default: None

Constraint: Max size = 35 characters

Yes

MarketplaceRefundPolicy

Specifies the refund choice from the MarketplaceRefundPolicy enumeration:

  • MasterTxnOnly

  • MarketplaceTxnOnly

  • MasterAndMarketplaceTxn

The marketplace developer can refund the master transaction, the marketplace fee, or both. The Marketplace Fee is a separate fee from the Amazon Payments fee and is paid by the recipient.

Type: Enumeration

Default: MasterTxnOnly

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

Size: 35 Bytes

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.sandbox.amazonaws.com?
Action=Refund
&AWSAccessKeyId=AKIAIIFXJCFIHITREP4Q
&CallerDescription=MyWish
&CallerReference=CallerReference03
&RefundAmount.CurrencyCode=USD
&RefundAmount.Value=1
&Signature=V6pU3PvDPkPhR9Eu7yZXnFZHuEFafLE5sBPgqqCELEU%3D
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-10-06T05%3A51%3A49.578Z
&TransactionId=14GK4TNCAQ84NK9VITEHKAS94RAD9ZE2AQD
&Version=2008-09-17

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:Pay xmlns:ns2="http://fps.amazonaws.com/doc/2008-09-17/">
   <ns2:SenderTokenId>76PSX31MM77T81ExampleQVDNQPG5GFAK</ns2:SenderTokenId>
   <ns2:RecipientTokenId>6SC9UJ1VJEExampleBTBNUNEYUBJM1K</ns2:RecipientTokenId>
     <ns2:TransactionAmount>
       <ns2:CurrencyCode>USD</ns2:CurrencyCode>
       <ns2:Amount>1.1</ns2:Amount>
     </ns2:TransactionAmount>
     <ns2:CallerReference>
      ReferenceString????rpXe12275876325471
     </ns2:CallerReference>
     <ns2:CallerDescription>
      DescriptionString-????i86x12275876325471
     </ns2:CallerDescription>
     <ns2:SenderDescription>
      DescriptionString-????0m6112275876325471
     </ns2:SenderDescription>
   </ns2:Pay>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Sample Response to REST Request

<RefundResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
  <RefundResult>
    <TransactionId>14GK6F2QU755ODS27SGHEURLKPG72Z54KMF</TransactionId>
    <TransactionStatus>Pending</TransactionStatus>
  </RefundResult>
  <ResponseMetadata>
    <RequestId>1a146b9a-b37b-4f5f-bda6-012a5b9e45c3:0</RequestId>
  </ResponseMetadata>
</RefundResponse>

Sample Response to SOAP Request

<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>13N91G4R7478C8ZLHEF93JLIGROQH2VQJSM</TransactionId>
        <TransactionStatus>Success</TransactionStatus>
      </RefundResult>
      <ResponseMetadata>
        <RequestId>6d63adbb-611e-40ee-9262-a29c30e8ecaa:0</RequestId>
      </ResponseMetadata>
    </RefundResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Sample IPN Pending Notification to Rest Request

--------------------------
transactionId: 14GK6F2QU755ODS27SGHEURLKPG72Z54KMF
statusMessage: The transaction is awaiting a response from the backend payment processor.
transactionDate: 1254808324
signatureVersion: 2
signatureMethod: RSA-SHA1
parentTransactionId: 14GK4TNCAQ84NK9VITEHKAS94RAD9ZE2AQD
buyerEmail: new_premium@amazon.com
notificationType: TransactionStatus
callerReference: CallerReference03
transactionAmount: USD 1.00
transactionStatus: PENDING
operation: REFUND
recipientEmail: test-caller@amazon.com
buyerName: Test Business
signature: mzis1HbeiiLx5j8nrUR3UeIVz3bcxVDG82JOW0gIEXO1FXxBVZHwPPBFCEVcyBMu8wtNTMph/ylu
okjBi8w9Q6shMswBteq9bwNQA9qbDRT256ckoqdwfCf0910lYVj+wNSKkezF6Clptjgsn0wMjMQO
D9QBuOAAA9qV6VnUorRumPZ1psY/17FUvDwKVUMPEkZNO1mn7lcLFZJJp1aMkIj+RmraafTUUM62
U0VMYKSR5pDEp0ifThn0Za4DogV0ZoGJrB/+gPhA07FdtnkM4uG5jgwqOCVyOA4ayP7uJpb7oImj
8Jhi60+EWUUbbUShTEsjTxqQtM8UKvsM6XAjdA==
recipientName: Test Business
paymentMethod: CC
certificateUrl: https://fps.sandbox.amazonaws.com/certs/090909/PKICert.pem
paymentReason: MyWish
statusCode: PendingNetworkResponse
--------------------------

Sample IPN Success Notification to Rest Request

--------------------------
transactionId: 14GK6F2QU755ODS27SGHEURLKPG72Z54KMF
statusMessage: The transaction was successful and the payment instrument was charged.
transactionDate: 1254808324
signatureVersion: 2
signatureMethod: RSA-SHA1
parentTransactionId: 14GK4TNCAQ84NK9VITEHKAS94RAD9ZE2AQD
buyerEmail: new_premium@amazon.com
notificationType: TransactionStatus
callerReference: CallerReference03
transactionAmount: USD 1.00
transactionStatus: SUCCESS
operation: REFUND
recipientEmail: test-caller@amazon.com
buyerName: Test Business
signature: sDq9YvW7L29W2NSIC/wjC5yLyR4QJSQyt/7iHhNiEdwFoGVkrLjJHiBloPfJxzznHnmMtCRsUQ+A
d3tZ0NdemMxf0qYM9NX93PyG0KBKXShKeM0Da39cvnC05tZmtxpfCuZT5ECRydr+BqRo/DOlx1Yg
93gihZ83qHWR8bpqQcBwsu7vD4c4m4mTZ4I75gw+NXKRDD+vCPFDNEKRnh5kQz+Tjjg4bnNYEEcG
Rf6UZfS2lvMzdj0c37RUY6t4gQ3W3Z9G/REGjC98JBuTimk/kc1HoSc+xe6WtAH/siNurisyqgoB
HWnQM8iRqLEHj/m9y6vx5EBHBokD1BJMIiiZNg==
recipientName: Test Business
paymentMethod: CC
certificateUrl: https://fps.sandbox.amazonaws.com/certs/090909/PKICert.pem
paymentReason: MyWish
statusCode: Success
--------------------------

Related Actions