REST · JSON Webhooks Public beta
  v1.4 · 99.96% uptime · 12 endpoints live

A clean API for Indian invoicing.

REST endpoints, idempotency keys, webhooks, sandbox. Build the resellers' tool, the accountant dashboard, the WhatsApp bot — we'll handle GST and the boring parts.

$ curl api.4square.in live
$ POST/v1/invoices "customer_id": "cus_8h2k", "items": [ { "sku": "SR-501", "qty": 2, "rate": 450 } ], "gst_treatment": "intra_state", "send_whatsapp": true
Response 201 Created · 184ms
"id": "inv_4s2026_0421", "number": "4S/2026-27/0421", "total": 1062, "gst": { "sgst": 81, "cgst": 81 }, "upi_qr": "https://api.4square.in/qr/inv_...", "whatsapp": { "sent": true, "to": "+9198765..." }
01 · Endpoints

Twelve endpoints. Boring on purpose.

Resource-shaped REST. Predictable JSON. Idempotency keys on every write. Read full reference at docs.4square.in.

POST/v1/invoicesCreate an invoice with items, GST, and optional WhatsApp send.
GET/v1/invoices/{id}Fetch a single invoice with PDF + UPI QR URLs.
GET/v1/invoices?from=...&to=...List invoices in a date range, paginated cursor-style.
PUT/v1/invoices/{id}/payMark paid. Records UPI ref or cash. Idempotent.
DEL/v1/invoices/{id}Soft-delete (recoverable). Audit log retains the original.
POST/v1/customersCreate a customer with GSTIN, place of supply, contact.
GET/v1/customers/{id}/ledgerRunning ledger — opening balance, txns, closing.
POST/v1/itemsCreate a product / service with HSN, GST rate, units.
POST/v1/paymentsRecord a payment, link to one or more invoices.
GET/v1/reports/gstr1GSTR-1 ready Excel for the requested month.
POST/v1/webhooksSubscribe to invoice.created, payment.received, etc.
GET/v1/healthStatus, region latency, current rate-limit window.
02 · Why this API

Built by people who shipped invoicing.

REST.JSON
Resource-shaped REST
No GraphQL gymnastics. Every resource has a /v1 path. POST creates, GET reads, PUT updates.
IDEMPOT
Idempotency keys
Pass an Idempotency-Key header. Safe to retry on network errors — never double-bills.
WEBHOOK
Webhooks + retries
12 events. Signed payloads. Auto-retry with exponential backoff for 24 hours.
SANDBOX
Real sandbox
Separate base URL with fake GSTINs that pass validation. Test invoices don't show up in your real ledger.
RATE
Generous rate limits
600 req/min on production, 60 req/min on sandbox. Headers tell you remaining.
SDK.SOON
SDKs (soon)
Node, Python, PHP wrapping the REST API. Ship raw HTTP today, swap to SDK when ready.
03 · Ecosystem

One API, every direction.

Ship your first invoice today.

Sandbox keys are free. Production access opens after one live test invoice.

Get a sandbox key Talk to engineering