API documentation · v1

Build on BillCraft

A simple JSON API and signed webhooks. Read your customers and their statements, bills, quotes, payments, items and expenses, create bills from your own website or app, and get told the moment a bill is paid.

Getting started

The API lets your own software work with one company's BillCraft data. You can read customers (with statements), bills, quotes, payments, items and expenses, and create customers and bills. It can never change or delete anything, change settings or see another company.

Base address: https://billcraft-be-prod.onrender.com/api/v1

  1. 1In BillCraft open Settings → Developers.
  2. 2Press Create key, give it a name, and copy the key. It is shown once.
  3. 3Send it on every request, as below.
Try it
curl https://billcraft-be-prod.onrender.com/api/v1/me \
  -H "Authorization: Bearer bc_live_your_key"

Authentication

Send your key as a bearer token: Authorization: Bearer bc_live_…. (X-API-Key: bc_live_… works too.) Keep it secret, like a password, and use it from your server, never in a web page or app that customers can open.

A key belongs to one company and acts as the person who made it, who must be the owner or an admin. Only the owner or an admin can make or revoke keys. If you lose a key or think it leaked, revoke it in Settings → Developers: it stops working at once.

We store only a scrambled copy of your key, so we can never show it again. Make a new one if it is lost.

Limits and errors

Each key can make 120 requests a minute. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (a Unix time) so you can slow down in time. If a company's plan has run out, creating is paused, exactly as in the app.

Everything is JSON. A single record comes back as { "data": {…} }. A list comes back as { "data": […], "meta": { "page", "limit", "total", "hasMore" } }, at most 100 rows a page. Money is a plain number, dates are YYYY-MM-DD and times are ISO 8601 in UTC.

Errors use a normal HTTP status and a message: { "error": "Some fields are not valid", "details": [{ "field": "items", "message": "…" }] }

400Something in your request is not valid. The message says what, and details lists each field
401The key is missing, wrong or revoked
403The company is not active, or the person who made the key no longer manages it
404That record does not exist for this company, or the route does not exist
409It already exists (for example a customer with the same name)
422Understood but not allowed right now
429More than 120 requests a minute with this key. Wait and retry

Endpoints

Customers

GET/v1/customers

List customers

Newest first.

Query parameters
search
stringPart of the customer's name
page
numberPage number, starting at 1
limit
numberRows per page, 1 to 100 (default 20)
Request
curl https://billcraft-be-prod.onrender.com/api/v1/customers?search=north&limit=10 \
  -H "Authorization: Bearer bc_live_your_key"
Response
{
  "data": [
    { "id": "e2a1…", "name": "Northwind Studio", "email": "accounts@northwind.example", "phone": null, "address": null, "taxId": null, "gstStateCode": null, "notes": null, "createdAt": "2026-10-01T10:00:00.000Z" }
  ],
  "meta": { "page": 1, "limit": 10, "total": 1, "hasMore": false }
}
GET/v1/customers/:id

Get a customer

One customer by id.

Request
curl https://billcraft-be-prod.onrender.com/api/v1/customers/e2a1… \
  -H "Authorization: Bearer bc_live_your_key"
Response
{ "data": { "id": "e2a1…", "name": "Northwind Studio", "email": "accounts@northwind.example", … } }
GET/v1/customers/:id/statement

Customer statement

A customer's account for a period: every bill, credit note and payment with a running balance, in your company's currency. Without dates it covers this financial year (April to March) up to today. The period can be at most 5 years.

Query parameters
from
dateFirst day, like 2026-04-01
to
dateLast day (included)
Request
curl https://billcraft-be-prod.onrender.com/api/v1/customers/e2a1…/statement?from=2026-04-01&to=2026-09-30 \
  -H "Authorization: Bearer bc_live_your_key"
Response
{
  "data": {
    "customer": { "id": "e2a1…", "name": "Northwind Studio" },
    "currency": "INR", "from": "2026-04-01", "to": "2026-09-30",
    "openingBalance": 0,
    "entries": [
      { "date": "2026-04-12", "type": "BILL", "document": "ACME-CORP-000118", "details": "Bill, due 2026-05-12", "debit": 2244, "credit": 0, "balance": 2244 },
      { "date": "2026-04-20", "type": "PAYMENT", "document": "ACME-CORP-000118", "details": "UPI received", "debit": 0, "credit": 1000, "balance": 1244 }
    ],
    "totalBilled": 2244, "totalReceived": 1000, "closingBalance": 1244
  }
}
POST/v1/customers

Create a customer

Returns 409 if you already have a customer with that name.

Body (JSON)
namerequired
stringRequired. Up to 100 characters
email
stringA valid email address
phone
stringUp to 50 characters
address
stringUp to 500 characters
taxId
stringGSTIN or tax number
gstStateCode
stringTwo-digit GST state code, for GST companies
notes
stringUp to 1000 characters
Request
curl -X POST https://billcraft-be-prod.onrender.com/api/v1/customers \
  -H "Authorization: Bearer bc_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Northwind Studio",
    "email": "accounts@northwind.example"
  }'
Response
{ "data": { "id": "e2a1…", "name": "Northwind Studio", "email": "accounts@northwind.example", … } }   // 201

Bills

GET/v1/bills

List bills

Newest first, each with its items.

Query parameters
status
stringDRAFT, SENT, PARTIALLY_PAID, PAID, OVERDUE or CANCELLED
customerId
stringOnly this customer's bills
search
stringPart of a bill number or customer name
from
dateBill date on or after, like 2026-04-01
to
dateBill date on or before
page
numberPage number, starting at 1
limit
numberRows per page, 1 to 100 (default 20)
Request
curl https://billcraft-be-prod.onrender.com/api/v1/bills?status=OVERDUE&limit=20 \
  -H "Authorization: Bearer bc_live_your_key"
Response
{ "data": [ { "id": "5b0f…", "number": "ACME-CORP-000118", "status": "OVERDUE", "total": 2244, "balanceDue": 2244, … } ], "meta": { "page": 1, "limit": 20, "total": 1, "hasMore": false } }
GET/v1/bills/:id

Get a bill

By its id or its bill number (like ACME-CORP-000118).

Request
curl https://billcraft-be-prod.onrender.com/api/v1/bills/ACME-CORP-000118 \
  -H "Authorization: Bearer bc_live_your_key"
Response
{
  "data": {
    "id": "5b0f6c1e-…",
    "number": "ACME-CORP-000118",
    "status": "SENT",
    "url": "https://billcraft.win/bill/…",
    "customer": { "id": "e2a1…", "name": "Northwind Studio", "email": "accounts@northwind.example", "phone": null, "address": null },
    "billDate": "2026-10-21",
    "dueDate": "2026-12-31",
    "currency": "INR",
    "exchangeRate": 1,
    "subtotal": 2040,
    "discount": 0,
    "tax": 204,
    "total": 2244,
    "amountPaid": 0,
    "creditedAmount": 0,
    "balanceDue": 2244,
    "notes": null,
    "terms": null,
    "items": [
      { "description": "Website redesign", "quantity": 1, "unitPrice": 1800, "amount": 1800, "hsn": null, "taxRate": 10 },
      { "description": "Hosting (annual)", "quantity": 1, "unitPrice": 240, "amount": 240, "hsn": null, "taxRate": 10 }
    ],
    "sentAt": "2026-10-21T08:30:00.000Z",
    "paidAt": null,
    "createdAt": "2026-10-21T08:30:00.000Z"
  }
}
POST/v1/bills

Create a bill

Creates a draft, or issues the bill straight away with status SENT. Totals, tax and the bill number are worked out for you. Issuing does not email the customer: send the returned url yourself, or use Email in the app.

Body (JSON)
customerNamerequired
stringRequired. Matches a saved customer with the same name
itemsrequired
arrayRequired. 1 to 200 items, see below
customerId
stringLink to a saved customer by id
customerEmail
stringWhere the bill can be sent
customerPhone
string
customerAddress
string
billDate
dateDefaults to today
dueDate
dateCannot be before the bill date
status
stringDRAFT (default) or SENT
discountType
stringPERCENTAGE or FIXED
discountValue
numberA percentage (0 to 100) or an amount
taxRate
numberSimple-tax companies: one rate for the bill, in percent
currency
stringThree-letter code, if not the company currency
exchangeRate
numberWith currency: how much of your currency one unit is worth
pricesIncludeTax
booleanGST and VAT companies: item prices already include the tax
reverseCharge
booleanGST companies: the buyer pays the GST. It is left out of the total and the bill says so. Not for composition dealers
customerGstin
stringThe customer's tax number: GSTIN for GST companies, VAT / tax number for VAT companies
placeOfSupply
stringGST state code, GST companies
notes
stringShown on the bill
terms
stringShown on the bill
Each item
descriptionrequired
stringRequired, up to 500 characters
quantityrequired
numberRequired, above 0
unitPricerequired
numberRequired, 0 or more
hsn
stringHSN / SAC code, GST companies
taxRate
numberThis line's GST or VAT rate in percent, for GST and VAT companies
Request
curl -X POST https://billcraft-be-prod.onrender.com/api/v1/bills \
  -H "Authorization: Bearer bc_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "customerName": "Northwind Studio",
    "customerEmail": "accounts@northwind.example",
    "dueDate": "2026-12-31",
    "status": "SENT",
    "items": [
      {
        "description": "Website redesign",
        "quantity": 1,
        "unitPrice": 1800
      },
      {
        "description": "Hosting (annual)",
        "quantity": 1,
        "unitPrice": 240
      }
    ]
  }'
Response
{
  "data": {
    "id": "5b0f6c1e-…",
    "number": "ACME-CORP-000118",
    "status": "SENT",
    "url": "https://billcraft.win/bill/…",
    "customer": { "id": "e2a1…", "name": "Northwind Studio", "email": "accounts@northwind.example", "phone": null, "address": null },
    "billDate": "2026-10-21",
    "dueDate": "2026-12-31",
    "currency": "INR",
    "exchangeRate": 1,
    "subtotal": 2040,
    "discount": 0,
    "tax": 204,
    "total": 2244,
    "amountPaid": 0,
    "creditedAmount": 0,
    "balanceDue": 2244,
    "notes": null,
    "terms": null,
    "items": [
      { "description": "Website redesign", "quantity": 1, "unitPrice": 1800, "amount": 1800, "hsn": null, "taxRate": 10 },
      { "description": "Hosting (annual)", "quantity": 1, "unitPrice": 240, "amount": 240, "hsn": null, "taxRate": 10 }
    ],
    "sentAt": "2026-10-21T08:30:00.000Z",
    "paidAt": null,
    "createdAt": "2026-10-21T08:30:00.000Z"
  }
}   // 201

Items

GET/v1/items

List items

Your products and services by name. Items that track stock show how many are left; the rest show stock as null.

Query parameters
search
stringPart of the item's name
page
numberPage number, starting at 1
limit
numberRows per page, 1 to 100 (default 20)
Request
curl https://billcraft-be-prod.onrender.com/api/v1/items?search=widget \
  -H "Authorization: Bearer bc_live_your_key"
Response
{
  "data": [
    { "id": "3a7e…", "name": "Widget", "description": null, "unit": "pcs", "unitPrice": 10, "hsn": null, "taxRate": null, "trackStock": true, "stock": 24, "lowStockAt": 5 }
  ],
  "meta": { "page": 1, "limit": 20, "total": 1, "hasMore": false }
}

Expenses

GET/v1/expenses

List expenses

What the company spent, newest first. Read only: add and edit expenses in the app.

Query parameters
from
dateOn or after, like 2026-04-01
to
dateOn or before
category
stringOnly this category, like Rent
page
numberPage number, starting at 1
limit
numberRows per page, 1 to 100 (default 20)
Request
curl https://billcraft-be-prod.onrender.com/api/v1/expenses?category=Rent&from=2026-04-01 \
  -H "Authorization: Bearer bc_live_your_key"
Response
{
  "data": [
    { "id": "7d41…", "date": "2026-10-10", "amount": 250.5, "category": "Rent", "vendor": "Landlord", "description": "October shop rent", "method": "UPI", "note": null, "createdAt": "2026-10-10T08:14:00.000Z" }
  ],
  "meta": { "page": 1, "limit": 20, "total": 1, "hasMore": false }
}

Quotes

GET/v1/quotes

List quotes

Newest first, each with its items.

Query parameters
status
stringDRAFT, SENT, ACCEPTED, DECLINED or CONVERTED
page
numberPage number, starting at 1
limit
numberRows per page, 1 to 100 (default 20)
Request
curl https://billcraft-be-prod.onrender.com/api/v1/quotes?status=ACCEPTED \
  -H "Authorization: Bearer bc_live_your_key"
Response
{ "data": [ { "id": "9c2d…", "number": "ACME-CORP-Q00007", "status": "ACCEPTED", "total": 5000, "convertedBillId": null, … } ], "meta": { … } }
GET/v1/quotes/:id

Get a quote

By its id or quote number.

Request
curl https://billcraft-be-prod.onrender.com/api/v1/quotes/ACME-CORP-Q00007 \
  -H "Authorization: Bearer bc_live_your_key"
Response
{ "data": { "id": "9c2d…", "number": "ACME-CORP-Q00007", "status": "ACCEPTED", "url": "https://billcraft.win/quote/…", … } }

Payments

GET/v1/payments

List payments

Newest first. Practice (test-mode) payments are left out.

Query parameters
billId
stringOnly payments of this bill
page
numberPage number, starting at 1
limit
numberRows per page, 1 to 100 (default 20)
Request
curl https://billcraft-be-prod.onrender.com/api/v1/payments?billId=5b0f… \
  -H "Authorization: Bearer bc_live_your_key"
Response
{ "data": [ { "id": "7e4a…", "billId": "5b0f…", "amount": 1122, "paidAt": "2026-10-22T09:00:00.000Z", "method": "UPI", "note": null, "source": "ONLINE", "test": false, "createdAt": "…" } ], "meta": { … } }

Objects

Bill
id string
Unique id
number string
Bill number, like ACME-CORP-000118
status string
DRAFT, SENT, PARTIALLY_PAID, PAID, OVERDUE or CANCELLED
url string
The page your customer opens to view and pay the bill
customer object
id, name, email, phone, address
billDate / dueDate date
YYYY-MM-DD
currency / exchangeRate string / number
The bill's currency and the rate saved with it
taxMode / taxLabel string
SIMPLE, GST or VAT, and the tax's name on a VAT bill (VAT, Sales Tax ...)
gstScheme / reverseCharge string / boolean
REGULAR or COMPOSITION (a composition dealer charges no GST and issues a Bill of Supply). reverseCharge is true when the buyer pays the GST
subtotal / discount / tax / total number
Worked out for you
amountPaid / creditedAmount number
Payments received and credit notes issued
balanceDue number
total − creditedAmount − amountPaid, never below 0
items array
description, quantity, unitPrice, amount, hsn, taxRate
sentAt / paidAt / createdAt datetime
ISO 8601, UTC
Customer
id string
Unique id
name string
email / phone / address string
Or null
taxId string
GSTIN or tax number, or null
gstStateCode string
Or null
notes string
Or null
createdAt datetime
Quote
id / number string
Id, and a number like ACME-CORP-Q00007
status string
DRAFT, SENT, ACCEPTED, DECLINED or CONVERTED
url string
Where your customer answers it
customer object
id, name, email
quoteDate / validUntil date
subtotal / discount / tax / total number
respondedAt / declineReason datetime / string
When and why it was answered
convertedBillId string
The bill made from it, or null
items array
Same as a bill's items
Item
id / name string
description / unit string
Or null
unitPrice number
The default price
hsn / taxRate string / number
Default HSN code and GST or VAT rate, or null
trackStock boolean
Whether issued bills take this item out of stock
stock / lowStockAt number
Quantity left and the alert level. null when stock is not tracked
Payment
id / billId string
amount number
In the bill's currency
paidAt datetime
method string
CASH, BANK_TRANSFER, UPI, CARD, CHEQUE, OTHER or ONLINE
source string
MANUAL or ONLINE
note string
Or null
test boolean
Always false here

Webhooks

Instead of asking us again and again, let us tell you. Add an address in Settings → Developers → Webhooks and choose the events you want. BillCraft sends a POST with JSON whenever one happens.

Reply with any 2xx within 8 seconds to confirm. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours, then marked failed (you can retry it from Settings, and see every delivery there). Your address must be https and public. We do not follow redirects.

bill.createdBillA bill was created: in the app, by the API, from a quote or by a recurring schedule
bill.sentBillA bill was issued to the customer
bill.partially_paidBillA part payment was recorded, online or by hand
bill.paidBillA bill is now fully paid
bill.overdueBillA bill passed its due date unpaid
quote.acceptedQuoteA customer accepted a quote
quote.declinedQuoteA customer declined a quote
customer.createdCustomerA customer was added
What we send
POST /your-webhook
Content-Type: application/json
User-Agent: BillCraft-Webhooks/1
BillCraft-Event: bill.paid
BillCraft-Event-Id: evt_6d1c…
BillCraft-Delivery: 3f9a…
BillCraft-Signature: t=1792570000,v1=9f2a…

{
  "id": "evt_6d1c…",
  "type": "bill.paid",
  "createdAt": "2026-10-22T08:30:00.000Z",
  "companyId": "e95c…",
  "data": { "object": { "id": "5b0f…", "number": "ACME-CORP-000118", "status": "PAID", "total": 2244, "balanceDue": 0, … } }
}

data.object has the same shape as the API returns (a Bill, Quote or Customer). The same event can arrive more than once, for example after a retry, so use id to ignore repeats. You can press Send test in Settings to receive a sample ping event.

Verify signatures

Every call is signed with your webhook's secret (shown once when you add it). Make an HMAC-SHA256 of "<t>.<raw body>" with the secret and compare it with v1. Use the raw body, before it is parsed, and reject a call whose t is more than 5 minutes old.

Node.js
import crypto from "crypto";

export function isFromBillCraft(rawBody, header, secret) {
  const t = /t=(\d+)/.exec(header)?.[1];
  const v1 = /v1=([0-9a-f]+)/.exec(header)?.[1];
  if (!t || !v1 || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return expected.length === v1.length && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}
Python
import hmac, hashlib, re, time

def is_from_billcraft(raw_body: bytes, header: str, secret: str) -> bool:
    t = re.search(r"t=(\d+)", header); v1 = re.search(r"v1=([0-9a-f]+)", header)
    if not t or not v1 or abs(time.time() - int(t.group(1))) > 300:
        return False
    expected = hmac.new(secret.encode(), t.group(1).encode() + b"." + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, v1.group(1))