title: Quotes
Quotes
Documentation for managing quotes will go here.
Endpoints for managing quotes.
List Quotes
GET /api/quotes
Description: Retrieves a paginated list of quotes. Supports filtering by status and search by quote number or client name.
Authorization: API Key (Bearer Token) required.
Query Parameters:
- Name
page
- Type
- integer
- Description
Page number for pagination.
- Name
limit
- Type
- integer
- Description
Number of quotes per page.
- Name
sortBy
- Type
- string
- Description
Field to sort by (e.g.,
createdAt
,expiryDate
).
- Name
sortOrder
- Type
- string
- Description
Sort order (
asc
ordesc
).
- Name
status
- Type
- string
- Description
Filter by quote status (
draft
,sent
,accepted
,rejected
,expired
,all
).
- Name
search
- Type
- string
- Description
Search term for quote number or client name.
Request
curl -X GET "https://your-summit-instance.com/api/quotes?status=accepted&limit=5" \
-H "Authorization: Bearer <YOUR_API_TOKEN>"
Response (Success: 200 OK)
{
"data": [
{
"id": 1,
"companyId": 1,
"clientId": 1,
"quoteNumber": "QUO-2023-001",
"status": "accepted",
"issueDate": "2023-09-01",
"expiryDate": "2023-09-30",
"subtotal": "1000.00",
"tax": "100.00",
"taxRate": "10.00",
"total": "1100.00",
"notes": "Quote for services.",
"createdAt": "2023-09-01T10:00:00.000Z",
"updatedAt": "2023-09-10T14:00:00.000Z",
"acceptedAt": "2023-09-10T14:00:00.000Z",
"softDelete": false,
"convertedToInvoiceId": null,
"client": {
"id": 1,
"name": "Client Alpha",
"email": "[email protected]"
},
"company": {
"id": 1,
"name": "My Company",
"defaultCurrency": "IDR"
// ... other company fields
},
"items": [
{
"id": 1,
"quoteId": 1,
"description": "Service A",
"quantity": "10.00",
"unitPrice": "100.00",
"amount": "1000.00"
}
]
}
],
"total": 1,
"page": 1,
"limit": 5,
"totalPages": 1
}
Create Quote
POST /api/quotes
Description: Creates a new quote. The subtotal
, tax
, and total
will be calculated based on the items
and taxRate
provided.
Authorization: API Key (Bearer Token) required.
Request Body: application/json
- Name
clientId
- Type
- integer
- Description
ID of the client.
- Name
quoteNumber
- Type
- string
- Description
Unique quote number.
- Name
status
- Type
- string
- Description
Quote status (
draft
,sent
,accepted
,rejected
,expired
).
- Name
issueDate
- Type
- string
- Description
Issue date (YYYY-MM-DD).
- Name
expiryDate
- Type
- string
- Description
Expiry date (YYYY-MM-DD).
- Name
taxRate
- Type
- number
- Description
Tax rate as a percentage (e.g., 10 for 10%).
- Name
notes
- Type
- string
- Description
Additional notes for the quote.
- Name
items
- Type
- array
- Description
Array of quote items.
Quote Items (items[]
):
- Name
description
- Type
- string
- Description
Description of the item.
- Name
quantity
- Type
- number
- Description
Quantity of the item.
- Name
unitPrice
- Type
- string
- Description
Unit price of the item (as string, e.g., "100.00").
Request
curl -X POST "https://your-summit-instance.com/api/quotes" \
-H "Authorization: Bearer <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"clientId": 1,
"quoteNumber": "QUO-2023-002",
"status": "draft",
"issueDate": "2023-11-01",
"expiryDate": "2023-11-15",
"taxRate": 5,
"notes": "Initial project proposal.",
"items": [
{
"description": "Consulting Hours",
"quantity": 10,
"unitPrice": "75.00"
}
]
}'
Response (Success: 201 Created)
// Similar structure to "List Quotes" items, but for a single quote
// Example based on request:
{
"id": 2, // Example ID
"companyId": 1,
"clientId": 1,
"quoteNumber": "QUO-2023-002",
"status": "draft",
"issueDate": "2023-11-01",
"expiryDate": "2023-11-15",
"subtotal": "750.00", // Calculated: 10 * 75.00
"taxRate": "5.00",
"tax": "37.50", // Calculated: 750.00 * 0.05
"total": "787.50", // Calculated: 750.00 + 37.50
"notes": "Initial project proposal.",
"createdAt": "2023-10-28T10:00:00.000Z", // Example timestamp
"updatedAt": "2023-10-28T10:00:00.000Z", // Example timestamp
"acceptedAt": null,
"softDelete": false,
"convertedToInvoiceId": null,
"client": { /* ...client details... */ },
"company": { /* ...company details... */ },
"items": [
{
"id": 2, // Example ID
"quoteId": 2,
"description": "Consulting Hours",
"quantity": "10.00",
"unitPrice": "75.00",
"amount": "750.00"
}
]
}
Get Quote Details
GET /api/quotes/{quoteId}
Description: Retrieves the details of a specific quote, including its items, client, and company information.
Authorization: API Key (Bearer Token) required.
Path Parameters:
- Name
quoteId
- Type
- integer
- Description
ID of the quote to retrieve.
Request
curl -X GET "https://your-summit-instance.com/api/quotes/1" \
-H "Authorization: Bearer <YOUR_API_TOKEN>"
Response (Success: 200 OK)
// See response example for "List Quotes" (single quote object from the data array)
{
"id": 1,
"companyId": 1,
"clientId": 1,
"quoteNumber": "QUO-2023-001",
"status": "accepted",
"issueDate": "2023-09-01",
"expiryDate": "2023-09-30",
"subtotal": "1000.00",
"tax": "100.00",
"taxRate": "10.00",
"total": "1100.00",
"notes": "Quote for services.",
"createdAt": "2023-09-01T10:00:00.000Z",
"updatedAt": "2023-09-10T14:00:00.000Z",
"acceptedAt": "2023-09-10T14:00:00.000Z",
"softDelete": false,
"convertedToInvoiceId": null,
"client": {
"id": 1,
"name": "Client Alpha",
"email": "[email protected]"
},
"company": {
"id": 1,
"name": "My Company",
"defaultCurrency": "IDR"
// ... other company fields
},
"items": [
{
"id": 1,
"quoteId": 1,
"description": "Service A",
"quantity": "10.00",
"unitPrice": "100.00",
"amount": "1000.00"
}
]
}
Update Quote
PUT /api/quotes/{quoteId}
Description: Updates an existing quote. subtotal
, tax
, and total
are recalculated.
Authorization: API Key (Bearer Token) required.
Path Parameters:
- Name
quoteId
- Type
- integer
- Description
ID of the quote to update.
Request Body: application/json
(Same structure as Create Quote. All fields are optional.)
Request
curl -X PUT "https://your-summit-instance.com/api/quotes/1" \
-H "Authorization: Bearer <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"clientId": 1,
"quoteNumber": "QUO-2023-001-R1",
"status": "sent",
"issueDate": "2023-09-01",
"expiryDate": "2023-10-15",
"taxRate": 10,
"items": [
{
"description": "Service A (Revised)",
"quantity": 12,
"unitPrice": "100.00"
}
]
}'
Response (Success: 200 OK)
// Similar to Create Quote response, with updated fields
{
"id": 1,
"companyId": 1,
"clientId": 1,
"quoteNumber": "QUO-2023-001-R1",
"status": "sent",
"issueDate": "2023-09-01",
"expiryDate": "2023-10-15",
"subtotal": "1200.00", // Recalculated
"tax": "120.00", // Recalculated
"taxRate": "10.00",
"total": "1320.00", // Recalculated
"notes": "Quote for services.", // Assuming notes were not changed
"createdAt": "2023-09-01T10:00:00.000Z",
"updatedAt": "2023-10-28T11:00:00.000Z", // New updated timestamp
"acceptedAt": "2023-09-10T14:00:00.000Z", // Assuming not changed by this update
"softDelete": false,
"convertedToInvoiceId": null,
"client": { /* ... */ },
"company": { /* ... */ },
"items": [
{
"id": 3, // Example new/updated ID
"quoteId": 1,
"description": "Service A (Revised)",
"quantity": "12.00",
"unitPrice": "100.00",
"amount": "1200.00"
}
]
}
Delete Quote
DELETE /api/quotes/{quoteId}
Description: Soft deletes a quote.
Authorization: API Key (Bearer Token) required.
Path Parameters:
- Name
quoteId
- Type
- integer
- Description
ID of the quote to delete.
Request
curl -X DELETE "https://your-summit-instance.com/api/quotes/1" \
-H "Authorization: Bearer <YOUR_API_TOKEN>"
Response (Success: 200 OK)
{
"message": "Quote deleted successfully"
}