Promotions Import/Export

Use the promotion.xsd to specify an import/export file for both campaigns and promotions. For information about specific section of the import/export schema, see the following topics:

The top-level elements can be either, as follows:

<!-- top-level element -->
  <xsd:element name="promotions">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="campaign" type="Campaign" minOccurs="0" maxOccurs="unbounded" />
        <xsd:element name="promotion" type="Promotion" minOccurs="0" maxOccurs="unbounded" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

For importing mass data, use this structure:

<!-- fake element for mass data support -->
<xsd:element name="campaign" type="Campaign" />
<xsd:element name="promotion" type="Promotion" />

Campaigns

Campaign, a complex data type within the promotion.xsd, is primarily used to group promotions. They are also associated with customer groups. You can specify customer groups as within a promotion import/export file, or separately using the customergroup.xsd. The following is within the promotion.xsd:

<xsd:complexType name="CustomerGroups" mixed="false">
    <xsd:sequence>
     <xsd:element name="customer-group" type="CustomerGroup" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CustomerGroup" mixed="false">
    <xsd:attribute name="group-id" type="Generic.NonEmptyString.256" use="required" />
</xsd:complexType>

Promotion Classes

All promotion classes (product, order, shipping and bonus) share certain elements that are defined at the level of the promotion XML element (specified in promotion.xsd). The differences between the main promotion classes (product, order and shipping) are represented as an optional choice of promotion class specific rule elements, as follows:

<xsd:choice minOccurs="0" maxOccurs="1">
  <xsd:element name="product-promotion-rule" type="ProductPromotionRule" />
  <xsd:element name="shipping-promotion-rule" type="ShippingPromotionRule" />
  <xsd:element name="order-promotion-rule" type="OrderPromotionRule" />
</xsd:choice>

Excluded product rules are imported and exported with order promotions via the excluded-products element, as follows:

<!-- order promotions -->
<xsd:complexType name="OrderPromotionRule" mixed="false">
  <xsd:sequence>
   <!-- new element-->
    <xsd:element name="excluded-products" type="ProductSpecification" minOccurs="0" maxOccurs="1" />
    <!-- end of new element-->
 ...
    </xsd:sequence>
</xsd:complexType>

The qualifying-products element is supported for shipping and order promotions.

This is a sample of how an order promotions import/export XML would look:

<promotion campaign-id="Demo Campaign" promotion-id="OP_10_500">
  <enabled-flag>true</enabled-flag>
  <qualifiers>
    <customer-groups/>
  </qualifiers>
  <exclusivity>class</exclusivity>
  <name xml:lang="x-default">10% off orders $500 and up</name>
  <callout-msg xml:lang="x-default">10% off orders $500 and up.</callout-msg>
  <details xml:lang="x-default">10% off orders $500 and up.</details>
    <order-promotion-rule>
<!-- excluded product section -->
      <excluded-products>
         <included-products>
            <condition-group>
              <category-condition catalog-id="master-catalog">
                <category-id>GiftCerts</category-id>
              </category-condition>
            </condition-group>
         </included-products>
      </excluded-products>
<!-- end of excluded product section -->	
      <discounts condition-type="order-total">
        <discount>
          <threshold>500.0</threshold>
          <percentage>10.0</percentage>
        </discount>
      </discounts>
    </order-promotion-rule>
</promotion>
Note: The non-qualifying-products element is deprecated. It is supported on import but not on export.