Sample promotions

This section includes sample promotions you can create with the Admin API.

The following promotions include sample request bodies for the POST /ccadmin/v1/promotions endpoint:

You can find more sample promotions in Custom Promotions API How-To with Examples on Oracle Cloud Customer Connect.

Get Order Discount

This promotion automatically discounts an entire order with no spend requirements.

The following example creates a promotion that discounts an order by 10%.

{
  "displayName":"Get 10% off your order",
  "description":"A get order discount promotion",
  "priceListGroups":["defaultPriceGroup"],
  "enabled":true,
  "priority":"1",
  "startDate":"2016-03-10T00:00:00.000-05:00",
  "endDate":"2116-03-30T00:00:00.000-05:00",
  "templatePath": "order",
  "templateName": "rawPmdlTemplate",
  "templateValues":{"pmdl": {"xml": "<pricing-model><qualifier/><offer>
    <discount-structure calculator-type="standard" discount-type="percentOff"
    adjuster="10"/></offer></pricing-model>"}
}
}

Spend Y in X Get Order Discount

This promotion discounts an entire order when the shopper spends the specified amount in the specified collections.

The following example creates a promotion that discounts an order by 10% when the shopper spends $20 in the Summer Favorites collection, whose ID is cat60036.

{
  "displayName":"Spend $20 in Summer Favorites Get Order Discount",
  "description":"A sample spend y in x get order discount promotion",
  "priceListGroups":["defaultPriceGroup"],
  "enabled":true,
  "priority":"1",
  "startDate":"2016-03-10T00:00:00.000-05:00",
  "endDate":"2116-03-30T00:00:00.000-05:00",
  "templatePath": "order",
  "templateName": "rawPmdlTemplate",
  "templateValues":{"pmdl": {"xml": "<pricing-model><qualifier>
    <quantifier name="at-least" number="20"><collection-name>items</collection-
    name><element-name>item</element-name><aggregator name="spendAmount"
    operation="total"/><comparator name="includes-any">
    <value>item.auxiliaryData.productRef.ancestorCategoryIds</value>
    <constant><data-type>java.util.Set</data-type><string-value>cat60036</string-
    value></constant></comparator></quantifier></qualifier><offer>
    <discount-structure calculator-type="standard" discount-type="percentOff"
    adjuster="10"></discount-structure></offer></pricing-model>"}
}
}

Spend Y in X Get Item Discount

This promotion discounts one or more items when a shopper spends the specified amount in the specified collections. Unlike the Spend Y Get Order Discount promotion, which looks only at the total amount spent on the order to determine whether the customer qualifies for the promotion, this promotion examines the individual items in the shopping cart.

The following example creates a promotion that discounts the product Beach Umbrella by 50% when the shopper spends $10 in the Summer Favorites collection, whose ID is cat60036.

{
  "displayName":"Spend $10 in Summer Favorites, get 50% off a beach umbrella",
  "description":"A sample spend y in x get item discount promotion",
  "priceListGroups":["defaultPriceGroup"],
  "enabled":true,
  "priority":"1",
  "startDate":"2016-03-10T00:00:00.000-05:00",
  "endDate":"2116-03-30T00:00:00.000-05:00",
  "templatePath": "item",
  "templateName": "rawPmdlTemplate",
  "templateValues":{"pmdl": { "xml": {"<pricing-model><qualifier><quantifier
    name="at-least" number="10"><collection-name>items</collection-name><element-
    name>item</element-name><aggregator name="spendAmount"
    operation="total"/><comparator name="includes-any">
    <value>item.auxiliaryData.productRef.ancestorCategoryIds</value>
    <constant><data-type>java.util.Set</data-type><string-
    value>cat60036</string-value></constant></comparator>
    </quantifier></qualifier><offer><discount-structure
    calculator-type="standard" discount-type="percentOff"
    adjuster="50"><target><iterator name="up-to-and-including" number="-1"
    sort-by="priceInfo.listPrice" sort-order="ascending">
    <collection-name>items</collection-name><element-name>item</element-name>
    <aggregator name="quantity" operation="total"/>
    <comparator name="includes-any">
    <value>item.auxiliaryData.productRef.ancestorCategoryIds</value>
    <constant><data-type>java.util.Set</data-type>
    <string-value>cat60036</string-value></constant></comparator>
    </iterator></target></discount-structure></offer></pricing-model>"}
}
}

Spend Y in X Get Shipping Discount

This promotion offers free shipping when the shopper purchases items from a specified collection.

The following example creates a promotion that offers free shipping when a shopper buys anything from the Summer Favorites collection, whose ID is cat60036.

{
  "displayName":"Spend $10 in Summer Favorites, Get Free Shipping",
  "description":A sample spend y in x get shipping discount promotion,
  "priceListGroups":["defaultPriceGroup"],
  "enabled":true,
  "priority":"1",
  "startDate":"2016-03-10T00:00:00.000-05:00",
  "endDate":"2016-03-30T00:00:00.000-05:00",
  "templatePath": "shipping",
  "templateName": "rawPmdlTemplate",
  "templateValues":{"pmdl": {"xml": "<pricing-model><qualifier><quantifier
    name=\"at-least\" number=\"10\"><collection-name>items</collection-name>
    <element-name>item</element-name><aggregator name=\"spendAmount\"
    operation=\"total\"/><comparator name=\"includes-any\">
    <value>item.auxiliaryData.productRef.ancestorCategoryIds</value>
    <constant><data-type>java.util.Set</data-type>
    <string-value>cat60036</string-value></constant></comparator>
    </quantifier></qualifier> <offer><discount-structure calculator-type=\"standard\"
    discount-type=\"fixedPrice\" adjuster=\"0\"></discount-structure>
    </offer></pricing-model>"}
}
}

Apply shipping discounts to individual shipping groups

Shipping discount promotions you create from templates in the administration interface apply to a shopper's entire order. However, you can use the Admin API to create promotions that discount shipping for individual, qualifying shipping groups. You can create promotions that discount shipping when a shipping group reaches a value threshold ("Spend $100, Get Free Ground Shipping") or when it contains specific items ("All Outerwear Ships Free").

The following sample request body creates a promotion that offers free ground shipping for a shipping group when it contains anything from the Summer Favorites collection, whose ID is cat60036.

{
  "displayName":"Free Shipping on All Your Summer Favorites",
  "description":"A sample shipping discount promotion for individual shipping groups",
  "priceListGroups":["defaultPriceGroup"],
  "enabled":true,
  "priority":"1",
  "startDate":"2018-03-10T00:00:00.000-05:00",
  "endDate":"2018-03-30T00:00:00.000-05:00",
  "shippingMethods":"US48Ground",
  "templatePath": "shipping",
  "templateName": "rawPmdlTemplate",
  "templateValues":{"pmdl": {"xml": 
    "<pricing-model>
      <qualifier>
        <quantifier name=\"at-least\" number=\"1\">
          <collection-name>shippingGroup.commerceItemRelationships</collection-name>
          <element-name>item</element-name>
          <aggregator name=\"spendAmount\" operation=\"total\"/>
          <comparator name=\"includes-any\">
            <value>item.auxiliaryData.productRef.ancestorCategoryIds</value>
            <constant>
              <data-type>java.util.Set</data-type>
              <string-value>cat60036</string-value>
            </constant>
          </comparator>
        </quantifier>
      </qualifier>
      <offer>
        <discount-structure calculator-type=\"standard\" discount-type=\"fixedPrice\" adjuster=\"0.0\">
        </discount-structure>
      </offer>
    </pricing-model>"}}
}

The following sample request body creates a promotion that offers free two-day shipping when a shipping group contains $100 in merchandise.

{
  "displayName":"Spend $100, Get Free 2 Day Shipping",
  "description":"A sample shipping discount promotion for individual shipping groups",
  "priceListGroups":["defaultPriceGroup"],
  "enabled":true,
  "priority":"1",
  "startDate":"2018-03-10T00:00:00.000-05:00",
  "endDate":"2018-03-30T00:00:00.000-05:00",
  "shippingMethods":"US48TwoDay",
  "templatePath": "shipping",
  "templateName": "rawPmdlTemplate",
  "templateValues":{"pmdl": {"xml": 
    "<pricing-model>
      <qualifier>
        <greater-than>
          <value>shippingGroup.priceInfo.itemSubtotal</value>
          <constant>
            <data-type>java.lang.Double</data-type>
            <string-value>100.0</string-value>
          </constant>
        </greater-than>
      </qualifier>
      <offer>
        <discount-structure calculator-type=\"standard\" discount-type=\"fixedPrice\" adjuster=\"0.0\">
        </discount-structure>
      </offer>
    </pricing-model>"}}
}