StoreCashierDocumentation Free 1.6.6 Pro 1.5.6 Apps 1.5.0

REST API & webhooks PRO

Connect StoreCashier to other software: a mobile app, an ERP or accounting system, Zapier / n8n / Make, a data warehouse or your own scripts. The REST API (storecashier/v1) lets an outside program read and write your data with an API key limited to the features (scopes) you allow. Webhooks push events (a sale, a stock movement, a new lead, a settlement…) to an external URL the moment they happen, signed so the receiver can trust them.

Where: Inventory Management → Reports → API (API Keys, Webhooks, API Docs; Request log) · Settings → API & Webhooks
The POS apps do not use API keys; they pair with your site separately (see POS apps admin screen). This page is for your own integrations.

1. Switch the API on#

API and webhooks settings
Settings → API & Webhooks.
SettingWhat it does
Enable the StoreCashier REST API (storecashier/v1)When off, every API request is rejected regardless of key. Webhooks still fire unless you disable each webhook.
Default rate limit (requests / minute / key)0 = unlimited. A key can override it.
Reject API requests that are not sent over HTTPSRecommended on live sites.
Allow the sc_key / sc_secret query-string fallbackHeaders are always accepted. Query-string credentials can end up in server logs; disable the fallback in production.
Log every API request / Keep log entries for (days)Request log (key, route, status, IP, duration). Old log rows and finished webhook deliveries are purged daily.

2. Create an API key#

API keys list with scopes, last used, requests and status
API → API Keys.
New API key form with user, expiry, rate limit, IP allow-list and permissions
New API key.
FieldWhat it does
Label / DescriptionE.g. "Mobile app", "Zapier", "ERP sync"; who owns it.
Acts as userThe WordPress user the key works as. The key can never do more than this user: every request also checks the user's StoreCashier permissions.
Expires onOptional end date.
Rate limit (requests / minute)Per key (blank = default).
IP allow-listOne IPv4 / IPv6 address or CIDR range per line; empty = any IP.
PermissionsPer feature Read and Write (write implies read), or All read, All read + write, Full access (every feature, including ones enabled later). Features of switched-off modules are hidden and their endpoints unavailable.

Click Generate key. The key and secret are shown once — "This secret is shown only once and cannot be retrieved later — only a hash is stored." Copy them now. Later you can Edit, Regenerate secret (the old one stops immediately), Disable / Enable, Revoke (permanent) or Delete. The list shows scopes, last used, last IP, requests, expiry and status (Active, Disabled, Expired, Revoked) plus 24-hour totals.

Scopes (features)#

Products, Stock, Sales & orders, POS, Purchases (read-only), Stock transfers (read-only), Stock adjustments (read-only; use stock:write to post adjustments), Manufacturing (read-only), Contacts, Leads, CRM, Support tickets, Bookings, Subscriptions, Accounts & payments, Expenses, Income, Approvals, Reports, Projects, Tasks, Repair, Assets, Documents, HRM & payroll (payroll read-only), Audit trail (read-only), Settings (read-only; secrets never exposed), Webhooks. Scopes are written as group:read / group:write or *.

3. Authenticate a request#

Send the key and secret in headers on every request:

curl https://your-shop.com/wp-json/storecashier/v1/ping \
  -H "X-SC-Key: YOUR_KEY" \
  -H "X-SC-Secret: YOUR_SECRET"

Each request is checked in this order: API switched on → HTTPS (if required) → key active, not revoked, not expired, secret matches → client IP in the allow-list → rate limit → scope → the bound user's permission.

Error codeMeaning
sc_api_disabledThe API is switched off.
sc_api_https_requiredRequest was not HTTPS.
sc_api_no_key / sc_api_bad_keyMissing or wrong key / secret.
sc_api_key_inactive / sc_api_key_expiredKey disabled, revoked or expired.
sc_api_ip_blockedIP not in the allow-list.
sc_api_rate_limited (HTTP 429)Too many requests; wait for Retry-After seconds.
sc_api_scope / sc_api_forbiddenThe key's scopes or the user's permissions do not allow it.
sc_api_module_disabledThe module behind the endpoint is switched off.

Errors use the standard WordPress REST format: {"code": "...", "message": "...", "data": {"status": 4xx}}. Responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset.

4. Endpoints#

Base URL: https://your-shop.com/wp-json/storecashier/v1. The live, complete reference with every field, parameter and example is in API → API Docs (and as an OpenAPI document at /openapi).

Built-in API documentation
API → API Docs — generated from your site, so it matches your version and modules.
AreaRoutes (methods)
GeneralGET /ping (health check), GET /me (key, user, scopes, rate limit), GET /openapi
Catalogue/products (GET, POST; item GET, PUT/PATCH, DELETE — writes go through WooCommerce), /categories, /brands, /units (GET)
StockGET /stock, GET /stock/movements, POST /stock/adjust, GET /transfers, GET /adjustments
Sales/orders (CRUD via WooCommerce), /pos/sales (GET, POST), GET /pos/lookup (barcode / SKU)
Purchasing & manufacturingGET /purchases, GET /manufacturing/recipes, GET /manufacturing/orders
Contacts & money/contacts (CRUD), GET /contacts/{id}/summary, /contacts/{id}/payments (GET, POST), /accounts (CRUD), GET /accounts/{id}/ledger, GET /payments, /expenses, /expenses/categories, /income, /income/categories (CRUD)
Sales modules/leads (+ /leads/{id}/notes), /crm/deals, /crm/proposals, /crm/estimates, /crm/contracts (CRUD)
Operations/projects, /projects/milestones (CRUD), GET /projects/timesheets, /tasks, /tickets (+ /tickets/{id}/replies), /bookings, /bookings/resources, /assets, /assets/categories, /repairs (CRUD), /subscriptions (CRUD, POST /subscriptions/{id}/invoice)
HR/hrm/employees, /hrm/attendance, /hrm/leaves, /hrm/departments (CRUD), GET /hrm/leave-types, GET /hrm/payroll
WorkflowGET /approvals, POST /approvals/{id}/decide, /documents (CRUD, metadata of existing media files), GET /audit-log
Reports & settingsGET /reports, GET /reports/{report}, GET /settings, GET /settings/{group}, GET /settings/locations, GET /settings/tax-rates
Webhooks/webhooks (CRUD), GET /webhooks/events, GET /webhooks/{id}/deliveries, POST /webhooks/{id}/test

Lists accept page (default 1), per_page (default 25, max 100), order (asc / desc, default desc), orderby, search (where supported) and after / before date filters. Totals are returned in the X-WP-Total and X-WP-TotalPages headers.

Writes are real. Creating a POS sale, posting a stock adjustment or a contact payment through the API changes stock, accounts and balances exactly like doing it in the admin. Test with a staging site first.

5. Request log#

API request log with key, method, route, status, IP and duration
API request log.

Cards: Requests, Errors, Rate-limited and Avg. response (24 h). Filter by key, status, or route / IP / error code; Clear log.

6. Webhooks#

Webhooks list with events, last delivery and status
API → Webhooks.
New webhook with payload URL, signing secret and events
New webhook.
  1. API → Webhooks → New webhook.
  2. Enter a Label and the Payload URL (e.g. a Zapier catch hook), keep Active ticked.
  3. Copy the Signing secret (tick Rotate the signing secret on save to change it).
  4. Tick the Events (or Select all) and save.
  5. Use Send test ping in the list. "Delivery sent — the endpoint answered with a 2xx status" means it works.

Events#

EventFires when
sale.finalizedA sale is finalized.
order.createdA POS order is created.
order.status_changedA WooCommerce order changes status.
stock.movedA stock movement is recorded.
product.syncedA product is created / updated (mirrored from WooCommerce).
payment.receivedA contact payment is received.
settlement.createdCustomer / supplier balances are settled against each other (no cash movement). Payload: settlement_id, customer_id, supplier_id, amount, settled_on, customer_pay_group, supplier_pay_group.
settlement.deletedA balance settlement is deleted (both halves reversed). Same payload.
deal.wonA CRM deal is won (CRM on).
approval.decidedAn approval request is finally approved or rejected (Approvals on).
{entity}.created / .updated / .deletedFor contact, product, purchase, sale, adjustment, transfer, expense, income, lead, deal, proposal, estimate, contract, project, task, ticket, booking, asset, subscription, subscription_invoice, repair, production_order, employee, leave, document — only for modules that are on.

A settlement never also fires payment.received, so a receiver does not count money twice. See Linked customer & supplier (settle).

Payload, headers and signature#

Each delivery is a POST with a JSON body:

{ "id": "delivery-uuid", "event": "sale.finalized", "data": { … }, "site": "https://your-shop.com", "sent_at": "2026-11-16 10:15:00" }

Headers: X-SC-Event, X-SC-Delivery, X-SC-Webhook-Id, X-SC-Timestamp, X-SC-Signature (hex HMAC-SHA256 of the raw body with your signing secret) and X-SC-Signature-256 (sha256=<hex>). Verify it before trusting the data, e.g. in PHP:

$body = file_get_contents( 'php://input' );
$ok   = hash_equals( hash_hmac( 'sha256', $body, $secret ), $_SERVER['HTTP_X_SC_SIGNATURE'] ?? '' );

Retries and delivery log#

A delivery succeeds on any 2xx answer. On a timeout, HTTP 429 or 5xx it is retried up to 6 attempts in total, after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours; other errors (4xx) fail at once. Pings are not retried. Open a webhook to see its recent deliveries (event, status, attempts, response code and body); the last 200 deliveries per webhook are kept.

Permissions#

Store Staff → Roles → API & Webhooks: View API keys & webhooks and Manage API keys & webhooks.

FAQ#

I lost the secret.

It cannot be shown again. Use Regenerate secret on the key and update your integration.

My integration gets 403 although the scope is ticked.

The bound user lacks the matching StoreCashier permission, or the module is switched off. Check "Acts as user" and the user's role.

Can I add my own webhook events?

Developers can extend the catalogue with the storecashier_webhook_events filter and fire events with \StoreCashier\Modules\RestApiAdmin::trigger( $slug, $data ).