Loading...
Area: Episerver Product Recommendations, Episerver Personalized Search & Navigation
Applies to versions: v1.4

XML elements

Recommended reading 

The root of the XML file is the <orders> element, which contains one <order> element for each order.

Each <order> element contains the following information as attributes:

  • reference code (refCode) of the order (or order number)
  • order date. The value for orderDate must be in the format defined by ISO 8601 “Date and Time Formats”.
  • currency that the order was placed in. The value for currency must be from the available Currency codes, which are in the 3-letter format defined by ISO 4217 “Currency codes”.
  • total value of the order. The subtotal, and shipping cost are optional. For example:
    <order refCode="orderRef123" 
           orderDate="2017-04-23T14:25:00 GMT" 
           currency="GBP" 
           total="100.0">

Each <order> element contains the following as sub-elements: 

  • The <user> element is optional. If present it should contain the email of the user who placed the order. You should include it to improve the accuracy of the online product recommendations presented to those customers.

    The element must include an XML attribute specifying the user’s email address. For example:

    <user email="customer@email.com"></user>
  • You must have at least one <product> element per order. The element contains the product's reference code (as provided in the product catalog feed for Episerver), the ordered quantity, and ordered price (per unit). For example:
    <product refCode="CB4551" 
             qty="1" 
             price="6.5">
    </product>

    The <product> element can be empty or include a number of sub-elements containing information about the product’s attributes. If supplied, the product’s <attribute> element needs to contain an XML attribute (which consists of a name-value pair specifying the name of the product’s attribute, such as key="pricerange") and a value (such as cheap). For example:

    <product refCode="CB4551" qty="2" price="6.5">
      <attribute key="pricerange">cheap</attribute>
    </product>

    Note: The price should be the final price per unit that the user paid for the product. Also, information given in the product’s <attribute> element is only imported into the database if it matches the associated information from the online-data feed. That is, if the product’s attribute name or value differs from what is in the database for that product, the new attribute is not imported into the database.

  • The <attribute> element is optional; use it to specify attributes related to the order. You can specify multiple instances of this element. If supplied, the order’s <attribute> element must contain an XML attribute (which consists of a name-value pair specifying the name of the order’s attribute, such as key="transaction") and a value (such as debitcard). For example:
    <attribute key="transaction">debitcard</attribute>

The following table lists the XML elements and their attributes.

XML element names XML attribute names XML attribute value examples XML element value examples
orders      
      order refCode orderRef123  
  orderDate 2017-04-23T14:25:00 GMT  
customerId (optional) customer123
  currency GBP  
  shipping (optional) 10.00  
  subTotal (optional) 90.00  
  total 100.00  
        attribute (optional) key tillname Till3
    user (optional) email (optional) customer@email.com (optional)  
    product refCode CB4551  
    qty 1  
    price 6.5  
       attribute (optional) key pricerange cheap
Do you find this information helpful? Please log in to provide feedback.

Last updated: Nov 06, 2017

Recommended reading