Skip to main content

Quotations

List All Quotations

curl -X GET "${VITE_BASE_URL}/quotation_admin" \
  -H "Authorization: Bearer <token>"
Retrieves a list of all quotations. Authentication Required: Yes

Response

data
array
Array of quotation objects
id
number
Quotation unique identifier
uuid
string
Quotation UUID for public access
client_id
number
Associated client ID
client
object
Client information
total
number
Quotation total amount
subtotal
number
Subtotal before taxes
tax
number
Tax amount
status
string
Quotation status (draft, sent, approved, rejected)
items
array
Array of quotation line items
created_at
string
Creation timestamp
valid_until
string
Quotation expiration date
{
  "data": [
    {
      "id": 1,
      "uuid": "550e8400-e29b-41d4-a716-446655440000",
      "client_id": 5,
      "client": {
        "id": 5,
        "name": "Empresa ABC",
        "email": "[email protected]"
      },
      "subtotal": 10000.00,
      "tax": 1600.00,
      "total": 11600.00,
      "status": "sent",
      "items": [
        {
          "product_id": 1,
          "product_name": "Product A",
          "quantity": 10,
          "unit_price": 1000.00,
          "total": 10000.00
        }
      ],
      "created_at": "2024-03-01T10:00:00Z",
      "valid_until": "2024-03-31T23:59:59Z"
    }
  ]
}

Get Quotation by ID

curl -X GET "${VITE_BASE_URL}/quotation_admin/1" \
  -H "Authorization: Bearer <token>"
Retrieves a single quotation by ID or UUID. Authentication Required: Yes

Path Parameters

id
number | string
required
Quotation ID or UUID

Response

id
number
Quotation unique identifier
uuid
string
Quotation UUID
client_id
number
Associated client ID
client
object
Full client information
items
array
Detailed line items with product information
subtotal
number
Subtotal amount
tax
number
Tax amount
total
number
Total amount
notes
string
Quotation notes or terms
status
string
Current status
created_by
object
User who created the quotation
{
  "id": 1,
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "client_id": 5,
  "client": {
    "id": 5,
    "name": "Empresa ABC",
    "email": "[email protected]",
    "rfc": "ABC123456XYZ"
  },
  "items": [
    {
      "id": 1,
      "product_id": 1,
      "product": {
        "id": 1,
        "name": "Product A",
        "description": "High quality product"
      },
      "quantity": 10,
      "unit_price": 1000.00,
      "discount": 0,
      "total": 10000.00
    }
  ],
  "subtotal": 10000.00,
  "tax": 1600.00,
  "total": 11600.00,
  "notes": "Payment terms: Net 30",
  "status": "sent",
  "created_by": {
    "id": 1,
    "name": "John Doe"
  },
  "created_at": "2024-03-01T10:00:00Z",
  "valid_until": "2024-03-31T23:59:59Z"
}

Create Quotation

curl -X POST "${VITE_BASE_URL}/quotation_admin" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: multipart/form-data" \
  -F 'client_id=5' \
  -F 'items=[{"product_id":1,"quantity":10,"unit_price":1000}]' \
  -F 'notes=Payment terms: Net 30' \
  -F 'valid_until=2024-03-31' \
  -F 'attachments[]=@/path/to/file.pdf'
Creates a new quotation with optional file attachments. Authentication Required: Yes
Content-Type: multipart/form-data

Request Body

client_id
number
required
Client ID for this quotation
items
array
required
Array of line itemsEach item should have:
  • product_id (number): Product ID
  • quantity (number): Quantity
  • unit_price (number): Unit price
  • discount (number, optional): Discount percentage
notes
string
Quotation notes or payment terms
valid_until
string
Expiration date (YYYY-MM-DD format)
attachments
file[]
Optional file attachments
status
string
Initial status (default: “draft”)

Response

id
number
Created quotation ID
uuid
string
Generated UUID for the quotation
message
string
Success message
{
  "id": 42,
  "uuid": "7d9e4b2a-3c1f-4e8a-9d6b-5f2a3e7c8d1b",
  "message": "Quotation created successfully"
}

Download Quotation PDF

curl -X GET "${VITE_BASE_URL}/quotation_admin/550e8400-e29b-41d4-a716-446655440000/pdf" \
  -H "Authorization: Bearer <token>" \
  --output quotation.pdf
Generates and downloads a PDF version of the quotation. Authentication Required: Yes
Response Type: Binary (PDF file)

Path Parameters

uuid
string
required
Quotation UUID

Response

Returns a PDF file as binary data with the following headers:
  • Content-Type: application/pdf
  • Content-Disposition: attachment; filename="quotation-{uuid}.pdf"
Binary PDF data

Build docs developers (and LLMs) love