API Reference

The Book Pilot REST API lets your ERP, store or app create invoices, record payments and read your books and GST data. It does everything the web app does, with the same GST rules and accounting.

  • Base URL: https://www.bookpilot.cloud/api/v1
  • Send and receive JSON. Set Accept: application/json and Content-Type: application/json.
  • Dates are YYYY-MM-DD. Money is a decimal number in the document's currency.
  • Lists are paginated: ?page=2&per_page=50 (max 100). The response holds data, current_page, last_page and total.

Authentication

Create a token in Settings & API > API tokens. Each token belongs to one company, so you never pass a company id. Choose read only or read & write. The token acts as you, limited to your role in that company.

curl https://www.bookpilot.cloud/api/v1/company \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

To work with several companies, create one token per company.

Errors & limits

StatusMeaning
401Missing or invalid token.
403Token is read-only, your role does not allow the action, or you lost access to the company.
404Not found in this company. Records from other companies are never visible.
422Validation failed. errors lists messages per field, e.g. items.0.rate.
429Rate limit: 120 requests per minute per token.
{
  "message": "Amount exceeds the balance due of 5,900.00 INR.",
  "errors": { "amount": ["Amount exceeds the balance due of 5,900.00 INR."] }
}

How GST is calculated

You send quantities, rates and GST rates. The server works out everything else and returns it on the invoice:

  • Place of supply defaults to the party's state (from their GSTIN, place of supply or billing state). Same state as your company means CGST + SGST; a different state means IGST.
  • tax_mode: gst, non_gst (bill of supply), export_lut (zero rated, no IGST) or export_igst. For overseas parties it defaults to export_lut when you have an LUT in settings, otherwise export_igst.
  • reverse_charge: tax is calculated and reported but not added to the amount the party pays.
  • Line taxable value = quantity × rate − discount%. Tax is rounded per line to 2 decimals. INR totals are rounded to the rupee when round-off is on in your settings.
  • Foreign currency: send currency and exchange_rate (1 unit = ? of your base currency). Books are kept in base currency. Payments at a different rate post realised exchange gain or loss.

Cross-company invoices

When you invoice a party whose GSTIN belongs to another company on Book Pilot, a copy appears in their account as a purchase bill with sync_status: "received". Credit notes become debit notes. They accept it (which posts it to their books) or reject it. Your later edits and cancellation update their copy. Use GET /invoices?type=purchase_bill&sync_status=received to fetch bills waiting for you.

Company

GET /company The company the token belongs to, and your role in it.

Parties (customers & vendors)

GET /parties List. Filters: type (customer|vendor), gstin, q, per_page.
POST /parties Create a party.
GET /parties/{id} Get one party.
PUT /parties/{id} Update (send only the fields that change).
DELETE /parties/{id} Delete a party without documents.

Party fields

FieldNotes
name *Legal name.
typecustomer, vendor or both.
gst15 character GSTIN. Sets gst_treatment to registered unless you send one.
gst_treatmentregistered, composition, unregistered, consumer, overseas, sez.
currencyDefault currency for this party's invoices.
place_of_supplyState name or 2 digit state code.
opening_balance, opening_typeBalance brought forward; dr (they owe you) or cr.
billing_* / shipping_*attention, address_line1, address_line2, city, state, pincode, country, phone.

Items

GET /items List. Filters: q (name, SKU or HSN).
POST /items Create an item.
GET /items/{id} Get one item.
PUT /items/{id} Update.
DELETE /items/{id} Delete.

Item fields

name *, unit *, price *Unit is one of the codes in reference values.
hsnHSN or SAC code, 4 to 8 digits.
gst_rateOne of 0, 0.1, 0.25, 1, 1.5, 3, 5, 6, 12, 18, 28, 40.
type, sku, purchase_price, cess_rate, tax_preference, descriptionOptional. tax_preference: non_taxable forces 0% GST.

Invoices, bills & notes

GET /invoices List. Filters: type, status, customer_id, sync_status, from, to, number.
POST /invoices Create and issue (or "draft": true). GST is calculated for you.
GET /invoices/{id} Get one, with items and payments.
PUT /invoices/{id} Update. Fields you omit keep their current value.
POST /invoices/{id}/issue Issue a draft: number it and post it to the ledger.
POST /invoices/{id}/cancel Cancel and reverse the ledger entry.
DELETE /invoices/{id} Delete a draft.
GET /invoices/{id}/pdf Download the PDF.
POST /invoices/{id}/payment-link Create a Razorpay payment link for the balance due.
POST /invoices/{id}/accept Accept a bill received from another company.
POST /invoices/{id}/reject Reject a received bill.

Invoice fields

FieldNotes
typesales_invoice (default), purchase_bill, credit_note, debit_note; non-accounting documents quotation, proforma, sales_order, delivery_challan, purchase_order, receipt_note.
source_order_idConvert from a quotation / order / challan. Goods already sent on a challan (or received on a GRN) do not move stock again.
godown_idLocation the goods leave from / arrive at (default location if omitted).
Transport (e-way bill Part B)transporter_id (from your transporter list) or transporter_name + transporter_gstin (GSTIN / TRANSIN), transport_mode (1 road, 2 rail, 3 air, 4 ship), vehicle_number, vehicle_type (R / O), transport_doc_no (LR / RR / AWB / BL) and transport_doc_date, distance_km, dispatch_from, freight_terms (paid / to_pay), ewaybill_number.
customer_id *The party.
numberLeave empty to auto-number (INV/26-27/0001). Required for purchase bills: the vendor's bill number.
date, due_dateDate defaults to today.
against_invoice_idFor credit / debit notes: the original document. Cannot exceed its open balance.
tax_mode, place_of_supply, reverse_chargeSee GST.
currency, exchange_rateRate is required when currency differs from your base currency.
port_code, shipping_bill_no, shipping_bill_dateExports (reported in GSTR-1).
notes, terms, reference, templateTemplate: classic, modern, minimal.
drafttrue to save without issuing.
items * (array)Each: item_id or name, quantity, rate, gst_rate, hsn, unit, discount_percent, cess_rate, description. With item_id, missing values come from the item.

Responses add balance_due, type_label and share_url (a signed link your customer can open to view, download and pay).

Status flows draft → issued → partially_paid / paid, or cancelled.

Payments

GET /payments List. Filters: direction (in|out), customer_id, invoice_id.
POST /payments Record a payment received or made.
GET /payments/{id} Get one.
DELETE /payments/{id} Delete and reverse.

Payment fields

invoice_idSettle an invoice or bill. Party, direction and currency are taken from it.
directionin (received) or out (made). Required without invoice_id.
customer_idRequired without invoice_id (on-account payment).
amount *, date *Amount in the document currency.
exchange_rateRate on the day of payment, for foreign currency.
ledger_idCash or bank ledger. Defaults to the primary bank (or cash when mode is cash).
modecash, bank, upi, cheque, card, gateway.
tds_amount, bank_charges, reference, notesTDS counts towards settling the invoice. Bank charges are in base currency.

Accounting

GET /ledgers Chart of accounts with current balances.
GET /ledgers/{id}/statement Ledger statement. Query: from, to.
GET /vouchers List vouchers. Filters: type, from, to.
POST /vouchers Post a journal, contra, receipt or payment voucher.
GET /expenses List expenses.
POST /expenses Record an expense.

Reports & GST

GET /reports/trial-balance Query: as_of.
GET /reports/profit-loss Query: from, to.
GET /reports/balance-sheet Query: as_of.
GET /reports/receivables Open invoices with aging buckets.
GET /reports/payables Open bills with aging buckets.
GET /gst/gstr1 GSTR-1 JSON for period=MMYYYY.
GET /gst/gstr3b GSTR-3B JSON, liability and ITC set-off for period=MMYYYY.
GET /stock Stock summary: quantity, average cost and value per item. Query: as_of, godown_id, low=1.

Example: create an invoice

curl -X POST https://www.bookpilot.cloud/api/v1/invoices \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" -H "Accept: application/json" \
  -d '{
    "customer_id": 12,
    "date": "2026-10-18",
    "due_date": "2026-11-17",
    "items": [
      { "item_id": 4, "quantity": 2 },
      { "name": "Installation", "hsn": "998719", "unit": "hrs", "quantity": 3, "rate": 750, "gst_rate": 18 }
    ]
  }'

Response (abridged):

{
  "data": {
    "id": 381, "type": "sales_invoice", "number": "INV/26-27/0042", "status": "issued",
    "supply_type": "inter", "place_of_supply": "29",
    "taxable_total": "7250.00", "cgst_total": "0.00", "sgst_total": "0.00", "igst_total": "1305.00",
    "round_off": "0.00", "total": "8555.00", "balance_due": 8555,
    "items": [ ... ],
    "share_url": "https://www.bookpilot.cloud/i/381?signature=..."
  }
}

Example: export invoice in USD under LUT

{
  "customer_id": 31,
  "currency": "USD",
  "exchange_rate": 83.25,
  "tax_mode": "export_lut",
  "port_code": "INBOM4",
  "items": [ { "name": "Software development", "hsn": "998314", "unit": "hrs", "quantity": 120, "rate": 40, "gst_rate": 18 } ]
}

Example: record a payment

curl -X POST https://www.bookpilot.cloud/api/v1/payments \
  -H "Authorization: Bearer YOUR_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
  -d '{ "invoice_id": 381, "date": "2026-10-25", "amount": 8355, "tds_amount": 200, "mode": "upi", "reference": "UTR123456" }'

Example: post a journal voucher

{
  "type": "journal",
  "date": "2027-03-31",
  "narration": "Depreciation for FY 2026-27",
  "entries": [
    { "ledger_id": 55, "debit": 12000 },
    { "ledger_id": 41, "credit": 12000 }
  ]
}

Debits must equal credits. Get ledger ids from GET /ledgers.

Reference values

State codes (place_of_supply)

01 Jammu & Kashmir
02 Himachal Pradesh
03 Punjab
04 Chandigarh
05 Uttarakhand
06 Haryana
07 Delhi
08 Rajasthan
09 Uttar Pradesh
10 Bihar
11 Sikkim
12 Arunachal Pradesh
13 Nagaland
14 Manipur
15 Mizoram
16 Tripura
17 Meghalaya
18 Assam
19 West Bengal
20 Jharkhand
21 Odisha
22 Chhattisgarh
23 Madhya Pradesh
24 Gujarat
26 Dadra & Nagar Haveli and Daman & Diu
27 Maharashtra
29 Karnataka
30 Goa
31 Lakshadweep
32 Kerala
33 Tamil Nadu
34 Puducherry
35 Andaman & Nicobar Islands
36 Telangana
37 Andhra Pradesh
38 Ladakh
97 Other Territory
96 Other Country

Units

box Box, cm Centimeter, dz Dozen, ft Feet, gm Grams, kg Kilogram, lb Pounds, ltr Litre, mg Milli Grams, ml Milli Litre, m Meter, nos Numbers, pcs Pieces, set Set, sqft Square Feet, ton Tonnes, hrs Hours, unit Unit

Currencies

INR, USD, EUR, GBP, AED, AUD, CAD, SGD, JPY, CNY, SAR, OMR, BHD, CHF, NOK, SEK, DKK, PLN, CZK, HUF, RON, KWD, QAR, JOD, TND

Questions? Contact [email protected].