This guide walks you through cloning the repository, wiring up environment variables, registering your first company, and making an authenticated API request — all in about five minutes. You will need Node.js 18+, a running MongoDB instance (local or Atlas), andDocumentation 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.
curl (or any HTTP client).
Configure environment variables
Create a
.env file in the project root with the following three variables. These are read by src/config.js via dotenv at startup..env
| Variable | Description |
|---|---|
PORT | The TCP port Express will listen on. |
MONGODB_URL | Full MongoDB connection string, including database name. |
SECRET | Signing secret used by jsonwebtoken to sign and verify all JWTs. |
Start the development server
Run the dev server with nodemon. The process will restart automatically on file changes.Expected startup output:If you see a
Error connecting to DB → message, verify that MONGODB_URL in your .env points to a reachable MongoDB instance.Register a company
Use A successful response returns HTTP Save the
POST /api/user/register-company to create your first tenant. Supply a unique nit_company (the company tax ID), the founder’s name, and a type_company that matches one of the supported verticals (sublimacion, restaurante, farmacia, etc.).200 with the new company document:_id value — you will use it as company_id in subsequent requests.Log in and retrieve a JWT
Call Example response:Copy the value of
POST /api/user/login-company with the company’s nit_company and password. The API returns a signed JWT valid for 365 days."token" — you will pass it in every subsequent request.Make an authenticated request
Pass the token in the A successful response:
token-access header as Bearer <token>. The example below lists all active sub-users for a company.Every protected endpoint in MultiSas requires the
token-access: Bearer <token> header. Requests that omit the header receive HTTP 401 {"msj": "Sin autorizacion", "status": false}. Requests with an expired token receive HTTP 403 {"msj": "Sesion finalizada", "status": false}.Next Steps
- Read the Authentication guide to understand the full JWT middleware stack, sub-user flows, and role-based access control.
- Browse the module references to explore available endpoints for Sublimation, Restaurant, Pharmacy, Accounting, and HR.