Skip to main content

GET /api/quotation/quotations

Retrieves a list of all quotations stored in the system. Each quotation includes factory information, pricing details, and itemized sections with construction items.

Headers

No special headers required for this endpoint.

Query Parameters

This endpoint does not accept query parameters. It returns all quotations in the system.

Request Example

curl -X GET http://localhost:3000/api/quotation/quotations

Response

Returns an array of quotation objects.
quotations
array
Array of quotation objects.
_id
string
MongoDB generated quotation ID.
factory
string
Factory or construction site name.
fix
string
Fix or property identifier.
description_quotation
string
General description of the quotation.
subtotal
number
Subtotal amount before taxes and additional costs.
unexpected
number
Unexpected costs or contingency amount.
iva
number
IVA (Value Added Tax) amount.
administratitive
number
Administrative costs.
utility
number
Utility or profit margin amount.
total_price
number
Total price including all costs and taxes.
sections
array
Array of construction sections.
sections[].description_sections
string
Description of the construction section.
sections[].section_price
number
Total price for this section.
sections[].items
array
Array of items within the section.
sections[].items[].item_name
string
Name of the construction item.
sections[].items[].item_description
string
Detailed description of the item.
sections[].items[].item_total
number
Total cost for this item (quantity × unit value).
sections[].items[].quantity
number
Quantity of items.
sections[].items[].unity
string
Unit of measurement (e.g., “m2”, “units”, “kg”).
sections[].items[].item_value
number
Unit value/price per item.
Example Response
[
  {
    "_id": "507f1f77bcf86cd799439011",
    "factory": "Construction Site A",
    "fix": "Building 1",
    "description_quotation": "Complete construction quotation for residential building",
    "subtotal": 50000000,
    "unexpected": 2500000,
    "iva": 9500000,
    "administratitive": 3000000,
    "utility": 5000000,
    "total_price": 70000000,
    "sections": [
      {
        "description_sections": "Foundation and Structure",
        "section_price": 25000000,
        "items": [
          {
            "item_name": "Concrete",
            "item_description": "High-strength concrete for foundation",
            "item_total": 15000000,
            "quantity": 100,
            "unity": "m3",
            "item_value": 150000
          },
          {
            "item_name": "Steel Rebar",
            "item_description": "Reinforcement steel bars",
            "item_total": 10000000,
            "quantity": 5000,
            "unity": "kg",
            "item_value": 2000
          }
        ]
      },
      {
        "description_sections": "Walls and Finishes",
        "section_price": 25000000,
        "items": [
          {
            "item_name": "Brick",
            "item_description": "Standard construction brick",
            "item_total": 12000000,
            "quantity": 20000,
            "unity": "units",
            "item_value": 600
          },
          {
            "item_name": "Paint",
            "item_description": "Interior wall paint",
            "item_total": 5000000,
            "quantity": 500,
            "unity": "m2",
            "item_value": 10000
          }
        ]
      }
    ]
  }
]
Returned when an error occurs while retrieving quotations from the database.
message
string
Error message.
error
object
Error details object.
Example Response
{
  "message": "Error al obtener cotizaciones",
  "error": {}
}

Response Structure

The endpoint returns a flat array of quotations. Each quotation contains:
  • Top-level pricing: Overall costs, taxes, and totals
  • Sections: Major construction divisions (e.g., foundation, walls, electrical)
  • Items: Specific materials or work items within each section

Use Cases

  • Viewing all quotations for a construction company
  • Generating reports on pending or active quotations
  • Analyzing pricing across multiple projects
  • Exporting quotation data for external systems

Implementation Reference

The list quotations endpoint is implemented in:
  • Route: /home/daytona/workspace/source/src/routes/quotationRoutes.js:8
  • Controller: /home/daytona/workspace/source/src/controllers/quotationController.js:4

Build docs developers (and LLMs) love