Number Series
Auto-numbering configuration (prefix/suffix/padding) per document type.
GET
/api/v1/number-seriesList number series
Scope:
numberSeries.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | number | Optional | 1-based page number. |
limit | query | number | Optional | Page size, max 200. |
Example request
curl "https://pre-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-seriesCreate a number series
Scope:
numberSeries.createdocType has a unique constraint per organization — one series per document type.
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
docType | string | Required | one of: QUOTE, SALES_ORDER, INVOICE, PAYMENT_RECEIVED, PURCHASE_ORDER, BILL, PAYMENT_MADE, EXPENSE, CREDIT_NOTE, DEBIT_NOTE, DEBIT_ADJUSTMENT, CREDIT_ADJUSTMENT |
prefix | string | Optional | max length 40; default "" |
suffix | string | Optional | max length 20; default "" |
padding | integer | Optional | min 1; max 10; default 5 |
nextNumber | integer | Optional | min 1; max 9007199254740991; default 1 |
resetYearly | boolean | Optional | default true |
Example request
curl -X POST "https://pre-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.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Number series ID. |
Example request
curl "https://pre-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.updatedocType is immutable and cannot be changed after creation.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Number series ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
prefix | string | Optional | max length 40 |
suffix | string | Optional | max length 20 |
padding | integer | Optional | min 1; max 10 |
nextNumber | integer | Optional | min 1; max 9007199254740991 |
resetYearly | boolean | Optional | — |
Example request
curl -X PATCH "https://pre-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.deleteParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Number series ID. |
Example request
curl -X DELETE "https://pre-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