Amazon Pay API Integration
Creating Amazon Pay App And Adding Your Domain
Log in to https://sellercentral.amazon.com
Go to Integration → Integration Central
Go to Manage client ID/store ID(s) section at the bottom of the page and click “Create new client ID/store ID” or click “View client ID/store ID(s)” and “Edit” to update existing app.
Add your lander domain to JavaScript origins and return URLs and create or update.
Obtain Amazon Pay MID Credentials
Log in to https://sellercentral.amazon.com
Go to Integration → MWS Access Key
Click the gold “Copy your keys” button at the top right
Copy the credentials shown in the popup.
Create Amazon Pay MID
In the CRM, go to Merchants->MID List
Click the green plus sign to create a new MID
Select Amazon Pay as Gateway field
Fill in copied credentials (merchant_id, access_key, secret_key, client_id, client_secret)
Fill in MID Title, Descriptor, MID #
Click “Create MID”
Add Amazon Pay Widgets and JavaScript to Your Lander Code
Sample Code from Amazon docs:
For more information on adding Amazon Pay widgets and Javascript visit https://developer.amazon.com/docs/amazon-pay-onetime/add-a-button.html
Send Amazon Pay Parameters with Import Order API Call
Send these parameters during Import Order API call
paySource: “AMAZON”
amazonBillerId: ID of Amazon Pay MID in the CRM (found on the MID List page)
amazonAddressConsent: access_token returned to your checkout page via the URL by Amazon
amazonOrderId: obtained in the AddressBook
onOrderReferenceCreatefunction withorderReference.getAmazonOrderReferenceId();
Transaction Flow
Customer clicks Amazon-generated Amazon Pay button on checkout page.

New window pops up for customer to log into Amazon

Customer returned to checkout page with access_token in URL query string.
access_token is used with Amazon profile API to obtain the firstName, lastName, and emailAddress parameters to send on Import Order API call. Send profileResponse.email as emailAddress parameter on Import Order API call. Parse profileResponse.name and send as firstName and lastName parameters on Import Order API call.
Call functions to display the Amazon AddressBook and Wallet widgets.
Obtain Amazon Order Reference ID to send on Import Order API call as amazonOrderId parameter in the AddressBook onOrderReferenceCreate function with orderReference.getAmazonOrderReferenceId();
Customer chooses shipping address and payment method from Amazon-generated widgets.


Import Order with parameters: paySource=AMAZON, amazonBillerId, amazonOrderId, amazonAddressConsent (access_token).
Upsells
Repeat JavaScript process on your upsell page and send amazonBillerId, amazonOrderId, amazonAddressConsent on Import Upsale API call.
Enable Recurring Payments
Follow the same integration steps as for one-time payments above and replace the Amazon AddressBook and Wallet widget code and add the Consent widget code as follows:
For more information on adding Amazon Pay widgets and Javascript visit https://developer.amazon.com/docs/amazon-pay-automatic/add-address-and-wallet-widgets.html
The customer will be required to check the “Use my selected payment method for future purchases and payments to this merchant” box in the Amazon-generated consent widget to complete the purchase.

Send the amazonBillingAgreementId as the amazonOrderId parameter on your Import Order API call.
Errors/Decline Messages
Below you will find common errors that other users have encountered when using Amazon Pay.
InvalidPaymentMethod
The customer’s payment method inside Amazon is no longer valid.
Customer must ensure that all payment methods inside their Amazon account are valid.
Last updated