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
Quick decision
Use this shortcut:- I run the tool myself -> API key
- I am building an installable third-party app -> OAuth2
- API Keys
- 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. 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.Using your API key
Include the API key in theAuthorization header with the Bearer scheme:Scopes
Scopes follow aresource.action format, for example products.read, orders.write, or themes.read. Use * for full access.
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.readdisputes.readsubscriptions.writepayment_links.writeproducts.read
Customer & analytics scopes
customers.writeanalytics.readanalytics.writeaffiliates.readaffiliates.write
Platform & security scopes
webhooks.writethemes.readthemes.writelicenses.readlicenses.writesecurity.readsecurity.writestore.readstore.write*for full access
orders.read customers.read, the merchant approves, and the exchanged shpat_... token can then only read orders and customers.
Inspecting the active key
UseGET /me/capabilities to inspect the active key at runtime:
- 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
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, the capabilities response also tells you which OAuth client issued the current access token.
Key format
Example:
shx_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
Error responses
Missing or invalid key
Shop suspended
Missing scope
Regenerating keys
If an API key is compromised:- Go to Settings in your dashboard
- Revoke the affected key
- Create a new key with the smallest required scopes
- Update your integration with the new key
401 Unauthorized.
Best practices
Use least privilege scopes
Give every integration only the scopes it really needs. A reporting tool needsproducts.read and payments.read, not *.
Handle rate-limit headers
ReadX-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 processingjob_123, send X-Request-Id: job_123 so your logs and Shoppex support traces line up.