Sections · Getting started
API reference
Guide
Getting started
From an integration user and a token to your first call, and the rules every endpoint follows.
The Reevio API lets another system read and update your Reevio workspace: an online store syncing products and stock, a warehouse system reading orders, or a BI tool pulling invoices. It is a JSON REST API over HTTPS.
1. Create an integration user
Give each integration its own user instead of a person's login. Otherwise it stops working when that person leaves or changes role, and you cannot cut it off without touching their account.
- In Reevio, go to Administration → Users and create a user, for example
storefront-integration. - Give it a role with exactly what the integration needs. The role is the ceiling: a token can never do more than its user's role allows.
- Leave Restrict access by working hours off. Outside a user's working hours every call
is refused with
outside_access_schedule.
2. Issue a token
Only a workspace administrator can issue tokens.
- Go to Administration → API Tokens and create a token for the integration user.
- Tick the scopes the integration needs. Each endpoint below names the scope it requires; only scopes the user's role already grants can be ticked.
- Set an expiry. A token without one never expires.
- If the integration always calls from the same addresses, list them under Allowed IP
addresses. Calls from anywhere else are refused with
ip_not_allowed. - Copy the token when it is shown. It is stored encrypted and cannot be shown again.
Revoking the token, or deactivating its user, cuts the integration off at once.
3. Make your first call
Send the token as a bearer token. Call your workspace's own address: the one you open Reevio
at, followed by /api/public/v1.
curl https://your-workspace.reevio.app/api/public/v1/token \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"
GET /token needs no scope. It returns the token's label, scopes and expiry, its user, and
the workspace's functional currency, timezone and today's date on the workspace calendar.
Call it first to check the connection.
A token only works on the address of the workspace that issued it. Sent anywhere else, it is
refused with workspace_mismatch.
Test on a sandbox copy
Build and test against a sandbox copy of your workspace, not your live data. Ask Reevio support for one: it is a full, independent copy with its own address. Issue a separate token inside the copy; your live workspace's tokens do not work on the copy's address, and the copy's tokens do not work on your live address. Webhooks are not copied either, so a copy never sends test events to your live systems; add the copy's own on its token page.
Conventions
- Ids are opaque strings (
01K2ZQ7M4X8N6P3R9T5V7W1Y2A). Store them as strings and never build them yourself. - Decimals are strings: money, quantities, rates and percentages (
"10000.00","2.5000"), at the precision Reevio stores them. Parse them with a decimal type, not a float. - Dates ending in
_onare calendar dates,YYYY-MM-DD, on the workspace's calendar. Instants ending in_atare ISO-8601 in UTC (2026-10-31T09:15:00.000000Z). - Requests name, responses describe. A request refers to another record by
*_id(orcurrency_code,country_code); a response returns a small identity object for it, such as"customer": { "id": "…", "code": "CUS-000001", "name": "Acme Trading" }. - Document numbers (
number, for exampleINV-2026-00007) are assigned when a document is issued, so a new draft has none. - Envelope: one record comes back as
{ "data": { … } }, a list as{ "data": [ … ], "meta": { … } }. - Language: messages are in English, or Arabic when you send
Accept-Language: ar. Never branch on a message; use the errorcode. - Unknown fields: ignore fields you do not recognise. New ones are added without notice.
Lists, paging and sync
Lists are paged with a cursor, oldest first, so records created while you page never shift the ones you have not read yet.
limitsets the page size, 1–200, default 50.- When
meta.has_moreistrue, call again withpage_cursorset tometa.next_page_cursor, and nothing else: the cursor already carries your filters and page size. - Without filters a list comes back in creation order; with
issued_from/issued_to, in document-date order.
To keep a copy in sync, send updated_since (an ISO-8601 instant) instead of re-reading
everything. You get every record changed at or after that instant, including records moved
to Trash (they carry trashed_at, so you can delete your copy). Store the time you started
each sync and send it next time. A sync can return a record twice, never skip one, so update
your copy by id.
Stock is the exception: GET /stock-levels is a live snapshot with no updated_since. Poll it
for the products you care about.
Writing
POSTcreates.PATCHchanges only the fields you send; sendingnullclears a field.PUTreplaces a whole draft document, lines included.DELETEmoves a record to Trash, exactly when Reevio's own screens would allow it.- Writes run the same checks as the screens: permissions, prices, workflow steps and record
locks. A refusal answers
409with acodeand leaves everything unchanged. - Retries: send an
Idempotency-Keyheader (any unique string, up to 255 characters) on everyPOST. Repeating the request with the same key within 24 hours returns the first response, markedIdempotency-Replayed: true, instead of creating a second record. Reusing a key for a different request is refused withidempotency_key_reused.
Actions and their refusals
Issuing, canceling and reverting are their own calls (POST /sales-orders/{id}/issue), and
run exactly what the button in Reevio runs. When credit control, a sale limit or stock
stops one, the answer is a 409 whose code says what to do next; nothing has changed:
code |
Resend with |
|---|---|
credit_warning |
"confirm_credit_warning": true |
credit_limit_exceeded |
"credit_override": true and "credit_override_reason"; the token needs sales.credit_override |
sale_limit_exceeded |
"sale_limit_override": true and "sale_limit_override_reason"; the token needs sales.sale_limit_override |
stock_unavailable |
Nothing: change the lines to backorder, or wait for stock |
{
"code": "credit_warning",
"message": "Acme Trading would exceed their credit limit of 10,000,000 IQD.",
"details": { "violations": ["Acme Trading would exceed their credit limit of 10,000,000 IQD."], "resend_with": "confirm_credit_warning" }
}
An order that sells stock goes from draft to invoice in four calls:
POST /sales-orders/{id}/issuereserves its stock.POST /delivery-noteswith itssales_order_iddrafts the delivery note from that stock (when the workspace drafts one on issue, the409names it indetails.delivery_note).POST /delivery-notes/{id}/issuetakes the stock out.POST /invoiceswith itssales_order_iddrafts the invoice; issue it withPOST /invoices/{id}/issue.
A direct invoice (lines, no order) creates its own order and delivery note when issued and moves the stock, so never use one to re-bill a credited invoice: that moves the stock twice.
Webhooks
Instead of polling, Reevio can send your system an event when something changes. An
administrator adds a webhook on the token's page in Administration → API Tokens: an
https:// address and the events to send. The webhook acts with its token: it only
receives events for records the token can read, and revoking the token removes it.
Each event is a small JSON body naming the record; fetch the record for its full shape:
{ "id": "01K4B2C3D4E5F6G7H8J9K0MNPQ", "type": "invoice.issued", "occurred_at": "2026-11-02T08:15:00Z",
"data": { "object": "invoice", "id": "01K3A1B2C3D4E5F6G7H8J9K0MN", "number": "INV-2026-00007", "status": "issued" } }
Events: customer.created, .updated, .trashed; product.created, .updated,
.trashed; sales_order.created, .issued, .canceled, .reverted; invoice.issued,
.paid, .credited; credit_note.issued; customer_payment.posted, .reversed;
delivery_note.issued; purchase_order.issued. New types may be added.
Check the signature. The signing secret is shown once, when the webhook is added. Every
request carries Reevio-Signature: t=<unix time>,v1=<hex>, where v1 is the HMAC-SHA256
of the time, a dot and the raw body. Compare in constant time and refuse old timestamps:
[$t, $v1] = sscanf($_SERVER['HTTP_REEVIO_SIGNATURE'], 't=%d,v1=%s');
$body = file_get_contents('php://input');
$valid = abs(time() - $t) < 300 && hash_equals(hash_hmac('sha256', $t.'.'.$body, $secret), $v1);
Answer quickly. Reply with any 2xx within 10 seconds and do the work afterwards.
Anything else is retried with growing pauses for 24 hours; after that the webhook is
switched off and the workspace's administrators are told. Reevio-Delivery is the event's
id, and a delivery resent from the token page keeps it, so ignore an id you have already
handled.
Errors
Every error has a stable code and a human-readable message. Validation errors also carry
errors, keyed by field.
{
"code": "validation_failed",
"message": "The name field is required.",
"errors": { "name": ["The name field is required."] }
}
| Status | code |
Meaning |
|---|---|---|
| 400 | invalid_cursor |
The page cursor is invalid or was sent with other filters |
| 401 | unauthenticated |
Missing, expired or revoked token, or its user was deactivated |
| 403 | missing_scope |
The token lacks the scope; required_scope names it |
| 403 | scope_not_granted |
The user's role no longer allows it |
| 403 | module_unavailable |
The workspace's plan does not include the module the scope works in; required_scope names it |
| 403 | ip_not_allowed |
Called from an address not on the token's allowlist |
| 403 | workspace_mismatch |
The token was sent to another workspace's address |
| 403 | outside_access_schedule |
Outside the user's working hours |
| 404 | not_found |
No such record, or one this user cannot see |
| 405 | method_not_allowed |
Wrong HTTP method for this path |
| 409 | various | A business rule refused the change: invalid_state, record_locked, workflow_blocked, credit_warning, credit_limit_exceeded, sale_limit_exceeded, stock_unavailable or in_use |
| 409 | idempotency_in_progress |
The first request with this key is still running; retry shortly |
| 422 | validation_failed |
Field errors in errors |
| 422 | idempotency_key_reused |
The key was already used for a different request |
| 429 | rate_limited |
Too many requests; wait for Retry-After |
| 503 | tenant_maintenance |
The workspace is in maintenance; retry after Retry-After |
A record the user cannot see is always 404, never 403, so ids cannot be probed.
Rate limits
Each token may make 120 requests a minute, of which 60 may be writes. Past that, calls are
refused with 429 rate_limited and a Retry-After header. Two integrations on one user do
not share a limit when they use separate tokens.
Versioning
This is version 1 (/api/public/v1). Within v1, changes only add things: new endpoints, new
optional request fields, new response fields. Anything that would break an integration waits
for v2, and v1 then stays available for at least 12 months. Changes are listed in the
changelog below.