Amazon Simple Pay
Advanced User Guide (API Version 2010-08-28)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Cancel

Description

The Cancel action cancels a reserved or pending transaction. Once the transaction is canceled, you cannot settle it. You cannot use Cancel on a completed transaction. Once a transaction is completed, you can do a refund if you want to reverse the order.

If the sender's credit card was in a reserved state, it is not part of this action to make sure the reserved status is removed.

[Note]Note

This action is an Amazon Flexible Payment Service (Amazon FPS) action. In order to execute this action, you must have an AWS Developer account. For information about how to get an account, see "Before you Begin" in the Amazon Simple Pay Getting Started Guide.

Request Parameters

ParameterDescription

Required

TransactionId

The unique ID generated by Amazon FPS and returned in response to a successful transaction.

Type: String

Constraint: 35 characters maximum

Ancestor: RefundResult, ResponseMetadata

Yes

Description

Describes the reason for cancellation.

Type: String

Default: None

No

You must also use parameters that are common to all requests that are described in Common Request Parameters. Parameter names are case sensitive.

Response Elements

ElementDescription

ResponseMetadata

Provides information about the request, including the request ID. Always returned.

Type: Common Response Elements

TransactionId

This is the ID of the completed transaction. Returned only if the transaction is successful.

Type: String: Max size = 35 characters

TransactionStatus

Specifies the status of the cancellation request. Always returned.

Type: TransactionStatus

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

Examples

[Note]Note

In order to provide a secure request, you must generate a signature whenever you make a call using this action. For more information, see Keeping Payments Secure

Sample REST Request

This section shows a sample REST request.

https://fps.sandbox.amazonaws.com?
Action=Cancel
&AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE
&Description=MyWish
&Signature=yOedrTuiMoMrKt8SwugDDnfd0nydyoX9uPq1H1SUCl4%3D
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-10-06T09%3A14%3A58.796Z
&TransactionId=14GKI1SKSR1V6DO1RCCB32RBR6KLODMGQUD
&Version=2008-09-17

Sample Response to REST Request

This section shows a sample response to a REST request.

<CancelResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
  <CancelResult>
    <TransactionId>14GKI1SKSR1V6DO1RCCB32RBR6KLODMGQUD</TransactionId>
    <TransactionStatus>Cancelled</TransactionStatus>
  </CancelResult>
  <ResponseMetadata>
    <RequestId>6fe4b755-a328-419d-8967-e1d3b43779fc:0</RequestId>
  </ResponseMetadata>
</CancelResponse>

Sample IPN Success Notification to Rest Request

This section shows a sample IPN notification to a REST request.

--------------------------
transactionId: 14GKI1SKSR1V6DO1RCCB32RBR6KLODMGQUD
statusMessage: The transaction was explicitly cancelled by the caller.
transactionDate: 1254820475
signatureVersion: 2
signatureMethod: RSA-SHA1
buyerEmail: new_premium@amazon.com
notificationType: TransactionStatus
callerReference: CallerReference08
transactionAmount: USD 1.00
transactionStatus: CANCELLED
operation: RESERVE
recipientEmail: test-caller@amazon.com
buyerName: Test Business
signature: jWDbBxtEhw2rQEyMeEXcpWCgoZvm8rjLEnmg38oYoPPR7NbMGgmMA9/5CDjt9Q/FMktKMbARXnZF
YTzHj3YOKiAM3vxI0zT1oTiSdBx1KBRFzK7mauxxlQv5BYxjFX+R5cl+keCaT2nQyrp3agdrIIp5
MZ5Oy9dBuYMwMFWXoZZor90EidD23hBdZSOOzQRUdzKaKJsF14RQVrKcf5pDCs1HaB6LBKbATaNT
RSxxrviIXy9JcWRQhJwzcc1H6cFOJDpNFSJ03b0Z94eL/XNu9BU7bT4KRWb+OHF0Pn53yf4zyBT9
jTD+94WeujCxwE2rF0j5+brmXp/+Sn/RccDG7w==
recipientName: Test Business
paymentMethod: CC
certificateUrl: https://fps.sandbox.amazonaws.com/certs/090909/PKICert.pem
paymentReason: Reserve
statusCode: Cancelled
--------------------------