Skip to main content
If you are using Claude Code, Codex, or an internal automation script for themes, use an API key with scopes themes.read themes.write. Use OAuth2 only if you are building an external app that other merchants install.

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 installable apps and third-party connectors
Your own warehouse worker would use an API key. A third-party ERP or CRM would use OAuth2, so the merchant clicks “Connect Shoppex” instead of pasting a raw key.

Quick Decision

Use this shortcut:
  • I run the tool myself -> API key
  • I am building an installable third-party app -> OAuth2
Claude Code editing your own theme? API key. Codex running your internal deployment helper? API key. ERP integration for many merchants? OAuth2.
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.Common scope combinations:
IntegrationScopes
Fulfillment / ERP syncorders.read
Chargeback toolingdisputes.read
Report automationanalytics.read, analytics.write
Theme developmentthemes.read, themes.write
Catalog syncproducts.read
CRM synccustomers.read
Webhook managementwebhooks.read, webhooks.write
5

Copy Key

Copy your API key immediately. It starts with shx_ and won’t 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:
curl -X GET https://api.shoppex.io/dev/v1/invoices \
  -H "Authorization: Bearer shx_your_api_key_here"

Scopes

Scopes follow a resource.action format: products.read, orders.write, themes.read, etc. Use * for full access. The most common mistake here is giving a key more scopes than it needs. A catalog sync should not also get customers.write. A reporting tool only needs read scopes. Grant the minimum and expand later if needed. You can inspect the currently active key with:
curl https://api.shoppex.io/dev/v1/me/capabilities \
  -H "Authorization: Bearer shx_your_api_key_here"

Key Format

PrefixDescription
shx_Shoppex API Key (32 characters after prefix)
shoc_OAuth client id
shcs_OAuth client secret
shoa_OAuth authorization code
shpat_OAuth access token
shprt_OAuth refresh token
Example: shx_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6

Error Responses

Missing or Invalid Key

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing or invalid API key. Expected: Authorization: Bearer shx_...",
    "doc_url": "https://docs.shoppex.io/api/errors#UNAUTHORIZED"
  }
}

Shop Suspended

{
  "error": {
    "code": "FORBIDDEN",
    "message": "Your shop has been suspended.",
    "doc_url": "https://docs.shoppex.io/api/errors#FORBIDDEN"
  }
}

Missing Scope

{
  "error": {
    "code": "FORBIDDEN",
    "message": "Missing required API scope.",
    "doc_url": "https://docs.shoppex.io/api/errors#FORBIDDEN"
  }
}

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

Give every integration only the scopes it really needs. A reporting tool needs products.read and payments.read — not *.
Read X-RateLimit-Remaining and Retry-After. When remaining hits 0, back off until the reset window passes instead of hammering the API.
If your worker is processing job_123, send X-Request-Id: job_123 so your logs and Shoppex support traces line up perfectly.
Never hardcode API keys in your source code.
export SHOPPEX_API_KEY=shx_your_api_key_here
const apiKey = process.env.SHOPPEX_API_KEY;
Never expose your API key in client-side code (browsers, mobile apps). Make API calls from your backend server.
Always use HTTPS when making API requests to prevent key interception.
Check your dashboard regularly for unusual API activity.