Amazon Pay and Login with Amazon integration guide

Step 9: Mark the order reference as closed

Mark an Order Reference object that is in an Open or Suspended state as Closed to indicate that the order has been fulfilled, and you will not request any more authorisations against it. If you can only partially fulfill the order, you should still mark the Order Reference object as Closed after charging the appropriate amount.

Amazon uses a Closed Order Reference object to indicate to buyers that they have completed payment for their order. Otherwise, when buyers review their transactions on the Amazon Pay website, these order references are shown as Open for 180 days. After 180 days, Amazon changes the status of the Order Reference object to Closed with a reason code of Expired.

When the Order Reference object is marked as Closed:

  • You can still capture funds against open authorisations on the order reference.
  • You cannot create any new authorisations on the Order Reference object.
  • You can still execute refunds against the Order Reference object.


  1. Make a call to the CloseOrderReference API.

from pay_with_amazon.client import PayWithAmazonClient

client = PayWithAmazonClient(

response = client.close_order_reference(
closure_reason='My closure reason.')

require 'pay_with_amazon'

merchant_id = 'YOUR_MERCHANT_ID'
access_key = 'YOUR_ACCESS_KEY'
secret_key = 'YOUR_SECRET_KEY'

client =
  sandbox: true,
  currency_code: :usd,
  region: :na

amazon_order_reference_id = 'AMAZON_ORDER_REFERENCE_ID'

  mws_auth_token: 'amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE'

See also

Copyright © 2009-2019, Inc. or its affiliates. Amazon and are registered trademarks of, Inc. or its affiliates. All other trademarks are the property of their respective owners.