Get All Quotes
This API endpoint retrieves a list of quotes from the server, allowing you to filter results by specific criteria such as company, customer, and pagination parameters.
HTTP Request
- URL:
/quote/all - Method:
GET - Headers:
accessToken: Required. This is your access token for authenticating the request.
Query Parameters
To effectively retrieve and manage quotes, you can include the following query parameters:
| Parameter | Type | Description |
|---|---|---|
page | Integer | The page number to retrieve; defaults to 1 if not specified. |
limit | Integer | The number of items to retrieve per page; defaults to 10. |
company | String | The unique identifier of the company whose quotes you want to retrieve. |
customer | String | The unique identifier of the customer whose quotes you want to retrieve. |
cURL Example
Below is a sample cURL command that demonstrates how to make a request to the API endpoint:
curl --location '<BASE_URL>/quote/all?page=1&limit=10&company=<COMPANY_ID>&customer=<CUSTOMER_ID>' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The request was successful, and the server returned a list of quotes.
- 4XX: Client errors indicating issues such as an invalid access token or missing parameters.
- 5XX: Server errors indicating that something went wrong on the server's end.
Sample JSON Response
Below is an example of the JSON response you might receive from making a request to this endpoint:
{
"success": true,
"data": [
{
"id": "7323abc1648b4f3a8dfd7e23",
"title": "Q1 Purchase Order",
"company": "65ba028af764f931f1c7c18b",
"customer": "66d07121db294e0b70180bf6",
"status": "pending",
"products": [
{
"product": "65b88ef5045a7d009e79974b",
"quantity": 2,
"requestedPrice": "2100"
},
{
"product": "66b4a01249e6ce3d41c428fa",
"variant": "66d5a286fcb786834cebb16a",
"quantity": 3,
"requestedPrice": "1900"
}
],
"comments": [
{
"commentId": "66fb9ddfac1453f825712ca3",
"text": "Waiting for approval.",
"createdAt": "2024-01-10T12:00:00Z"
}
],
"createdAt": "2024-01-09T10:00:00Z",
"updatedAt": "2024-01-10T12:00:00Z"
}
// Additional quotes omitted for brevity...
],
"pagination": {
"page": 1,
"total": 50,
"count": 10
}
}
Response Details
| Key | Type | Description |
|---|---|---|
success | Boolean | Indicates if the request was successful. |
data | Array of Objects | List of quotes. |
pagination | Object | Provides pagination details. |
Quote Data
| Field | Type | Description |
|---|---|---|
id | String | The unique identifier of the quote. |
title | String | Title of the quote. |
company | String | The unique identifier of the company associated. |
customer | String | The unique identifier of the customer associated. |
status | String | Current status of the quote such as "pending". |
products | Array of Objects | List of products included in the quote. |
comments | Array of Objects | List of comments associated with the quote. |
createdAt | String | Date and time the quote was created (ISO 8601 format). |
updatedAt | String | Date and time the quote was last updated (ISO 8601 format). |
Products Data
| Field | Type | Description |
|---|---|---|
product | String | Unique identifier for the product. |
variant | String | Unique identifier for the product variant (optional). |
quantity | Number | Quantity of the product requested in the quote. |
requestedPrice | String | Price requested for the product in the quote. |
Comments Data
| Field | Type | Description |
|---|---|---|
commentId | String | Unique identifier of the comment. |
text | String | Content of the comment. |
createdAt | String | Date and time the comment was made (ISO 8601 format). |
Pagination Details
| Key | Type | Description |
|---|---|---|
page | Integer | Current page number. |
total | Integer | Total number of items available. |
count | Integer | Number of items returned in this response. |
Notes
- Ensure that the
accessTokenprovided is valid and has not expired. - The query parameters can help filter and paginate the list of quotes effectively.