Use the GraphQL Playground with Your Store

📘

Important

The Buy with Prime API is offered as a preview and might change as we receive feedback and iterate on the interfaces. We are sharing this early documentation to help you learn about the Buy with Prime API as we write and iterate on the content.

Use the Buy with Prime API GraphQL playground to test API calls. You can test against your sandbox environment or the production instance of your store by providing targeting information in the header. Your live store reflects all changes made to the production instance. Below the main editor window, the header panel shows two values.

  • The authorization value is a Buy with Prime access token generated from your API credentials in the Bearer <access token> format. For details on generating access tokens, see Authenticate to the Buy with Prime API.
  • The x-omni-targetid value is your custom store’s targetId.

📘

Important

API calls containing a mutation change the state of your custom store. For example, a createOrder mutation sent to your custom store through the GraphQL playground creates a live order. To test mutations without changing the state of your custom store, use the Buy with Prime sandbox. For details, see Test in a Sandbox Environment.

Executing a query against your custom store can return live order details that include real shopper information. Adhere to all shopper privacy requirements when testing queries against your store using the GraphQL playground.

Mutations in the GraphQL playground

The GraphQL playground can execute mutations when targeting your sandbox or the production instance of your store. To access mutations, navigate to the "Add new" menu, select mutation and choose the plus(+) sign icon. Select a mutation from the new list to import it to your main editor window. You can select mutation variables from the explorer to include them in the imported mutation.

Related topics