Skip to main content
If you run an internal automation script, use an API key. Use OAuth2 when an app or service should connect to your store through an Allow Access page and get its own tokens, so nobody pastes a key. An OAuth app connects only to the store that created it. To connect Claude or another AI agent, see Agents & CLI.

Authentication modes

Shoppex supports two Bearer token modes for the Dev API:
  • API keys for server-to-server integrations you manage directly
  • OAuth2 access tokens for an app that a person on your team connects through an Allow Access page
Your own warehouse worker uses an API key. An ERP or CRM with a “Connect Shoppex” button uses OAuth2: a team member approves the access, and the app gets tokens that act with that person’s access.

Quick decision

Use this shortcut:
  • I run the tool myself -> API key
  • People connect an app to the store with an Allow Access page -> OAuth2
An internal deployment helper? API key. An ERP that your team connects with a “Connect Shoppex” button? OAuth2. An app that serves many stores needs one OAuth app in each store: each store creates it and gives the app its client ID and secret.
Shoppex uses API keys for authentication. Each key belongs to exactly one shop and can be limited with scopes.

Creating an API key

1

Open Dashboard

Go to dashboard.shoppex.io and log in.
2

Navigate to Settings

Go to Settings in the sidebar.
3

Generate Key

In the Developer API section, click Generate New API Key.
4

Choose access

Pick the smallest scope set your integration needs. Start from a preset, or choose Custom to select scopes one resource at a time. To change the scopes of a key later, use Edit Scopes in its menu.Common scope combinations:
5

Copy Key

Copy your API key immediately. It starts with shx_ and will not be shown again.
Store your API key securely. If compromised, regenerate it immediately.

Using your API key

Include the API key in the Authorization header with the Bearer scheme:

Scopes

Scopes follow a resource.action format, for example products.read, orders.write, or themes.read. Use * for full access. * covers every scope except customers.portal_sessions, which a key must hold by name. The most common mistake here is giving a key more scopes than it needs. A catalog sync must not also get customers.write. A reporting tool only needs read scopes. Grant the minimum and expand later if needed. Available scopes fall into three groups:

Commerce scopes

  • orders.read
  • disputes.read
  • subscriptions.write
  • payment_links.write
  • products.read

Customer & analytics scopes

  • customers.write
  • analytics.read
  • analytics.write (no endpoint uses it since the analytics reports were removed on 2026-10-03)
  • affiliates.read
  • affiliates.write
  • customers.portal_sessions signs a customer into your store’s account page with a one-time link (Portal Sessions). Full Access does not include it, and only the store owner can give it to a key.

Platform & security scopes

  • webhooks.write
  • themes.read
  • themes.write
  • licenses.read
  • licenses.write
  • security.read
  • security.write
  • store.read
  • store.write
  • * for full access
A scope covers every endpoint of its resource. products.read and products.write also cover shipping zones (/dev/v1/shipping-zones), and orders.write covers shipping and delivering physical orders. OAuth2 access tokens use these same Dev API scopes. For instance, your app requests orders.read customers.read, the merchant approves, and the exchanged shpat_... token can then only read orders and customers.

Inspecting the active key

Use GET /me/capabilities to inspect the active key at runtime:
This response tells you:
  • which scopes are active
  • whether the key has full access
  • which resource groups are readable or writable
  • which payment methods are enabled for the shop
  • which gated Dev API features are enabled for the shop
Notably, enabledPaymentMethods tells you whether gateways like Stripe, PayPal, or your connected crypto provider (OxaPay, Cryptomus, NowPayments) are active. features.nativeCryptoCheckout tells you which non-custodial native crypto gateways are available. If you authenticated with OAuth2, apiKey.credentialType is oauth_access_token, apiKey.oauthClientId is the client_id of the app that issued the current access token (shoc_... for an app the store created) and apiKey.oauthClientName is its name.

Key format

Example: shx_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6

Error responses

Missing or invalid key

Shop suspended

Missing scope

Regenerating keys

If an API key is compromised:
  1. Go to Settings in your dashboard
  2. Revoke the affected key
  3. Create a new key with the smallest required scopes
  4. Update your integration with the new key
The old key is immediately invalidated. All requests using it will fail with 401 Unauthorized.

Best practices

Use least privilege scopes

Give every integration only the scopes it really needs. A reporting tool needs products.read and payments.read, not *.

Handle rate-limit headers

Read X-RateLimit-Remaining and Retry-After. When remaining hits 0, back off until the reset window passes instead of hammering the API.

Forward a request id

If your worker is processing job_123, send X-Request-Id: job_123 so your logs and Shoppex support traces line up.

Use environment variables

Never hardcode API keys in your source code.

Keep keys server-side

Never expose your API key in client-side code (browsers, mobile apps). Make API calls from your backend server.

Use HTTPS only

Always use HTTPS when making API requests to prevent key interception.

Monitor usage

Check your dashboard regularly for unusual API activity.