Update Quote
This PUT API allows you to update an existing quote with new details, including product quantities and requested prices.
Endpoint Details
- URL:
/quote/update/{quote_id} - Method:
PUT - Authentication: Bearer Token (required)
Path Parameters
| Parameter | Type | Description |
|---|---|---|
quote_id | string | The unique identifier of the quote to update. |
Authentication
You must provide a valid accessToken in the request headers to authenticate and access this endpoint.
Authentication Headers
| Header | Type | Description |
|---|---|---|
Content-Type | string | Must be set to application/json. |
accessToken | string | A valid access token is required. |
Request Body
The request body should be in JSON format and must outline the updated details of the quote:
| Field | Type | Description |
|---|---|---|
title | string | Updated title of the quote. |
company | string | The unique identifier of the company associated with the quote. |
customer | string | The unique identifier of the customer for whom the quote is created. |
status | string | Updated status of the quote (e.g., "pending", "negotiated"). |
products | array | Array of objects containing updated product details, including quantities and requested prices. |
comment | string | Updated comments or notes for the quote. |
Product Object (products[])
Each object in the products array should follow this structure:
| Field | Type | Description |
|---|---|---|
product | string | Unique identifier for the product. |
variant | string | Unique identifier for the product variant (optional). |
quantity | number | Updated quantity of the product or variant requested in the quote. |
requestedPrice | string | Updated price requested for the product or variant in the quote. |
Sample Request Body
{
"title": "End of Season Quote",
"company": "65ba028af764f931f1c7c18b",
"customer": "66d07121db294e0b70180bf6",
"status": "negotiated",
"products": [
{
"product": "65b88ef5045a7d009e79974b",
"quantity": 5,
"requestedPrice": "1255"
},
{
"product": "66b4a01249e6ce3d41c428fa",
"variant": "66d5a286fcb786834cebb16a",
"quantity": 5,
"requestedPrice": "1967"
}
],
"comment": "Please review the updated terms."
}
Response
Success Response
| Status Code | Description |
|---|---|
| 200 OK | The request was successful, and the quote details were updated. |
Success Response Body Structure
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the request was successful. |
message | string | Message indicating the result of the update. |
data | object | Contains the updated details of the quote. |
Sample Response Body
{
"success": true,
"message": "Quote updated Successfully",
"data": {
"id": "7323abc1648b4f3a8dfd7e23",
"title": "End of Season Quote",
"company": "65ba028af764f931f1c7c18b",
"customer": "66d07121db294e0b70180bf6",
"status": "negotiated",
"products": [
{
"product": "65b88ef5045a7d009e79974b",
"quantity": 5,
"requestedPrice": "1255"
},
{
"product": "66b4a01249e6ce3d41c428fa",
"variant": "66d5a286fcb786834cebb16a",
"quantity": 5,
"requestedPrice": "1967"
}
],
"comment": "Please review the updated terms.",
"createdAt": "2024-01-10T12:00:00Z",
"updatedAt": "2024-01-15T14:00:00Z"
}
}
Error Responses
| Status Code | Description |
|---|---|
| 400 Bad Request | Invalid request format or missing data. |
| 401 Unauthorized | Invalid or missing access token. |
| 403 Forbidden | Access denied. |
| 404 Not Found | Quote not found. |
| 500 Internal Server Error | Server encountered an error. |
Notes
- Ensure that the
quote_idin the URL matches the ID of the quote you wish to update. - Include all required fields in the request body to avoid validation errors.
- A valid access token is necessary for authentication to successfully update the quote.