One of the most important actions in massive events such as Black Friday is establishing prices during a limited period of time. Scheduling a price for a specific time range allows you to temporarily optimize a product’s profitability during promotional actions and switch back to the regular price automatically given an end date.
This is possible using Pricing API, more specifically by making a request to PUT
Create or Update Base Price or Fixed Prices.
In the request body, you should include the fixedPrices
object containing a dateRange
object, with from
and to
properties. Make sure to check out the request body example and include all properties as specified in the PUT
Create or Update Base Price or Fixed Prices documentation.
By default, dates are in Coordinated Universal Time (UTC) and they must follow the RFC3339 format. Example: "2017-06-23T03:00:00Z"
.
In case a price is changed through the VTEX Admin, the scheduled hour will be lost and only the date will be considered.
Request body example
_23{_23 "markup": 30,_23 "basePrice": 100,_23 "listPrice": 35,_23 "fixedPrices": [_23 {_23 "tradePolicyId": "1",_23 "value": 31,_23 "listPrice": 32,_23 "minQuantity": 1,_23 "dateRange": {_23 "from": "2022-05-21T22:00:00Z",_23 "to": "2022-05-21T23:00:00Z"_23 }_23 },_23 {_23 "tradePolicyId": "1",_23 "value": 31.5,_23 "listPrice": 33,_23 "minQuantity": 2_23 }_23 ]_23}