Skip to main content

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

ParameterTypeDescription
quote_idstringThe 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

HeaderTypeDescription
Content-TypestringMust be set to application/json.
accessTokenstringA valid access token is required.

Request Body

The request body should be in JSON format and must specify the negotiation details of the quote:

FieldTypeDescription
companystringThe unique identifier of the company associated with the quote.
customerstringThe unique identifier of the customer for whom the quote is created.
productsarrayArray of objects detailing the products, quantities, and requested prices.
commentstringAdditional comments or notes for the negotiation.

Product Object (products[])

Each object in the products array should follow this structure:

FieldTypeDescription
productstringUnique identifier for the product.
variantstringUnique identifier for the product variant (optional).
quantitynumberUpdated quantity of the product or variant requested in the negotiation.
requestedPricestringUpdated 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 CodeDescription
200 OKThe request was successful, and the quote details were updated for negotiation.

Success Response Body Structure

FieldTypeDescription
successbooleanIndicates if the request was successful.
messagestringMessage indicating the result of the negotiation.
dataobjectContains 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 CodeDescription
400 Bad RequestInvalid request format or missing data.
401 UnauthorizedInvalid or missing access token.
403 ForbiddenAccess denied.
404 Not FoundQuote not found.
500 Internal Server ErrorServer encountered an error.

Notes

  • Ensure that the quote_id in 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.