v1 live · Free for current users

GST Invoicing API for Developers & Platforms

Generate GST-compliant invoices from your app with a single API call. Automatic CGST, SGST, and IGST splits, customer management, and a clean REST surface — built for SaaS, marketplaces, and ERPs in India.

Base URL: https://gst-invoice.com/api/public

Quickstart

Sign in, create a key under API Keys, then call the API.

    1

    Set up your business

    In Settings, save your company GSTIN and state — used to compute CGST/SGST vs IGST.

    2

    Create an API key

    Go to API Keys and create a key. Copy it — you'll only see it once.

    3

    Make your first call

    Send a POST to /v1/invoices with your customer and items. Get back a complete invoice.

# Create an invoice
curl -X POST https://gst-invoice.com/api/public/v1/invoices \
  -H "Authorization: Bearer lk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "name": "Acme Pvt Ltd",
      "gstin": "27AAPFU0939F1ZV",
      "state_code": "27"
    },
    "items": [
      {
        "name": "Web design services",
        "hsn_sac": "998314",
        "quantity": 1,
        "rate": 50000,
        "gst_rate": 18
      }
    ]
  }'

Authentication

Every request must include your API key as a Bearer token. Keys start with lk_live_. Treat them like passwords.

Authorization: Bearer lk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Lost a key? Revoke it and create a new one — old keys stop working immediately.

Endpoint reference

All endpoints return JSON. Successful responses use HTTP 200 or 201.

MethodPathDescription
POST/v1/invoicesCreate a GST invoice with auto tax split
GET/v1/invoicesList invoices (filter by status, date)
GET/v1/invoices/{id}Retrieve a single invoice with line items
GET/v1/invoices/{id}/pdfDownload the invoice PDF (application/pdf)
POST/v1/customersCreate a customer (state auto-derived from GSTIN)
GET/v1/customersList customers

Create invoice — request body

{
  "customer": {                       // or { "customer_id": "uuid" } for existing customer
    "name": "Acme Pvt Ltd",
    "gstin": "27AAPFU0939F1ZV",       // optional, but recommended
    "state_code": "27"                // 2-digit GST state code
  },
  "invoice_date": "2026-05-21",       // optional, defaults to today
  "due_date": "2026-06-04",           // optional
  "place_of_supply": "27",            // optional, defaults to customer state
  "reverse_charge": false,            // optional
  "items": [
    {
      "name": "Web design services",
      "description": "Landing page",  // optional
      "hsn_sac": "998314",            // optional
      "unit": "Nos",                  // optional, defaults to "Nos"
      "quantity": 1,
      "rate": 50000,
      "discount_pct": 0,              // optional
      "gst_rate": 18
    }
  ],
  "notes": "Thank you for your business",  // optional
  "terms": "Net 14"                         // optional
}

Errors

Status & codeMeaning
401 unauthorizedMissing or invalid API key
404 not_foundInvoice or customer does not exist
412 profile_incompleteBusiness profile missing state — set it in app settings
422 validation_errorRequest body failed schema validation (see details)
500 internal_errorUnexpected server error

All errors return JSON in the shape { "error": { "code", "message" } }.

Developer documentation

End-to-end request and response examples — copy, paste, and ship. All examples use real schemas returned by the v1 API.

POST/v1/invoices— Create invoice

Creates a GST invoice. Tax split is derived automatically: same-state seller and place of supply yields CGST + SGST; different states yield IGST. Amounts are returned in paise-precision INR with two decimals.

RequestcURL
# Create an invoice (inter-state → IGST)
curl -X POST https://gst-invoice.com/api/public/v1/invoices \
  -H "Authorization: Bearer lk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "name": "Acme Pvt Ltd",
      "gstin": "27AAPFU0939F1ZV",
      "state_code": "27",
      "email": "ap@acme.in"
    },
    "place_of_supply": "29",
    "invoice_date": "2026-05-21",
    "due_date": "2026-06-04",
    "items": [
      {
        "name": "Web design services",
        "hsn_sac": "998314",
        "quantity": 1,
        "rate": 50000,
        "gst_rate": 18
      },
      {
        "name": "Hosting (annual)",
        "hsn_sac": "998315",
        "quantity": 1,
        "rate": 12000,
        "gst_rate": 18
      }
    ],
    "notes": "Thank you for your business",
    "terms": "Net 14"
  }'
Response201 · application/json
HTTP/1.1 201 Created
Content-Type: application/json

{
  "id": "inv_01HZX9K3M2B7QH4N6T0R8YV5JE",
  "number": "INV-2026-000128",
  "status": "issued",
  "invoice_date": "2026-05-21",
  "due_date": "2026-06-04",
  "currency": "INR",
  "place_of_supply": "29",
  "seller_state_code": "27",
  "tax_type": "IGST",
  "customer": {
    "id": "cus_01HZX9JC0V9YH1M2N3P4Q5R6S7",
    "name": "Acme Pvt Ltd",
    "gstin": "27AAPFU0939F1ZV",
    "state_code": "27"
  },
  "items": [
    {
      "name": "Web design services",
      "hsn_sac": "998314",
      "quantity": 1,
      "rate": 50000,
      "taxable_value": 50000,
      "gst_rate": 18,
      "igst": 9000,
      "cgst": 0,
      "sgst": 0,
      "total": 59000
    },
    {
      "name": "Hosting (annual)",
      "hsn_sac": "998315",
      "quantity": 1,
      "rate": 12000,
      "taxable_value": 12000,
      "gst_rate": 18,
      "igst": 2160,
      "cgst": 0,
      "sgst": 0,
      "total": 14160
    }
  ],
  "totals": {
    "subtotal": 62000,
    "cgst": 0,
    "sgst": 0,
    "igst": 11160,
    "round_off": 0,
    "grand_total": 73160
  },
  "pdf_url": "https://gst-invoice.com/api/public/v1/invoices/inv_01HZX9K3M2B7QH4N6T0R8YV5JE/pdf",
  "created_at": "2026-05-21T11:42:08.214Z"
}
Validation error422 · application/json
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json

{
  "error": {
    "code": "validation_error",
    "message": "items[0].gst_rate must be one of 0, 0.1, 0.25, 3, 5, 12, 18, 28",
    "field": "items[0].gst_rate"
  }
}
GET/v1/invoices/{id}/pdf— Export invoice as PDF

Returns a server-rendered, GST-compliant PDF for the invoice. The response is binary application/pdf — stream it to disk or pipe it directly to your customer. The same URL is returned as pdf_url on the invoice resource.

RequestcURL
# Download the rendered invoice PDF
curl -L -X GET https://gst-invoice.com/api/public/v1/invoices/inv_01HZX9K3M2B7QH4N6T0R8YV5JE/pdf \
  -H "Authorization: Bearer lk_live_..." \
  -H "Accept: application/pdf" \
  -o invoice-INV-2026-000128.pdf
Response200 · application/pdf
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="INV-2026-000128.pdf"
Content-Length: 84213
Cache-Control: private, max-age=0, must-revalidate

%PDF-1.7
%âãÏÓ
… binary PDF stream …
%%EOF
Note: PDF rendering is rolling out to API users. While it's in preview, the endpoint may return 202 pdf_pending on the first call and the PDF becomes available within a few seconds. Poll the same URL or subscribe to the invoice.pdf.ready webhook (coming soon).

Built for production

REST + JSON

Predictable resources and clear error codes.

Auto GST Split

CGST/SGST for intra-state, IGST for inter-state, UTGST for UTs.

Scoped API Keys

Hashed at rest. Revoke instantly from the dashboard.

Fast endpoints

Low-latency edge runtime with regional failover.

PDF rendering

Coming soon — render branded invoice PDFs on demand.

GST compliant

HSN/SAC, reverse charge, audit trail.

Shopify integration

Auto-generate GST invoices from Shopify orders. Connect a store in your dashboard, register a webhook in Shopify, and we handle the tax math.

Per-store HMAC secret

Each connection gets its own signing secret. We verify Shopify's X-Shopify-Hmac-Sha256 header on every event.

Idempotent by order id

Re-delivered webhooks won't create duplicate invoices — the same Shopify order id always resolves to the same invoice.

GSTIN from checkout

Customers can pass their GSTIN via a checkout note attribute; we attach it to the invoice automatically.

Webhook endpoint

POST https://gst-invoice.com/api/public/v1/shopify/webhook
X-Shopify-Shop-Domain: my-store.myshopify.com
X-Shopify-Topic: orders/paid
X-Shopify-Hmac-Sha256: <base64 hmac>
Content-Type: application/json

Supported topics: orders/paid, orders/create. Enable per-store in the dashboard.

Response on success

HTTP/1.1 201 Created
{
  "ok": true,
  "invoice_id": "9a73...c2e1",
  "invoice_number": "INV/2025-26/137",
  "warnings": []
}

Returns 200 {"ok":true,"duplicate":true} if the order has already been invoiced.

Optional checkout note attributes

KeyPurposeExample
gstinBuyer's GSTIN (for B2B invoices)27AAPFU0939F1ZV
place_of_supplyOverride place of supply (2-digit GST state code)29

Mapping logic

  • • Shipping address province_code (e.g. MH, KA) is mapped to its GST state code (27, 29).
  • • Place of supply = place_of_supply note attribute, else shipping state, else seller state.
  • • CGST+SGST when buyer and seller share a state; IGST otherwise. UT replaces SGST in union territories.
  • • GST rate per line is taken from the first Shopify tax line on the item (e.g. rate: 0.18 → 18%). Missing tax rates default to 0%.
  • • Per-line discount = total_discount as a percentage of quantity × price.
  • • Invoice number reserved atomically using your account's invoice prefix.

API FAQ

Want webhooks & PDF rendering?

Join the waitlist for the next wave: webhooks, bulk operations, branded PDF rendering, and credit/debit note endpoints.

We'll only email you about API early access. No spam.