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.
1. Switch the API on#

| Setting | What 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 HTTPS | Recommended on live sites. |
| Allow the sc_key / sc_secret query-string fallback | Headers 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#


| Field | What it does |
|---|---|
| Label / Description | E.g. "Mobile app", "Zapier", "ERP sync"; who owns it. |
| Acts as user | The 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 on | Optional end date. |
| Rate limit (requests / minute) | Per key (blank = default). |
| IP allow-list | One IPv4 / IPv6 address or CIDR range per line; empty = any IP. |
| Permissions | Per 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 code | Meaning |
|---|---|
sc_api_disabled | The API is switched off. |
sc_api_https_required | Request was not HTTPS. |
sc_api_no_key / sc_api_bad_key | Missing or wrong key / secret. |
sc_api_key_inactive / sc_api_key_expired | Key disabled, revoked or expired. |
sc_api_ip_blocked | IP not in the allow-list. |
sc_api_rate_limited (HTTP 429) | Too many requests; wait for Retry-After seconds. |
sc_api_scope / sc_api_forbidden | The key's scopes or the user's permissions do not allow it. |
sc_api_module_disabled | The 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).

| Area | Routes (methods) |
|---|---|
| General | GET /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) |
| Stock | GET /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 & manufacturing | GET /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 |
| Workflow | GET /approvals, POST /approvals/{id}/decide, /documents (CRUD, metadata of existing media files), GET /audit-log |
| Reports & settings | GET /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.
5. 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#


- API → Webhooks → New webhook.
- Enter a Label and the Payload URL (e.g. a Zapier catch hook), keep Active ticked.
- Copy the Signing secret (tick Rotate the signing secret on save to change it).
- Tick the Events (or Select all) and save.
- Use Send test ping in the list. "Delivery sent — the endpoint answered with a 2xx status" means it works.
Events#
| Event | Fires when |
|---|---|
sale.finalized | A sale is finalized. |
order.created | A POS order is created. |
order.status_changed | A WooCommerce order changes status. |
stock.moved | A stock movement is recorded. |
product.synced | A product is created / updated (mirrored from WooCommerce). |
payment.received | A contact payment is received. |
settlement.created | Customer / 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.deleted | A balance settlement is deleted (both halves reversed). Same payload. |
deal.won | A CRM deal is won (CRM on). |
approval.decided | An approval request is finally approved or rejected (Approvals on). |
{entity}.created / .updated / .deleted | For 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 ).