Analytics & Reports
Analytics
StoreFront

Upload

API

The following curl command is a sample method of how to POST data to the Past Purchase service, where pastPurchaseData.json is the name of the file you are uploading.

Order Data Format

The data must be in JSON format, UTF-8 without BOM. Each record is one order.

json
{
    "id": "testid1",
    "metadata": [
        {
            "key": "First Name",
            "value": "Linda"
        }
    ],
    "items": [...
    ],
    "sessionId": "testsessionid1",
    "visitorId": "testvisitorid1",
    "cartType": "online",
    "userId": "testuserid1",
    "loyaltyId": "testloyaltyid1",
    "createdOn": 148322880000
}

Item Data Format

Each cart contains an array of individual items purchased.

Sample Item
{
  "sku": "1682483",
  "quantity": 1,
  "collection": "products",
  "metadata": [
    {
      "key": "customMessage",
      "value": "Happy Birthday!"
    }
  ],
  "title": "$20 Giftcard"
}