OfferItem.detailed

Specificies where a discount should get appllied. A shop can give a complete category a discount, or only a certain product, or only a fixed product price. When calculating the discount, always round the price to 1 cent before multiplying it with an amount, persons or kilograms.

Field Type Description
type String String enumarion of 'percentage', 'x-plus-y'
x Int? Nullable. If type is x-plus-y, x contains the amount of items you need to order to receive y items for free
y Int? Nullable. If type is x-plus-y, y contains the amount of items you get for free per x items you order
percentage Int? Nullable. If type is percentage, x, contains discount per ten thousand. E.g. 1‱ equals 0.01% discount, 100‱ equals 1% discount. Could be zero when there is no discount, but the products should get added to the offer for display.
minimum Int? Nullable. Minimum amount, weight, or persons (amount, amount * persons, and weight * amount is used depending on the price type of the product) needed to order in order to enjoy this offer
offer Offer.simple A special discount for one or multiple products of the shop
applies_to String String enumarion of 'category', 'product', 'product-price'
item_id Int ID of the category, product or product price where the offer applies to.

Examples

Example 1

{
    "type": "percentage",
    "x": 18,
    "y": 11,
    "percentage": 19,
    "minimum": 13,
    "offer": {
        "id": 13,
        "name": "Black Friday",
        "from_date": "2019-01-31",
        "until_date": "2019-01-31",
        "valid_for": "order",
        "recurring": 17,
        "recurring_on": {
            "day_1": 15,
            "day_2": 15,
            "day_3": 13,
            "day_4": 19,
            "day_5": 14,
            "day_6": 15,
            "day_7": 19
        }
    },
    "applies_to": "category",
    "item_id": 14
}
This is a development version Do not use this version in production
1.10.0 development