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.

    Resolve variant groups for ids

    View source
    POST
    /discovery/v1/variants
    curl --request POST \
    --url 'https://api.eu1.luigisbox.ai/discovery/v1/variants?channel_id=example' \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --header 'x-lbx-visitor-id: example' \
    --data '{ "guid": "example", "ids": [ "example" ], "return_fields": [ "example" ] }'

    Resolve the variant group of each product id and return its siblings.

    A follow-up to a search or collections result (like /facets), so a token authorized on either surface may call it. channel_id is a query parameter; the ids, optional guid, and optional return_fields travel in the JSON body.

    Siblings and total cover only the members this channel can serve. Each id’s siblings are capped at 100; when a group is larger, the first 100 by @id are returned and total reflects the group’s visible size, so truncation is detectable.

    variants maps every requested id to its variant siblings (the id itself excluded) and the group’s total size.

    channel_id
    required
    Channel Id

    Channel identifier (serving destination).

    string
    >= 1 characters

    Channel identifier (serving destination).

    x-lbx-visitor-id
    required
    X-Lbx-Visitor-Id

    Stable per-browser visitor identifier, generated client-side and persisted (e.g. a UUID in localStorage or a first-party cookie). Send it whether or not personalization is on: it is what links a request to a visitor’s history and to the analytics events reporting it. Keep it stable across page loads, sessions and token refreshes; never generate it server-side, or every visitor collapses into one.

    string
    >= 1 characters

    Stable per-browser visitor identifier, generated client-side and persisted (e.g. a UUID in localStorage or a first-party cookie). Send it whether or not personalization is on: it is what links a request to a visitor’s history and to the analytics events reporting it. Keep it stable across page loads, sessions and token refreshes; never generate it server-side, or every visitor collapses into one.

    Media type application/json
    VariantsRequestBody

    JSON body accepted by the variants endpoint.

    object
    guid
    Any of:
    string
    >= 1 characters <= 64 characters
    ids
    required
    Ids

    Catalog @id values to resolve, used verbatim.

    Array<string>
    >= 1 items <= 200 items
    return_fields
    Return Fields

    Object fields to return; empty for the default, or [’*’] for all fields.

    Array<string>
    <= 100 items
    Example generated
    {
    "guid": "example",
    "ids": [
    "example"
    ],
    "return_fields": [
    "example"
    ]
    }

    Successful Response

    Media type application/json
    VariantsResponse

    Response of POST /discovery/v1/variants.

    object
    variants
    Variants

    Each requested id mapped to its variant siblings and the group’s visible size.

    object
    key
    additional properties
    VariantSiblings

    One requested id’s variant siblings, with the group’s visible size.

    object
    siblings
    Siblings

    The variant group’s other members this channel can serve — the requested id itself excluded. Capped at 100; when the group is larger the first 100 by @id are returned and total reflects its visible size.

    Array<object>
    HitObject

    Single result item returned by discover endpoints.

    Flat structure — all catalog fields are top-level keys. @id and @type are always present; every other key is a catalog field.

    object
    @id
    required
    @Id

    Unique identity of the hit.

    string
    @type
    required
    @Type

    Type of the hit (e.g. ‘product’).

    string
    key
    additional properties
    any
    total
    required
    Total

    Member count of the group, counting only the members this channel can serve and including the requested id when it is one of them. An ungrouped or not-found id has empty siblings and total 0. Otherwise total minus the number of returned siblings is one for a requested id this channel can serve, zero for one it cannot, and more than one when the group is larger than the 100-member cap.

    integer
    Example generated
    {
    "variants": {
    "additionalProperty": {
    "siblings": [
    {
    "@id": "example",
    "@type": "example"
    }
    ],
    "total": 1
    }
    }
    }

    Malformed request

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Missing or invalid credentials

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Authenticated but not permitted

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Request validation failed

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Rate limit exceeded

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Upstream service failed

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }