₹hisaab
માર્ગદર્શિકા જુઓ માર્ગદર્શિકાનું મુખ્ય પાનું

API referencePro

Endpoints, authentication, errors and webhook signatures for the Hisaab REST API (v1).

Base URL: https://hisaab.ipsit.tech/api/v1. Send and receive JSON. Every request needs your key:

Authorization: Bearer hk_live_...

Up to 120 requests a minute per account. Amounts are numbers in the document's currency; dates are YYYY-MM-DD.

Endpoints

Method Path What it does
GET /me Your user and the key's business
GET /clients?search=&page= List clients (25 per page, per_page up to 100)
POST /clients Add a client
GET /clients/{id} One client
PATCH /clients/{id} Change a client (send only what changes)
GET /invoices?status=&client_id=&from=&to= List invoices. status: unpaid, paid, overdue, cancelled
POST /invoices Create an invoice
GET /invoices/{id} One invoice with its lines
GET /invoices/{id}/payments Payments on an invoice
POST /invoices/{id}/payments Record a payment
GET /payments?from=&to= All payments received

Create a client

POST /clients
{ "name": "Acme Pvt Ltd", "gstin": "27AAPFU0939F1ZV", "email": "ap@acme.in" }

Indian clients need a state_code (two digits, e.g. 27 for Maharashtra) or a GSTIN, which gives the state. For a client abroad send "country_code": "US" and optionally "currency": "USD".

Create an invoice

POST /invoices
{
  "client_id": 42,
  "items": [
    { "description": "Website design", "hsn": "998314", "qty": 1, "rate": 40000, "gst": 18 }
  ]
}

Optional: number (default: your next number), issue_date (today), due_date (15 days later), notes. GST is worked out the same way as in the app. The reply is the invoice, including url, the link to send your client.

Record a payment

POST /invoices/123/payments
{ "amount": 47200, "method": "upi", "paid_on": "2026-11-20", "reference": "UTR 1234" }

method: upi, bank, cash, cheque, card, other. tds (optional) records TDS the client deducted.

Errors

Status Meaning
401 Missing or wrong key
402 The account is not on Pro
403 API switched off for this business
404 Not found (or belongs to another business)
422 Validation failed: {"message": "...", "errors": {"field": ["..."]}}
429 Too many requests: wait a minute

Webhook messages

{ "id": "evt_...", "event": "invoice.paid", "created_at": "2026-11-20T10:15:00+05:30",
  "business_id": 7, "data": { "id": 123, "object": "invoice", "number": "INV-0012", ... } }

Check every message is really from hisaab. The header looks like X-Hisaab-Signature: t=1763600000,v1=5f2c.... Work out HMAC-SHA256(secret, t + "." + raw body) in hex and compare it with v1; also reject messages where t is more than 5 minutes old.

[$t, $v1] = array_map(fn ($p) => explode('=', $p, 2)[1], explode(',', $_SERVER['HTTP_X_HISAAB_SIGNATURE']));
$ok = hash_equals(hash_hmac('sha256', $t.'.'.file_get_contents('php://input'), $secret), $v1) && abs(time() - (int) $t) < 300;

Answer with any 2xx status within 10 seconds. The same event can arrive twice; use id to ignore repeats.

હજી મદદ જોઈએ છે? મદદ કેન્દ્ર · support@example.com