Use Login with Amazon for Shopper Identity

📘

Buy with Prime API is now available for early access

Sign up for early access to the Buy with Prime API using the 'Sign Up' button below. The API may change as Amazon receives feedback and iterates on it.

To customize the Buy with Prime experience to shoppers on your site, you can enable shoppers to sign in with their Amazon account credentials. To enable sign-in functionality, you can use Login with Amazon (LWA) or Amazon Pay. This section describes how to integrate with LWA, which is based on the OAuth 2.0 authentication framework. For a comparison to Amazon Pay, see Manage Shopper Identity.

Shopper sign-in flow

When you integrate your site with LWA, the shopper clicks a link that initiates the sign-in flow through LWA. During that process, the shopper consents to send you their Amazon customer profile data. LWA then redirects the shopper back to your site.

After LWA redirects the shopper back to your site, the profile data helps you personalize the shopper experience using the Buy with Prime API. For example, you might provide a smoother checkout experience by prefilling the shipping address with the shopper's default shipping address and mobile number.

For details about this process from a back-end perspective, see LWA Authentication Flow.

Ways to integrate your site with LWA

You can integrate your site with LWA in the following ways:

  • LWA SDK: LWA offers SDKs for JavaScript, iOS, and Android. Using an LWA SDK makes it easier to build well-formed authorization requests compared to directly using URL query parameters. The SDKs support both redirection and pop-up for sign-in. You must follow the Buy with Prime UI guidelines in your implementation. For details, see Integrate with LWA by Using an LWA SDK.

  • Direct integration: If you don't want to use an LWA SDK, you can integrate directly with the LWA OAuth endpoint. You must follow the Buy with Prime UI guidelines. For sign-in, direct LWA integration only supports redirection. If you want to have a pop-up window for sign-in, you must add that support yourself. Further, direct integration requires extra effort to clear the stored state when the shopper signs out. For details about direct integration with LWA, see Integrate Directly with LWA.

Related topics