Create Bundled Discounts

Link to section

1. Create Meal and Drinks Catalog Categories

  • You need to create a Meal category of the CatalogCategory type in your catalog. To create a Meal CatalogCategory object, follow this example.
  • You need to create a Drinks category of the CatalogCategory type in your catalog. To create a Drinks CatalogCategory object, follow this example.
Link to section

2. Configure a discount and a product set

To create a bundled discount, you need two catalog objects:

  • A DISCOUNT type catalog object that applies a 10% discount to a meal and drink combo.
  • A PRODUCT_SET type catalog object that groups exactly one meal and one drink.
Link to section

Create a bundled discount

To configure a bundled discount, create a discount first.

Link to section

Request

The following request creates a 10% discount for drinks and meals:

Upsert catalog object

Link to section

Response

The successful response returns a payload similar to the following:

The temporary ID (of the #10% Drink and Meal Discount form) is optional unless the object is referenced elsewhere in the same request payload.

You might need to make note of the returned object_id for future references to this discount object.

Link to section

Create a bundled product set to which to apply a discount

In addition to creating a discount, you must set products targeted for the discount. To do this, create product set of the CatalogProductSet object.

Link to section

Request

The following request creates a product set consisting of a Drinks category (GXFTT46M3RCBR6LV54HKALC6 in the product_ids_all list) and a Meal category (GCCTVZOTCOPI246SREKXNMYX in the product_ids_all list):

Upsert catalog object

The temporary ID (of the #Meals and Drinks form) is optional unless it's referenced elsewhere in the same request payload.

Link to section

Response

The successful response returns a payload similar to the following:

Link to section

3. Configure a pricing rule to apply discounts to products

The pricing rule object determines when the discount is applied and to which items to apply it. Set the Meals and Drinks product set to match_product_id so the discount applies any time a Meal or Drinks category is in a cart.

Link to section

Create a CatalogObject of the PRICING_RULE Type

Link to section

Request

The following request creates a pricing rule to enable automatic application of the 10% Drink and Meal Discount ("discount_id": "GHJNSI4B2WQMC3SFMOZXTUH2") to Meals and Drinks products and services ("match_products_id": "P47IPUGNDUIILQIYJMDKEDZO"):

Upsert catalog object

You might need to call the SearchCatalogObjects endpoint to retrieve the desired discount and product set from the catalog to determined the IDs used as input to the request.

Link to section

Response

The successful response returns a payload similar to the following:

You've now configured the pricing rule to enable the automatic application of the specified discount to the specified type of orders.