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:

ParameterDescription
access_tokenThe token you use as Bearer when calling Ecart API (store access token).
ecommercePlatform name (e.g. shopify, wix, amazon).
shop_idStable store identifier assigned by EcartAPI (e.g. 6a7a5bfb630276f8cbaf237b). Does not change on reconnection — use it as your primary store key.
ecartapi_keyHMAC for validating the integration request (see below).

Additional parameters may be present depending on the platform's integration structure:

ParameterWhen present
urlStore URL, when the platform provides it.
nameStore name, when the platform provides it.
tokenInternal token reference, when applicable.
refreshTokenRefresh token, when the platform supports it.
userIdStore owner identifier, when the platform provides it.
stateYour 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.

InputValue
Base stringYour App Id and the access token received, concatenated with &.
Secret keyThe 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.


Did this page help you?