Update Quote
Updates an existing quote. Only the fields you send are changed. Changes to the status, prices or quantities are recorded in the quote's timeline.
HTTP Request
- URL:
/quote/update/{id} - Method:
PUT - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_WRITE_QUOTE
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the quote to update. |
Request Body
The request body must be JSON. All fields are optional, but at least one must be sent.
| Field | Type | Required | Description |
|---|---|---|---|
title | String | No | New title of the quote. |
status | String | No | pending, approved, rejected, completed, negotiated or expired. |
company | String | No | ID of the new company. If left out, the quote's current company is kept. |
customer | String | No | ID of the new customer. Must belong to the quote's company. If left out, the quote's current customer is kept. |
products | Array | No | Updated quantities and prices for the products on the quote. See below. |
comment | String | No | Comment to add to the quote. |
notes | String | No | New internal notes. Send "" to clear them. |
metaFields | Array | No | Custom field values as code and value pairs. Replaces the current list. |
Product Object
| Field | Type | Required | Description |
|---|---|---|---|
product | String | Yes | ID of a product on the quote. |
quantity | Number | Yes | New quantity. |
companyPrice | Number | No | New company price per unit. If omitted, the current price is kept. |
requestedPrice | Number | No | New requested price per unit. If omitted, the current price is kept. |
cURL Example
curl --location --request PUT '<BASE_URL>/quote/update/6720f3c1a8b4e21f9c3d5a10' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"status": "approved",
"products": [
{
"product": "65b88ef5045a7d009e79974b",
"quantity": 12,
"companyPrice": 115
}
],
"comment": "Approved at the revised company price."
}'
Response
- 200 OK: The request was processed. Check
successto confirm the quote was updated. - 400 Bad Request: The access token is missing or invalid, does not have the required scope, or the request body is not valid.
Sample JSON Response
{
"success": true,
"message": "Quote updated Successfully",
"data": {
"_id": "6720f3c1a8b4e21f9c3d5a10",
"id": "6720f3c1a8b4e21f9c3d5a10",
"quoteId": 1042,
"title": "Q4 Restock Quote",
"status": "approved",
"requestedCount": 0,
"company": "65ba028af764f931f1c7c18b",
"customer": "66d07121db294e0b70180bf6",
"products": [
{
"_id": "6720f3c1a8b4e21f9c3d5a11",
"product": "65b88ef5045a7d009e79974b",
"variant": null,
"name": "Cordless Drill 18V",
"sku": "CD-18V",
"productSku": "CD-18V",
"image": "https://cdn.example.com/products/cd-18v.webp",
"options": [],
"quantity": 12,
"price": 129,
"companyPrice": 115,
"requestedPrice": 110,
"extendedPrice": 1380,
"selectedCurrencyPrice": null
}
],
"timeline": [
{
"_id": "6721a0d4c2e9b71a4f6d8e21",
"name": "ERP Integration",
"description": "ERP Integration update quote Updated status from pending to approved Updated quantity from 10 to 12 for product Cordless Drill 18V.",
"isCustomer": false,
"customer": null,
"user": null,
"createdAt": "2024-10-30T09:15:32.104Z",
"updatedAt": "2024-10-30T09:15:32.104Z"
}
],
"comments": [
{
"_id": "6721a0d4c2e9b71a4f6d8e22",
"name": "ERP Integration",
"comment": "Approved at the revised company price.",
"isCustomer": false,
"customer": null,
"user": null,
"replies": [],
"createdAt": "2024-10-30T09:15:32.104Z",
"updatedAt": "2024-10-30T09:15:32.104Z"
}
],
"notes": "Priority account",
"metaFields": [],
"expiryDate": "2024-11-13T14:02:09.498Z",
"isCompleted": false,
"createdAt": "2024-10-29T14:02:09.512Z",
"updatedAt": "2024-10-30T09:15:32.110Z",
"total": 1380
}
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the quote was updated. |
message | String | Result message. |
data | Object | The updated quote. |
Quote Data
The quote fields are described in Get Single Quote. The response also includes total, the sum of all line totals.
Notes
productsreplaces the product list on the quote, so include every product you want to keep. Use it to change quantities and prices of products already on the quote.- To move a quote to a different customer, send both
customerandcompany. The customer must belong to that company. - If no quote matches the ID,
successisfalseandmessageisQuote not found.