Coupons and Promotions Related Object Types
Gift Certificate
A gift certificate is a coupon with a monetary value that can be redeemed to pay for items in the storefront.
Sample XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gift_certificates>
<gift_certificate guid="664029B3-CB9F-C38D-54CF-E3DA3123FDCC">
<code>snapitupusgc100</code>
<creation_date>2010-06-16T00:00:00-07:00</creation_date>
<last_modified>2010-06-16T00:00:00-07:00</last_modified>
<recipient_name></recipient_name>
<sender_name></sender_name>
<theme>SomeTheme</theme>
<purchase_amount>100.00</purchase_amount>
<store_code>SNAPITUP</store_code>
<currency_code>USD</currency_code>
</gift_certificate>
</gift_certificates>
Promotions
A promotion is a marketing tool used to increase sales of a certain product or set of products. There are two types of promotions:
- Shopping cart promotions, which are applied to items after they are added to shopping carts.
- Catalog promotions, which are applied to specific products in the catalog.
Both types of promotions can be restricted to certain customers using the selling context conditions.
Sample XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<promotions>
<promotion type="Cart">
<stores>
<store_code>SNAPITUPUS</store_code>
<store_code>SNAPITUPUK</store_code>
</stores>
<applies_to_all_stores>false</applies_to_all_stores>
<name>20% off all digital cameras with coupon</name>
<displayName>
<value language="en">25% off digital cameras</value>
</displayName>
<code>CAMERA2</code>
<description>20% off all digital cameras (single use per customer only) (coupon code = CAMERA2-1, CAMERA2-2, CAMERA2-3, CAMERA2-4, CAMERA2-4, CAMERA2-5) IN SNAPITUPUK store</description>
<availability>
<enabled>true</enabled>
<enabledate>2014-03-21T00:10:00+00:00</enabledate>
<disabledate>2014-03-21T00:12:00+00:00</disabledate>
</availability>
<conditions>
<and>
<condition>
<kind>Condition</kind>
<type>limitedUseCouponCodeCondition</type>
<parameters/>
<exceptions/>
</condition>
<and>
<condition>
<kind>Condition</kind>
<type>cartCurrencyCondition</type>
<parameters>
<parameter>
<key>currency</key>
<value>GBP</value>
</parameter>
</parameters>
<exceptions/>
</condition>
</and>
</and>
</conditions>
<actions>
<action type="cartCategoryPercentDiscountAction">
<parameters>
<parameter>
<key>discountPercent</key>
<value>20.0</value>
</parameter>
<parameter>
<key>categoryCode</key>
<value>90000003|SNAPITUPUK</value>
</parameter>
<parameter>
<key>numItems</key>
<value>1</value>
</parameter>
</parameters>
<exceptions/>
</action>
</actions>
<selling_context>
<guid>ac02214a-9334-4eec-9e7a-68879a48ea13</guid>
<name>cartPromo_Segment1</name>
<priority>0</priority>
<conditions>
<condition>
<guid>42239a84-06c0-4319-acaf-e2116b67f8e6</guid>
<name>4154006714990400</name>
<condition_string> { AND { AND { CUSTOMER_SEGMENT.includes 'Segment1' } } } </condition_string>
<dictionary_guid>PROMOTIONS_SHOPPER</dictionary_guid>
</condition>
</conditions>
</selling_context>
</promotion>
<promotion type="Catalog">
<catalogs>
<catalog_code>SNAPITUPUS</catalog_code>
<catalog_code>SNAPITUPUK</catalog_code>
</catalogs>
<applies_to_all_catalogs>false</applies_to_all_catalogs>
<name>50% off all Single Use Cameras</name>
<displayName/>
<code>0774BF5E-B309-B50A-22AC-47576CC76992</code>
<description>50% off all Single Use Cameras</description>
<availability>
<enabled>true</enabled>
<enabledate>2008-01-01T00:00:00-08:00</enabledate>
</availability>
<conditions>
<and>
<condition>
<kind>Condition</kind>
<type>productCategoryCondition</type>
<parameters>
<parameter>
<key>categoryCode</key>
<value>90000010|SNAPITUPUS</value>
</parameter>
</parameters>
<exceptions/>
</condition>
</and>
</conditions>
<actions>
<action type="catalogCurrencyPercentDiscountAction">
<parameters>
<parameter>
<key>currency</key>
<value>USD</value>
</parameter>
<parameter>
<key>discountPercent</key>
<value>50.0</value>
</parameter>
</parameters>
<exceptions/>
</action>
</actions>
</promotion>
</promotions>
Condition Rules (Deprecated)
Condition rules are the condition under which promotions are applied. For example, the promotion could be 10% off all items in your cart and the condition could be you have more than 10 items in your cart.
note
Condition rules are now included in the Promotions document.
Sample XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<condition_rules>
<rule>
<code>A2386DD3-E146-32EB-8754-0AF2D52ABEF6</code>
<conditions>
<and>
<and>
<condition>
<kind>Condition</kind>
<type>cartSubtotalCondition</type>
<parameters>
<parameter>
<key>subtotalAmount</key>
<value>50</value>
</parameter>
</parameters>
<exceptions/>
</condition>
<condition>
<kind>Condition</kind>
<type>cartCurrencyCondition</type>
<parameters>
<parameter>
<key>currency</key>
<value>USD</value>
</parameter>
</parameters>
<exceptions/>
</condition>
</and>
</and>
</conditions>
<actions>
<action>
<type>ShoppingCartPromotion</type>
<code>A2386DD3-E146-32EB-8754-0AF2D52ABEF6</code>
</action>
</actions>
</rule>
</condition_rules>
Saved Condition
A saved condition is a set of conditions that can be stored and reused at later date.
Sample XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<saved_conditions>
<condition>
<guid>71C8CE90-9D47-2F34-ECD4-D2EC099F236E</guid>
<name>STORE_savedCondition</name>
<description></description>
<condition_string> { OR { SELLING_CHANNEL.equalTo 'SLRWORLD' } } </condition_string>
<dictionary_guid>STORES</dictionary_guid>
</condition>
</saved_conditions>
Coupon Set
A Coupon Set is a collection of coupon codes. The bearer of the coupon is entitled to a shopping cart promotion.
Field definitions:
<rule_code>
: This field used to associate the coupon with a promotion rule. The value should match with the<code>
specified in a promotion that has already been imported.<coupon_config_code>
: This is a unique identifier for this coupon configuration.
Sample XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<coupon_sets>
<coupon_set>
<coupon_config>
<rule_code>25%_Off_Binoculars</rule_code>
<coupon_config_code>8B857F27-9E8B-9787-A833-72206FBDA417</coupon_config_code>
<coupon_usage_type>limitPerSpecifiedUser</coupon_usage_type>
<usage_limit>1</usage_limit>
<duration_days>0</duration_days>
<limited_duration>false</limited_duration>
<multi_use_per_order>false</multi_use_per_order>
</coupon_config>
<coupons>
<coupon guid="bdaeffe2-da2b-4b5e-95ce-5a6a5d46ae6b">Bino001</coupon>
<coupon guid="e8ef2567-6035-463f-81a4-436d7e5352f1" suspended="true">Bino002</coupon>
</coupons>
<coupon_usages>
<coupon_usage>
<coupon_code>Bino001</coupon_code>
<active_in_cart>true</active_in_cart>
<email>alana.abercombie@elasticpath.com</email>
</coupon_usage>
<coupon_usage>
<coupon_code>Bino001</coupon_code>
<active_in_cart>true</active_in_cart>
<email>annabelle.alvirez@elasticpath.com</email>
</coupon_usage>
<coupon_usage>
<coupon_code>Bino002</coupon_code>
<active_in_cart>true</active_in_cart>
<email>darcy.aubel@elasticpath.com</email>
</coupon_usage>
<coupon_usage>
<coupon_code>Bino002</coupon_code>
<active_in_cart>true</active_in_cart>
<email>tester@ep.com</email>
</coupon_usage>
</coupon_usages>
</coupon_set>
</coupon_sets>