Loading...
Area: Optimizely Product Recommendations
Applies to versions: 1.4 and higher (Personalization API)
Other versions:

Offline order tracking endpoint

Recommended reading 

The offline order tracking endpoint lets you send offline customer order information to Optimizely in real-time. The order information contains information about the customer and the products they have just purchased offline. The API expects the following format for the JSON payload.

Parameters Description
lang [Optional] Language code of the store, for example:

"lang" : "en-gb"
If not specified, en-gb is the default. See Language codes.
user For example:

"user" : {…}

Note: When user is given, either email or id must be supplied. If user is omitted, the order data will not be used used to enrich that user's behavior.

  email [Deprecated] [Optional] The email address of the customer. For example:

"email" : "john.customer@email.com"

Note: email was deprecated and kept for backward compatibility only. Use id instead.

  id [Optional] Pseudonymised ID of the user. For example:

"id" : "abcd1234efgh"
This identifies a user in the Personalization system. Use the user ID to improve offline order tracking and product recommendations; you can use it also in other Optimizely products, such as Email Product Recommendations and Triggered Messages.

Note: For Product Recommendations, to prevent user behavior from being lost, send Optimizely an up-to-date mapping between email addresses and pseudonymized user IDs. This needs to be provided only once so that Optimizely Personalization can replace existing customer email addresses with their corresponding pseudonymized user ID.

  info [Optional] Information about the customer, such as their diet, allergies, gender, loyalty card information. This is given in key-value pairs; the keys need to be defined with Optimizely before use. For example:

"info" : {
           "gender"  : "female", 
           "allergy" : "nuts",
           "diet"    : "vegan"
           "store"   : "StreamlyCool Bluewater"
           "colour"  : "yellow"
           "size"    : "10"
         }
New records are created; existing records are updated.
order
"order" : {…}
  refCode

orderDate

customerId

currency

shipping

subTotal

total
"refCode"    : "orderRef123",
"orderDate"  : "orderRef123",
"customerId" : "customer123",
"currency"   : "GBP",
"shipping"   : 0.0,
"subTotal"   : 100.0,
"total"      : 100.0
  items
"items" : [{…},{…},{…},…]
  refCode

qty

price

attributes
"refCode"    : "CB4551",
"qty"        : 1,
"price"      : 6.5,
"attributes" : { "discount": "true" }

 

attributes [Optional]

"attributes" : {
                 "store"         : "StreamlyCool Regent Street",
                 "storePostcode" : "W1B 4HX",
               }

Example

{
  "lang"  : "en-gb",
  "user"  : {
	      "id"   : "abcd1234efgh",
	      "info" : {"gender": "male"}
	    },
  "order" : {
	      "refCode"    : "orderRef",
	      "orderDate"  : "2016-05-16T14:25:00 GMT",
	      "currency"   : "GBP",
	      "shipping"   : 0.0,
	      "subTotal"   : 90.0,
	      "total"      : 90.0,
	      "items"      : [
		               {
		                 "refCode"    : "ref1",
		                 "qty"        : 1,
		                 "price"      : 50.0,
		                 "attributes" : {"discount" : "true"}
		               },
      		               {
		                 "refCode"    : "ref2",
		                 "qty"        : 2,
		                 "price"      : 20.0,
		                 "attributes" : {"attr21" : "value21"}
		               }
	                     ],
	      "attributes" : {
		               "store"         : "StreamlyCool Regent Street",
		               "storePostcode" : "W1B 4HX"
		             }
	    }
}
  • The URL for testing in the UAT environment is:
    • https://uat.peerius.com/tracker/smart-api/orders/offline
  • The URL with the production end point follows one of the following formats, depending on your provisioned environment:
    • https://<sitename>.peerius.com/tracker/smart-api/orders/offline
    • https://<sitename>.peerius.episerver.net/tracker/smart-api/orders/offline

Contact Optimizely if you are unsure which domain applies to your integration.

Notes

  • The sitename part of this address is assigned by Optimizely.

  • This entry point requires a request header containing the authentication parameters defined in the Header information section.

  • The request body needs to be sent in a POST request.

  • Ensure HTTPS is in the URL.

  • Offline orders sent via API are used to enrich an individual's personal experience after the user logs into your online site and you track the user. Offline orders passed via API do not affect crowd behavior and algorithms by default. If the offline order data influences online algorithms, contact Optimizely.
Do you find this information helpful? Please log in to provide feedback.

Last updated: Nov 06, 2017

Recommended reading