On this page
What can you connect through the API?
Anything that speaks HTTP and JSON: your online store, a mobile app for your company, a booking website, a dashboard or a partner’s system. People search for it as “ERP integration for e-commerce” or “accounting software API”. It runs on the data of sales and invoicing software, customer accounts software, appointment booking software and the books of general ledger software, so you never need a second copy of your data.
You should know it is an interface for a developer who writes the connection, not a set of ready connectors. There is no prebuilt plugin for store platforms and no Zapier link, so your team or an integrator you hire writes the code that calls the API and receives the webhooks. If you have no development capacity, book a meeting and we will tell you honestly whether an integration is worth it.
| Resource | Read | Write |
|---|---|---|
| Contacts | List and detail | Create, update, delete one with no history |
| Products and stock | Products, services, stock per warehouse, price lists | Read only |
| Quotations | List and detail with lines | Create a draft, send, PDF link |
| Invoices | List, detail, customer page link | Draft, edit, delete, issue, cancel |
| Receipts and notes | List and detail | Receipt, allocate, cancel; credit or debit note and posting |
| Purchases | Purchase orders, bills, supplier payments | Draft purchase order and bill |
| Bookings | Availability, bookings, services, resources | Create and cancel a booking |
| Employees and attendance | Employees and punches | Record a punch like a time clock |
| Accounting | Journal entries and trial balance | Read only |
| Webhooks | Events, subscriptions, delivery log | Create, edit, replay |
How do access tokens work and how are they protected?
A company admin creates a token in the API settings with a name and the scopes they choose, plus an optional IP allow-list and expiry. The full token appears once and starts with anz_; Anzma stores only its hash, so it cannot be recovered and a lost token is replaced by a new one. It is Anzma’s own token scheme, not Sanctum or another package.
A token’s scopes are the permissions of the user who created it, no more, and only for modules enabled in your company. Someone who cannot issue invoices cannot hand that scope to a token. A revoked, expired or out-of-range token is rejected with a clear error instead of being ignored, and each token records its last use and daily request count.
- One token per integration, so you can revoke the store without stopping the app.
- Choose the narrowest scopes that work: a store that reads stock and writes invoices does not need accounting.
- Restrict the token to your server’s address when it is fixed.
- The default is 120 requests per minute per token; a token can lower it but not raise it above your plan.
What do a request and a response look like?
Every request carries an Authorization: Bearer header and returns JSON. Money is a decimal string rather than a floating-point number so no fraction is lost, dates are ISO 8601, and error messages come in Arabic or English per the Accept-Language header. Errors share one format with a text code such as plan_required, insufficient_scope or invalid_filter.
Lists use cursor pagination rather than page numbers: pass page[size] from 1 to 100 and page[after] from the previous response. Filters and sorting accept a whitelist per resource, and a filter outside it returns a 422 instead of being silently ignored. When you create an invoice you send its lines and the server computes prices, taxes and totals, so you never trust the client’s arithmetic.
Each response returns X-Request-Id and X-Api-Version headers; quote the first when you write to us about a specific request and we trace it in the log. A path for a module that is off in your company, or one your token’s scopes do not cover, returns a 403 naming the missing scope, so you know what to add instead of guessing.
- 1
Create the token
In the API settings, and keep it on your server only.
- 2
Create a draft invoice
POST to invoices with an Idempotency-Key; the server computes the totals.
- 3
Issue the invoice
POST to invoices/{id}/issue; it posts to the ledger and locks.
- 4
Get the customer link
GET pdf-link for the invoice page and PDF link.
- 5
Receive the payment
Subscribe to invoice.paid or payment.online_succeeded and get a message when it is settled.
What happens if the connection drops mid-request?
Send an Idempotency-Key with a unique value of your own on each POST. Anzma stores the first successful response for that key for 24 hours, and a repeat with the same key returns the same response plus an Idempotent-Replayed header, without creating a second invoice. If a duplicate arrives while the first is still running, you get a 409 with a Retry-After header. Attendance punches ignore duplicates on their own.
What are the webhook events and how do I verify their signature?
A webhook is a POST that Anzma sends to an address you set when an event happens, so your system does not have to ask every minute. You create a subscription with a name, a URL and events, and receive the signing secret once; later you can rotate it or send a test event. The URL must be http or https and resolve to public addresses, so Anzma refuses one that points at an internal network. A message is created only after the operation has committed, so you never get an invoice that is then rolled back.
Each request carries the headers X-Anzma-Event, X-Anzma-Event-Id, X-Anzma-Delivery, X-Anzma-Timestamp and X-Anzma-Signature. The signature is sha256= followed by an HMAC-SHA256 over the string “timestamp, a dot, then the raw request body” using the subscription secret. Compute it yourself, compare in constant time, and reject the message if the timestamp is more than five minutes off so a captured old message cannot be replayed. Store the event ID to skip any you have already handled.
| Event | When it fires | Module |
|---|---|---|
| invoice.issued / invoice.paid / invoice.cancelled | An invoice is issued, fully paid or cancelled | Sales |
| credit_note.posted | A credit or debit note is posted | Sales |
| receipt.created | A receipt is created | Sales |
| quotation.accepted | A customer accepts a quotation | Sales |
| purchase_bill.issued | A purchase bill is issued | Purchases |
| booking.created / cancelled / completed | A booking is created, cancelled or completed | Bookings |
| stock.low | An item reaches its reorder level | Warehouses |
| payment.online_succeeded | An online payment succeeds | Payment gateways |
| employee.created / contact.created | An employee or contact is added | Employees and contacts |
| membership.renewed | A membership is renewed | Memberships |
What happens if my system is unreachable?
A delivery counts as successful when your server answers with a 2xx code. Otherwise Anzma retries after one minute, five minutes, half an hour, two hours and six hours, for six attempts in all. If failures keep coming on a subscription past a count the company admin sets, ten by default, Anzma disables it and sends a notification, and pending deliveries are marked failed. You fix the address and re-enable the subscription.
Each subscription has a delivery log with the response code, time, an excerpt of the reply and the error cause, and you can replay any delivery with the same event ID. Old log rows are deleted after thirty days.
How does an online store connect to Anzma in practice?
An illustrative example for a store that sells through its own site and keeps its books in Anzma. The store’s developer creates a token with only the scopes to read stock and create invoices and receipts. For every paid order the site creates a draft invoice with the order number as the idempotency key, issues it, then records the receipt and allocates it, so the accountant sees the order in the books without anyone typing it.
In the other direction the site reads per-warehouse stock from the stock-levels endpoint to show what is available, and subscribes to stock.low to hide an item when it reaches its reorder level. It subscribes to invoice.paid to change an order’s status in the store when the customer pays from the invoice link. The sales record stays single, in Anzma, and the store remains a front end for browsing and ordering rather than a second source of truth.
None of this replaces testing on a separate company before go-live. Your team checks signature verification, failure cases and retries, then moves to the live company with a fresh token.
Where is the documentation, and is the API on every plan?
The OpenAPI 3.1 specification lives at /api/v1/openapi.json on your company’s own domain, open without a token, and imports into any tool that supports the standard maintained by the OpenAPI Initiative. Inside the app a developer docs page in Arabic and English covers authentication, curl examples, the changelog and how to verify the signature.
The API and webhooks are a feature of the Comprehensive and Enterprise plans. On Basic and Advanced they are added as a paid add-on, with the price on the pricing page. If your plan does not include the API, a request returns a 402 plan_required error. What is not built yet: no OAuth, no sandbox tokens in a separate test environment, and no ETag for conditional updates. For testing, use a separate test company.
Who benefits from the API?
Anyone who sells or books outside the Anzma screens. ecommerce management software pulls store orders in as invoices and reads stock, wholesale management software can connect a trade-order portal, and IT services management software builds integrations for its own clients. No industry template turns the API on by itself because it is a plan feature, so you request it when you need it.
For a broader view of choosing business software read the ERP selection guide, and for a walkthrough of your own integration scenario book an online meeting.
Frequently asked questions
Is there an API in Anzma?
Yes, a JSON REST API on version one with 68 operations covering contacts, products and stock, quotations, invoices, receipts, purchases, bookings, employees, accounting and webhooks, documented in OpenAPI 3.1.
What can I connect?
Any system that can call HTTP: an online store, an app, a booking site or a dashboard. You create invoices, quotations, receipts and bookings and read stock and journal entries. There are no ready connectors for store platforms, so the integration is written.
How are access tokens protected?
A token is shown once and only its hash is stored, its scopes never exceed its creator’s permissions, it can be limited by IP address and expiry, you can revoke it at any time, and each token has a per-minute request limit.
How do I verify a webhook signature?
Compute HMAC-SHA256 over the timestamp, a dot, then the raw request body, using the subscription secret, and compare it in constant time with the value after sha256= in the X-Anzma-Signature header. Reject the message if the timestamp is more than five minutes off.
Where is the documentation?
The public OpenAPI 3.1 specification at /api/v1/openapi.json on your company’s domain opens without a token and imports into developer tools. There is also a developer docs page inside the app in Arabic and English with curl examples and a changelog.
Is the API available on every plan?
The API and webhooks are a feature of the Comprehensive and Enterprise plans. On Basic and Advanced they come as a paid add-on you enable for your company, and without one a request returns a 402 plan_required error. See the pricing page for details.
What if I resend a create-invoice request?
Send a unique Idempotency-Key on every POST, such as your store’s order number. Repeating the request with the same key within 24 hours returns the first response with an Idempotent-Replayed header, and no duplicate invoice is created.
What happens when a delivery fails?
Anzma retries after one minute, five minutes, half an hour, two hours and six hours, then marks the delivery failed. Repeated failures disable the subscription after a limit the admin sets and send a notification; you replay from the delivery log by the same event ID.
Does it support OAuth or a sandbox?
No. Authentication today is Anzma’s own bearer token, created in the company settings. There is no OAuth, no sandbox tokens in a separate test environment and no ETag for conditional updates. We suggest a separate test company for development before connecting the live one.
Is there a free integration?
The API is a paid feature: included in the Comprehensive and Enterprise plans or added to Basic and Advanced. The integration itself needs a developer to write code, and exporting reports to Excel is a no-code alternative for simple cases. Book a free online meeting and we will find the right fit.
Rate this page
Did you find this useful? Your rating helps others.
No ratings yet.


