You are here: Pleisty > Docs


Setting Up the Users Feed


Pleisty can import users profile data, shopping cart data, order history data, and offline order data through a JSON or XML feed. Once imported, this data can be used for user segmentation, generating more relevant product recommendations, and enabling product features that depend on this data.

Security Recommendations

Because this feed contains sensitive information we recommend making this feed accessible using HTTP basic access authentication over HTTPS.

Additionally, please make the feed accessible only from Pleisty's IPs:

5.9.21.130
5.9.21.154
136.243.8.5
136.243.8.59
144.76.102.133

The Feed Structure

The feed should contain all the data required to support the intended implementation. All this data can be used in user segmentation and product recommendations. If unsure what information to include, please check with your Pleisty account manager.

{
  "users": {
    "user": [
      {
        "email": "The e-mail of the user",
        "customer_id": "The same customer_id used in the JS Tracking Code."
        "first name": "User's first name"
        "last name": "User's last name"        
        "cart": "Your user's shopping cart", // optional
        "orders": ["Your user's order history"], // optional
        "wishlists": ["Your user's wishlists"] // optional       
      }
    ]
  }
}

JSON Feed Example

Here is a JSON feed example.

{
  "users": {
    "user": [
      {
        "email": "example@email.com",
        "customer_id": "Customer ID", //same customer_id that you identify with on-site - in most cases this is email address
        "cart": {
          "cart_ts": "123456789", //Cart update timestamp(Unix Epoch Time)
          "cart_url": "https://url.com/cart", //URL to the user's cart
          "items": [
            {
              "item_id": "1232456", //Unique product identifier (ID or SKU)
              "item_url": "https://url.com/product",
              "item_price": "123.45",
              "item_qty": "2",
              "item_currency": "USD",
            },
            {...next item...}
          ],
        "orders": [
          {
              "order_id": "123456",
            "order_ts": "123456789", //Order Timestamp(Unix Epoch Time)
            "order_amount": "123.45",
            "order_currency": "USD",
            "order_source": "phone", //website or phone or offline
            "items": [
              {
                "item_id": "1232456", //Unique product identifier (ID or SKU)
                "item_url": "https://url.com/product",
                "item_price": "123.45",
                "item_qty": "2",
                "item_currency": "USD",
              },
              {...next item...}
            ]
          },
          {...next order...}
        ],              
        "wishlists": [
          {
            "wishlist_id": "123456",
            "wishlist_name": "name",
            "wishlist_create_ts": "123456789", //wishlist_create Timestamp(Unix Epoch Time)
            "wishlist_update_ts": "123456789",  //wishlist_update Timestamp(Unix Epoch Time)
            "wishlist_amount": "123.45",
            "wishlist_currency": "USD",
            "wishlist_source": "phone", //website or phone or offline
            "items": [
              {
                "item_id": "1232456", //Unique product identifier (ID or SKU)
                "item_url": "https://url.com/product",
                "item_price": "123.45",
                "item_qty": "2",
                "item_currency": "USD",
              },
              {...next item...}
            ]
          },
          {...next wishlist...}
        ],
      },
      {...next user...}
    ]
  }
}

JSON Lines Feed Format

You can also format the feed by the JSON Lines standard. See http://jsonlines.org/ for more details.

You need to keep the same format for each user as in the JSON Feed Format but have one product per line

{"email": "john@example.com", ...}
{"email": "mike@example.com", ...}
...

XML Feed Example

If you choose to use an XML feed, please use this format:


<?xml version="1.0" encoding="UTF-8"?>
<users>
  <user>
&lt;!-- BASIC PROFILE DATA SECTION --&gt;
  &lt;customer_id&gt;The same customer_id used in the General Tracking Code&lt;customer_id&gt;
  &lt;email&gt;email@example.com&lt;/email&gt;
&lt;!-- ORDERS HISTORY SECTION --&gt;
&lt;orders&gt;
  &lt;!-- first order --&gt;    
  &lt;order&gt;
    &lt;order_id&gt;Order ID&lt;/order_id&gt;
    &lt;order_ts&gt;Order Timestamp(Unix Epoch Time)&lt;/order_ts&gt;
    &lt;order_amount&gt;12345.67&lt;/order_amount&gt;
    &lt;order_currency&gt;EUR&lt;/order_currency&gt;
    &lt;order_source&gt;website or phone or offline&lt;/order_source&gt;
    &lt;items&gt;
      &lt;item&gt;
        &lt;item_url&gt;URL of the item, same as in product catalogue feed&lt;/item_url&gt;
        &lt;item_id&gt;Item SKU&lt;/item_id&gt;
        &lt;item_price&gt;12345.67&lt;/item_price&gt;
        &lt;item_currency&gt;EUR&lt;/item_currency&gt;
        &lt;item_qty&gt;99&lt;/item_qty&gt;
      &lt;/item&gt;
    &lt;/items&gt;
  &lt;/order&gt;
  &lt;!-- second order --&gt;    
  &lt;order&gt;
    &lt;!-- order details --&gt;           
  &lt;/order&gt;
  &lt;!-- next orders... --&gt;    
&lt;/orders&gt;

&lt;!-- SHOPPING CART SECTION --&gt;
&lt;cart&gt; 
  &lt;cart_ts&gt;Cart Timestamp(Unix Epoch Time)&lt;/cart_ts&gt;
  &lt;cart_url&gt;URL that recreates this cart for the user&lt;/cart_url&gt;
  &lt;items&gt;
    &lt;!-- first cart item --&gt;
    &lt;item&gt;
      &lt;item_url&gt;URL of the item, same as in product catalogue feed&lt;/item_url&gt;
      &lt;item_id&gt;Item SKU&lt;/item_id&gt;
      &lt;item_price&gt;12345.67&lt;/item_price&gt;
      &lt;item_currency&gt;EUR&lt;/item_currency&gt;
      &lt;item_qty&gt;3&lt;/item_qty&gt;
    &lt;/item&gt;
    &lt;!-- second cart item --&gt;
    &lt;item&gt;
      &lt;!-- item details --&gt;          
    &lt;/item&gt;
    &lt;!-- next cart items... --&gt;
  &lt;/items&gt;
&lt;/cart&gt;

&lt;!-- WISHLISTS SECTION --&gt;
&lt;wishlists&gt;
  &lt;!-- first wishlist --&gt;
  &lt;wishlist&gt;
    &lt;wishlist_id&gt;Wishlist ID&lt;/wishlist_id&gt;
    &lt;wishlist_name&gt;Wishlist name&lt;/wishlist_name&gt;
    &lt;wishlist_create_ts&gt;Wishlist create Timestamp(Unix Epoch Time)&lt;/wishlist_create_ts&gt;
    &lt;wishlist_update_ts&gt;Wishlist update Timestamp(Unix Epoch Time)&lt;/wishlist_update_ts&gt;
    &lt;items&gt;
      &lt;item&gt;
        &lt;item_url&gt;URL of the item, same as in product catalogue feed&lt;/item_url&gt;
        &lt;item_id&gt;Unique product identifier (ID or SKU)&lt;/item_id&gt;
        &lt;item_price&gt;12345.67&lt;/item_price&gt;
        &lt;item_currency&gt;EUR&lt;/item_currency&gt;
        &lt;item_qty&gt;2&lt;/item_qty&gt;
      &lt;/item&gt;
      &lt;!-- next wishlist item --&gt;
    &lt;/items&gt;
  &lt;/wishlist&gt;
  &lt;!-- next wishlist --&gt;
&lt;/wishlists&gt;

</user> <!-- next user ... -->
</users>

Notes: The "url" tag must contain the URL of the product as it is used on-site. For the "url" tag, please provide URLs that do not redirect. This will affect the reporting as well as the functioning of the widgets. All the URLs must use the same HTTP/HTTPS protocol.





Questions about installing Pleisty?
Get in touch