Skip to main content

Overview

The Quotations API allows you to manage sales quotations (also known as estimates or proformas). Quotations can be converted to invoices once approved by the customer.

Quotation Object

The quotation object structure is similar to invoices:
id
integer
Unique identifier for the quotation
workspace_id
integer
ID of the workspace this quotation belongs to
contact_id
integer
ID of the customer contact
document_subtype_id
integer
ID of the document subtype
document_number
string
Quotation number (e.g., “QT-0001”)
issue_date
date
Date the quotation was issued
due_date
date
Expiration date for this quotation
status
enum
Quotation status: draft, sent, approved, rejected, converted, cancelled
subtotal_amount
decimal
Subtotal before taxes and discounts
tax_amount
decimal
Total tax amount
discount_amount
decimal
Total discount amount
total_amount
decimal
Final total amount
notes
string
Additional notes or terms
items
array
Array of quotation line items

List Quotations

Retrieve a paginated list of quotations.

Query Parameters

page
integer
default:"1"
Page number for pagination
per_page
integer
default:"15"
Number of items per page
filter[status]
string
Filter by status: draft, sent, approved, converted, cancelled
filter[contact_id]
integer
Filter by customer contact ID
sort
string
default:"-issue_date"
Sort field (prefix with - for descending)

Response

{
  "data": [
    {
      "id": 5,
      "workspace_id": 2,
      "contact_id": 45,
      "document_subtype_id": 8,
      "document_number": "QT-0005",
      "issue_date": "2024-03-15",
      "due_date": "2024-03-30",
      "status": "sent",
      "subtotal_amount": "2500.00",
      "tax_amount": "450.00",
      "discount_amount": "0.00",
      "total_amount": "2950.00",
      "notes": "Valid for 15 days",
      "created_at": "2024-03-15T09:00:00Z",
      "updated_at": "2024-03-15T09:00:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 2,
    "per_page": 15,
    "total": 18
  }
}

Example

curl -X GET "https://acme.yourdomain.com/api/v1/quotations?filter[status]=sent" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Get Quotation

Retrieve a specific quotation by ID.

Path Parameters

id
integer
required
Quotation ID

Response

{
  "data": {
    "id": 5,
    "workspace_id": 2,
    "contact_id": 45,
    "document_number": "QT-0005",
    "issue_date": "2024-03-15",
    "due_date": "2024-03-30",
    "status": "sent",
    "total_amount": "2950.00",
    "contact": {
      "id": 45,
      "name": "Acme Corporation",
      "email": "[email protected]"
    },
    "items": [
      {
        "id": 12,
        "product_id": 78,
        "description": "Premium Product",
        "quantity": "20.00",
        "unit_price": "125.00",
        "discount": "0.00",
        "subtotal": "2500.00",
        "tax_amount": "450.00",
        "total": "2950.00",
        "product": {
          "id": 78,
          "name": "Premium Product",
          "sku": "PROD-001"
        },
        "taxes": [
          {
            "id": 1,
            "name": "ITBIS",
            "rate": "18.00"
          }
        ]
      }
    ]
  }
}

Create Quotation

Create a new quotation.

Request Body

contact_id
integer
required
Customer contact ID
document_subtype_id
integer
required
Document subtype ID
issue_date
date
required
Quotation issue date (YYYY-MM-DD)
due_date
date
Expiration date (YYYY-MM-DD)
notes
string
Additional notes or terms
items
array
required
Array of quotation line items (same structure as invoice items)
items[].product_id
integer
required
Product ID
items[].quantity
decimal
required
Quantity
items[].unit_price
decimal
required
Unit price
items[].discount
decimal
default:"0"
Discount amount
items[].tax_ids
array
Array of tax IDs

Response

{
  "data": {
    "id": 18,
    "workspace_id": 2,
    "contact_id": 45,
    "document_number": "QT-0018",
    "issue_date": "2024-03-20",
    "status": "draft",
    "total_amount": "2950.00",
    "created_at": "2024-03-20T10:30:00Z"
  },
  "message": "Cotización creada exitosamente."
}

Example

curl -X POST https://acme.yourdomain.com/api/v1/quotations \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contact_id": 45,
    "document_subtype_id": 8,
    "issue_date": "2024-03-20",
    "due_date": "2024-04-04",
    "notes": "Valid for 15 days",
    "items": [
      {
        "product_id": 78,
        "quantity": 20,
        "unit_price": 125.00,
        "tax_ids": [1]
      }
    ]
  }'
Quotations are created with status draft by default. They do not affect inventory until converted to invoices.

Update Quotation

Update an existing quotation.

Path Parameters

id
integer
required
Quotation ID

Request Body

Same as Create Quotation. All fields are optional.

Response

{
  "data": {
    "id": 18,
    "total_amount": "3200.00",
    "updated_at": "2024-03-20T11:00:00Z"
  },
  "message": "Cotización actualizada exitosamente."
}

Delete Quotation

Delete a quotation.

Path Parameters

id
integer
required
Quotation ID

Response

{
  "message": "Cotización eliminada exitosamente."
}

Convert to Invoice

Convert an approved quotation to an invoice. This creates a new invoice with the same items and marks the quotation as converted.

Path Parameters

id
integer
required
Quotation ID

Response

{
  "message": "Redirecting to invoice creation...",
  "redirect_url": "/invoices/create-from-quotation/5"
}

Example

curl -X POST https://acme.yourdomain.com/api/v1/quotations/5/convert-to-invoice \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Quotations can only be converted once. Attempting to convert a quotation with status converted or cancelled will result in an error.

Download Quotation PDF

Download quotation as PDF document.

Path Parameters

id
integer
required
Quotation ID

Response

Returns a PDF file with Content-Type: application/pdf.

Example

curl -X GET https://acme.yourdomain.com/api/v1/quotations/5/pdf \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -o quotation-005.pdf

Bulk PDF Download

Download multiple quotations as a single ZIP file containing PDFs.

Request Body

quotation_ids
array
required
Array of quotation IDs to download

Example

curl -X POST https://acme.yourdomain.com/api/v1/quotations/bulk/pdf \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"quotation_ids": [1, 2, 3, 4, 5]}' \
  -o quotations.zip

Invoices

Convert quotations to invoices

Contacts

Manage customer information

Products

Product catalog for quotations

Build docs developers (and LLMs) love