Series API
Configure auto-numbering series for documents (invoices, bookings, quotes, etc.). Each module has a prefix, separator, and next number that combine to generate the next document number.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/series/:orgId/list | List all series configurations |
| GET | /api/series/:orgId/:module | Get series for a specific module |
| PUT | /api/series/:orgId/:module/update | Update series configuration |
| GET | /api/series/:orgId/:module/preview | Preview the next generated number |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
orgId | string | Organization ID |
module | string | Module name (e.g. invoice, booking, quote, payment, expense, credit_note) |
List All Series
GET /api/series/:orgId/listResponse — 200 OK
json
{
"success": true,
"data": [
{
"_id": "665e5f6a7b8c9d0e1f2a3b4c",
"module": "invoice",
"prefix": "INV",
"separator": "-",
"nextNumber": 1042,
"preview": "INV-1042"
},
{
"_id": "665e5f6a7b8c9d0e1f2a3b4d",
"module": "booking",
"prefix": "BKG",
"separator": "-",
"nextNumber": 587,
"preview": "BKG-587"
},
{
"_id": "665e5f6a7b8c9d0e1f2a3b4e",
"module": "quote",
"prefix": "QT",
"separator": "-",
"nextNumber": 230,
"preview": "QT-230"
},
{
"_id": "665e5f6a7b8c9d0e1f2a3b4f",
"module": "payment",
"prefix": "PAY",
"separator": "-",
"nextNumber": 890,
"preview": "PAY-890"
},
{
"_id": "665e5f6a7b8c9d0e1f2a3b50",
"module": "expense",
"prefix": "EXP",
"separator": "/",
"nextNumber": 145,
"preview": "EXP/145"
},
{
"_id": "665e5f6a7b8c9d0e1f2a3b51",
"module": "credit_note",
"prefix": "CN",
"separator": "-",
"nextNumber": 38,
"preview": "CN-38"
}
]
}Get Series by Module
GET /api/series/:orgId/:moduleExample: GET /api/series/663f1a2b.../invoice
Response — 200 OK
json
{
"success": true,
"data": {
"_id": "665e5f6a7b8c9d0e1f2a3b4c",
"module": "invoice",
"prefix": "INV",
"separator": "-",
"nextNumber": 1042,
"orgId": "663f1a2b3c4d5e6f7a8b9c0d",
"createdAt": "2026-02-20T08:00:00.000Z",
"updatedAt": "2026-02-23T09:30:00.000Z"
}
}Update Series
PUT /api/series/:orgId/:module/updateRequest Body
json
{
"prefix": "INV",
"separator": "/",
"nextNumber": 2001
}Response — 200 OK
json
{
"success": true,
"message": "Series updated successfully",
"data": {
"_id": "665e5f6a7b8c9d0e1f2a3b4c",
"module": "invoice",
"prefix": "INV",
"separator": "/",
"nextNumber": 2001,
"orgId": "663f1a2b3c4d5e6f7a8b9c0d",
"createdAt": "2026-02-20T08:00:00.000Z",
"updatedAt": "2026-02-23T12:00:00.000Z"
}
}Preview Next Number
GET /api/series/:orgId/:module/previewReturns the next number that will be generated without incrementing the counter.
Response — 200 OK
json
{
"success": true,
"data": {
"module": "invoice",
"prefix": "INV",
"separator": "/",
"nextNumber": 2001,
"preview": "INV/2001"
}
}