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
Array of quotation objectsQuotation unique identifier
Quotation UUID for public access
Quotation status (draft, sent, approved, rejected)
Array of quotation line items
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
Response
Quotation unique identifier
Detailed line items with product information
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 for this quotation
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
Quotation notes or payment terms
Expiration date (YYYY-MM-DD format)
Optional file attachments
Initial status (default: “draft”)
Response
Generated UUID for the quotation
{
"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
Response
Returns a PDF file as binary data with the following headers:
Content-Type: application/pdf
Content-Disposition: attachment; filename="quotation-{uuid}.pdf"