OAuth 2.0
OAuth 2.0
You can embed Ecart API's OAuth flow so your customer connects their store without leaving your experience.
OAuth URL
Send your customer to the OAuth URL for your app. Replace [APP_ID] with your app's App Id from the dashboard:
https://oauth.ecartapi.com/[APP_ID]
You can embed this URL in your site as a redirect or iframe.
The state parameter
state parameterPass a state value in the OAuth URL to carry your own customer context through the flow. EcartAPI returns it unchanged in the redirect, so you know which of your customers initiated the connection:
https://oauth.ecartapi.com/[APP_ID]?state={your_customer_identifier}
Use any URL-safe string up to 255 characters — a user ID, session token, or tenant key. See Identifying stores and customers for the full pattern.
Steps for your customer
| Step | Action |
|---|---|
| 1 | Enter their store name and/or URL. |
| 2 | Click continue to start the OAuth process. |
| 3 | The ecommerce platform asks the store owner to authorize. After authorization, the customer is redirected to the Redirect URL you set when creating the app. |
What you get in the redirect URL
The redirect URL is called with query parameters including access_token, ecommerce, shop_id, ecartapi_key, and your original state value. See Store authentication for the full parameter list and how to validate the request with ecartapi_key.
Next
→ Store access token — Saving and using the access token.
→ API endpoints — API versions and base URL.
Updated 24 days ago