Skip to content

Events

APIs for tracking events in your Lindris account.

As a reminder, all requests must be authenticated and use the base URL: https://api.lindris.com

Track a generic custom event

POST api/events

Request Body

  • eventName string required - Event name to be tracked. Example: clicked_home_cta
  • email string optional - The person's email address. Either email or referenceId must be provided.
  • referenceId mixed optional - The person's unique identifier. Either email or referenceId must be provided. Numeric values will be cast to strings. Example: cust_123456
  • uuid string optional - The uuid from a previous event response. Can be used instead of email or referenceId.
    • Example: 318835f4-f968-4894-9847-358399823d6c
  • source string required - The e-commerce/platform source. Example: woocommerce
  • properties string[] optional - A key-value pair of event properties to be tracked.
  • silent boolean optional - If true, no workflow automations will be triggered, but the event will be stored. Example: true
  • test boolean optional - If true, no event will be added but response will be returned. Useful for testing the event properties without storing the event. Response is representative only. Example: true

Request

bash
curl --request POST \
    "https://api.lindris.com/api/events" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"eventName\": \"clicked_home_cta\",
    \"referenceId\": \"cust_123456\",
    \"uuid\": \"318835f4-f968-4894-9847-358399823d6c\",
    \"source\": \"woocommerce\",
    \"properties\": null,
    \"silent\": true,
    \"test\": true
}"
php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/events';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'eventName' => 'clicked_home_cta',
            'referenceId' => 'cust_123456',
            'uuid' => '318835f4-f968-4894-9847-358399823d6c',
            'source' => 'woocommerce',
            'properties' => null,
            'silent' => true,
            'test' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
javascript
const url = new URL(
    "https://api.lindris.com/api/events"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "eventName": "clicked_home_cta",
    "referenceId": "cust_123456",
    "uuid": "318835f4-f968-4894-9847-358399823d6c",
    "source": "woocommerce",
    "properties": null,
    "silent": true,
    "test": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Responses

json
{
   "success": true,
   "timestamp": 1710969645
}
json
{
   "message": "The given data was invalid.",
   "errors": {
      "eventName": [
         "The event name field is required."
      ],
      "source": [
         "The source field is required."
      ],
      "email": [
         "The email field is required when reference id is not present."
      ]
   }
}

Track a cart event

POST api/events/cart/{action}

For tracking cart lifecycle events

URL Parameters

  • action string required - The cart event action to track. Example: created
    • Must be one of:
      • created
      • updated
      • abandoned

Request Body

  • email string optional - The person's email address. Either email or referenceId must be provided.

  • referenceId mixed optional - The person's unique identifier. Either email or referenceId must be provided. Numeric values will be cast to strings. Example: cust_123456

  • uuid string optional - The uuid from a previous event response. Can be used instead of email or referenceId.

    • Example: 318835f4-f968-4894-9847-358399823d6c
  • source string required - The e-commerce platform source. Example: woocommerce

  • id mixed optional - The unique identifier for the cart, usually a cart session ID or similar. Numeric values will be cast to strings. Example: cart_123456

  • occurredAt string optional - The timestamp when this action occurred. Example: 2024-03-21T15:30:00Z

  • products object[] optional - The products in the cart.
    • Item * object Properties

      • id mixed required - The unique identifier for the product. Numeric values will be cast to strings. Example: prod_123
      • name string required - The name of the product. Example: Awesome T-Shirt
      • url string optional - A URL to the site containing the product details.
        • Example: https://store.example.com/products/awesome-tshirt
      • image_url string optional - A direct URL to an image of the product.
        • Example: https://store.example.com/images/awesome-tshirt.jpg
      • sku string optional - The SKU for the product. Example: TSH-001
      • variant_id mixed optional - The unique identifier for the variant of the product. Numeric values will be cast to strings. Example: var_123
      • brand string optional - The brand name for the product. Example: Awesome Brand
      • price number optional - The price of the product. Example: 29.99
      • quantity integer optional - The quantity of the product. Example: 2
      • total number optional - The line item total after all calculations. Example: 59.98
      • discounts number optional - The total discounts applied to this product. Example: 10
      • taxes number optional - The total taxes for this product. Example: 5
      • fees number optional - The total fees for this product. Example: 2
      • shipping number optional - The total shipping for this product. Example: 5
  • total number optional - The total value of the cart. Example: 59.98

  • total_products integer optional - The total number of products in the cart. Example: 2

  • url string optional - The URL of the cart.

    • Example: https://store.example.com/cart
  • currency string optional - The currency code (ISO 4217). Example: USD

  • modified_at string optional - When the cart was last modified. Example: 2024-03-21T15:30:00Z

  • silent boolean optional - If true, no workflow automations will be triggered, but the event will be stored. Example: true

  • test boolean optional - If true, no cart event will be added but response will be returned. Useful for testing the event properties without storing the event. Response is representative only. Example: true

Request

bash
curl --request POST \
    "https://api.lindris.com/api/events/cart/created" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"referenceId\": \"cust_123456\",
    \"uuid\": \"318835f4-f968-4894-9847-358399823d6c\",
    \"source\": \"woocommerce\",
    \"id\": \"cart_123456\",
    \"occurredAt\": \"2024-03-21T15:30:00Z\",
    \"total\": 59.98,
    \"total_products\": 2,
    \"url\": \"https:\\/\\/store.example.com\\/cart\",
    \"currency\": \"USD\",
    \"modified_at\": \"2024-03-21T15:30:00Z\",
    \"silent\": true,
    \"test\": true
}"
php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/events/cart/created';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'referenceId' => 'cust_123456',
            'uuid' => '318835f4-f968-4894-9847-358399823d6c',
            'source' => 'woocommerce',
            'id' => 'cart_123456',
            'occurredAt' => '2024-03-21T15:30:00Z',
            'total' => 59.98,
            'total_products' => 2,
            'url' => 'https://store.example.com/cart',
            'currency' => 'USD',
            'modified_at' => '2024-03-21T15:30:00Z',
            'silent' => true,
            'test' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
javascript
const url = new URL(
    "https://api.lindris.com/api/events/cart/created"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "referenceId": "cust_123456",
    "uuid": "318835f4-f968-4894-9847-358399823d6c",
    "source": "woocommerce",
    "id": "cart_123456",
    "occurredAt": "2024-03-21T15:30:00Z",
    "total": 59.98,
    "total_products": 2,
    "url": "https:\/\/store.example.com\/cart",
    "currency": "USD",
    "modified_at": "2024-03-21T15:30:00Z",
    "silent": true,
    "test": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Responses

json
{
   "success": true,
   "timestamp": 1710969645
}
json
{
   "message": "The given data was invalid.",
   "errors": {
      "source": [
         "The source field is required."
      ],
      "id": [
         "The id field is required."
      ],
      "email": [
         "The email field is required when reference id is not present."
      ]
   }
}

Track a product event

POST api/events/product/{action}

For tracking product lifecycle events

URL Parameters

  • action string required - The product event action to track. Example: viewed
    • Must be one of:
      • viewed
      • created
      • updated
      • deleted

Request Body

  • email string optional - The person's email address. Either email or referenceId must be provided.

  • referenceId mixed optional - The person's unique identifier. Either email or referenceId must be provided. Numeric values will be cast to strings. Example: cust_123456

  • uuid string optional - The uuid from a previous event response. Can be used instead of email or referenceId.

    • Example: 318835f4-f968-4894-9847-358399823d6c
  • source string required - The e-commerce platform source. Example: woocommerce

  • id mixed required - The unique identifier for the product. Numeric values will be cast to strings. Example: prod_123456

  • modified_at string optional - The timestamp when this product was last modified. Example: 2024-03-21T15:30:00Z

  • created_at string optional - The timestamp when this product was created. Example: 2024-03-21T15:30:00Z

  • name string optional - The name of the product. Example: Awesome T-Shirt

  • description string optional - The description of the product.

    • Example: A really awesome t-shirt
  • url string optional - The URL of the product.

    • Example: https://store.example.com/products/awesome-tshirt
  • image_url string optional - The URL of the product image.

    • Example: https://store.example.com/images/awesome-tshirt.jpg
  • price number optional - The price of the product. Example: 29.99

  • sku string optional - The SKU of the product. Example: TSH-001

  • barcode string optional - The barcode of the product. Example: 123456789

  • categories string[] optional - The categories of the product.

    • Example: [ "Clothing", "T-Shirts" ]
  • tags string[] optional - The tags of the product.

    • Example: [ "summer", "sale" ]
  • vendor string optional - The vendor/manufacturer of the product. Example: Awesome Brand

  • type string optional - The type of the product. Example: T-Shirt

  • brand string optional - The brand of the product. Example: Awesome Brand

  • public_id string optional - The public ID of the product. Example: prod_123456

  • variant_id string optional - The variant ID of the product. Example: var_123

  • variants object[] optional - The variants of the product.
    • Item * object Properties

      • id mixed required - The unique identifier for the variant. Numeric values will be cast to strings. Example: var_123
      • sku string optional - The SKU for this variant. Example: TSH-001-L
      • price number optional - The price for this variant. Example: 29.99
      • barcode string optional - The barcode for this variant. Example: 123456789-L
      • options string[] optional - The options that define this variant.
  • currency string optional - The currency code (ISO 4217). Example: USD

  • silent boolean optional - If true, no workflow automations will be triggered, but the event will be stored. Example: true

  • test boolean optional - If true, no product event will be added but response will be returned. Useful for testing the event properties without storing the event. Response is representative only. Example: true

Request

bash
curl --request POST \
    "https://api.lindris.com/api/events/product/viewed" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"referenceId\": \"cust_123456\",
    \"uuid\": \"318835f4-f968-4894-9847-358399823d6c\",
    \"source\": \"woocommerce\",
    \"id\": \"prod_123456\",
    \"modified_at\": \"2024-03-21T15:30:00Z\",
    \"created_at\": \"2024-03-21T15:30:00Z\",
    \"name\": \"Awesome T-Shirt\",
    \"description\": \"A really awesome t-shirt\",
    \"url\": \"https:\\/\\/store.example.com\\/products\\/awesome-tshirt\",
    \"image_url\": \"https:\\/\\/store.example.com\\/images\\/awesome-tshirt.jpg\",
    \"price\": 29.99,
    \"sku\": \"TSH-001\",
    \"barcode\": \"123456789\",
    \"categories\": [
        \"Clothing\",
        \"T-Shirts\"
    ],
    \"tags\": [
        \"summer\",
        \"sale\"
    ],
    \"vendor\": \"Awesome Brand\",
    \"type\": \"T-Shirt\",
    \"brand\": \"Awesome Brand\",
    \"public_id\": \"prod_123456\",
    \"variant_id\": \"var_123\",
    \"currency\": \"USD\",
    \"silent\": true,
    \"test\": true
}"
php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/events/product/viewed';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'referenceId' => 'cust_123456',
            'uuid' => '318835f4-f968-4894-9847-358399823d6c',
            'source' => 'woocommerce',
            'id' => 'prod_123456',
            'modified_at' => '2024-03-21T15:30:00Z',
            'created_at' => '2024-03-21T15:30:00Z',
            'name' => 'Awesome T-Shirt',
            'description' => 'A really awesome t-shirt',
            'url' => 'https://store.example.com/products/awesome-tshirt',
            'image_url' => 'https://store.example.com/images/awesome-tshirt.jpg',
            'price' => 29.99,
            'sku' => 'TSH-001',
            'barcode' => '123456789',
            'categories' => [
                'Clothing',
                'T-Shirts',
            ],
            'tags' => [
                'summer',
                'sale',
            ],
            'vendor' => 'Awesome Brand',
            'type' => 'T-Shirt',
            'brand' => 'Awesome Brand',
            'public_id' => 'prod_123456',
            'variant_id' => 'var_123',
            'currency' => 'USD',
            'silent' => true,
            'test' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
javascript
const url = new URL(
    "https://api.lindris.com/api/events/product/viewed"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "referenceId": "cust_123456",
    "uuid": "318835f4-f968-4894-9847-358399823d6c",
    "source": "woocommerce",
    "id": "prod_123456",
    "modified_at": "2024-03-21T15:30:00Z",
    "created_at": "2024-03-21T15:30:00Z",
    "name": "Awesome T-Shirt",
    "description": "A really awesome t-shirt",
    "url": "https:\/\/store.example.com\/products\/awesome-tshirt",
    "image_url": "https:\/\/store.example.com\/images\/awesome-tshirt.jpg",
    "price": 29.99,
    "sku": "TSH-001",
    "barcode": "123456789",
    "categories": [
        "Clothing",
        "T-Shirts"
    ],
    "tags": [
        "summer",
        "sale"
    ],
    "vendor": "Awesome Brand",
    "type": "T-Shirt",
    "brand": "Awesome Brand",
    "public_id": "prod_123456",
    "variant_id": "var_123",
    "currency": "USD",
    "silent": true,
    "test": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Responses

json
{
   "success": true,
   "timestamp": 1710969645
}
json
{
   "message": "The given data was invalid.",
   "errors": {
      "source": [
         "The source field is required."
      ],
      "id": [
         "The id field is required."
      ],
      "email": [
         "The email field is required when reference id is not present."
      ]
   }
}

Track an order event

POST api/events/order/{action}

For tracking order lifecycle events

URL Parameters

  • action string required - The order event action to track. Example: created
    • Must be one of:
      • created
      • updated
      • deleted
      • completed

Request Body

  • email string optional - The person's email address. Either email or referenceId must be provided.

  • referenceId mixed optional - The person's unique identifier. Either email or referenceId must be provided. Numeric values will be cast to strings. Example: cust_123456

  • uuid string optional - The uuid from a previous event response. Can be used instead of email or referenceId.

    • Example: 318835f4-f968-4894-9847-358399823d6c
  • source string required - The e-commerce/platform source. Example: woocommerce

  • id mixed required - The unique identifier for the order. Numeric values will be cast to strings. Example: order_123456

  • occurred_at string optional - The timestamp when this action occurred. Example: 2024-03-21T15:30:00Z

  • products object[] optional - The products in the order.
    • Item * object Properties

      • id mixed required - The unique identifier for the product. Numeric values will be cast to strings. Example: prod_123
      • name string required - The name of the product. Example: Awesome T-Shirt
      • url string optional - A URL to the site containing the product details.
        • Example: https://store.example.com/products/awesome-tshirt
      • image_url string optional - A direct URL to an image of the product.
        • Example: https://store.example.com/images/awesome-tshirt.jpg
      • sku string optional - The SKU for the product. Example: TSH-001
      • variant_id mixed optional - The unique identifier for the variant of the product. Numeric values will be cast to strings. Example: var_123
      • brand string optional - The brand name for the product. Example: Awesome Brand
      • price number optional - The price of the product. Example: 29.99
      • quantity integer optional - The quantity of the product ordered. Example: 2
      • total number optional - The line item total after all calculations. Example: 59.98
      • discounts number optional - The total discounts applied to this product. Example: 10
      • taxes number optional - The total taxes for this product. Example: 5
      • fees number optional - The total fees for this product. Example: 2
      • shipping number optional - The total shipping for this product. Example: 5
  • currency string optional - The currency code (ISO 4217). Example: USD

  • publicId mixed optional - The customer-facing order ID. Numeric values will be cast to strings. Example: #1001

  • total number optional - The total value of the order. Example: 99.99

  • shipping number optional - The total shipping cost. Example: 5.99

  • discounts number optional - The total discounts applied. Example: 10

  • taxes number optional - The total taxes applied. Example: 8.5

  • fees number optional - The total fees applied. Example: 2.5

  • status string optional - The current status of the order. Example: completed

  • url string optional - The public URL of the order details.

    • Example: https://store.example.com/order/1001
  • phone string optional - The customer's phone number. Example: +1234567890

  • billing_address object optional - The billing address details.
    • label string optional - The label describing the billing address. Example: Home
    • first_name string optional - The first name on the billing address. Example: John
    • last_name string optional - The last name on the billing address. Example: Doe
    • phone string optional - The phone number on the billing address. Example: +1234567890
    • company string optional - The company on the billing address. Example: Acme Inc
    • address1 string optional - The billing street address. Example: 123 Main St
    • address2 string optional - Additional billing address line. Example: Suite 100
    • city string optional - The city on the billing address. Example: New York
    • state string optional - The state on the billing address. Example: NY
    • postal_code string optional - The postal/zip code on the billing address. Example: 10001
    • country string optional - The country on the billing address. Example: US
  • shipping_address object optional - The shipping address details.
    • label string optional - The label describing the shipping address. Example: Office
    • first_name string optional - The first name on the shipping address. Example: John
    • last_name string optional - The last name on the shipping address. Example: Doe
    • phone string optional - The phone number on the shipping address. Example: +1234567890
    • company string optional - The company on the shipping address. Example: Acme Inc
    • address1 string optional - The shipping street address. Example: 123 Main St
    • address2 string optional - Additional shipping address line. Example: Suite 100
    • city string optional - The city on the shipping address. Example: New York
    • state string optional - The state on the shipping address. Example: NY
    • postal_code string optional - The postal/zip code on the shipping address. Example: 10001
    • country string optional - The country on the shipping address. Example: US
  • payment_gateway string optional - The payment gateway used. Example: stripe

  • _ls string optional - The revenue tracking hash.

  • silent boolean optional - If true, no workflow automations will be triggered, but the event will be stored. Example: true

  • test boolean optional - If true, no order event will be added but response will be returned. Useful for testing the event properties without storing the event. Response is representative only. Example: true

Request

bash
curl --request POST \
    "https://api.lindris.com/api/events/order/created" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"referenceId\": \"cust_123456\",
    \"uuid\": \"318835f4-f968-4894-9847-358399823d6c\",
    \"source\": \"woocommerce\",
    \"id\": \"order_123456\",
    \"occurred_at\": \"2024-03-21T15:30:00Z\",
    \"currency\": \"USD\",
    \"publicId\": \"#1001\",
    \"total\": 99.99,
    \"shipping\": 5.99,
    \"discounts\": 10,
    \"taxes\": 8.5,
    \"fees\": 2.5,
    \"status\": \"completed\",
    \"url\": \"https:\\/\\/store.example.com\\/order\\/1001\",
    \"phone\": \"+1234567890\",
    \"billing_address\": {
        \"label\": \"Home\",
        \"first_name\": \"John\",
        \"last_name\": \"Doe\",
        \"phone\": \"+1234567890\",
        \"company\": \"Acme Inc\",
        \"address1\": \"123 Main St\",
        \"address2\": \"Suite 100\",
        \"city\": \"New York\",
        \"state\": \"NY\",
        \"postal_code\": \"10001\",
        \"country\": \"US\"
    },
    \"shipping_address\": {
        \"label\": \"Office\",
        \"first_name\": \"John\",
        \"last_name\": \"Doe\",
        \"phone\": \"+1234567890\",
        \"company\": \"Acme Inc\",
        \"address1\": \"123 Main St\",
        \"address2\": \"Suite 100\",
        \"city\": \"New York\",
        \"state\": \"NY\",
        \"postal_code\": \"10001\",
        \"country\": \"US\"
    },
    \"payment_gateway\": \"stripe\",
    \"silent\": true,
    \"test\": true
}"
php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/events/order/created';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'referenceId' => 'cust_123456',
            'uuid' => '318835f4-f968-4894-9847-358399823d6c',
            'source' => 'woocommerce',
            'id' => 'order_123456',
            'occurred_at' => '2024-03-21T15:30:00Z',
            'currency' => 'USD',
            'publicId' => '#1001',
            'total' => 99.99,
            'shipping' => 5.99,
            'discounts' => 10.0,
            'taxes' => 8.5,
            'fees' => 2.5,
            'status' => 'completed',
            'url' => 'https://store.example.com/order/1001',
            'phone' => '+1234567890',
            'billing_address' => [
                'label' => 'Home',
                'first_name' => 'John',
                'last_name' => 'Doe',
                'phone' => '+1234567890',
                'company' => 'Acme Inc',
                'address1' => '123 Main St',
                'address2' => 'Suite 100',
                'city' => 'New York',
                'state' => 'NY',
                'postal_code' => '10001',
                'country' => 'US',
            ],
            'shipping_address' => [
                'label' => 'Office',
                'first_name' => 'John',
                'last_name' => 'Doe',
                'phone' => '+1234567890',
                'company' => 'Acme Inc',
                'address1' => '123 Main St',
                'address2' => 'Suite 100',
                'city' => 'New York',
                'state' => 'NY',
                'postal_code' => '10001',
                'country' => 'US',
            ],
            'payment_gateway' => 'stripe',
            'silent' => true,
            'test' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
javascript
const url = new URL(
    "https://api.lindris.com/api/events/order/created"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "referenceId": "cust_123456",
    "uuid": "318835f4-f968-4894-9847-358399823d6c",
    "source": "woocommerce",
    "id": "order_123456",
    "occurred_at": "2024-03-21T15:30:00Z",
    "currency": "USD",
    "publicId": "#1001",
    "total": 99.99,
    "shipping": 5.99,
    "discounts": 10,
    "taxes": 8.5,
    "fees": 2.5,
    "status": "completed",
    "url": "https:\/\/store.example.com\/order\/1001",
    "phone": "+1234567890",
    "billing_address": {
        "label": "Home",
        "first_name": "John",
        "last_name": "Doe",
        "phone": "+1234567890",
        "company": "Acme Inc",
        "address1": "123 Main St",
        "address2": "Suite 100",
        "city": "New York",
        "state": "NY",
        "postal_code": "10001",
        "country": "US"
    },
    "shipping_address": {
        "label": "Office",
        "first_name": "John",
        "last_name": "Doe",
        "phone": "+1234567890",
        "company": "Acme Inc",
        "address1": "123 Main St",
        "address2": "Suite 100",
        "city": "New York",
        "state": "NY",
        "postal_code": "10001",
        "country": "US"
    },
    "payment_gateway": "stripe",
    "silent": true,
    "test": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Responses

json
{
   "success": true,
   "timestamp": 1710969645
}
json
{
   "message": "The given data was invalid.",
   "errors": {
      "source": [
         "The source field is required."
      ],
      "id": [
         "The id field is required."
      ],
      "email": [
         "The email field is required when reference id is not present."
      ]
   }
}

Track a customer event

POST api/events/customer/{action}

For tracking customer lifecycle events

TIP

The Customer Events API is distinct from the People API.

  • Customer Events API: Used to track customer lifecycle events (creation, updates, deletion) that occur in your own e-commerce system
  • People API: Used to manage contacts (create, update, delete) directly in your Lindris account

For example:

  • When a customer creates an account in your WooCommerce store, you would track this using the Customer Events API
  • When you want to manually add or update a contact in Lindris, you would use the People API

The Customer Events API helps maintain a history of customer activities in your system, while the People API manages the actual contact records in Lindris.

URL Parameters

  • action string required - The customer event action to track. Example: created
    • Must be one of:
      • created
      • updated
      • deleted

Request Body

  • email string optional - The person's email address. Either email or referenceId must be provided.

  • referenceId mixed optional - The person's unique identifier. Either email or referenceId must be provided. Numeric values will be cast to strings. Example: cust_123456

  • uuid string optional - The uuid from a previous event response. Can be used instead of email or referenceId.

    • Example: 318835f4-f968-4894-9847-358399823d6c
  • source string required - The e-commerce platform source. Example: woocommerce

  • id mixed required - The unique identifier for the customer. Numeric values will be cast to strings. Example: cust_123456

  • is_contact boolean optional - If true, the customer event data will be used to create or update a contact. When set to true, relevant customer fields (firstName, lastName, address, etc.) will be automatically mapped to contact fields in Lindris. This allows you to sync customer data from your e-commerce platform to Lindris contacts without making separate API calls. For existing contacts, only fields that are provided will be updated, and the source field will not be overwritten if it already exists.

  • first_name string optional - Customer's first name. Example: John

  • last_name string optional - Customer's last name. Example: Doe

  • name string optional - Full name of the customer. Example: John Doe

  • customer_email string optional - Customer's email address (can differ from identifying email). Example: [email protected]

  • status string optional - Customer account status. Example: active

  • created_at string optional - When the customer was created. Example: 2024-03-21T15:30:00Z

  • modified_at string optional - When the customer was last modified. Example: 2024-03-21T15:30:00Z

  • user_id mixed optional - User ID in the source system. Numeric values will be cast to strings. Example: user_123

  • purchase_count integer optional - Number of purchases made by the customer. Example: 5

  • purchase_value number optional - Total value of all purchases. Example: 299.95

  • phone string optional - Customer's phone number. Example: +1-555-123-4567

  • url string optional - URL to the customer's profile.

    • Example: https://store.example.com/customers/123
  • avatar_url string optional - URL to the customer's avatar/profile image.

    • Example: https://store.example.com/avatars/john-doe.jpg
  • currency string optional - Currency code for monetary values. Example: USD

  • payment_gateway string optional - Payment gateway used by the customer. Example: stripe

  • public_id mixed optional - Public identifier for the customer. Numeric values will be cast to strings. Example: pub_123456

  • crm string optional - Customer management system the customer was created in. Example: woocommerce

  • address string[] optional - Customer's primary address details.
    • label string optional - The label describing the address. Example: Home
    • first_name string optional - The first name on the address. Example: John
    • last_name string optional - The last name on the address. Example: Doe
    • phone string optional - The phone number on the address. Example: +1-555-123-4567
    • company string optional - The company on the address. Example: Acme Inc.
    • address1 string optional - The street address. Example: 123 Main St
    • address2 string optional - Additional address line. Example: Apt 4B
    • city string optional - The city on the address. Example: New York
    • state string optional - The state/province on the address. Example: NY
    • postal_code string optional - The postal/zip code on the address. Example: 10001
    • country string optional - The country on the address. Example: US
  • billing_address string[] optional - Customer's billing address details.
    • label string optional - The label describing the billing address. Example: Billing
    • first_name string optional - The first name on the billing address. Example: John
    • last_name string optional - The last name on the billing address. Example: Doe
    • phone string optional - The phone number on the billing address. Example: +1-555-123-4567
    • company string optional - The company on the billing address. Example: Acme Inc.
    • address1 string optional - The billing street address. Example: 123 Main St
    • address2 string optional - Additional billing address line. Example: Apt 4B
    • city string optional - The city on the billing address. Example: New York
    • state string optional - The state on the billing address. Example: NY
    • postal_code string optional - The postal/zip code on the billing address. Example: 10001
    • country string optional - The country on the billing address. Example: US
  • shipping_address string[] optional - Customer's shipping address details.
    • label string optional - The label describing the shipping address. Example: Shipping
    • first_name string optional - The first name on the shipping address. Example: John
    • last_name string optional - The last name on the shipping address. Example: Doe
    • phone string optional - The phone number on the shipping address. Example: +1-555-123-4567
    • company string optional - The company on the shipping address. Example: Acme Inc.
    • address1 string optional - The shipping street address. Example: 123 Main St
    • address2 string optional - Additional shipping address line. Example: Apt 4B
    • city string optional - The city on the shipping address. Example: New York
    • state string optional - The state on the shipping address. Example: NY
    • postal_code string optional - The postal/zip code on the shipping address. Example: 10001
    • country string optional - The country on the shipping address. Example: US
  • user string[] optional - Details about the connected user, if applicable.
    • id mixed optional - The user's ID in the source system. Numeric values will be cast to strings. Example: user_123
    • username string optional - The user's username. Example: johndoe
    • email string optional - The user's email address. Example: [email protected]
    • first_name string optional - The user's first name. Example: John
    • last_name string optional - The user's last name. Example: Doe
    • display_name string optional - The user's display name. Example: John Doe
    • role string optional - The user's role in the system. Example: customer
    • created_at string optional - When the user was created. Example: 2024-03-21T15:30:00Z
    • modified_at string optional - When the user was last modified. Example: 2024-03-21T15:30:00Z
    • url string optional - URL to the user's profile.
      • Example: https://store.example.com/users/123
    • avatar_url string optional - URL to the user's avatar/profile image.
      • Example: https://store.example.com/avatars/john-doe.jpg
    • status string optional - User status. Example: active
    • last_login string optional - When the user last logged in. Example: 2024-03-21T15:30:00Z
  • plan string optional - Subscription plan details. Example: Premium

  • plan_name string optional - Name of the subscription plan. Example: Premium Plan

  • plan_id mixed optional - ID of the subscription plan. Numeric values will be cast to strings. Example: plan_123

  • plan_amount number optional - Cost of the subscription plan. Example: 19.99

  • plan_interval string optional - Billing interval (month, year, etc.). Example: month

  • plan_interval_count integer optional - Number of intervals between billings. Example: 1

  • subscriptions string[] optional - Array of subscription details for customers with multiple subscriptions.
    • Item * object Properties

      • plan string optional - Subscription plan details. Example: Premium
      • plan_name string optional - Name of the subscription plan. Example: Premium Plan
      • plan_id mixed optional - ID of the subscription plan. Numeric values will be cast to strings. Example: plan_123
      • plan_amount number optional - Cost of the subscription plan. Example: 19.99
      • plan_interval string optional - Billing interval (month, year, etc.). Example: month
      • plan_interval_count integer optional - Number of intervals between billings. Example: 1
      • status string optional - Status of the subscription (active, canceled, etc.). Example: active
      • start_date string optional - When the subscription started. Example: 2024-03-21T15:30:00Z
      • end_date string optional - When the subscription ends/ended. Example: 2025-03-21T15:30:00Z
      • trial_end_date string optional - When the trial period ends/ended. Example: 2024-04-21T15:30:00Z
      • canceled_at string optional - When the subscription was canceled. Example: 2024-05-21T15:30:00Z
      • currency string optional - Currency code for the subscription amounts. Example: USD
  • silent boolean optional - If true, no workflow automations will be triggered, but the event will be stored. Example: true

  • test boolean optional - If true, no customer event will be added but response will be returned. Useful for testing the event properties without storing the event. Response is representative only. Example: true

Request

bash
curl --request POST \
    "https://api.lindris.com/api/events/customer/created" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"referenceId\": \"cust_123456\",
    \"uuid\": \"318835f4-f968-4894-9847-358399823d6c\",
    \"source\": \"woocommerce\",
    \"id\": \"cust_123456\",
    \"first_name\": \"John\",
    \"last_name\": \"Doe\",
    \"name\": \"John Doe\",
    \"customer_email\": \"[email protected]\",
    \"status\": \"active\",
    \"created_at\": \"2024-03-21T15:30:00Z\",
    \"modified_at\": \"2024-03-21T15:30:00Z\",
    \"user_id\": \"user_123\",
    \"purchase_count\": 5,
    \"purchase_value\": 299.95,
    \"phone\": \"+1-555-123-4567\",
    \"url\": \"https:\\/\\/store.example.com\\/customers\\/123\",
    \"avatar_url\": \"https:\\/\\/store.example.com\\/avatars\\/john-doe.jpg\",
    \"currency\": \"USD\",
    \"payment_gateway\": \"stripe\",
    \"public_id\": \"pub_123456\",
    \"crm\": \"woocommerce\",
    \"plan\": \"Premium\",
    \"plan_name\": \"Premium Plan\",
    \"plan_id\": \"plan_123\",
    \"plan_amount\": 19.99,
    \"plan_interval\": \"month\",
    \"plan_interval_count\": 1,
    \"silent\": true,
    \"test\": true
}"
php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/events/customer/created';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'referenceId' => 'cust_123456',
            'uuid' => '318835f4-f968-4894-9847-358399823d6c',
            'source' => 'woocommerce',
            'id' => 'cust_123456',
            'first_name' => 'John',
            'last_name' => 'Doe',
            'name' => 'John Doe',
            'customer_email' => '[email protected]',
            'status' => 'active',
            'created_at' => '2024-03-21T15:30:00Z',
            'modified_at' => '2024-03-21T15:30:00Z',
            'user_id' => 'user_123',
            'purchase_count' => 5,
            'purchase_value' => 299.95,
            'phone' => '+1-555-123-4567',
            'url' => 'https://store.example.com/customers/123',
            'avatar_url' => 'https://store.example.com/avatars/john-doe.jpg',
            'currency' => 'USD',
            'payment_gateway' => 'stripe',
            'public_id' => 'pub_123456',
            'crm' => 'woocommerce',
            'plan' => 'Premium',
            'plan_name' => 'Premium Plan',
            'plan_id' => 'plan_123',
            'plan_amount' => 19.99,
            'plan_interval' => 'month',
            'plan_interval_count' => 1,
            'silent' => true,
            'test' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
javascript
const url = new URL(
    "https://api.lindris.com/api/events/customer/created"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "referenceId": "cust_123456",
    "uuid": "318835f4-f968-4894-9847-358399823d6c",
    "source": "woocommerce",
    "id": "cust_123456",
    "first_name": "John",
    "last_name": "Doe",
    "name": "John Doe",
    "customer_email": "[email protected]",
    "status": "active",
    "created_at": "2024-03-21T15:30:00Z",
    "modified_at": "2024-03-21T15:30:00Z",
    "user_id": "user_123",
    "purchase_count": 5,
    "purchase_value": 299.95,
    "phone": "+1-555-123-4567",
    "url": "https:\/\/store.example.com\/customers\/123",
    "avatar_url": "https:\/\/store.example.com\/avatars\/john-doe.jpg",
    "currency": "USD",
    "payment_gateway": "stripe",
    "public_id": "pub_123456",
    "crm": "woocommerce",
    "plan": "Premium",
    "plan_name": "Premium Plan",
    "plan_id": "plan_123",
    "plan_amount": 19.99,
    "plan_interval": "month",
    "plan_interval_count": 1,
    "silent": true,
    "test": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Responses

json
{
   "success": true,
   "timestamp": 1710969645
}
json
{
   "message": "The given data was invalid.",
   "errors": {
      "source": [
         "The source field is required."
      ],
      "id": [
         "The id field is required."
      ],
      "email": [
         "The email field is required when reference id is not present."
      ]
   }
}

Track a user event

POST api/events/user/{action}

For tracking user lifecycle events

URL Parameters

  • action string required - The user event action to track. Example: created
    • Must be one of:
      • created
      • updated
      • deleted

Request Body

  • email string optional - The user's email address. Example: [email protected]
  • referenceId mixed optional - The person's unique identifier. Either email or referenceId must be provided. Numeric values will be cast to strings. Example: cust_123456
  • uuid string optional - The uuid from a previous event response. Can be used instead of email or referenceId.
    • Example: 318835f4-f968-4894-9847-358399823d6c
  • source string required - The platform source. Example: wordpress
  • id mixed required - The unique identifier for the user. Numeric values will be cast to strings. Example: user_123456
  • is_contact boolean optional - If true, the user will be synced to contacts. Example: true
  • username string optional - The username. Example: johndoe
  • first_name string optional - The user's first name. Example: John
  • last_name string optional - The user's last name. Example: Doe
  • display_name string optional - The user's display name. Example: John Doe
  • role string optional - The user's role. Example: subscriber
  • url string optional - The URL to the user's profile.
    • Example: https://example.com/users/johndoe
  • avatar_url string optional - The URL to the user's avatar image.
    • Example: https://example.com/avatars/johndoe.jpg
  • status string optional - The user's status. Example: active
  • created_at string optional - When the user was created. Example: 2024-03-21T15:30:00Z
  • modified_at string optional - When the user was last modified. Example: 2024-03-21T15:30:00Z
  • deleted_at string optional - When the user was deleted. Example: 2024-03-21T15:30:00Z
  • last_login string optional - When the user last logged in. Example: 2024-03-21T15:30:00Z
  • silent boolean optional - If true, no workflow automations will be triggered, but the event will be stored. Example: true
  • test boolean optional - If true, no user event will be added but response will be returned. Useful for testing the event properties without storing the event. Response is representative only. Example: true

Request

bash
curl --request POST \
    "https://api.lindris.com/api/events/user/created" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"email\": \"[email protected]\",
    \"referenceId\": \"cust_123456\",
    \"uuid\": \"318835f4-f968-4894-9847-358399823d6c\",
    \"source\": \"wordpress\",
    \"id\": \"user_123456\",
    \"is_contact\": true,
    \"username\": \"johndoe\",
    \"first_name\": \"John\",
    \"last_name\": \"Doe\",
    \"display_name\": \"John Doe\",
    \"role\": \"subscriber\",
    \"url\": \"https:\\/\\/example.com\\/users\\/johndoe\",
    \"avatar_url\": \"https:\\/\\/example.com\\/avatars\\/johndoe.jpg\",
    \"status\": \"active\",
    \"created_at\": \"2024-03-21T15:30:00Z\",
    \"modified_at\": \"2024-03-21T15:30:00Z\",
    \"deleted_at\": \"2024-03-21T15:30:00Z\",
    \"last_login\": \"2024-03-21T15:30:00Z\",
    \"silent\": true,
    \"test\": true
}"
php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/events/user/created';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'email' => '[email protected]',
            'referenceId' => 'cust_123456',
            'uuid' => '318835f4-f968-4894-9847-358399823d6c',
            'source' => 'wordpress',
            'id' => 'user_123456',
            'is_contact' => true,
            'username' => 'johndoe',
            'first_name' => 'John',
            'last_name' => 'Doe',
            'display_name' => 'John Doe',
            'role' => 'subscriber',
            'url' => 'https://example.com/users/johndoe',
            'avatar_url' => 'https://example.com/avatars/johndoe.jpg',
            'status' => 'active',
            'created_at' => '2024-03-21T15:30:00Z',
            'modified_at' => '2024-03-21T15:30:00Z',
            'deleted_at' => '2024-03-21T15:30:00Z',
            'last_login' => '2024-03-21T15:30:00Z',
            'silent' => true,
            'test' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
javascript
const url = new URL(
    "https://api.lindris.com/api/events/user/created"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "[email protected]",
    "referenceId": "cust_123456",
    "uuid": "318835f4-f968-4894-9847-358399823d6c",
    "source": "wordpress",
    "id": "user_123456",
    "is_contact": true,
    "username": "johndoe",
    "first_name": "John",
    "last_name": "Doe",
    "display_name": "John Doe",
    "role": "subscriber",
    "url": "https:\/\/example.com\/users\/johndoe",
    "avatar_url": "https:\/\/example.com\/avatars\/johndoe.jpg",
    "status": "active",
    "created_at": "2024-03-21T15:30:00Z",
    "modified_at": "2024-03-21T15:30:00Z",
    "deleted_at": "2024-03-21T15:30:00Z",
    "last_login": "2024-03-21T15:30:00Z",
    "silent": true,
    "test": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Responses

json
{
   "success": true,
   "timestamp": 1710969645
}
json
{
   "message": "The given data was invalid.",
   "errors": {
      "source": [
         "The source field is required."
      ],
      "id": [
         "The id field is required."
      ],
      "email": [
         "The email field is required when reference id is not present."
      ]
   }
}

Track a subscription event

POST api/events/subscription/{action}

For tracking subscription lifecycle events

URL Parameters

  • action string required - The subscription event action to track. Example: created
    • Must be one of:
      • created
      • updated
      • deleted
      • renewed
      • cancelled
      • expired
      • renewal_failed

Request Body

  • email string optional - The person's email address. Either email or referenceId must be provided.

  • referenceId mixed optional - The person's unique identifier. Either email or referenceId must be provided. Numeric values will be cast to strings. Example: cust_123456

  • uuid string optional - The uuid from a previous event response. Can be used instead of email or referenceId.

    • Example: 318835f4-f968-4894-9847-358399823d6c
  • source string required - The platform source. Example: woocommerce

  • id mixed required - The unique identifier for the subscription. Numeric values will be cast to strings. Example: sub_123456

  • url string optional - The URL to the subscription.

    • Example: https://store.example.com/my-account/subscriptions/123456
  • currency string optional - The three-letter ISO currency code. Example: USD

  • products object[] optional - The products associated with the subscription.
    • Item * object Properties

      • id mixed required - The unique identifier for the product. Numeric values will be cast to strings. Example: prod_123
      • name string required - The name of the product. Example: Awesome T-Shirt
      • url string optional - A URL to the site containing the product details.
        • Example: https://store.example.com/products/awesome-tshirt
      • image_url string optional - A direct URL to an image of the product.
        • Example: https://store.example.com/images/awesome-tshirt.jpg
      • variant_id mixed optional - The unique identifier for the variant of the product. Numeric values will be cast to strings. Example: var_123
      • brand string optional - The brand name for the product. Example: Awesome Brand
      • price number optional - The price of the product. Example: 29.99
      • quantity integer optional - The quantity of the product ordered. Example: 2
      • total number optional - The line item total after all calculations. Example: 59.98
      • discounts number optional - The total discounts applied to this product. Example: 10
      • taxes number optional - The total taxes for this product. Example: 5
      • fees number optional - The total fees for this product. Example: 2
      • shipping number optional - The total shipping for this product. Example: 5
  • silent boolean optional - If true, no workflow automations will be triggered, but the event will be stored. Example: true

  • test boolean optional - If true, no subscription event will be added but response will be returned. Useful for testing the event properties without storing the event. Response is representative only. Example: true

Request

bash
curl --request POST \
    "https://api.lindris.com/api/events/subscription/created" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"referenceId\": \"cust_123456\",
    \"uuid\": \"318835f4-f968-4894-9847-358399823d6c\",
    \"source\": \"woocommerce\",
    \"id\": \"sub_123456\",
    \"url\": \"https:\\/\\/store.example.com\\/my-account\\/subscriptions\\/123456\",
    \"currency\": \"USD\",
    \"silent\": true,
    \"test\": true
}"
php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/events/subscription/created';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'referenceId' => 'cust_123456',
            'uuid' => '318835f4-f968-4894-9847-358399823d6c',
            'source' => 'woocommerce',
            'id' => 'sub_123456',
            'url' => 'https://store.example.com/my-account/subscriptions/123456',
            'currency' => 'USD',
            'silent' => true,
            'test' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
javascript
const url = new URL(
    "https://api.lindris.com/api/events/subscription/created"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "referenceId": "cust_123456",
    "uuid": "318835f4-f968-4894-9847-358399823d6c",
    "source": "woocommerce",
    "id": "sub_123456",
    "url": "https:\/\/store.example.com\/my-account\/subscriptions\/123456",
    "currency": "USD",
    "silent": true,
    "test": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Responses

json
{
   "success": true,
   "timestamp": 1710969645
}
json
{
   "message": "The given data was invalid.",
   "errors": {
      "source": [
         "The source field is required."
      ],
      "id": [
         "The id field is required."
      ],
      "email": [
         "The email field is required when reference id is not present."
      ]
   }
}