Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Emporix Auth

Use the emporix-auth skill to choose Emporix token types, request tokens, pick scopes, and interpret 401 and 403 responses.

Use the emporix-auth skill to authenticate against the Emporix Commerce Engine API. It helps you pick the right token type, compose OAuth requests, choose minimal scopes, and diagnose 401 or 403 responses from api.emporix.io.

This page explains when to use the skill and how to work with it. For endpoint details and OpenAPI security requirements, see the OAuth Service documentation, Token exchange, and the API reference for each call. For MCP credentials, see also Retrieving Emporix MCP Token.

Skill details

Property
Value

Skill name

emporix-auth

Package path

skills/emporix-auth/ (contains SKILL.md)

Install it once using Installing skills.

When to use it

Use this skill when you need to:

  • Obtain or choose between Emporix token types (service access, anonymous, customer, SSO / token exchange, B2B legal-entity, MCP)

  • Compose OAuth token requests for integrations

  • Select minimal scopes for an API key or integration

  • Diagnose 401 or 403 responses from any api.emporix.io endpoint

  • Connect an AI tool to the hosted Emporix MCP server with the right MCP token packaging

How it works

Every Emporix API call is authorized with an OAuth 2.0 bearer token, except for MCP URL packaging, which embeds API key material. Endpoints declare which scopes the token must carry. The platform uses different token types for machine integrations, storefront guests, logged-in customers, and SSO.

Walk the decision tree top-down; the first match wins. Base URL for token and API calls: https://api.emporix.io. Tenant names are lowercase.

Token type
Typical use

Service access

Backend, scripts, and CI. A machine caller uses the client_credentials grant.

MCP

Hosted Emporix MCP server URL. The value is Base64 of the custom API key clientId:secret (not an OAuth access token).

Anonymous

Storefront guest session; returns sessionId for cart continuity

Customer

Storefront email/password login; authorize login with the anonymous bearer token first

SSO / token exchange

External IdP. Use Emporix-managed authorization code or client-owned token exchange. Do not mix them.

B2B (after customer or SSO)

Refresh the customer token with legalEntityId so the company context is embedded in the token

  • B2B is not a separate first-choice token. After a customer or SSO token exists, refresh with legalEntityId when the shopper acts for a company. Switching companies means another refresh with the new legalEntityId, not a full re-login.

  • For storefront continuity, start with an anonymous token, then complete customer login while sending the anonymous bearer token, then merge the anonymous cart into the customer cart. Skipping a step can lose the guest cart. Customer tokens also return saas_token (needed for checkout) and a refresh_token.

  • Do not impersonate Management Dashboard employees from integrations. Use a service access token with restricted scopes instead.

Prerequisites

Before you use this skill, make sure you have:

  • Emporix API credentials (Client ID and Secret) and, for storefront flows, Storefront API credentials (Client ID)

  • A custom API key with only the scopes your integration needs – recommended for production

  • A clear call pattern (backend, storefront, SSO, or MCP) so you can pick the matching token type

How to use it

After install, work in your AI tool with natural-language requests. Examples:

Get a service access token with only currency.currency_read for tenant mytenant.

Which token type do I need for a storefront guest who later logs in?

Why do I get 403 on this product update when my token call returned 200?

Build an MCP server URL for the product domain with the right scopes.

Provide your tenant name (lowercase), Client ID/Secret source, and the endpoint or MCP domain you are calling.

Usage notes

  • Request explicit scopes on service tokens in production. Omitting scope grants every scope on the API key.

  • Service access tokens have no usable refresh token. When they expire, request a new one. Confirm tenant binding via tenant= in the token response scope string.

  • An MCP token packages a custom key that carries the MCP scope plus tool scopes; missing tools usually mean missing scopes on the key.

  • The MCP server URL contains one of the domains product, order, customer, extensibility, frontend, or importtool, or the ID of a dynamic server you created in AI MCPs. The old domain frontend-facing returns 404.

  • A 401 from the MCP server means the key has no MCP scope, or the tenant or credentials in the URL are wrong. Check the tenant and the Base64 token first, then create a custom key that carries the MCP scope if it is missing. Treat the MCP URL as a credential. See Retrieving Emporix MCP Token.

  • Custom API key scopes are fixed at creation. You cannot add scopes later; create a new key if needed. Some scopes cannot be attached to API keys at all. If a scope is not offered in the portal, contact Emporix Support.

  • Requesting a scope the key does not carry still returns 200; the missing scope is silently absent from the granted set. Always read back the scope field.

  • Prefer _read over _manage, and _own or type-specific scopes over tenant-wide ones. Take required scopes from each endpoint’s API reference. Do not invent scope names.

  • For SSO access, choose either Emporix-managed authorization code or token exchange. Never use both in one implementation.

Checking status codes

Symptom
What it means
What to check

Invalid ApiKey when requesting a token

Gateway rejected client_id before OAuth

Confirm the Client ID in Developer Portal → Manage API Keys. Check the key is for the right environment and is not revoked.

401 Unauthorized

Token rejected

Check whether the token has expired. Confirm you are using the right token type for the endpoint. Compare the {tenant} in the URL with tenant= in the token scope string.

403 Forbidden

Valid token, missing scope

Compare the scopes granted on the token with the endpoint’s API reference. If a scope you requested is missing from the grant, create a new API key that includes it.

Last updated

Was this helpful?