This page is the Dev API overview, not the best first page for every workflow.Use this quick routing:
- if you want your first generic Dev API call, start with Quick Start
- if you want to build or customize a theme with AI, start with Build and Customize a Theme with AI
- if you want theme automation endpoints specifically, read Editing Themes first and use this API section as reference after that
Guide vs Reference
/themes/*explains the theme workflow and when to use inspect, apply, validate, preview, and publish/api-reference/*explains the Dev API shape, auth, scopes, and endpoint details
Official SDKs
If you do not want to hand-write requests, use an official SDK:- JavaScript / TypeScript backend SDK:
@shoppexio/sdk - Python backend SDK:
shoppexio - PHP backend SDK:
shoppexio/shoppex-php
@shoppexio/sdk, a Python cron job reading customers uses shoppexio, and a Laravel admin tool rotating webhooks uses shoppexio/shoppex-php.
SDKs & Libraries
Official Shoppex SDKs, install commands, public repos, and language examples.
Base URL
All API requests should be made to:Authentication
The Shoppex API uses Bearer token authentication. You can authenticate with:- an API key like
shx_... - an OAuth2 access token like
shpat_...
Authorization: Bearer shx_your_api_key_here, while an installable ERP app would use Authorization: Bearer shpat_your_access_token_here.
Include the token in the Authorization header:
Commerce Scopes
Commerce Scopes
orders.readdisputes.readsubscriptions.writepayment_links.writeproducts.read
Customer & Analytics
Customer & Analytics
customers.writeanalytics.readanalytics.writeaffiliates.readaffiliates.write
Platform & Security
Platform & Security
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.
Getting Your API Key
- Log in to dashboard.shoppex.io
- Go to Settings → API Keys
- Click Generate New Key
- Choose the scopes your integration needs
- Copy and store your key securely (it starts with
shx_)
API keys are shown only once when created. Store them in a secure location like a password manager or environment variables.
- API key auth
themes.readthemes.write
themes.read themes.write.
Capabilities Endpoint
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 normal gateways like Stripe or PayPal are active, and features.white_label_crypto_checkout.enabled tells you whether your shop may request raw crypto payment data for a custom UI or bot flow.
If you authenticated with OAuth2, the capabilities response also tells you which OAuth client issued the current access token.
Request Format
All requests should:- Use
Content-Type: application/json - Send JSON-encoded request bodies
- Include the Authorization header
OAuth2 Flow
For third-party apps, Shoppex also supports an OAuth2 authorization-code flow:
In practice: the browser redirects to
/dev/v1/oauth/authorize?..., the merchant approves on the Shoppex-hosted page, your backend exchanges the code via POST /dev/v1/oauth/token, then calls GET /dev/v1/orders with Authorization: Bearer shpat_....
Important:
/dev/v1/oauth/tokenreturns standard OAuth2 JSON, not the normal Shoppex API envelope- normal Dev API resource endpoints still use the standard Shoppex response format
Payment Retries And Gateway Switches
Shoppex may create more than one internal payment attempt for the same invoice. A customer might start with PayPal, close the checkout, reopen the invoice, and finish with Stripe. This catches most people off guard: treat the Shoppex invoice or payment ID as the source of truth, not a single provider session or order ID.Orders & Disputes
Orders & Disputes
- use
GET /ordersfor your operational order queue - use
POST /orderswhen your backend wants to create a pending order from catalog line items - use
POST /orders/:id/fulfillfor a server-side fulfillment trigger on a pending order - use
POST /orders/:id/refundfor merchant-driven refunds without the dashboard - use
GET /disputesfor chargebacks and payment-risk review
Invoices & Payments
Invoices & Payments
- use
GET /invoiceswhen you need the lower-level invoice resource directly - use
POST /payment-linksorPOST /payment-links/:id/togglefor sales-link workflows - use
GET /coupons/code/:codefor server-side coupon validation by code
Subscriptions & Customers
Subscriptions & Customers
- use
POST /subscriptions/:id/pauseorPATCH /subscriptions/:id/custom-fieldsfor recurring billing workflows - use
POST /customers/:id/wallet/creditorPOST /customers/:id/wallet/debitfor store-credit adjustments - use
GET /customers/:id?include_affiliate=truewhen you need customer detail plus affiliate summary in one response
Products & Variants
Products & Variants
- use
GET /products/:id/variants/fields,POST /products/:id/variants/fields, orPOST /products/:id/variants/fields/:fieldId/optionsfor variant configuration tooling - use
GET /products?include_variants=truewhen you need product reads with inline variant prices
Analytics & Affiliates
Analytics & Affiliates
- use
GET /analytics/reportsorPOST /analytics/reports/:id/generatefor scheduled exports - use
GET /affiliates/customersorPOST /affiliates/applications/:id/approvefor affiliate program automation
Store & Themes
Store & Themes
- use
GET /store/branding,POST /store/domains/additional,GET /store/domains/additional/:id/verification, orPUT /store/layoutfor storefront automation - use
GET /themes/:id/control/inspect,POST /themes/:id/control/apply,POST /themes/:id/control/preview,GET /themes/:id/control/preview/starts/:startId, orPOST /themes/:id/control/publishfor theme automation
Licenses & Webhooks
Licenses & Webhooks
- use
GET /licenses,POST /licenses,PATCH /licenses/:id, orDELETE /licenses/:idfor license support workflows - use
POST /webhooks/logs/:id/retryorPOST /webhooks/:id/rotate-secretfor webhook ops workflows
Security
Security
- use
GET /security/audit-trailorGET /security/session-trail/:session_idfor security and support workflows
- the public storefront flow already had
POST /v1/storefront/coupons/check GET /coupons/code/:codeis the server-to-server Dev API equivalent
Theme Automation Shortcut
If you came here for themes, the usual endpoint family is:POST /themes/control/createGET /themes/{id}/control/inspectGET /themes/{id}/control/diffPOST /themes/{id}/control/applyPOST /themes/{id}/control/validatePOST /themes/{id}/control/previewGET /themes/{id}/control/preview/starts/{startId}POST /themes/{id}/control/publish
- Build and Customize a Theme with AI
- Editing Themes
- this API reference for the exact endpoint details
Response Format
All responses return JSON with a consistent structure: Authenticated Dev API responses also includeX-Request-Id. If you send X-Request-Id: sync-run-42, Shoppex echoes that same id back. If you don’t send one, Shoppex generates one for you — useful for correlating logs when debugging.
- Success Response
- List Response
- Error Response
HTTP Status Codes
All error responses follow the standard error envelope format. See the Error Handling guide for detailed error codes.
| Code | Description |
|---|---|
200 | Success |
201 | Resource created |
400 | Business rule or domain-specific request error |
401 | Unauthorized (invalid or missing API key) |
403 | Forbidden (missing scope or suspended shop) |
404 | Resource not found |
422 | Validation error for request body, params, or query |
429 | Rate limit exceeded |
500 | Internal server error |
Request Tracing
UseX-Request-Id to correlate your logs with Shoppex responses.
Rate Limiting
API requests are limited to protect the service. When you exceed the limit, you’ll receive a429 Too Many Requests response.
Authenticated Dev API requests return these headers:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-ResetRetry-Afterwhen the request is blocked
Rate limits are plan-dependent. The values above are illustrative. Check the response headers from your actual requests for your current limits.
X-RateLimit-Reset or Retry-After before retrying.
Idempotency
All current state-changing/dev/v1 endpoints support idempotent retries.
This covers product, category, group, coupon, variant, customer, webhook, ticket, review, blacklist, license, escrow, invoice, and payment writes. Retrying POST /customers after a timeout won’t create the same customer twice, and retrying POST /webhooks/:id/test won’t spam duplicate test deliveries.
Use one of these headers:
Idempotency-KeyX-Idempotency-Key
Idempotency-Status header:
createdwhen the request created a new paymentcachedwhen Shoppex replayed the stored responseprocessingwhen the same key is still in flightbypassedwhen idempotency was intentionally skipped
- the replay key is scoped to your authenticated key, the route, and the idempotency key
- Shoppex also checks the request body for the same method and path
- the replay window is currently 24 hours
5xxresponses are not cached for replay
processing.
Pagination
The Dev API currently uses two pagination models: cursor-based pagination for feed-style entity lists (products, invoices, orders, customers, subscriptions) and page-based pagination for operational lists (webhook delivery logs, affiliate review queues). Most resource lists use cursor-based pagination withcursor and limit parameters.
For detailed pagination patterns, code examples, and best practices, see the Pagination guide.
Filtering
Core list endpoints now support a shared filtering and sorting contract:GET /customersGET /ordersGET /invoices
filters uses field:value pairs separated by commas.
status or customerEmail still work where already documented, but new integrations should prefer filters and sorts.