Endpoint
src/controllers/quotationController.js:14.
Request Body
All fields are required. The request must include a complete quotation object with at least one section containing at least one item.Required Fields
Root Level Fields
Root Level Fields
| Field | Type | Description |
|---|---|---|
factory | String | Factory or project identifier |
fix | String | Fix reference number |
description_quotation | String | Overall description of the quotation |
subtotal | Number | Subtotal before additional costs |
unexpected | Number | Unexpected costs or contingency |
iva | Number | VAT/IVA tax amount |
administratitive | Number | Administrative costs |
utility | Number | Utility or profit margin |
total_price | Number | Final total price |
sections | Array | Array of section objects (must have at least one) |
Section Object Fields
Section Object Fields
Each object in the
sections array must contain:| Field | Type | Description |
|---|---|---|
description_sections | String | Description of the section |
section_price | Number | Total price for this section |
items | Array | Array of item objects (must have at least one) |
Item Object Fields
Item Object Fields
Each object in the
items array must contain:| Field | Type | Description |
|---|---|---|
item_name | String | Name of the item |
item_description | String | Detailed item description |
item_total | Number | Total cost for this item (quantity × item_value) |
quantity | Number | Quantity of items |
unity | String | Unit of measurement |
item_value | Number | Unit price per item |
Creating a Quotation
Structure sections
Group related items into logical sections (e.g., “Foundation Work”, “Electrical”, “Plumbing”).
Request Example
Basic Quotation with Single Section
Complete Quotation with Multiple Sections
Response
Success Response (201 Created)
Error Responses
400 Bad Request - Invalid Format
400 Bad Request - Invalid Format
- Any required root-level field is missing
sectionsis not an array- Any numeric field is undefined (note: 0 is valid)
- Required nested fields in sections or items are missing
500 Internal Server Error
500 Internal Server Error
Validation Logic
The controller implements validation atsrc/controllers/quotationController.js:18-24:
Notice that numeric fields check for
undefined rather than falsy values. This means you can send 0 as a valid value for any numeric field.Best Practices
Consider these tips:
- Use descriptive section names that group related work
- Include detailed item descriptions for clarity
- Use standard units of measurement (m2, m3, kg, units, meters)
- Double-check all calculations before submitting