Buy with Prime post order elements are shopper-facing embeddable user interface (UI) components that provide access to the Buy with Prime post order experience on your ecommerce site. You can add these elements to your order details or summaries, footers, headers, FAQ and help pages, chatbots, and returns and refunds policy pages.
Shoppers can access post order actions for Prime items, such as the order summary, order detail, shipment tracking, cancellation, and returns directly on your site without being redirected. When shoppers access the Buy with Prime post order experience through one of the entry points, they land on a page within your site where the post order element loads. Shoppers start on the order detail or summary element and can access other elements from there, such as cancellations, tracking, and returns, all without leaving your site.
To embed post order elements on your site, use the following steps:
Create new pages for Buy with Prime post order elements
You need to create two new pages within your site theme.
Shopify
- Open your Shopify admin.
- On the side menu, under Sales channels, choose Online store, and then Pages.
- Choose Add page.
- In the Title field, enter the page name, for example “yourstore.com/pages/amzn-post-order”.
Note: Page names can vary based on your preference. You can’t change the URLs after completing this process. - In the Content field, choose the HTML [<>] button.
- Add the following code snippet to embed the Buy with Prime post order experience within your site:
<amazon-order-management/> <script type="module" data-target-id="[your-target-id]" src="http://cdn.elements.amazon/elements/amazon-order-management/v1.0/web-component.js"></script> <amazon-order-management> </amazon-order-experience>
- In the Visibility section, choose Visible.
- In the Template section, choose Default page.
- Choose Save.
- Repeat steps 2-3.
- In the Title field, enter “yourstore.com/pages/amzn-post-order-redirect”.
- In the Content field, choose the HTML [<>] button.
- Add the following code snippet to integrate the Login with HAQM (LWA) authentication:
<script async data-target-id="[your-target-id]" type="module" src=" http://cdn.elements.amazon/elements/amazon-sign-in/v1.0/web-component.js "></script> <amazon-sign-in hidden="true"></amazon-sign-in>
- Repeat steps 7-9.
Register for a developer account and security profile to use Login with HAQM
Login with HAQM (LwA) authenticates shoppers in the Buy with Prime post order flows embedded on your site. After authentication, shoppers see a consent screen. For more information about LwA, go to Login with HAQM Documentation.
Before you can use LwA on your site, you must register for a developer account and security profile through the HAQM Developer Console. During registration, you provide the name and description of your application, your logo, and a link to your privacy policy. Users see this information each time they use LwA on your site or mobile app. To register for LwA and a security profile, use the following steps:
- Sign in to HAQM developer using your HAQM developer credentials.
- Choose Create a New Security Profile.
- In the Security Profile Management page, enter the following details:
- Security Profile Name: Your site’s domain name. This name appears on the consent screen when users agree to share information with your application.
- Security Profile Description: The internal description for your security profile.
- Consent Privacy Notice URL: The location of your company or application’s privacy policy (for example, http://www.example.com/privacy.html). This link appears for users on the consent screen.
- (Optional) Consent Logo Image: to add the logo image for your application, choose Upload Image. This logo is displayed on the sign in and consent screen to represent your business or website.
- Choose Save. Your security profile is created, and you see this message “Login with HAQM successfully enabled for security profile”.
Add your site to your security profile
After creating a security profile or activating an existing security profile for LwA on the developer console, you can add settings for your website. To add a website to your profile, use the following steps:
- If you’re not signed in, sign in to HAQM developer using your new security profile.
- In the Login with HAQM Configurations section, choose the security profile that you created in Register for a developer account and security profile to use Login with HAQM.
- In the Manage column, choose Web Settings.
- Choose Edit.
- Add the following details:
- Allowed Origins: Add your website domain. For example, http://www.example.com.
- Allowed Return URLs: Add the redirect page with the post order element code that you created in Create new pages for Buy with Prime post order elements. For example, http://www.example.com/pages/amzn-post-order-redirect.
- Choose Save.
Activate Buy with Prime post order elements on your site
To activate post order elements on your site, share the following information with your Sales Representative or contact Merchant Support.
- Page URLs created in Create new pages for Buy with Prime post order elements
- Security Profile ID created in Register for a developer account and security profile to use Login with HAQM
- Client ID
To locate and copy these IDs, use the following steps:
- If you’re not signed in, sign in to HAQM developer using your new Security Profile.
- In the Login with HAQM Configurations section, choose the Security Profile that you created in Step 2.
- In the Manage column, choose Security Profile.
- Choose the General tab, and then copy your Security Profile ID (also known as LwA application ID).
- Choose the Web Settings tab, and then copy your Client ID.
Allow list your site domain
To add your site’s domain to the allow list within merchant console, use the following steps:
- Sign in to merchant console.
- On the side menu, choose Settings, and then Domains.
- Verify if your site’s domain is on the allow list.
- If not, add your site’s domain to the list.
- Save your changes.
Add an ingress to the Buy with Prime post order elements on your site
To ensure that shoppers can access the Buy with Prime post order elements, you need to surface an ingress or entry point across key locations on your site. Locations can include the header, footer, shipping/returns help pages, contact us page, order history and detail pages, and the Buy with Prime collection page. Use the following steps to implement the ingress using either a direct link or a Prime branded button, such as in the following example:
Shopify
- Open your Shopify admin.
- On the side menu, under Sales channels, choose Online store, and then Themes.
- Create a duplicate of the theme file as a backup.
- On the more actions (…) menu on your theme, choose Edit Code.
- Choose the page where you want to add the ingress.
- In the code editor, add a new Section.
- In the new section, add the following code snippet:
<script type="module" data-target-id="[your-target-id]" src="http://cdn.elements.amazon/elements/amazon-order-ingress/v1.0/web-component.js"></script> <amazon-order-ingress page-url="[http://yourstore.com/pages/amazon-order]"></amazon-order-ingress>
Where:- target id: A unique value assigned to each Buy with Prime sales channel. You can find it on the Domain Allowlist page in merchant console.
- page-url: The page you created for the Buy with Prime post order elements. For example, “http://yourstore.com/pages/amzn-post-order”.
(Optional) Add additional attributes to the code snippet:
Configuration Input parameter Choose to show the subtext or not (tracking, returns, support, and more) show-explainer="true” or “false” Activate/deactivate the dark mode for the button background color-mode="light” or “dark” Model the ingress as a link type=”link” Set the order-id attribute to link to a specific order detail page. This is useful when the order ingress element is linked to a specific order, for example, on your native order detail page or on an order confirmation page. If no order-id is passed, the element links to the shopper’s order history page. order-id=”{{order.id}}
Validate the Buy with Prime post order elements
Place a test order on your site, and then confirm that you can see and access the Buy with Prime post order elements. If you don’t see the link or button to the post order elements, contact Merchant Support.