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, based on Condition Rules.
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 camera with coupon</name>
<displayName>
<value language="en">25 % off digital camera</value>
</displayName>
<code>CAMERA2</code>
<description>20% off all DigiCameras (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>
<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>
</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 Camera's</name>
<displayName/>
<code>0774BF5E-B309-B50A-22AC-47576CC76992</code>
<description>50% off all Single Use Camera's</description>
<availability>
<enabled>true</enabled>
<enabledate>2008-01-01T00:00:00-08:00</enabledate>
</availability>
<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
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.
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>