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/jsonandContent-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 holdsdata,current_page,last_pageandtotal.
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
| Status | Meaning |
|---|---|
| 401 | Missing or invalid token. |
| 403 | Token is read-only, your role does not allow the action, or you lost access to the company. |
| 404 | Not found in this company. Records from other companies are never visible. |
| 422 | Validation failed. errors lists messages per field, e.g. items.0.rate. |
| 429 | Rate 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) orexport_igst. For overseas parties it defaults toexport_lutwhen you have an LUT in settings, otherwiseexport_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
currencyandexchange_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
Parties (customers & vendors)
Party fields
| Field | Notes |
|---|---|
| name * | Legal name. |
| type | customer, vendor or both. |
| gst | 15 character GSTIN. Sets gst_treatment to registered unless you send one. |
| gst_treatment | registered, composition, unregistered, consumer, overseas, sez. |
| currency | Default currency for this party's invoices. |
| place_of_supply | State name or 2 digit state code. |
| opening_balance, opening_type | Balance brought forward; dr (they owe you) or cr. |
| billing_* / shipping_* | attention, address_line1, address_line2, city, state, pincode, country, phone. |
Items
Item fields
| name *, unit *, price * | Unit is one of the codes in reference values. |
| hsn | HSN or SAC code, 4 to 8 digits. |
| gst_rate | One of 0, 0.1, 0.25, 1, 1.5, 3, 5, 6, 12, 18, 28, 40. |
| type, sku, purchase_price, cess_rate, tax_preference, description | Optional. tax_preference: non_taxable forces 0% GST. |
Invoices, bills & notes
Invoice fields
| Field | Notes |
|---|---|
| type | sales_invoice (default), purchase_bill, credit_note, debit_note; non-accounting documents quotation, proforma, sales_order, delivery_challan, purchase_order, receipt_note. |
| source_order_id | Convert from a quotation / order / challan. Goods already sent on a challan (or received on a GRN) do not move stock again. |
| godown_id | Location 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. |
| number | Leave empty to auto-number (INV/26-27/0001). Required for purchase bills: the vendor's bill number. |
| date, due_date | Date defaults to today. |
| against_invoice_id | For credit / debit notes: the original document. Cannot exceed its open balance. |
| tax_mode, place_of_supply, reverse_charge | See GST. |
| currency, exchange_rate | Rate is required when currency differs from your base currency. |
| port_code, shipping_bill_no, shipping_bill_date | Exports (reported in GSTR-1). |
| notes, terms, reference, template | Template: classic, modern, minimal. |
| draft | true 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
Payment fields
| invoice_id | Settle an invoice or bill. Party, direction and currency are taken from it. |
| direction | in (received) or out (made). Required without invoice_id. |
| customer_id | Required without invoice_id (on-account payment). |
| amount *, date * | Amount in the document currency. |
| exchange_rate | Rate on the day of payment, for foreign currency. |
| ledger_id | Cash or bank ledger. Defaults to the primary bank (or cash when mode is cash). |
| mode | cash, bank, upi, cheque, card, gateway. |
| tds_amount, bank_charges, reference, notes | TDS counts towards settling the invoice. Bank charges are in base currency. |
Accounting
Reports & GST
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 & Kashmir02 Himachal Pradesh03 Punjab04 Chandigarh05 Uttarakhand06 Haryana07 Delhi08 Rajasthan09 Uttar Pradesh10 Bihar11 Sikkim12 Arunachal Pradesh13 Nagaland14 Manipur15 Mizoram16 Tripura17 Meghalaya18 Assam19 West Bengal20 Jharkhand21 Odisha22 Chhattisgarh23 Madhya Pradesh24 Gujarat26 Dadra & Nagar Haveli and Daman & Diu27 Maharashtra29 Karnataka30 Goa31 Lakshadweep32 Kerala33 Tamil Nadu34 Puducherry35 Andaman & Nicobar Islands36 Telangana37 Andhra Pradesh38 Ladakh97 Other Territory96 Other CountryUnits
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].