Skip to main content

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:

ParameterTypeDescription
pageIntegerThe page number to retrieve; defaults to 1 if not specified.
limitIntegerThe number of items to retrieve per page; defaults to 10.
companyStringThe unique identifier of the company whose quotes you want to retrieve.
customerStringThe 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

KeyTypeDescription
successBooleanIndicates if the request was successful.
dataArray of ObjectsList of quotes.
paginationObjectProvides pagination details.

Quote Data

FieldTypeDescription
idStringThe unique identifier of the quote.
titleStringTitle of the quote.
companyStringThe unique identifier of the company associated.
customerStringThe unique identifier of the customer associated.
statusStringCurrent status of the quote such as "pending".
productsArray of ObjectsList of products included in the quote.
commentsArray of ObjectsList of comments associated with the quote.
createdAtStringDate and time the quote was created (ISO 8601 format).
updatedAtStringDate and time the quote was last updated (ISO 8601 format).

Products Data

FieldTypeDescription
productStringUnique identifier for the product.
variantStringUnique identifier for the product variant (optional).
quantityNumberQuantity of the product requested in the quote.
requestedPriceStringPrice requested for the product in the quote.

Comments Data

FieldTypeDescription
commentIdStringUnique identifier of the comment.
textStringContent of the comment.
createdAtStringDate and time the comment was made (ISO 8601 format).

Pagination Details

KeyTypeDescription
pageIntegerCurrent page number.
totalIntegerTotal number of items available.
countIntegerNumber of items returned in this response.

Notes

  • Ensure that the accessToken provided is valid and has not expired.
  • The query parameters can help filter and paginate the list of quotes effectively.