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.

    Object types and relationships

    View source

    A catalog holds more than products. Category pages, brand pages and editorial content can be indexed and returned by discovery.

    Each object declares what it is in @type, and its identity carries the same type as a prefix. Discovery requests ask for one type at a time.

    @typeWhat it representsTypical use
    productSomething a shopper can buySearch results, recommendations, listing pages
    categoryA navigational groupingCategory suggestions in autocomplete, category landing pages
    brandA brand and its landing pageBrand suggestions, brand pages
    articleEditorial or help contentGuides and posts alongside product results
    queryA popular search phrase stored as an objectQuery suggestions in autocomplete

    The list is a convention rather than a closed set — a catalog can be configured with other types. What is fixed is that the prefix in @id must equal @type, so product/123 cannot be indexed as a category.

    For a query object, the identity value is the phrase, because a query has no other key.

    Every search, collections and recommendation request carries a required type field. One request returns one type of object:

    Terminal window
    # Products matching "running shoes"
    curl -X POST 'https://api.eu1.luigisbox.ai/discovery/v1/search?channel_id=lbn_4hj9tv&surface_id=lbs_search_main' \
    -H 'Authorization: Bearer <token>' \
    -H 'X-Lbx-Visitor-Id: 8f14e45f-ea0f-4b5c-9a1d-2b3c4d5e6f70' \
    -H 'Content-Type: application/json' \
    -d '{ "type": "product", "query": "running shoes" }'

    An autocomplete panel that shows products, categories and suggested phrases issues three requests — one per type — and renders them into three sections. Each type has its own ranking and its own result count.

    Objects link by identity. A product does not embed its category or brand; it points at them.

    {
    "@id": "product/sku-1001",
    "@type": "product",
    "@title": "Blue Cotton T-Shirt",
    "@category": ["category/shirts", "category/summer"],
    "@brand": "brand/northwear"
    }

    The referenced objects live on their own:

    {
    "@id": "category/shirts",
    "@type": "category",
    "@title": "Shirts"
    }

    Two consequences:

    • A link does not need to resolve at ingestion time. You can send a product feed before the category feed. Nothing is rejected for pointing at an object that does not exist yet, and nothing has to be re-sent once it does.
    • Renaming a category is one write. Because products hold only the link, changing a category title updates one object rather than every product in it.

    Categories additionally link to each other, with @parent — see Hierarchies.

    To turn those links into displayable data in one round trip, fetch the linked objects with object lookup instead of issuing one request per link.

    Variants are not a separate type. Every variant is a complete product with its own identity; members of one variant group share an opaque @group_id. See Product variants.