HisabHelp Center

Getting Started with the API

2 min readLast updated: Jun 3, 20262 views

Getting Started with the API

The Hisab REST API lets you automate invoicing — create customers and invoices, finalize them, export PDFs/XML, and more — straight from your own systems.

Plan requirement: API access is available on the Professional and Fiduciaire plans.

1. Create an API key

  1. Go to Settings → API Keys.
  2. Click Create API key.
  3. Give it a clear name (e.g. "Billing automation").
  4. Select the scopes it needs (least privilege — only what you'll use).
  5. Click create, then copy the key now — for security it's shown only once. Store it somewhere safe like a secrets manager.

2. Authenticate

Send your key as a Bearer token. The base URL is:

https://hisab.ma/api/v1

Example — list your invoices:

curl https://hisab.ma/api/v1/invoices \ -H "Authorization: Bearer hisab_your_api_key_here"

3. Scopes

Keys are scoped so you only grant what you need:

GroupScopes
Invoicesread, write, finalize, send, payment, void, export
Recurring invoicesread, write, delete
Customersread, write, delete
Organizationread, write
Webhooksread, write

4. Create an invoice

curl -X POST https://hisab.ma/api/v1/invoices \ -H "Authorization: Bearer hisab_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "cus_...", "issue_date": "2026-06-03", "items": [ { "description": "Consulting", "quantity": 10, "unit_price": 500, "tax_rate": 20 } ] }'

5. Use the official SDK (Node.js / TypeScript)

npm install hisab-sdk
import { HisabClient } from 'hisab-sdk'; const hisab = new HisabClient({ apiKey: process.env.HISAB_API_KEY }); const invoices = await hisab.invoices.list({ status: 'paid' });

6. Webhooks

To react to events (e.g. an invoice was paid), set up endpoints under Settings → Webhooks. Hisab signs each delivery so you can verify it's genuine.

Notes

  • Requests are rate limited; if you hit the limit you'll get a 429 — back off and retry.
  • Keep keys secret. If one leaks, revoke it from Settings → API Keys and create a new one.

Was this article helpful?