Negotiate Quote
This PUT API allows you to negotiate an existing quote by updating product quantities and requested prices.
Endpoint Details
- URL:
/quote/negotiate/{quote_id} - Method:
PUT - Authentication: Bearer Token (required)
Path Parameters
| Parameter | Type | Description |
|---|---|---|
quote_id | string | The unique identifier of the quote to negotiate. |
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 specify the negotiation details of the quote:
| Field | Type | Description |
|---|---|---|
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. |
products | array | Array of objects detailing the products, quantities, and requested prices. |
comment | string | Additional comments or notes for the negotiation. |
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 negotiation. |
requestedPrice | string | Updated price requested for the product or variant in the negotiation. |
Sample Request Body
{
"company": "65ba028af764f931f1c7c18b",
"customer": "66d07121db294e0b70180bf6",
"products": [
{
"product": "65b88ef5045a7d009e79974b",
"quantity": 6,
"requestedPrice": "1300"
},
{
"product": "66b4a01249e6ce3d41c428fa",
"variant": "66d5a286fcb786834cebb16a",
"quantity": 7,
"requestedPrice": "1900"
}
],
"comment": "Please consider this new offer."
}
Response
Success Response
| Status Code | Description |
|---|---|
| 200 OK | The request was successful, and the quote details were updated for negotiation. |
Success Response Body Structure
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the request was successful. |
message | string | Message indicating the result of the negotiation. |
data | object | Contains the updated details of the negotiated quote. |
Sample Response Body
{
"success": true,
"message": "Quote updated Successfully",
"data": {
"id": "7323abc1648b4f3a8dfd7e23",
"company": "65ba028af764f931f1c7c18b",
"customer": "66d07121db294e0b70180bf6",
"products": [
{
"product": "65b88ef5045a7d009e79974b",
"quantity": 6,
"requestedPrice": "1300"
},
{
"product": "66b4a01249e6ce3d41c428fa",
"variant": "66d5a286fcb786834cebb16a",
"quantity": 7,
"requestedPrice": "1900"
}
],
"comment": "Please consider this new offer.",
"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 negotiate. - Include all necessary fields in the request body to avoid validation errors.
- A valid access token is necessary for authentication to successfully negotiate the quote.