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
Open Dashboard
Go to dashboard.shoppex.io and log in.
Choose Access
Pick the smallest scope set your integration needs.Common scope combinations:
| Integration | Scopes |
|---|---|
| Fulfillment / ERP sync | orders.read |
| Chargeback tooling | disputes.read |
| Report automation | analytics.read, analytics.write |
| Theme development | themes.read, themes.write |
| Catalog sync | products.read |
| CRM sync | customers.read |
| Webhook management | webhooks.read, webhooks.write |
Using Your API Key
Include the API key in theAuthorization header with the Bearer scheme:Scopes
Scopes follow aresource.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:
Key Format
| Prefix | Description |
|---|---|
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 |
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
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
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
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 perfectly.Use environment variables
Use environment variables
Never hardcode API keys in your source code.
Keep keys server-side
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
Use HTTPS only
Always use HTTPS when making API requests to prevent key interception.
Monitor usage
Monitor usage
Check your dashboard regularly for unusual API activity.