Skip to main content

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​

ParameterTypeDescription
idStringRequired. 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.

FieldTypeRequiredDescription
titleStringNoNew title of the quote.
statusStringNopending, approved, rejected, completed, negotiated or expired.
companyStringNoID of the new company. If left out, the quote's current company is kept.
customerStringNoID of the new customer. Must belong to the quote's company. If left out, the quote's current customer is kept.
productsArrayNoUpdated quantities and prices for the products on the quote. See below.
commentStringNoComment to add to the quote.
notesStringNoNew internal notes. Send "" to clear them.
metaFieldsArrayNoCustom field values as code and value pairs. Replaces the current list.

Product Object​

FieldTypeRequiredDescription
productStringYesID of a product on the quote.
quantityNumberYesNew quantity.
companyPriceNumberNoNew company price per unit. If omitted, the current price is kept.
requestedPriceNumberNoNew 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 success to 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​

FieldTypeDescription
successBooleanWhether the quote was updated.
messageStringResult message.
dataObjectThe 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​

  • products replaces 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 customer and company. The customer must belong to that company.
  • If no quote matches the ID, success is false and message is Quote not found.