Letβs get you up and running with the Commerce Engine Storefront API. This guide covers the basics: obtaining credentials, understanding environments, and making your first API call.
store_id
: This unique identifier represents your specific store within your Commerce Engine organization. All data (products, orders, customers, etc.) is scoped to a store. Youβll find this ID in the Store settings section of the Admin Portal.
X-Api-Key
): This secret key is used only for the initial authentication step to identify your application when requesting an anonymous user token.
https://staging.api.commercengine.io/api/v1/{store_id}/storefront
https://prod.api.commercengine.io/api/v1/{store_id}/storefront
{store_id}
in the URL with your actual Store ID obtained from the Admin Portal. Youβll switch between these base URLs as you move from development to production.
POST
request to the /auth/anonymous
endpoint, providing your storeβs API Key in the X-Api-Key
header.content.user.id
: A unique ID for this anonymous user.content.access_token
: A short-lived Bearer token used to authenticate subsequent API calls for this userβs session.content.refresh_token
: A longer-lived token used to obtain a new access_token
when it expires.access_token
and refresh_token
on the client-side. Weβll cover how to use and manage these tokens in the Authentication section.access_token
, you can make authenticated requests to other Storefront API endpoints by including it in the Authorization
header: