data-src=../../includes/commerce-only.md
Update a negotiable quote
Sellers and buyers can edit a negotiable quote at various times during the quote's lifecycle. Both use the PUT /V1/negotiableQuote/:quoteId call to update the quote. This call is defined in the quoteCartRepositoryV1 service and is functionally similar to the PUT /V1/carts/mine call.
The quote object now contains a set of negotiable_quote extension attributes that can be used to update a quote.
quote_idis_regular_quotestatuscreated, submitted_by_customer, submitted_by_admin, processing_by_customer, processing_by_admin, ordered, expired, declined, closednegotiated_price_typenegotiated_price_valueshipping_pricequote_nameexpiration_periodYYYY-MM-DD.email_notification_statushas_unconfirmed_changesis_shipping_tax_changedis_customer_price_changednotificationsapplied_rule_idsis_address_draftdeleted_skucreator_idcreator_typeoriginal_total_pricebase_original_total_pricenegotiated_total_pricebase_negotiated_total_priceSet a negotiated price
In every successful negotiate quote, the seller must set the negotiated price.
The negotiated_price_type can have one of the following values:
1- Apply a percentage discount to the quote. Thenegotiated_price_valueparameter indicates the percentage.2- Apply a fixed amount as a discount for the quote. Thenegotiated_price_valueparameter specifies the amount of the discount.3- Set a proposed price for the entire quote. Thenegotiated_price_valueparameter specifies the proposed price.
Service Name:
quoteCartRepositoryV1
Sample Usage:
PUT <host>/rest/<store_code>/V1/negotiableQuote/6
data-slots=heading, code
data-repeat=1
data-languages=JSON
Payload
{
"quote": {
"id": 6,
"extension_attributes": {
"negotiable_quote": {
"negotiated_price_type": 1,
"negotiated_price_value": 5
}
}
}
}
Add a new quote item to the negotiable quote
The buyer can add, update, or delete items from the quote under the following conditions:
- The quote is in one of the following system states:
created,processing_by_admin, orsubmitted_by_customer. - The quote doesn't have a negotiated price.
Sample Usage:
POST <host>/rest/<store_code>/V1/carts/mine/items
Headers:
Content-Type application/json
Authorization Bearer <customer token>
data-slots=heading, code
data-repeat=2
data-languages=JSON, JSON
Payload
{
"cartItem": {
"sku": "24-MB01",
"qty": 1,
"quote_id": "7"
}
}
Response
{
"item_id": 18,
"sku": "24-MB01",
"qty": 1,
"name": "Joust Duffle Bag",
"price": 34,
"product_type": "simple",
"quote_id": "7",
"extension_attributes": {
"negotiable_quote_item": {
"item_id": 18,
"original_price": 34,
"original_tax_amount": 0,
"original_discount_amount": 0
}
}
}
Change the quote expiration date
Sample Usage:
PUT <host>/rest/<store_code>/V1/negotiableQuote/6
data-slots=heading, code
data-repeat=2
data-languages=JSON, JSON
Payload
{
"quote": {
"id": 6,
"extension_attributes": {
"negotiable_quote": {
"expiration_period": "2017-09-30"
}
}
}
}
Response
// an empty array