Skip to main content

Store events

In-store customer events

AiFi doesn’t give real-time insights into a customer’s cart in every store (this feature is only available in sensor-based stores). However, AiFi does offer near real-time information about their trip.

Checkout-zone entry and exit

info

Legacy naming of the "checkout" zone The zones discussed here are called "checkout" zones but shouldn't be confused with the checkout process of finalizing a purchase. The name comes from a specific deployment of the AiFi system that provides real-time feedback on items picked up. While this feature isn't available in most stores, other metadata, such as the specialAttention flag, are provided when customers enter the zone.

A checkout zone can be defined as any rectangle on the floor. When a customer enters or leaves the zone, the AiFi system triggers a webhook to a specified URL, such as retailer.com/checkout-zone/entered, with the following payload:

{
"checkoutZoneId": 1,
"customer": {
"id": "42",
"externalId": "my-customer-94325",
"role": "customer"
},
"storeId": 2,
"storeExternalId": "mystore-0001",
"sessionId": "some-unique-token",
"specialAttention": true,
"timeOfOrigin": "2023-01-19T10:49:06.149Z",
"timeOfIssue": "2023-01-19T10:49:06.149Z"
}
Triggering the webhooks

Note that people under the same shopping session will yield the same payload.

SpecialAttention: Interactions with age-restricted items

The specialAttention flag indicates whether a person in the checkout zone interacted with a restricted item. AiFi provides this flag in near real-time, allowing you to implement additional flows, such as verifying a customer's age when they enter the zone.

To use this feature, ensure that you mark the products as restricted in the AiFi system. You can do this through the AiFi Console or your API integration.

Important considerations

  1. entered/left - The checkout zone webhook is similar to the transitions webhook. Your URL must support suffixes of /entered or /left as the action is communicated through a separate path. For more detailed information, see the API reference.
  2. buffered vs unbuffered - The checkout zones in the store can be collectively configured to be buffered (people are queued, the next webhook is only sent when the currently active person leaves) or unbuffered (every entry/exit is sent). The difference can be summarized with this example sequence: A enters, B enters, B leaves, C enters, A leaves.
    • Buffered: The sequence will yield webhooks A entered, A left, C entered (B entering/leaving is omitted; C entry is only sent after A leaves).
    • Unbuffered: The sequence will yield webhooks A entered, B entered, B left, C entered, A left (exact replica of what happened).

Most of the time, you will want the unbuffered checkout zone to have full freedom in implementing interactive applications on top of it.