Repository navigation
User Guide
- About Amazon Login and Pay
- Installing the Extension
- Registering Your Site
- Configuring the Extension
- Configuring Amazon Payments
- Getting your Amazon keys from Seller Central
The extension adds two components to your Spree Commerce installation:
- a Login module that allows customers to seamlessly register and login using their Amazon account.
- This functionality is provided by the spree_social extension and the payment extension, when installed, will include the spree_social extension as a dependency.
- a Payments module that allows customers to complete checkout using the payment methods in their Amazon account.
You’ll need to create an Amazon Login and Pay merchant account to use with the extension. This account is where you’ll receive payments, see keys you’ll need to configure the extension, view reports, and configure your deposit account.
More information about Amazon Login and Pay, including pricing, can be found at https://payments.amazon.com/merchant. Registration takes just a few minutes, and In most cases, approval is instant.
Login and Pay for Spree Commerce follows standard order and payment flows for the Spree platform. For more information see https://guides.spreecommerce.com/user/ on how to manage your orders and payment state in Spree commerce.
Note: Amazon Login and Pay is not the same as Checkout by Amazon (CBA) or Amazon Flexible Payment Service (FPS). If you have accounts with either of these older services, you’ll still need to register for a new Login and Pay account to use this service.
In order to install the extension, you’ll first need to ensure that you meet the following prerequisites:
- You’re using Spree Commerce version XXXXXXX
- SSL is installed on your site and active on your checkout and login pages.
Assuming the prerequisites are met, follow these steps to install the extension:
- Add spree_amazon_payments to your Gemfile:
gem 'spree_amazon_payments', github: 'amzn/spree_pay_with_amazon', branch: ‘23stable’
gem ‘spree_social’, github: ‘spreecontrib/spree_social’, branch: ‘23stable’
- Bundle your dependencies and run the installation generator:
bundle
bundle exec rails g spree_amazon_payments:install
bundle exec rails g spree_social:install
- Be sure to answer ‘Y’ to any installation prompts about running db migrations.
You will need to create an Amazon Payments account and register your site with this extension. There is a special sign up link for associating your account to Spree Commerce

From there, follow these steps:
- Click the Get Started! button to start the process.
- On the Welcome screen enter your Legal Name, click the User Agreement checkbox, and then click the Continue button.

- On the next screen, there are several fields to fill out:
- Application Name: Enter the name of your website that you’d like displayed when a consumer logs in.
- Application Description: Enter a brief description of your site, if desired.
- Privacy Notice URL: Enter the URL of your site’s privacy policy, which will be displayed the first time a user logs in using Amazon on your site.
- Allowed login domains: Enter the secure domain of any domain names you’ll be operating your site on, including any testing or staging environments. Be sure to include any variations of the sub-domain, such as: https://yourstore.com/, https://www.yourstore.com/, https://store.yourstore.com/.
- Click the Submit button.
- The Summary of Amazon Payments Registration Information has all of the keys you need to connect the extension with your Amazon account—keep them handy. NOTE: You can always find these keys in your Amazon account dashboards, as well.
- Click the Continue to Seller Central button to finish your registration and complete your store setup.
- If you would like your store’s logo to appear on the Amazon Login screen:
- Make sure ‘Login with Amazon’ is selected from the pull-down at the top of the page.
- At the bottom of the Application Information section, click the Edit button.
- Next to Logo Image, click the Choose File button and select a 150px by 150px PNG image of your logo.
- Click the Save button to save your changes.
- Next, you’ll need to flesh out your store details:
- Select one of the ‘Amazon Payments Advanced’ options from the pull-down at the top of the page. (Doesn’t matter which.)
- From the Settings menu in the upper-right corner, select Account Info.
- Fill out the Seller Information section, which is used for customer-facing emails.
- In the Legal Entity section, you’ll need to supply your tax identity information. (Click the Launch Interview Wizard link, if you haven’t supplied this information already.)
- In the Deposit Method section, click the Add button to the right to add your bank account you your seller account.
- Once you’ve filled everything out, head back to the Magento admin page to configure the extension.
Setting up Amazon Login & Pay allows your customers to login with their Amazon credentials and use any payment methods or contact information they have stored in their Amazon account. You can configure Login & Pay from the Spree administrative pages
Lets start by logging into you Spree admin

You can access your Amazon configuration through the Configuration tab in your Spree dashboard
Click Configuration to start

Login with Amazon allows you to let Amazon users login to your site using their Amazon credentials. Lets start by adding Amazon as a Social Authentication Method
From the configuration screen, click Social Authentication Methods * *this requires that you have installed the spree_social gem

From the next screen, you will need to add a new authentication method, start by clicking the New Authentication Method button in the top right

The next screen lets you add an authentication provider, select Amazon from the drop down list

On this screen you will need to add your keys for Login with Amazon that can be found in your seller central account at seller.amazoncentral.com. See instructions later in this guide for where to get the appropriate keys for these settings.

Here you can enter your API KEY and API SECRET. These values correspond to your Login with Amazon Client ID and Client Secret in Seller Central

Enter your values for these keys, select the environment you wish to target with this added social authentication method and select whether it should be enabled immediately by setting Active to yes or no. At this point, your site will allow users to login to your site using their Amazon account.
What does this mean? Now, when buyers login to your site using their amazon account, an account will be created in the Users table in your Spree backend. This will tie orders to this user and capture their email address should you want to market to them at a later date
To add Amazon as a payment method, you will need to add Amazon as a new payment method under Payment Methods in your Spree configuration and the appropriate keys.
To begin, select Payment Methods from the right sidebar in your Spree administration page.

Next, click the New Payment Method button in the top right. From the drop down list select Spree::Gateway::Amazon.


On this configuration page you will need to specify:
- Name - a common name for this payment method.
- Description - a description for this payment method
- Environment - the environment you are targeting
-
Display - where you would like Amazon Payments to be used, available values are:
- Both - show on front and back end (to buyers and administrators)
- Front End - only show on the front end and disable any backend functionality. This option should not be used
- Back End - do not show buyers the Pay with Amazon button on checkout, but provide the ability to manage captures and refunds on the back end. Useful for testing purposes or when protecting buyers from accidentally using Amazon Payments before you are ready
-
Auto Capture
- If set to yes, the funds will be captured at the time of purchase.
- Active - Disables the functionality completely.
When finished, click Create to save the new payment method. After creating initially Amazon client information fields will be available.

These are:
- Server
- This should be either test or live depending on where you are running the plugin
- Test Mode
- A flag for setting a sandbox mode in the Amazon Payments plugin that allows you to perform test orders without capturing real funds. You will need to create test buyer accounts associated with your Amazon Payments account in Seller Central. See this video for more information on test buyer accounts.
- Client ID
- The Login with Amazon client id. Amazon Payments requires this for authentication of buyers even if Amazon is not added as a social authentication method
- Merchant ID
- Your Amazon Payments merchant/seller id. See later in this guide on how to register for a payments account and/or login to sellercentral.amazon.com to retrieve your keys
- AWS Access Key ID
- Your Amazon Marketplace Webservices access key. This can be found at sellercentral.amazon.com.
- AWS Secret Access Key
- The companion secret key also found at Seller Central. See later in this guide for more information.
Amazon Client ID Lets start by getting your AMAZON CLIENT ID. Start by logging into your Seller Central account.
From your Seller Central dashboard, make sure that ‘Login with Amazon’ is selected from the pull-down at the top of the screen.

Under the Web Settings heading, you’ll find the Client ID and Client Secret (which you can reveal by clicking the Show Secret button).
Copy the Client ID to the AMAZON CLIENT ID field into your Amazon Payment Method.
Amazon Merchant ID From your Seller Central dashboard, select either Amazon Payments Advanced (Production View) option from the top pull-down.

From the Settings menu in the upper-right, select Integration Settings.

At the top of the page, you’ll see Your Merchant ID

Copy the Merchant ID into your Amazon Payment Method for AMAZON MERCHANT ID
Amazon MWS Access Key/Secret Key
Your AMAZON MWS ACCESS KEY and AMAZON MWS SECRET KEY are available from the same Amazon Payments Advanced (Production View) drop down option. From the top navigation bar of Seller Central, mouseover Integration on the left-hand side, and select MWS Access Key from the drop-down menu.

On this page, you’ll see Your Access Key ID and Your Secret Access Key (again, click +Show to reveal it). Copy these values into your mazon Payment Method's fields for MWS ACCESS KEY ID and MWS SECRET KEY & save.

Next log into Seller Central and select Amazon Payments Advanced (Production View) from the drop down. From the Settings menu in the upper-right, select Integration Settings.

In the Instant Notification Settings section, click the Edit button.

Paste the URL you copied into the Merchant URL field
