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.

    Browse catalog collections

    View source
    POST
    /discovery/v1/collections
    curl --request POST \
    --url 'https://api.eu1.luigisbox.ai/discovery/v1/collections?channel_id=example&surface_id=example' \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --header 'referer: ' \
    --header 'user-agent: ' \
    --header 'x-lbx-visitor-id: example' \
    --data '{ "collection_filters": { "$and": [ { "brand": { "in": [ "nike", "adidas" ] } }, { "lbx:price": { "gte": 50, "lte": 200 } }, { "$or": [ { "condition": { "eq": "new" } }, { "warranty_months": { "gte": 12 } } ] }, { "$not": { "material": { "eq": "leather" } } }, { "image": { "exists": true } } ] }, "cursor": "example", "debug": false, "filters": { "$and": [ { "brand": { "in": [ "nike", "adidas" ] } }, { "lbx:price": { "gte": 50, "lte": 200 } }, { "$or": [ { "condition": { "eq": "new" } }, { "warranty_months": { "gte": 12 } } ] }, { "$not": { "material": { "eq": "leather" } } }, { "image": { "exists": true } } ] }, "personalize": false, "return_fields": [ "example" ], "size": 10, "sort": { "direction": "asc", "field": "example" }, "type": "example", "user_id": "" }'

    Run collection browsing from a structured JSON request body.

    channel_id
    required
    Channel Id

    Channel identifier (serving destination).

    string
    >= 1 characters

    Channel identifier (serving destination).

    surface_id
    required
    Surface Id

    Surface identifier, lbs_. The service segment must match the endpoint: lbs_search* on /search, lbs_collection_* on /collections, lbs_recommender_* on /recommender.

    string
    >= 1 characters

    Surface identifier, lbs_. The service segment must match the endpoint: lbs_search* on /search, lbs_collection_* on /collections, lbs_recommender_* on /recommender.

    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.

    user-agent
    User-Agent

    Originating client’s User-Agent. Optional; used to derive the platform (ios, android, web) the result set is attributed to. A backend caller should forward the end user’s value rather than its own.

    string
    ""

    Originating client’s User-Agent. Optional; used to derive the platform (ios, android, web) the result set is attributed to. A backend caller should forward the end user’s value rather than its own.

    referer
    Referer

    Originating page URL. Optional; lets the result set be attributed to the page it was served on.

    string
    ""

    Originating page URL. Optional; lets the result set be attributed to the page it was served on.

    Media type application/json
    CollectionsRequestBody

    JSON body accepted by the collections endpoint.

    object
    collection_filters
    Any of:
    One of:

    A group node: exactly one of $and, $or, $not.

    object
    >= 1 properties <= 1 properties
    $and

    Nodes that must all match.

    Array
    >= 1 items <= 50 items
    One of:
    object recursive
    $not
    One of:
    object recursive
    $or

    Nodes of which at least one must match.

    Array
    >= 1 items <= 50 items
    One of:
    object recursive
    cursor
    Any of:
    string
    >= 1 characters <= 128 characters
    debug
    Debug

    Include a diagnostic debug payload in the response.

    boolean
    filters
    Any of:
    One of:

    A group node: exactly one of $and, $or, $not.

    object
    >= 1 properties <= 1 properties
    $and

    Nodes that must all match.

    Array
    >= 1 items <= 50 items
    One of:
    object recursive
    $not
    One of:
    object recursive
    $or

    Nodes of which at least one must match.

    Array
    >= 1 items <= 50 items
    One of:
    object recursive
    personalize
    Personalize

    Whether to personalize results for the given user.

    boolean
    return_fields
    Return Fields

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

    Array<string>
    <= 100 items
    size
    Size

    Number of objects to return per page.

    integer
    default: 10 >= 1 <= 100
    sort
    Any of:
    SortRequest

    Structured sort override supplied in a JSON request body.

    object
    direction
    required
    SortDirection

    Sort direction.

    string
    Allowed values: asc desc
    field
    required
    Field

    Attribute to sort by, for example ‘lbx:price’.

    string
    >= 1 characters
    type
    required
    Type

    Catalog object type to retrieve, for example ‘product’.

    string
    >= 1 characters
    user_id
    User Id

    Stable identifier of the end user, used for personalization.

    string
    ""

    Successful Response

    Media type application/json
    CollectionsResponse

    Response of the collections endpoint.

    object
    debug
    Any of:
    object
    key
    additional properties
    any
    guid
    required
    Guid

    GUID identifying this result set.

    string
    hits
    required
    Hits

    Ranked list of result hits — only objects this channel can serve.

    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
    next_page_cursor
    required
    Any of:
    string
    pagination_status
    required
    Pagination Status

    Why this response does or does not carry a next_page_cursor: more — more pages exist and next_page_cursor is set; exhausted — this was the last page; unsupported — this result set cannot be paged and retrying will not produce a cursor; unavailable — pagination state could not be saved for this request (a transient failure) and re-issuing the search may succeed.

    string
    Allowed values: more exhausted unsupported unavailable
    total
    required
    Any of:
    integer
    total_approx
    required
    Total Approx

    Approximate total for the whole result set, counting only the objects this channel can serve. Always present, so use it as the fallback when total is null. It may be an estimate, so prefer total wherever that is set.

    integer
    Example
    {
    "pagination_status": "more"
    }

    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"
    }

    Resource not found

    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"
    }