Skip to content

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

MethodPathDescription
GET/api/series/:orgId/listList all series configurations
GET/api/series/:orgId/:moduleGet series for a specific module
PUT/api/series/:orgId/:module/updateUpdate series configuration
GET/api/series/:orgId/:module/previewPreview the next generated number

Path Parameters

ParameterTypeDescription
orgIdstringOrganization ID
modulestringModule name (e.g. invoice, booking, quote, payment, expense, credit_note)

List All Series

GET /api/series/:orgId/list

Response — 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/:module

Example: 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/update

Request 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/preview

Returns 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"
  }
}

Released under the MIT License.