Overview of the integration

The following is an overview of the typical process to set up Amazon Pay on your website for an automatic payment. The steps are grouped into two parts: enabling the purchase flow and processing payments.

Enabling the purchase flow

  1. Add the Amazon Pay button on the page where the customer starts the checkout flow (for example, the create an account page, the shopping cart, or the product detail page). The Login with Amazon button enables a customer to authenticate with Amazon Pay, and the Amazon Pay button can be used for authentication and payment.
  2. After the customer has successfully authenticated, Amazon Pay provides you an Access Token. You can optionally use this token to get the customer's name, email, and postal code.
  3. If the customer has chosen an address from the AddressBook widget, get the shipping address by calling the GetBillingAgreementDetails operation to compute taxes and shipping costs, and show the shipping and tax amount to the customer.
  4. Optionally, provide details about the payment like a note to the customer about the purchase or an order/subscription identifier to Amazon Pay by calling the SetBillingAgreementDetails operation.
  5. Show the Authorize Recurring Payments widget to obtain the customer's consent for future payments.
  6. Optionally, show the read-only version of the AddressBook and Wallet widgets on your order review page.
  7. After the customer authorizes the payment and confirms the purchase, confirm the purchase to Amazon Pay by calling the ConfirmBillingAgreement operation.
  8. To ensure that the customer has chosen a valid payment method, you have the option to call the ValidateBillingAgreement operation.
  9. Thank the customer for placing the order. Send an order confirmation email to the customer.

Note: Amazon Pay sends the "New merchant agreement" email to the customer when you confirm the Billing Agreement with Amazon Pay. This informs the customer that they have set up Amazon Pay as their payment method for future payments and purchases.

The following image shows how to enable a purchase using Amazon Pay:

The following image shows how to enable the guest checkout option using Amazon Pay:

Processing payment

  1. Request Amazon Pay to authorize the customer's payment by calling the AuthorizeOnBillingAgreement operation to ensure that the payment method has sufficient funds for the purchase. You can capture these funds at a later time by using the Capture operation as described in step 3 below. If you do not need to authorize payment before fulfilling the order, you can both authorize and capture funds with this operation. Note: Amazon Pay provides both Synchronous and Asynchronous modes for the AuthorizeOnBillingAgreement operation. With the Synchronous mode, you receive the final processing status of your AuthorizeOnBillingAgreement request at the same time. In Asynchronous mode, you first receive a Pending status of the Authorization object. After processing is complete, Amazon Pay notifies you of the final processing status via an Instant Payment Notification (IPN). For more information, see Synchronous and Asynchronous modes of the AuthorizeOnBillingAgreement operation.
  2. For Asynchronous mode, listen for the Authorize Instant Payment Notification (IPN) for the processing status of your authorization request.
  3. When you want to capture previously authorized payments, call the Capture operation.
  4. Listen to the Capture IPN for the processing status of your capture request. Amazon Pay sends a "Charge notification" email to the customer when the capture is successfully processed.
  5. Listen for an additional Capture IPN and a Refund IPN to learn if a customer paying with the direct debit method of payment has canceled payment during the 24 hour pre-notification period. If the customer requests a cancellation, Amazon Pay closes the capture object and initiates a refund.
  6. If you need to issue a refund, you can do so by calling the Refund operation.
  7. Listen to the Refund IPN for the processing status of your refund request. Amazon Pay sends a "Refund notification" email to the customer when the refund is successfully processed.

The following image shows how to process a payment:

See also