Update Basket - Discount(s)

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Overview

Apply discounts to perform a recalculation of basket totals based on the specified discount type and value. Baskets can also be updated with additional items when discount types like item_bogof or item_freeare specified. The response returns an updated discountsTotal along with itemised discountTotal for item level discounts to ensure detailed reporting.

Commerce Discount Types

The following table describes the supported discount types and the equivalent value to map to when retrieving info via loyalty API via GET Programs

Commerce Discount TypeLoyalty Program TypeDescription
order_percent_offdiscount_percentagePercentage discount applied to the subtotal of the order.
order_flat_offdiscount_amountFixed amount discount applied to the subtotal of the order
item_bogofbuy_one_get_one_freeBuy one get one free promotion on specific items.
item_freefree_itemA specific item is provided free of charge.
item_percent_offitem_discount_percentagePercentage discount applied to a specific item.
item_flat_offitem_discount_amountFixed amount discount applied to a specific item.
wallet_cash-Discount funded by a user's digital wallet balance.
compensation_cardcompensation_cardDiscount applied via a compensation card
-item_fixed_priceItem is sold at a fixed price. The channel must calculate the discount amount and add it to the commerce basket as an item_flat_off.

Available Providers

ProviderDescription
restaurantUsed when the discount is provided by the restaurant
couponUsed when the discount is applied via a coupon code returned by the Coupons API.
loyaltyUsed when the discount is applied as a result from the Loyalty API.

Loyalty provider

📘

Using a loyalty provider, the programId retrieved via GET /programs identifies the exact program being applied. To update the basket, use the value obtained via programId as the externalId to reference the specific program applied to the basket.

[
  {
    "type": "item_flat_off",
    "provider": "loyalty",
    "externalId": "discount-item-flat-123",
    "name": "Item flat off: $5",
    "menuId": "668f7ff64dc853**c96**877",
    "value": 5000,
    "itemIds": [
      "6900f2f01306779be71e7b8e"
    ]
  }
]
[
  {
    "type": "order_percent_off",
    "provider": "restaurant",
    "value": 1000,
    "name": "CONGRATS10% OFF"
  }
]
[
  {
    "type": "order_flat_off",
    "provider": "coupon",
    "amount": 100,
    "name": "CONGRATS! HERE IS 1 EUR OFF"
  }
]
[
  {
    "type": "order_percent_off",
    "provider": "restaurant",
    "value": 1000,
    "name": "CONGRATS10% OFF"
  }
]
[
  {
    "provider": "restaurant",
    "name": "Free coke",
    "type": "item_free",
    "plu": "DLX-3",
    "menuId": "69d4c198e1c58591f461cb4a",
    "externalId": "discount-123"
  }
]
[
  {
    "provider": "restaurant",
    "name": "",
    "type": "item_bogof",
    "plu": "DLX-3",
    "menuId": "69d4c198e1c58591f461cb4a",
    "externalId": "discount-bogo"
  }
]
[
  {
    "type": "item_percent_off",
    "provider": "restaurant",
    "externalId": "discount-123",
    "name": "Item percent off: 25%",
    "menuId": "69d4c198e1c58591f461cb4a",
    "value": 2500,
    "itemIds": [
      "6900f2f01306779be71e7b8e"
    ]
  }
]
[
  {
    "type": "wallet_cash",
    "value": 1000,
    "provider": "loyalty",
    "externalId": null
  }
]
[
  {
    "type": "compensation_card",
    "provider": "restaurant",
    "externalId": "cardnumber-123",
    "value": 5000,
    "name": "Compensation card for $5"
  }
]

Path Params
string
required
string
required
Body Params

Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json