PriceAdjustmentRequest document (Shop API 23.2)
(supports custom properties)
Document representing a price adjustment request.
Use the
level
and item_id
properties to specify
where you want the price adjustment to be added:
- If you specify order as the level, you do not have to specify an
item_id
. This indicates that the price adjustment should be added directly to basket. - If you specify product as the level, the
item_id
that you specify is theitem_id
of the product item. This indicates that the price adjustment should be added to the product item. - If you specify shipping as the level,
item_id
that you specify is theitem_id
of the shipping item. This indicates that the price adjustment is added to the shipping item.
item_text
and reason_code
properties to
describe the price adjustment.
The promotion_id
property is optional. If you do not specify an id,
one is automatically assigned (in the format 'dw.manual[n]', where [n] is 1, 2, 3...).
If you specify an id, make sure that it is not already used for a price
adjustment in the basket or for a promotion in the promotion engine.
You need to specify the value of the price adjustment by defining a discount
from which the price adjustment
is calculated. The discount definition consists of a type
and a
value
.
The type amount describes a (unit) price discount, and its corresponding
value
(positive) defines the amount each unit is to be reduced.
For example, for a $10 discount:
{ "discount" : {"type" : "amount", "value" : 10.00 }, ... }
The type percentage describes a percentage discount, and its corresponding
value
(positive) defines the percentage reduction. For example,
for a 5% discount:
{ "discount" : {"type" : "percentage", "value" : 5 }, ... }
The type fixed_price describes a fixed price discount, and its corresponding value
(positive) defines the resulting fixed price for the item. Only one fixed_price
discount can be set for each item. For example, to fix a $15 price for the
item:
{ "discount" : {"type" : "fixed_price", "value" : 15.00 }, ... }
The type fixed_price is not applicable at the order level.
Property | Type | Constraints | Description |
---|---|---|---|
discount |
DiscountRequest | A discount that you can specify instead of a price .
When defining a discount, you must specify a type and
a value . |
|
item_id |
String | The item to which the price adjustment should be added, depending on the specified level. If the level is 'order', you need not specify an item id. If 'shipping', specify the uuid of the shipping item. If 'product', specify the uuid of the product item. | |
item_text |
String | The text describing the item in more detail. | |
level |
Enum {product, shipping, order} | mandatory=true, nullable=false | The level at which the adjustment is applied. When a product or shipping level is specified, you must also specify the item id. |
promotion_id |
String | The id of the related promotion. Custom price adjustments can be assigned any promotion id so long it is not used by a price adjustment belonging to the same item and is not used by promotion defined in the promotion engine. If not specified, a promotion id is generated. | |
reason_code |
String | The reason why this price adjustment was made. |
X
OCAPI versions 15.x and 16.x will be retired on March 31, 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.