HishabBook API
Connect your website, mobile app, POS or accounting software to your HishabBook business. Read parties, items, bills and reports; create invoices, payments and purchase bills; and get a webhook the moment something happens.
Base URL https://hishabbook.com/api/v1
Format JSON · UTF-8
Amounts rupees, 2 decimals
Dates YYYY-MM-DD, IST
API keys
The business owner makes keys in Settings → API & Webhooks (paid plans). A key works for one business only and has permissions: read is always on; writing parties, items, invoices, payments or purchases must be ticked. Send the key in every request:
Authorization: Bearer hg_xxxxxxxxxxxxxxxxxxxx
Accept: application/json
Keep keys on your server. Never put a key in a web page, mobile app or public code: anyone who has it can read your business data. If a key leaks, revoke it in Settings and make a new one.
Permission Allows
readParties, items, bills, payments, purchases and reports parties.writeCreate and update customers and suppliers items.writeCreate and update items, change stock invoices.writeMake sales invoices and cancel them payments.writePayment In from customers, Payment Out to suppliers purchases.writeEnter supplier bills (stock goes up)
Errors
Success is 200 (or 201 when something is created). Every error has the same shape, so your code can show message to a person and use code in logic. Validation errors list each wrong field.
{
"error": {
"code": "validation_failed",
"message": "Some fields are missing or wrong.",
"fields": {
"items.0.qty": [
"Quantity must be greater than 0."
]
}
}
}
HTTP code Meaning
401 unauthenticatedMissing, wrong, revoked or expired key
403 missing_scopeThe key does not have the permission this call needs
403 plan_requiredThe business's plan does not include the API
404 not_foundNo such record in this business (or no such endpoint)
409 conflictSame Idempotency-Key is still being processed
422 validation_failedSee fields
429 rate_limitedToo many requests; wait Retry-After seconds
500 server_errorOur fault. Retry later (with the same Idempotency-Key)
Rate limits
Each key may make this many requests per minute:
Plan Requests / minute
Free No API Pro 60 Business 300
Every response has X-RateLimit-Limit and X-RateLimit-Remaining. After a 429, wait the seconds in Retry-After.
Safe retries (Idempotency-Key)
If a POST times out you cannot know whether the bill was made. Send a unique Idempotency-Key header (for example your own order id). If you send the same request again with the same key within 24 hours, you get the first response back and nothing is created twice. The replayed response has the header Idempotent-Replayed: true.
Idempotency-Key: order-2026-10-16-0042
Pages & sync
Lists return 25 records per page (up to 100 with per_page) with meta and links.next. To keep your system in step, save the time of your last sync and ask only for what changed: ?updated_since=2026-10-16T10:00:00+05:30. Or use webhooks.
{
"data": [
"…"
],
"meta": {
"page": 1,
"per_page": 25,
"total": 134,
"last_page": 6
},
"links": {
"next": "https://hishabbook.com/api/v1/parties?page=2",
"prev": null
}
}
Account
Check a key and see which business it belongs to.
Who am I
GET /v1/me
The business, the key's permissions and the rate limit. Use it as a "test connection" call.
Example response {
"data": {
"business": {
"id": 1,
"name": "Sharma Kirana Store",
"legal_name": "Sharma Kirana Store",
"gstin": "19AAAAA0000A1Z5",
"state_code": "19",
"state": "West Bengal",
"phone": "9800000000",
"email": null
},
"key": {
"id": 3,
"name": "My website",
"ends_with": "x9Qa",
"scopes": [
"read",
"invoices.write"
],
"expires_at": null,
"created_at": "2026-10-16T10:00:00+05:30"
},
"plan": {
"name": "Pro",
"requests_per_minute": 60
}
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/me" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/me');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/me', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Parties
Customers and suppliers. "balance": positive = they owe you (to collect), negative = you owe them (to pay).
List parties
GET /v1/partiesread
Sorted by name.
Query Type Notes
qstring Search name, phone or GSTIN typecustomer | supplier Filter pageinteger Page number, from 1 per_pageinteger 1 to 100 (default 25) updated_sinceISO date-time Only records changed since then (for syncing)
Example response {
"data": [
{
"id": 12,
"name": "Gupta Traders",
"type": "customer",
"gstin": "19ABCDE1234F1Z5",
"pan": "ABCDE1234F",
"phone": "9800000000",
"email": null,
"address": "12 MG Road",
"city": "Kolkata",
"pincode": "700001",
"state_code": "19",
"state": "West Bengal",
"category": null,
"credit_days": 15,
"credit_limit": 50000,
"opening_balance": 0,
"balance": 2528,
"created_at": "2026-10-01T10:00:00+05:30",
"updated_at": "2026-10-16T11:20:00+05:30"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
},
"links": {
"next": null,
"prev": null
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/parties" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/parties');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/parties', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Get a party
GET /v1/parties/{id}read
Example response {
"data": {
"id": 12,
"name": "Gupta Traders",
"type": "customer",
"gstin": "19ABCDE1234F1Z5",
"pan": "ABCDE1234F",
"phone": "9800000000",
"email": null,
"address": "12 MG Road",
"city": "Kolkata",
"pincode": "700001",
"state_code": "19",
"state": "West Bengal",
"category": null,
"credit_days": 15,
"credit_limit": 50000,
"opening_balance": 0,
"balance": 2528,
"created_at": "2026-10-01T10:00:00+05:30",
"updated_at": "2026-10-16T11:20:00+05:30"
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/parties/1" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/parties/1');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/parties/1', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Create a party
POST /v1/partiesparties.write
For a registered party the state is taken from the GSTIN.
Body Type Notes
namestring, required 2–100 characters typecustomer | supplier Default customer gstinstring 15 characters phonestring emailstring addressstring citystring pincodestring 6 digits state_codestring GST state code, e.g. "27" opening_balancenumber + they owe you, − you owe them credit_daysinteger 0–365 credit_limitnumber categorystring panstring
Example response {
"data": {
"id": 12,
"name": "Gupta Traders",
"type": "customer",
"gstin": "19ABCDE1234F1Z5",
"pan": "ABCDE1234F",
"phone": "9800000000",
"email": null,
"address": "12 MG Road",
"city": "Kolkata",
"pincode": "700001",
"state_code": "19",
"state": "West Bengal",
"category": null,
"credit_days": 15,
"credit_limit": 50000,
"opening_balance": 0,
"balance": 2528,
"created_at": "2026-10-01T10:00:00+05:30",
"updated_at": "2026-10-16T11:20:00+05:30"
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X POST "https://hishabbook.com/api/v1/parties" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name":"Gupta Traders","type":"customer","gstin":"19ABCDE1234F1Z5","phone":"9800000000","credit_days":15}'
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->post('https://hishabbook.com/api/v1/parties', [
'name' => 'Gupta Traders',
'type' => 'customer',
'gstin' => '19ABCDE1234F1Z5',
'phone' => '9800000000',
'credit_days' => 15
]);
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/parties', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Gupta Traders",
"type": "customer",
"gstin": "19ABCDE1234F1Z5",
"phone": "9800000000",
"credit_days": 15
})
});
const { data } = await res.json();
Update a party
PATCH /v1/parties/{id}parties.write
Send only the fields to change.
Example response {
"data": {
"id": 12,
"name": "Gupta Traders",
"type": "customer",
"gstin": "19ABCDE1234F1Z5",
"pan": "ABCDE1234F",
"phone": "9800000000",
"email": null,
"address": "12 MG Road",
"city": "Kolkata",
"pincode": "700001",
"state_code": "19",
"state": "West Bengal",
"category": null,
"credit_days": 15,
"credit_limit": 50000,
"opening_balance": 0,
"balance": 2528,
"created_at": "2026-10-01T10:00:00+05:30",
"updated_at": "2026-10-16T11:20:00+05:30"
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X PATCH "https://hishabbook.com/api/v1/parties/1" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"phone":"9811111111","credit_limit":75000}'
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->patch('https://hishabbook.com/api/v1/parties/1', [
'phone' => '9811111111',
'credit_limit' => 75000
]);
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/parties/1', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"phone": "9811111111",
"credit_limit": 75000
})
});
const { data } = await res.json();
Items
Goods and services. Prices are stored without GST; "sale_price_incl_tax" is given for convenience.
List items
GET /v1/itemsread
Query Type Notes
qstring Search name, code or HSN categorystring typegoods | service low_stockboolean Only items at or below their low-stock level pageinteger Page number, from 1 per_pageinteger 1 to 100 (default 25) updated_sinceISO date-time Only records changed since then (for syncing)
Example response {
"data": [
{
"id": 5,
"name": "Basmati Rice 5kg",
"code": "RICE5",
"type": "goods",
"hsn": "1006",
"unit": "BAG",
"gst_rate": 5,
"sale_price": 450,
"sale_price_incl_tax": 472.5,
"purchase_price": 400,
"track_stock": true,
"stock_qty": 38,
"low_stock_qty": 5,
"track_batch": false,
"category": "Grocery",
"created_at": "2026-10-01T10:00:00+05:30",
"updated_at": "2026-10-16T11:20:00+05:30"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
},
"links": {
"next": null,
"prev": null
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/items" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/items');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/items', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Get an item
GET /v1/items/{id}read
Example response {
"data": {
"id": 5,
"name": "Basmati Rice 5kg",
"code": "RICE5",
"type": "goods",
"hsn": "1006",
"unit": "BAG",
"gst_rate": 5,
"sale_price": 450,
"sale_price_incl_tax": 472.5,
"purchase_price": 400,
"track_stock": true,
"stock_qty": 38,
"low_stock_qty": 5,
"track_batch": false,
"category": "Grocery",
"created_at": "2026-10-01T10:00:00+05:30",
"updated_at": "2026-10-16T11:20:00+05:30"
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/items/1" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/items/1');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/items/1', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Create an item
POST /v1/itemsitems.write
Body Type Notes
namestring, required typegoods | service Default goods unitstring Unit code, e.g. PCS, KGS, BOX, NOS (default PCS) sale_pricenumber, required price_includes_taxboolean true if sale_price includes GST gst_ratenumber, required 0, 0.25, 3, 5, 12, 18, 28 … hsnstring 4, 6 or 8 digits codestring Your SKU / barcode purchase_pricenumber opening_stocknumber low_stock_qtynumber track_stockboolean Default true for goods categorystring
Example response {
"data": {
"id": 5,
"name": "Basmati Rice 5kg",
"code": "RICE5",
"type": "goods",
"hsn": "1006",
"unit": "BAG",
"gst_rate": 5,
"sale_price": 450,
"sale_price_incl_tax": 472.5,
"purchase_price": 400,
"track_stock": true,
"stock_qty": 38,
"low_stock_qty": 5,
"track_batch": false,
"category": "Grocery",
"created_at": "2026-10-01T10:00:00+05:30",
"updated_at": "2026-10-16T11:20:00+05:30"
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X POST "https://hishabbook.com/api/v1/items" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name":"Basmati Rice 5kg","unit":"BAG","sale_price":472.5,"price_includes_tax":true,"gst_rate":5,"hsn":"1006","opening_stock":40}'
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->post('https://hishabbook.com/api/v1/items', [
'name' => 'Basmati Rice 5kg',
'unit' => 'BAG',
'sale_price' => 472.5,
'price_includes_tax' => true,
'gst_rate' => 5,
'hsn' => '1006',
'opening_stock' => 40
]);
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/items', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Basmati Rice 5kg",
"unit": "BAG",
"sale_price": 472.5,
"price_includes_tax": true,
"gst_rate": 5,
"hsn": "1006",
"opening_stock": 40
})
});
const { data } = await res.json();
Update an item
PATCH /v1/items/{id}items.write
Send only the fields to change. Stock is changed with the stock endpoint.
Example response {
"data": {
"id": 5,
"name": "Basmati Rice 5kg",
"code": "RICE5",
"type": "goods",
"hsn": "1006",
"unit": "BAG",
"gst_rate": 5,
"sale_price": 450,
"sale_price_incl_tax": 472.5,
"purchase_price": 400,
"track_stock": true,
"stock_qty": 38,
"low_stock_qty": 5,
"track_batch": false,
"category": "Grocery",
"created_at": "2026-10-01T10:00:00+05:30",
"updated_at": "2026-10-16T11:20:00+05:30"
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X PATCH "https://hishabbook.com/api/v1/items/1" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"sale_price":460}'
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->patch('https://hishabbook.com/api/v1/items/1', [
'sale_price' => 460
]);
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/items/1', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"sale_price": 460
})
});
const { data } = await res.json();
Change stock
POST /v1/items/{id}/stockitems.write
Add (positive) or remove (negative) stock by hand.
Body Type Notes
changenumber, required e.g. 10 or -2 notestring
Example response {
"data": {
"id": 5,
"name": "Basmati Rice 5kg",
"code": "RICE5",
"type": "goods",
"hsn": "1006",
"unit": "BAG",
"gst_rate": 5,
"sale_price": 450,
"sale_price_incl_tax": 472.5,
"purchase_price": 400,
"track_stock": true,
"stock_qty": 38,
"low_stock_qty": 5,
"track_batch": false,
"category": "Grocery",
"created_at": "2026-10-01T10:00:00+05:30",
"updated_at": "2026-10-16T11:20:00+05:30"
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X POST "https://hishabbook.com/api/v1/items/1/stock" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"change":10}'
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->post('https://hishabbook.com/api/v1/items/1/stock', [
'change' => 10
]);
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/items/1/stock', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"change": 10
})
});
const { data } = await res.json();
Sales invoices
Totals and GST (CGST + SGST or IGST) are always worked out by HishabBook from the lines.
List invoices
GET /v1/invoicesread
Newest first. Includes credit notes / sales returns unless you filter by type.
Query Type Notes
fromYYYY-MM-DD Bill date from toYYYY-MM-DD Bill date to party_idinteger typeinvoice | credit_note cancelledboolean qstring Search bill number pageinteger Page number, from 1 per_pageinteger 1 to 100 (default 25) updated_sinceISO date-time Only records changed since then (for syncing)
Example response {
"data": [
{
"id": 101,
"number": "INV-20",
"type": "invoice",
"date": "2026-10-16",
"due_date": "2026-10-31",
"party_id": 12,
"customer": {
"name": "Gupta Traders",
"gstin": "19ABCDE1234F1Z5",
"phone": "9800000000",
"state_code": "19"
},
"place_of_supply": "19",
"taxable": 900,
"cgst": 22.5,
"sgst": 22.5,
"igst": 0,
"discount": 0,
"other_charges": 0,
"round_off": 0,
"total": 945,
"paid": 500,
"returned": 0,
"due": 445,
"status": "partial",
"cancelled": false,
"ref_invoice_id": null,
"e_invoice": {
"status": "none",
"irn": null,
"ack_no": null,
"ack_date": null
},
"eway_bill": null,
"notes": null,
"pdf_url": "https://hishabbook.com/api/v1/invoices/101/pdf"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
},
"links": {
"next": null,
"prev": null
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/invoices" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/invoices');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/invoices', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Get an invoice
GET /v1/invoices/{id}read
With lines.
Example response {
"data": {
"id": 101,
"number": "INV-20",
"type": "invoice",
"date": "2026-10-16",
"due_date": "2026-10-31",
"party_id": 12,
"customer": {
"name": "Gupta Traders",
"gstin": "19ABCDE1234F1Z5",
"phone": "9800000000",
"state_code": "19"
},
"place_of_supply": "19",
"taxable": 900,
"cgst": 22.5,
"sgst": 22.5,
"igst": 0,
"discount": 0,
"other_charges": 0,
"round_off": 0,
"total": 945,
"paid": 500,
"returned": 0,
"due": 445,
"status": "partial",
"cancelled": false,
"ref_invoice_id": null,
"e_invoice": {
"status": "none",
"irn": null,
"ack_no": null,
"ack_date": null
},
"eway_bill": null,
"notes": null,
"pdf_url": "https://hishabbook.com/api/v1/invoices/101/pdf",
"items": [
{
"item_id": 5,
"description": "Basmati Rice 5kg",
"hsn": "1006",
"qty": 2,
"unit": "BAG",
"price": 450,
"discount": 0,
"taxable": 900,
"gst_rate": 5,
"cgst": 22.5,
"sgst": 22.5,
"igst": 0,
"total": 945,
"batch_no": null,
"expiry_date": null
}
]
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/invoices/1" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/invoices/1');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/invoices/1', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Invoice PDF
GET /v1/invoices/{id}/pdfread
The bill in the business's chosen design. Add ?download=1 to download.
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/invoices/1/pdf" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/invoices/1/pdf');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/invoices/1/pdf', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Create an invoice
POST /v1/invoicesinvoices.write
Stock goes down for goods that keep stock. A line can be just item_id + qty: name, HSN, unit, price and GST come from the item. Without party_id it is a cash sale and is marked fully paid.
Body Type Notes
party_idinteger Customer. Leave out for a cash sale customer.namestring Name for a cash sale customer.phonestring numberstring Leave out to use the next number dateYYYY-MM-DD Default today due_dateYYYY-MM-DD items[]array, required Lines items[].item_idinteger items[].descriptionstring Required without item_id items[].qtynumber, required items[].pricenumber Required without item_id items[].price_includes_taxboolean items[].gst_ratenumber Required without item_id items[].hsnstring items[].unitstring items[].discountnumber Rupees off this line items[].batch_nostring items[].expiry_dateYYYY-MM-DD discount.amount | discount.percentnumber Discount on the whole bill charges[]array {label, amount, gst_rate} e.g. delivery payment.amountnumber Received now payment.modeCASH | UPI | BANK | CARD | CHEQUE Default CASH paid_in_fullboolean notesstring termsstring round_offnumber Leave out for automatic rounding
Example response {
"data": {
"id": 101,
"number": "INV-20",
"type": "invoice",
"date": "2026-10-16",
"due_date": "2026-10-31",
"party_id": 12,
"customer": {
"name": "Gupta Traders",
"gstin": "19ABCDE1234F1Z5",
"phone": "9800000000",
"state_code": "19"
},
"place_of_supply": "19",
"taxable": 900,
"cgst": 22.5,
"sgst": 22.5,
"igst": 0,
"discount": 0,
"other_charges": 0,
"round_off": 0,
"total": 945,
"paid": 500,
"returned": 0,
"due": 445,
"status": "partial",
"cancelled": false,
"ref_invoice_id": null,
"e_invoice": {
"status": "none",
"irn": null,
"ack_no": null,
"ack_date": null
},
"eway_bill": null,
"notes": null,
"pdf_url": "https://hishabbook.com/api/v1/invoices/101/pdf",
"items": [
{
"item_id": 5,
"description": "Basmati Rice 5kg",
"hsn": "1006",
"qty": 2,
"unit": "BAG",
"price": 450,
"discount": 0,
"taxable": 900,
"gst_rate": 5,
"cgst": 22.5,
"sgst": 22.5,
"igst": 0,
"total": 945,
"batch_no": null,
"expiry_date": null
}
]
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X POST "https://hishabbook.com/api/v1/invoices" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"party_id":12,"items":[{"item_id":5,"qty":2},{"description":"Packing charge","qty":1,"price":20,"gst_rate":18}],"payment":{"amount":500,"mode":"UPI"}}'
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->post('https://hishabbook.com/api/v1/invoices', [
'party_id' => 12,
'items' => [
[
'item_id' => 5,
'qty' => 2
],
[
'description' => 'Packing charge',
'qty' => 1,
'price' => 20,
'gst_rate' => 18
]
],
'payment' => [
'amount' => 500,
'mode' => 'UPI'
]
]);
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/invoices', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"party_id": 12,
"items": [
{
"item_id": 5,
"qty": 2
},
{
"description": "Packing charge",
"qty": 1,
"price": 20,
"gst_rate": 18
}
],
"payment": {
"amount": 500,
"mode": "UPI"
}
})
});
const { data } = await res.json();
Cancel an invoice
POST /v1/invoices/{id}/cancelinvoices.write
Stock comes back. A bill with an IRN must have its IRN cancelled first (in the app).
Example response {
"data": {
"id": 101,
"number": "INV-20",
"type": "invoice",
"date": "2026-10-16",
"due_date": "2026-10-31",
"party_id": 12,
"customer": {
"name": "Gupta Traders",
"gstin": "19ABCDE1234F1Z5",
"phone": "9800000000",
"state_code": "19"
},
"place_of_supply": "19",
"taxable": 900,
"cgst": 22.5,
"sgst": 22.5,
"igst": 0,
"discount": 0,
"other_charges": 0,
"round_off": 0,
"total": 945,
"paid": 500,
"returned": 0,
"due": 445,
"status": "cancelled",
"cancelled": true,
"ref_invoice_id": null,
"e_invoice": {
"status": "none",
"irn": null,
"ack_no": null,
"ack_date": null
},
"eway_bill": null,
"notes": null,
"pdf_url": "https://hishabbook.com/api/v1/invoices/101/pdf",
"items": [
{
"item_id": 5,
"description": "Basmati Rice 5kg",
"hsn": "1006",
"qty": 2,
"unit": "BAG",
"price": 450,
"discount": 0,
"taxable": 900,
"gst_rate": 5,
"cgst": 22.5,
"sgst": 22.5,
"igst": 0,
"total": 945,
"batch_no": null,
"expiry_date": null
}
]
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X POST "https://hishabbook.com/api/v1/invoices/1/cancel" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->post('https://hishabbook.com/api/v1/invoices/1/cancel');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/invoices/1/cancel', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Payments
Payment In (from customers) and Payment Out (to suppliers).
List payments
GET /v1/paymentsread
Query Type Notes
directionin | out party_idinteger invoice_idinteger fromYYYY-MM-DD toYYYY-MM-DD pageinteger Page number, from 1 per_pageinteger 1 to 100 (default 25) updated_sinceISO date-time Only records changed since then (for syncing)
Example response {
"data": [
{
"id": 77,
"direction": "in",
"party_id": 12,
"invoice_id": 101,
"purchase_id": null,
"amount": 500,
"mode": "UPI",
"date": "2026-10-16",
"reference": "UTR 4521",
"note": null,
"bank_account_id": null,
"created_at": "2026-10-16T11:25:00+05:30"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
},
"links": {
"next": null,
"prev": null
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/payments" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/payments');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/payments', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Get a payment
GET /v1/payments/{id}read
Example response {
"data": {
"id": 77,
"direction": "in",
"party_id": 12,
"invoice_id": 101,
"purchase_id": null,
"amount": 500,
"mode": "UPI",
"date": "2026-10-16",
"reference": "UTR 4521",
"note": null,
"bank_account_id": null,
"created_at": "2026-10-16T11:25:00+05:30"
}
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/payments/1" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/payments/1');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/payments/1', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Record a payment
POST /v1/paymentspayments.write
Settles the given bill first, then the party's oldest unpaid bills; what is left stays as an advance. Returns one row per bill settled.
Body Type Notes
directionin | out, required party_idinteger, required amountnumber, required modeCASH | UPI | BANK | CARD | CHEQUE Default CASH dateYYYY-MM-DD Default today invoice_idinteger Bill to settle first (direction in) purchase_idinteger Bill to settle first (direction out) referencestring UTR / cheque no. notestring bank_account_idinteger
Example response {
"data": [
{
"id": 77,
"direction": "in",
"party_id": 12,
"invoice_id": 101,
"purchase_id": null,
"amount": 500,
"mode": "UPI",
"date": "2026-10-16",
"reference": "UTR 4521",
"note": null,
"bank_account_id": null,
"created_at": "2026-10-16T11:25:00+05:30"
}
]
}
cURL
PHP (Laravel)
JavaScript
Try it
curl -X POST "https://hishabbook.com/api/v1/payments" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"direction":"in","party_id":12,"amount":500,"mode":"UPI","invoice_id":101,"reference":"UTR 4521"}'
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->post('https://hishabbook.com/api/v1/payments', [
'direction' => 'in',
'party_id' => 12,
'amount' => 500,
'mode' => 'UPI',
'invoice_id' => 101,
'reference' => 'UTR 4521'
]);
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/payments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"direction": "in",
"party_id": 12,
"amount": 500,
"mode": "UPI",
"invoice_id": 101,
"reference": "UTR 4521"
})
});
const { data } = await res.json();
Purchases
Supplier bills (stock goes up), purchase returns and debit notes.
List purchases
GET /v1/purchasesread
Query Type Notes
fromYYYY-MM-DD toYYYY-MM-DD party_idinteger typebill | purchase_return | debit_note pageinteger Page number, from 1 per_pageinteger 1 to 100 (default 25) updated_sinceISO date-time Only records changed since then (for syncing)
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/purchases" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/purchases');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/purchases', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Get a purchase
GET /v1/purchases/{id}read
With lines.
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/purchases/1" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/purchases/1');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/purchases/1', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Create a purchase bill
POST /v1/purchasespurchases.write
Lines work like invoice lines; with only item_id the item's purchase price is used.
Body Type Notes
party_idinteger, required Supplier numberstring, required Supplier's bill number dateYYYY-MM-DD Default today due_dateYYYY-MM-DD items[]array, required Same as invoices payment.amountnumber Paid now payment.modestring paid_in_fullboolean update_item_pricesboolean Save these prices as the items' purchase price notesstring
cURL
PHP (Laravel)
JavaScript
Try it
curl -X POST "https://hishabbook.com/api/v1/purchases" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"party_id":14,"number":"SUP/889","items":[{"item_id":5,"qty":20,"price":400}]}'
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->post('https://hishabbook.com/api/v1/purchases', [
'party_id' => 14,
'number' => 'SUP/889',
'items' => [
[
'item_id' => 5,
'qty' => 20,
'price' => 400
]
]
]);
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/purchases', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"party_id": 14,
"number": "SUP/889",
"items": [
{
"item_id": 5,
"qty": 20,
"price": 400
}
]
})
});
const { data } = await res.json();
Reports
Read-only summaries.
Business summary
GET /v1/reports/summaryread
Sales, returns, purchases, expenses, money in/out for a period, and today's to-collect / to-pay.
Query Type Notes
fromYYYY-MM-DD Default 1st of this month toYYYY-MM-DD Default today
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/reports/summary" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/reports/summary');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/reports/summary', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Outstanding by party
GET /v1/reports/outstandingread
Parties with a balance, biggest first.
Query Type Notes
sidecollect | pay
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/reports/outstanding" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/reports/outstanding');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/reports/outstanding', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Stock
GET /v1/reports/stockread
Items that keep stock, with value at purchase price.
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/reports/stock" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/reports/stock');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/reports/stock', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
GSTR-1 JSON
GET /v1/reports/gstr1read
Same JSON as the GSTR-1 download in the app. Check with your CA before filing.
Query Type Notes
monthYYYY-MM, required
cURL
PHP (Laravel)
JavaScript
Try it
curl -X GET "https://hishabbook.com/api/v1/reports/gstr1" \
-H "Authorization: Bearer $HG_KEY" \
-H "Accept: application/json"
$res = Http::withToken(env('HG_KEY'))->acceptJson()
->get('https://hishabbook.com/api/v1/reports/gstr1');
$data = $res->json('data');
const res = await fetch('https://hishabbook.com/api/v1/reports/gstr1', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.HG_KEY}`,
Accept: 'application/json'
}
});
const { data } = await res.json();
Webhooks
Add your URL in Settings → API & Webhooks and tick the events you want. When one happens, we POST JSON to your URL within seconds. Answer with any 2xx status within 8 seconds; do slow work after answering.
Event When
invoice.createdSales invoice created invoice.updatedSales invoice edited invoice.cancelledSales invoice cancelled credit_note.createdSales return / credit note created payment.createdPayment In / Out recorded party.createdParty added item.createdItem added purchase.createdPurchase bill / return / debit note created ping"Send test" button in Settings
Headers: X-HishabBook-Event, X-HishabBook-Delivery (unique id; use it to ignore repeats), X-HishabBook-Signature. Body (data is the same shape as the API):
{
"id": "9b2f0c1e-6a1d-4c55-9f3e-1d2a3b4c5d6e",
"event": "payment.created",
"created_at": "2026-10-16T11:25:03+05:30",
"business": {
"id": 1,
"name": "Sharma Kirana Store",
"gstin": "19AAAAA0000A1Z5"
},
"data": {
"id": 77,
"direction": "in",
"party_id": 12,
"invoice_id": 101,
"amount": 500,
"mode": "UPI",
"date": "2026-10-16"
}
}
Retries: if your server does not answer 2xx, we try again after 1, 5, 30, 120 and 360 minutes. After 20 failures in a row the webhook is switched off (turn it on again in Settings). Deliveries can arrive more than once or out of order.
Verify the signature
Check every webhook really came from HishabBook. The header looks like t=1760595903,v1=5f1c…. Compute HMAC-SHA256 of t + "." + raw body with your signing secret (whsec_…) and compare. Also reject times older than 5 minutes.
// PHP
$sig = $_SERVER['HTTP_X_HISHABBOOK_SIGNATURE'] ?? '';
$raw = file_get_contents('php://input');
parse_str(str_replace(',', '&', $sig), $p); // t=…, v1=…
$expected = hash_hmac('sha256', $p['t'] . '.' . $raw, $secret);
if (!hash_equals($expected, $p['v1'] ?? '') || abs(time() - (int) $p['t']) > 300) {
http_response_code(400); exit;
}
$event = json_decode($raw, true);
http_response_code(200);
// Node.js (Express)
import crypto from 'node:crypto';
app.post('/hisaabghar-webhook', express.raw({ type: 'application/json' }), (req, res) => {
const p = Object.fromEntries(req.get('X-HishabBook-Signature').split(',').map(s => s.split('=')));
const expected = crypto.createHmac('sha256', process.env.HG_WEBHOOK_SECRET)
.update(`${p.t}.${req.body}`).digest('hex');
const ok = p.v1?.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(p.v1));
if (!ok || Math.abs(Date.now() / 1000 - Number(p.t)) > 300) return res.sendStatus(400);
const event = JSON.parse(req.body);
res.sendStatus(200);
});