Number Series

Auto-numbering configuration (prefix/suffix/padding) per document type.

GET/api/v1/number-series

List number series

Scope: numberSeries.read

Parameters

NameInTypeRequiredDescription
pagequerynumberOptional1-based page number.
limitquerynumberOptionalPage size, max 200.

Example request

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

Example response

JSON
{
  "id": "clx4ns000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "docType": "INVOICE",
  "prefix": "INV-",
  "suffix": "",
  "padding": 5,
  "nextNumber": 42,
  "resetYearly": true,
  "updatedAt": "2026-04-01T00:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden

POST/api/v1/number-series

Create a number series

Scope: numberSeries.create

docType has a unique constraint per organization — one series per document type.

Request body

FieldTypeRequiredConstraints
docTypestringRequiredone of: QUOTE, SALES_ORDER, INVOICE, PAYMENT_RECEIVED, PURCHASE_ORDER, BILL, PAYMENT_MADE, EXPENSE, CREDIT_NOTE, DEBIT_NOTE, DEBIT_ADJUSTMENT, CREDIT_ADJUSTMENT
prefixstringOptionalmax length 40; default ""
suffixstringOptionalmax length 20; default ""
paddingintegerOptionalmin 1; max 10; default 5
nextNumberintegerOptionalmin 1; max 9007199254740991; default 1
resetYearlybooleanOptionaldefault true

Example request

curl -X POST "https://invoice.avscorp.in/api/v1/number-series" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "docType": "INVOICE",
  "prefix": "INV-",
  "padding": 5
}'

Example response

JSON
{
  "id": "clx4ns000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "docType": "INVOICE",
  "prefix": "INV-",
  "suffix": "",
  "padding": 5,
  "nextNumber": 42,
  "resetYearly": true,
  "updatedAt": "2026-04-01T00:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, conflict

GET/api/v1/number-series/{id}

Get a number series

Scope: numberSeries.read

Parameters

NameInTypeRequiredDescription
idpathstringRequiredNumber series ID.

Example request

curl "https://invoice.avscorp.in/api/v1/number-series/clx4ns000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "id": "clx4ns000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "docType": "INVOICE",
  "prefix": "INV-",
  "suffix": "",
  "padding": 5,
  "nextNumber": 42,
  "resetYearly": true,
  "updatedAt": "2026-04-01T00:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found

PATCH/api/v1/number-series/{id}

Update a number series

Scope: numberSeries.update

docType is immutable and cannot be changed after creation.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredNumber series ID.

Request body

FieldTypeRequiredConstraints
prefixstringOptionalmax length 40
suffixstringOptionalmax length 20
paddingintegerOptionalmin 1; max 10
nextNumberintegerOptionalmin 1; max 9007199254740991
resetYearlybooleanOptional—

Example request

curl -X PATCH "https://invoice.avscorp.in/api/v1/number-series/clx4ns000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "nextNumber": 100
}'

Example response

JSON
{
  "id": "clx4ns000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "docType": "INVOICE",
  "prefix": "INV-",
  "suffix": "",
  "padding": 5,
  "nextNumber": 42,
  "resetYearly": true,
  "updatedAt": "2026-04-01T00:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found, validation_error

DELETE/api/v1/number-series/{id}

Delete a number series

Scope: numberSeries.delete

Parameters

NameInTypeRequiredDescription
idpathstringRequiredNumber series ID.

Example request

curl -X DELETE "https://invoice.avscorp.in/api/v1/number-series/clx4ns000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "deleted": true
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found