Skip to main content
Quote blocks are the service line items that make up a quote. They are grouped into categories. These endpoints are public — no authentication required.
All endpoints in this page are rate limited to 60 requests per minute.

GET /api/quote-blocks

Returns all active categories with their active blocks, ordered by order ascending.

Request

No parameters required.
curl https://your-domain.com/api/quote-blocks

Response

success
boolean
required
Always true on a successful response.
categories
object[]
required
Ordered array of active category objects.

Examples

curl https://your-domain.com/api/quote-blocks
200 — success
{
  "success": true,
  "categories": [
    {
      "id": 1,
      "name": "Web Development",
      "description": "Frontend and backend web services",
      "expanded": true,
      "blocks": [
        {
          "id": 10,
          "name": "Landing Page",
          "description": "Single-page marketing site",
          "type": "fixed",
          "category_id": 1,
          "base_price": 1500.00,
          "default_hours": 40,
          "config": {},
          "order": 1
        }
      ]
    }
  ]
}

GET /api/quote-blocks/category/

Returns all active blocks belonging to a specific category, ordered by order ascending.

Path parameters

categoryId
integer
required
The ID of the category whose blocks you want to retrieve.

Request

curl https://your-domain.com/api/quote-blocks/category/1

Response

Returns a JSON array of QuoteBlock model objects. Each object contains the full model attributes.
200 — success
[
  {
    "id": 10,
    "name": "Landing Page",
    "description": "Single-page marketing site",
    "type": "fixed",
    "category_id": 1,
    "base_price": "1500.00",
    "default_hours": 40,
    "config": null,
    "is_active": true,
    "order": 1,
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z"
  }
]
If the category does not exist, this endpoint returns an empty array rather than a 404 error.

POST /api/quote-blocks/calculate

Calculates the price for a specific block given its quantity and type-specific parameters. The pricing logic varies by block type and uses the block’s formula field when present; otherwise it applies type-specific rules.

Request body

block_id
integer
required
The ID of the QuoteBlock to price. Must exist in the quote_blocks table.
quantity
integer
default:"1"
Number of units. Minimum 1.
parameters
object
Type-specific parameters used by the pricing formula. Contents vary by block type:

Response

success
boolean
required
true on success.
price
number
Calculated total price as a float.
formatted_price
string
Price formatted as a string: "$1,234.56 MXN".
unit_price
number
Price per unit (price / quantity).
message
string
Confirmation: "Precio calculado exitosamente".

Examples

cURL
curl --request POST \
  https://your-domain.com/api/quote-blocks/calculate \
  --header "Content-Type: application/json" \
  --data '{
    "block_id": 5,
    "quantity": 2,
    "parameters": {
      "complexity": "high",
      "estimatedHours": 80,
      "requiresIntegration": true
    }
  }'
200 — success
{
  "success": true,
  "price": 95000.00,
  "formatted_price": "$95,000.00 MXN",
  "unit_price": 47500.00,
  "message": "Precio calculado exitosamente"
}
422 — validation error
{
  "success": false,
  "errors": {
    "block_id": ["The block id field is required."],
    "quantity": ["The quantity field must be at least 1."]
  }
}

Build docs developers (and LLMs) love