These instructions explain how to add Amazon Pay to your existing API-only integration.
Before you begin
Before starting your Amazon Pay integration:
- Make sure that you have set up your back end implementation.
- Add Amazon Pay in your test Customer Area.
- Register with Amazon for an Amazon Pay account.
- Follow the steps on Amazon Pay's documentation to integrate with Amazon Pay.
- Check if your payments are affected by PSD2. If your payments are affected, implement 3D Secure authentication to comply with PSD2.
Build your payment form for Amazon Pay
Show Amazon Pay as an available payment method in countries where Amazon Pay is supported. When the shopper selects Amazon Pay, they are presented with the payment form.
We provide logos for Amazon Pay which you can use on your payment form. For more information, refer to Downloading logos.
You can also submit a /paymentMethods request specifying:
- countryCode: Country where Amazon Pay is supported. For example, NL.
- amount.currency: You can only accept payments in the currency that you used when you registered with Amazon Pay. For example, EUR.
In the response, you receive
Make a payment
Refer to Amazon Pay's documentation to integrate with Amazon Pay.
- Create a checkout session and follow all subsequent steps as described in Amazon Pay's documentation.
- Make a Get Checkout Session call to get the
amazonPayTokenfrom the response.
From your server, make a /payments request, providing:
paymentMethod.amazonPayToken: This is the
amazonPayTokenthat you obtained from the Get Checkout Session response.
browserInfo: Required if you're implementing 3D Secure. The shopper's browser information.
The following example shows how to make a payment request for Amazon Pay if you're not implementing 3D Secure.
Without 3D Secure, the /payments response contains:
pspReference: Adyen's unique reference for the payment.
Present the payment result
resultCode that you received in the /payments response to present the payment result to your shopper.
resultCode values you can receive for Amazon Pay are:
|Action to take
|The payment was successful.
|Inform the shopper that the payment has been successful.
If you are using manual capture, you also need to capture the payment.
|The shopper cancelled the payment.
|Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.
|There was an error when the payment was being processed. For more information, check the
|Inform the shopper that there was an error processing their payment.
|The payment was refused. For more information, check the
|Redirect the shopper back to the payment page and ask them to try the payment again using a different card. For more information on how to do this, check Amazon Pay's documentation.
resultCode values are possible in case of the 3D Secure authentication flow. For more information, refer to Result codes.
|Action to take
|The transaction failed.
|Cancel the order and inform the shopper that the payment failed.
|The shopper successfully completed the payment.
|Inform the shopper that the payment has been successful and proceed with the order.
|The shopper did not complete the payment.
|Cancel the order and inform the shopper that the payment timed out.
Make sure you have your Amazon Pay integration set up for recurring payments. For details of how to do this, see Amazon Pay's documentation.
We support recurring transactions for Amazon Pay. To make recurring payments, you need to:
Create a token
To create a token, include in your /payments request:
- shopperReference: Your unique identifier for the shopper.
When the payment has been settled, you receive a webhook containing:
pspReferenceof the initial payment.
pspReference: This is the token that you need to make recurring payments for this shopper.
Make sure that your server is able to receive RECURRING_CONTRACT as part of your standard webhooks. You can enable the RECURRING_CONTRACT event code in the webhook settings page.
Make a payment with a token
To make a payment with the token, include in your /payments request:
pspReferencefrom the RECURRING_CONTRACT.
You can also get this value using the /listRecurringDetails endpoint.
shopperReference: The unique shopper identifier that you specified when creating the token.
recurringProcessingModel: Subscription or UnscheduledCardOnFile.
For more information about the
recurringProcessingModel fields, refer to Recurring transaction types.
Test and go live
To test Amazon Pay, you must follow the Amazon Pay testing guidelines.
You can check the status of an Amazon Pay test payment in your Customer Area > Transactions > Payments.
For more information, see Amazon Pay's test environment setup.