Transactions

Transactions are events which relate to the sale of products and services. Generally, these include Orders and Cancellations / Returns. These events are key, as revenue is generated here, and are vital for Modelling and Predictions.

Index:

Events

Event Description
Completed Order An order is placed (including all products in the order)
Changed Order Status An order is cancelled / returned

Properties

Order events have three base properties, as well as Cart properties. 

Property Description Mandatory Example
id Unique Identifier yes DEF12345
timestamp Event date yes 2022-01-01T09:21:06Z
orderId Invoice ID yes 1234
cart.products[].id Invoice item number yes 1
cart.products[].quantity quantity of item yes 4
cart.products[].price price per unit yes 10.99
cart.products[].category Product Category   Shoes
cart.product[].brand Product brand   Nike
cart.products[].sku Product SKU   AB1234
cart.products[].name Product name   Air Jordan
cart.currency Currency of payment   Euro

Examples

You can upload these events using the ActivatePro API, or via the Event Feed. Please go to Data Management to learn more.

Here is an example of the JSON used to upload an event via the API.

{
  "id": "ABC12345",
  "events": [{
          "event": "Completed Order",
          "timestamp": "2022-01-01T09:21:06Z",
          "properties": {
              "orderId": "1234",
              "cart": {
                  "total": 46.13,
                  "currency": "EUR",
                  "numberOfItems": 3,
                  "numberOfUniqueItems": 2,
                  "products": [{
                          "id": "1",
                          "price": 10.99,
                          "quantity": 1,
                          "category": "T-shirt"
                  },{
                          "id": "2",
                          "price": 17.57,
                          "quantity": 2,
                          "category": "Shoe"
                  }]
              }
          }
        }, {
          "event": "Changed Order Status",
          "timestamp": "2022-01-01T09:21:06Z",
          "properties": {
              "orderId": "1234",
              “status”: “return”,
              "currency": "EUR",
              “id”: “1”,
              "price": 10.99,
              "quantity": 1,
              "category": "T-shirt"
	  }
	}]
}

Here is the same example, presented as a JSON file that can be uploaded via Data Feeds:

[{
   "event": "Completed Order",
   "id": "ABC12345",
   "timestamp": "2022-01-01T09:21:06Z",
   "orderId": "1234",
   "cart": {
       "total": 46.13,
       "currency": "EUR",
       "numberOfItems": 3,
       "numberOfUniqueItems": 2,
       "products": [{
               "id": "1",
               "price": 10.99,
               "quantity": 1,
               "category": "T-shirt"
           },
           {
               "id": "2",
               "price": 17.57,
               "quantity": 2,
               "category": "Shoe"
           }]}}
{
   "event": "Changed Order Status",
   "id": "ABC12345",
   "timestamp": "2022-01-01T09:21:06Z",
   "orderId": "1234",
   “status”: “return”,
   "currency": "EUR", 
    “id”: “1”,
   "price": 10.99,
   "quantity": 1,
   "category": "T-shirt"
}]