POST /api/quotation/register/quotation
Creates a new quotation in the system with complete pricing breakdown, sections, and itemized construction details. All required fields are validated before storage.Headers
Must be
application/jsonRequest Body
Factory or construction site name/identifier.
Fix or property identifier associated with the quotation.
General description of the entire quotation.
Subtotal amount before taxes and additional costs.
Unexpected costs or contingency amount.
IVA (Value Added Tax) amount to be applied.
Administrative costs.
Utility or profit margin amount.
Total price including all costs, taxes, and additional charges.
Array of construction sections. Each section contains description, price, and items.
Description of the construction section.
Total price for this section.
Array of construction items within the section.
Name of the construction item.
Detailed description of the item.
Total cost for this item (typically quantity × unit value).
Quantity of items needed.
Unit of measurement (e.g., “m2”, “units”, “kg”, “m3”).
Unit value/price per individual item.
Request Example
Response
201 - Quotation Created Successfully
201 - Quotation Created Successfully
Success message confirming quotation storage.
The newly created quotation object including MongoDB generated ID.
MongoDB generated quotation ID.
Factory or construction site name.
Fix or property identifier.
General description of the quotation.
Subtotal amount.
Unexpected costs.
IVA amount.
Administrative costs.
Utility amount.
Total price.
Array of sections with items.
Example Response
400 - Bad Request
400 - Bad Request
Returned when the request body is missing required fields or has invalid format.This error is returned when any of the following conditions are not met:
Error message describing the validation failure.
Invalid JSON Format
factoryfield is missing or emptyfixfield is missing or emptydescription_quotationfield is missing or emptysubtotalis undefinedunexpectedis undefinedivais undefinedadministratitiveis undefinedutilityis undefinedtotal_priceis undefinedsectionsis not an array or is missing
500 - Internal Server Error
500 - Internal Server Error
Validation Rules
The endpoint performs strict validation on the request body:- Required String Fields:
factory,fix,description_quotationmust be present and non-empty - Required Number Fields: All pricing fields must be defined (can be 0, but not undefined):
subtotalunexpectedivaadministratitiveutilitytotal_price
- Sections Array: Must be a valid array (can be empty, but must be an array)
- Section Structure: Each section must contain:
description_sections(string, required)section_price(number, required)items(array, required)
- Item Structure: Each item must contain:
item_name(string, required)item_description(string, required)item_total(number, required)quantity(number, required)unity(string, required)item_value(number, required)
Pricing Structure
The quotation follows this pricing hierarchy:Implementation Reference
The create quotation endpoint is implemented in:- Route:
/home/daytona/workspace/source/src/routes/quotationRoutes.js:9 - Controller:
/home/daytona/workspace/source/src/controllers/quotationController.js:14