Skip to content

    Pre-launch API. The concepts described here are settled, but the API shape is not: request and response fields, parameters and defaults can still change. Build against it, and talk to your Luigi's Box contact before you put an integration into production.

    Event reference

    View source

    Field-level reference for the events accepted by POST /events/v1/events. For how to send them, see Sending events.

    There are two event types, covering three things to report: a click, a cart addition, and a completed order. The results a surface returned are recorded when the discovery request is served — you do not send them. See What you report, and what you don’t.

    Present on both event types.

    FieldTypeRequiredNotes
    typestringYesinteraction or transaction
    channel_idstringYeslbn_ + 6 characters
    event_idstringNoGenerated if omitted. Set it yourself for idempotent retries.
    event_timestampintegerNoUnix seconds. Receipt time if omitted.
    catalog_idstringNolbc_ + 6 characters
    user_idstringNoYour opaque key for a signed-in shopper
    consent_grantedbooleanNoDefaults to false
    currencystringNoISO currency code
    platformstringNoYour own vocabulary — web, ios, …
    referrerstringNoReferring URL. Truncated at 1000 characters.
    contextobjectNoFlat map, string keys to string values
    ab_testbooleanNoWhether this belongs to your own A/B test
    variantstringNoWhich variant of it
    app_versionstringNo
    api_versionstringNoDefaults to "1"

    The visitor is not an envelope field — it travels in the required X-Lbx-Visitor-Id header. See Sending events.

    RuleDetail
    Identifierschannel_id must match lbn_ + 6 Crockford base32 characters; catalog_id the same with lbc_
    References<type>/<field>:<value>, all three parts non-empty — see Object references
    BooleansOnly true, false, "true", "false". 1 and 0 are rejected.
    contextValues must be strings. Nested objects are rejected.
    URLsTruncated at 1000 characters rather than rejected

    Covers both clicks and cart additions; interaction_type distinguishes them.

    FieldTypeRequiredNotes
    referencestringYesThe object acted on
    interaction_typestringYesclick, add_to_cart, … — your own vocabulary
    listing_ab_testbooleanYesWhether this came from a result set under an A/B test
    urlstringNoWhere it happened
    countintegerNoQuantity, for cart actions
    pricenumberNoUnit price. Must be ≥ 0.

    Keep interaction_type values stable — reporting groups on the exact string, so renaming one splits its history in two.

    A click:

    {
    "type": "interaction",
    "channel_id": "lbn_4hj9tv",
    "reference": "product/@id:product/sku-1001",
    "interaction_type": "click",
    "listing_ab_test": false,
    "consent_granted": true
    }

    A cart addition:

    {
    "type": "interaction",
    "channel_id": "lbn_4hj9tv",
    "reference": "product/sku:ABC-123",
    "interaction_type": "add_to_cart",
    "listing_ab_test": false,
    "consent_granted": true,
    "count": 2,
    "price": 29.9
    }
    FieldTypeRequiredNotes
    itemsarrayYesAt least one item
    listing_ab_testbooleanYes
    urlstringNo

    Each item:

    FieldTypeRequiredNotes
    referencestringYes
    titlestringYes
    countintegerYesQuantity
    total_pricenumberYesLine total, not unit price
    was_discountedbooleanNoDefaults to false
    was_volume_discountedbooleanNoDefaults to false
    {
    "type": "transaction",
    "channel_id": "lbn_4hj9tv",
    "currency": "EUR",
    "listing_ab_test": false,
    "consent_granted": true,
    "items": [
    { "reference": "product/sku:ABC-123", "title": "Blue Cotton T-Shirt", "count": 2, "total_price": 59.8 }
    ]
    }

    Send it when the order completes. A server-side order handler is a slightly more reliable place for it than the browser, but either works.

    Every reference is three parts — <type>/<field>:<value> — and any field the object carries can be the field. Object references covers which one to pick and what happens when a reference resolves to nothing.