Vendor Ledger

Computed running-balance statement per vendor (bills, payments, debit notes). Read-only; uses the reports.read scope.

GET/api/v1/vendor-ledger

List ledger-eligible vendors

Scope: reports.read

Parameters

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

Example request

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

Example response

JSON
{
  "vendorId": "clx2vnd001000000000000001",
  "displayName": "Shree Textile Suppliers",
  "openingBalance": 0,
  "currencyCode": "INR"
}

Possible errors: unauthorized, insufficient_scope, forbidden

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

Get a vendor's computed ledger

Scope: reports.read

id is the vendorId. Optional ?from=YYYY-MM-DD&to=YYYY-MM-DD windows the `entries` array. Payables sign convention: bills/debit notes credit the balance, payments debit it.

Parameters

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

Example request

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

Example response

JSON
{
  "vendor": {
    "id": "clx2vnd001000000000000001",
    "displayName": "Shree Textile Suppliers"
  },
  "entries": [
    {
      "date": "2026-07-01T00:00:00.000Z",
      "type": "invoice",
      "number": "BILL-2026-0091",
      "debit": 0,
      "credit": 59000,
      "status": "PARTIALLY_PAID",
      "balance": 59000
    },
    {
      "date": "2026-07-15T00:00:00.000Z",
      "type": "payment",
      "number": "PMT-2026-0058",
      "debit": 30000,
      "credit": 0,
      "status": "",
      "balance": 29000
    }
  ],
  "openingBalance": 0,
  "outstanding": 29000
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found