🏗 AlumSaleh API

v1.0 Base URL: /api ⚡ Health
Authentication
POST /api/auth/login Obtain a JWT token ▾
Content-Type: application/json

Returns a token to use as Authorization: Bearer <token> header, or ?token=... for direct PDF links.

FieldTypeLocationNotes
username *stringBody (JSON)Your account username
password *stringBody (JSON)Your account password
Orders
GET/api/ordersList all orders🔒▾
Query params: status, search, page, limit
POST/api/ordersCreate a new order🔒▾
Content-Type: application/json
Body (JSON): clientName *, projectName, projectAddress, dueDate (YYYY-MM-DD), notes, status (draft|in_production|done|cancelled), customerId
GET/api/orders/statsOrder statistics🔒▾

No additional parameters.

GET/api/orders/:idGet order with items and cuts🔒▾

No additional parameters.

PUT/api/orders/:idUpdate order + replace all items🔒▾
Content-Type: application/json
Body (JSON): same fields as POST. Include items array to replace all items.
PATCH/api/orders/:id/statusChange order status🔒▾
Content-Type: application/json
Body (JSON): status * — one of draft, in_production, done, cancelled
DELETE/api/orders/:idDelete an order🔒▾

No additional parameters.

POST/api/orders/:id/itemsAdd item to order (auto-calculates cuts)🔒▾
Content-Type: application/json
Body (JSON): seriesId *, openingType *, widthMM *, heightMM *, quantity, numSashes, location, color, glazing, accessories (array)
PUT/api/orders/:id/items/:itemIdUpdate an item (recalculates cuts)🔒▾
Content-Type: application/json
Body (JSON): same fields as POST item
DELETE/api/orders/:id/items/:itemIdDelete an item🔒▾

No additional parameters.

GET/api/orders/:id/cutsCalculated cuts grouped by bar🔒▾
Query param: barLength (default: 6000)
POST/api/orders/:id/recalculateRecalculate all cuts for order🔒▾
No body required.
PDF Generation

All endpoints accept ?token=JWT for direct browser access. Add ?download=true to force download.

GET/api/orders/:id/pdf/productionFull production order PDF🔒▾

No additional parameters.

GET/api/orders/:id/pdf/glassGlass purchase order PDF🔒▾

No additional parameters.

GET/api/orders/:id/pdf/cutsWorkshop cut sheet PDF🔒▾
Query: barLength
GET/api/orders/:id/pdf/profilesProfiles purchase order PDF🔒▾
Query: barLength
Catalog
GET/api/catalog/seriesList all series (20 KLIL series)🔒▾

No additional parameters.

GET/api/catalog/series/:idGet a single series🔒▾
Path param :id example: belgi_7300
GET/api/catalog/series/:id/rulesGet cutting formulas for a series🔒▾

No additional parameters.

PUT/api/catalog/series/:id/rulesUpdate cutting formulas🔒▾
Content-Type: application/json
Body (JSON): openingTypes object with framePieces and glassPieces arrays
Settings
GET/api/settingsGet all business settings🔒▾

No additional parameters.

PUT/api/settingsUpdate settings🔒▾
Content-Type: application/json
Body (JSON): businessName, phone, businessId, vatRate, colors, glazingOptions, accessories, commonLocations, seriesPrices
System
GET/healthServer + DB health check▾

No additional parameters.

GET/api/healthServer + DB health check (alias)▾

No additional parameters.