MultiSas includes a basic chart of accounts (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/MultiSas/llms.txt
Use this file to discover all available pages before exploring further.
plan contable) module. Account plan entries are scoped to a company and provide a structured foundation for recording financial transactions such as purchases, sales, and inventory movements. Each entry maps a standardized account code to an account name and a broad account type.
Both endpoints in this module use the
Token middleware exclusively — TokenAny is not accepted. The JWT must be issued to a Company identity (i.e. obtained via POST /api/user/login-company). In addition, the caller’s role must be either Admin or Super Admin; any other role receives a 403 No tienes permisos response.POST /api/account_plan/:company_id
Creates a new chart-of-accounts entry and appends it to the company’saccount_plan_company array.
Auth: Token + TokenAuthorize('Admin', 'Super Admin')
Path Parameters
MongoDB ObjectId of the company that owns the account plan entry.
Body Parameters
Standardized account code. Must be one of the following enumerated values:
| Code | Account Name | Class |
|---|---|---|
1101 | Caja | Activo |
1102 | Banco | Activo |
1201 | Clientes | Activo |
1301 | Inventario | Activo |
2101 | Proveedores | Pasivo |
2201 | Cuentas por pagar | Pasivo |
4101 | Ventas | Ingreso |
5101 | Costo de ventas | Costo |
Human-readable name for the account. Must be one of the following enumerated values:
"Caja", "Banco", "Clientes", "Inventario", "Proveedores", "Cuentas por pagar", "Ventas", "Costo de ventas".Broad classification of the account. Accepted values:
"Activo", "Pasivo", "Ingreso", "Costo". Pass an empty string "" to leave unclassified (defaults to "").Example Request
Response
Returns the newly created account plan document on success.Human-readable confirmation message:
"Plan de cuenta creado correctamente".true on success.The persisted account plan document.
GET /api/account_plan/list/:company_id/:pag?/:perpage?
Returns a paginated list of all account plan entries that belong to the specified company, sorted newest-first (_id: -1).
Auth: Token + TokenAuthorize('Admin', 'Super Admin')
Path Parameters
MongoDB ObjectId of the company whose account plan entries are being listed.
Page number to retrieve. Optional — defaults to
1 when omitted. This is a URL segment, not a query string parameter.Number of records per page. Optional — defaults to
10 when omitted. This is also a URL segment.Example Request
Response
Status message:
"Cargando plan de cuentas...".true on success.Array of account plan entry objects. Each item has the same shape as the
new_account_plan object described in the POST response above.Pagination metadata returned by the
Paginate middleware.Pagination
Account plan list endpoints use the/:pag?/:perpage? URL-segment pattern rather than query string parameters. Both segments are optional. The Paginate middleware defaults perpage to 10 when the segment is absent.
| URL pattern | Effect |
|---|---|
/api/account_plan/list/:company_id | Page 1, 10 records per page |
/api/account_plan/list/:company_id/2 | Page 2, 10 records per page |
/api/account_plan/list/:company_id/1/20 | Page 1, 20 records per page |
/api/account_plan/list/:company_id/3/10 | Page 3, 10 records per page |
Paginate middleware computes the skip offset ((pag - 1) * perpage) and injects req.body.skippag and req.body.limit before the controller runs. These values are used directly in the Mongoose .skip() and .limit() calls.
Error Responses
| Status | Body | Cause |
|---|---|---|
401 | {"msj": "Sin autorizacion", "status": false} | No token provided |
403 | {"msj": "Sesion finalizada", "status": false} | Token has expired |
403 | {"msj": "No tienes permisos", "status": false} | Caller role is not Admin or Super Admin |
403 | {"msj": "Completea todos los campos", "status": false} | One or more required body fields are missing (POST only) |
404 | {"msj": "Empresa no encontrada", "status": false} | No company found for the given company_id |
500 | Mongoose/Node error object | Unexpected server error |