Comment on Quote
Adds a comment to a quote on behalf of a customer. To reply to an existing comment, include its commentId.
HTTP Request
- URL:
/quote/comment/{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 comment on. |
Request Body
The request body must be JSON and contain the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
customer | String | Yes | ID of the customer writing the comment. |
comment | String | Yes | Text of the comment. |
commentId | String | No | ID of an existing comment. The new comment is added as a reply to it. |
cURL Example
curl --location --request PUT '<BASE_URL>/quote/comment/6720f3c1a8b4e21f9c3d5a10' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customer": "66d07121db294e0b70180bf6",
"commentId": "6720f3c1a8b4e21f9c3d5a13",
"comment": "Lead time of two weeks works for us."
}'
Response
- 200 OK: The comment was added successfully.
- 400 Bad Request: The access token is missing or invalid, does not have the required scope, the request body is not valid, or the quote was not found.
Sample JSON Response
{
"success": true,
"message": "Quote Comment Successfully",
"data": {
"_id": "6720f3c1a8b4e21f9c3d5a10",
"id": "6720f3c1a8b4e21f9c3d5a10",
"quoteId": 1042,
"title": "Q4 Restock Quote",
"status": "negotiated",
"comments": [
{
"_id": "6720f3c1a8b4e21f9c3d5a13",
"id": "6720f3c1a8b4e21f9c3d5a13",
"name": "ERP Integration",
"comment": "Please confirm lead time.",
"isCustomer": false,
"customer": null,
"user": "66d07121db294e0b70180bf6",
"replies": [
{
"_id": "6721c4f2e5a1b73d8f0c2a40",
"name": "Dana Whitfield",
"comment": "Lead time of two weeks works for us.",
"isCustomer": false,
"customer": "66d07121db294e0b70180bf6",
"user": null,
"createdAt": "2024-10-30T12:53:06.348Z",
"updatedAt": "2024-10-30T12:53:06.348Z"
}
],
"createdAt": "2024-10-29T14:02:09.512Z",
"updatedAt": "2024-10-30T12:53:06.348Z"
}
],
"createdAt": "2024-10-29T14:02:09.512Z",
"updatedAt": "2024-10-30T12:53:06.352Z"
}
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the request was successful. |
message | String | Result message. |
data | Object | The updated quote. |
Comment Data
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the comment. |
name | String | Name of the person who wrote the comment. |
comment | String | Text of the comment. |
isCustomer | Boolean | Whether the comment was written by a customer. |
customer | String | ID of the customer who wrote the comment, if any. |
replies | Array | Replies to the comment, with the same fields. |
createdAt | String | Date and time the comment was added (ISO 8601). |
updatedAt | String | Date and time the comment was last updated (ISO 8601). |
Other quote fields are described in Get Single Quote.