Customer Ledger

Computed running-balance statement per customer (invoices, payments, adjustments). Read-only.

GET/api/v1/customer-ledger

List ledger-eligible customers

Scope: customers.read

Parameters

NameInTypeRequiredDescription
qquerystringOptionalFree-text search on display name, GSTIN, phone, or email.

Example request

curl "https://invoice.avscorp.in/api/v1/customer-ledger" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "id": "clx2cus001000000000000001",
  "displayName": "Acme Retailers",
  "gstin": "27BBBBB1111B1Z9",
  "phone": "9876543210",
  "email": "accounts@acme.example",
  "currencyCode": "INR",
  "openingBalance": 5000
}

Possible errors: unauthorized, insufficient_scope, forbidden

GET/api/v1/customer-ledger/{id}

Get a customer's computed ledger

Scope: customers.read

id is the customerId. Optional ?from=YYYY-MM-DD&to=YYYY-MM-DD windows the `entries` array; `outstanding` always reflects the full history.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.
fromquerystringOptionalWindow start date, YYYY-MM-DD.
toquerystringOptionalWindow end date, YYYY-MM-DD.

Example request

curl "https://invoice.avscorp.in/api/v1/customer-ledger/clx2cus001000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "customer": {
    "id": "clx2cus001000000000000001",
    "displayName": "Acme Retailers",
    "legalName": "Acme Retailers Pvt Ltd",
    "gstin": "27BBBBB1111B1Z9",
    "phone": "9876543210",
    "email": "accounts@acme.example",
    "currencyCode": "INR",
    "openingBalance": 5000
  },
  "from": "2026-07-01",
  "to": "2026-08-31",
  "openingBalance": 5000,
  "outstanding": 12500,
  "entries": [
    {
      "date": "2026-07-05T00:00:00.000Z",
      "type": "invoice",
      "number": "INV-2026-0102",
      "debit": 11800,
      "credit": 0,
      "status": "SENT",
      "balance": 16800
    },
    {
      "date": "2026-07-20T00:00:00.000Z",
      "type": "payment",
      "number": "PR-2026-0044",
      "debit": 0,
      "credit": 4300,
      "status": "BANK_TRANSFER",
      "balance": 12500
    }
  ]
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found