HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback

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 offline orders. For example:

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

  • The <user> element is optional for offline orders. 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:

  • 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 Optimizely), the ordered quantity, and ordered price (per unit). For example:


    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:



    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:


The following table lists the XML elements and their attributes.

(Script tags will be stripped)