Store authentication
Store authentication
To make Ecart API requests you need a store access token. Your customers integrate their store through Ecart API's authentication process; you do not need to assist them.
Recommended: Use the built-in authentication flow so store owners can connect their store easily. After a successful integration, the user is redirected to your Redirect URL with the tokens and data you need.
What you receive in the redirect URL
Your redirect URL is called with query parameters. The following four parameters are always present regardless of platform:
| Parameter | Description |
|---|---|
| access_token | The token you use as Bearer when calling Ecart API (store access token). |
| ecommerce | Platform name (e.g. shopify, wix, amazon). |
| shop_id | Stable store identifier assigned by EcartAPI (e.g. 6a7a5bfb630276f8cbaf237b). Does not change on reconnection — use it as your primary store key. |
| ecartapi_key | HMAC for validating the integration request (see below). |
Additional parameters may be present depending on the platform's integration structure:
| Parameter | When present |
|---|---|
| url | Store URL, when the platform provides it. |
| name | Store name, when the platform provides it. |
| token | Internal token reference, when applicable. |
| refreshToken | Refresh token, when the platform supports it. |
| userId | Store owner identifier, when the platform provides it. |
| state | Your own value, if you passed state in the OAuth URL. |
Parameters beyond the four core ones vary by platform. Do not rely on them being present for all integrations.
Example (conceptual):
https://example.com/callback?access_token=...&ecommerce=shopify&shop_id=6a7a5bfb630276f8cbaf237b&ecartapi_key=...&state=user_123
Validating the integration request
To validate that the redirect request is legitimate, use the ecartapi_key parameter. It is an HMAC with SHA-256 and Base64 encoding.
| Input | Value |
|---|---|
| Base string | Your App Id and the access token received, concatenated with &. |
| Secret key | The Client Id token from your dashboard settings. |
Use this to verify the request before saving the store access token.
Recap: Validate the redirect with ecartapi_key (HMAC SHA-256, Base64), then save the access_token and link it to your customer.
For a practical example with code samples, see the recipe Validating the integration request.
Next
→ OAuth 2.0 — How to send your customer to the OAuth URL and what they see.
→ Store access token — Where to find the token, saving it, and using it as Bearer.
Updated 24 days ago