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.

    Recommend catalog items

    View source
    POST
    /discovery/v1/recommender
    curl --request POST \
    --url 'https://api.eu1.luigisbox.ai/discovery/v1/recommender?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 '{ "anchor_ids": [ "example" ], "debug": false, "exclude_ids": [ "example" ], "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": true, "return_fields": [ "example" ], "size": 10, "touchpoint": "autocomplete", "type": "example", "user_id": "" }'

    Run recommendations 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 /collection, lbs_recommender_* on /recommender.

    string
    >= 1 characters

    Surface identifier, lbs_. The service segment must match the endpoint: lbs_search* on /search, lbs_collection_* on /collection, 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
    RecommenderRequestBody

    JSON body accepted by the recommender endpoint.

    object
    anchor_ids
    Anchor Ids

    Seed object ids the recommendations are based on.

    Array<string>
    <= 50 items
    debug
    Debug

    Include a diagnostic debug payload in the response.

    boolean
    exclude_ids
    Exclude Ids

    Object ids the recommendations must not contain. Binds every object in the slate: unlike an @id not_in filter, a pinned placement cannot put one back.

    Array<string>
    <= 50 items
    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
    One of:
    object recursive
    $not
    One of:
    object recursive
    $or

    Nodes of which at least one must match.

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

    Personalize this request, and assert that the shopper has consented to behavioural personalization. Defaults to true: personalized, and recorded as consented. Send false for a shopper who has not consented; read it from your consent manager on every request. When true and no sort is given, the result set (and, where returned, its request_key and cursors) is bound to the shopper: user_id and the X-Lbx-Visitor-Id sent. Under an explicit sort personalization does not change the order, so the result set is shared.

    boolean
    default: true
    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 recommended objects to return.

    integer
    default: 10 >= 1 <= 100
    touchpoint
    Any of:
    RecommenderTouchpoint

    Where in the shopper’s journey recommendations appear.

    string
    Allowed values: autocomplete serp plp landing_page homepage pdp basket checkout order_confirmation error_page email chat mcp_agent
    type
    required
    Type

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

    string
    >= 1 characters
    user_id
    User Id

    Signed-in shopper’s stable identifier, your own opaque key. Omit it or send it blank for anonymous traffic; the strings undefined, null, None, NaN and [object Object] (any case) also count as anonymous.

    string
    ""

    Successful Response

    Media type application/json
    RecommenderResponse

    Response of the recommender endpoint.

    object
    debug
    Any of:
    object
    key
    additional properties
    any
    hits
    required
    Hits

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

    Array<object>
    RankedHit

    A hit from /search, /collection or /recommender.

    These endpoints rank, so a campaign or an ad platform can place a product on them — and a placed hit may carry @disclosure. A hit from a direct lookup never does.

    object
    @disclosure
    Disclosure

    Present only on a hit whose placement is disclosed — one a disclosing campaign’s rules pinned or boosted, or one an ad platform sold. Absent otherwise; never null.

    object
    advertiser
    Advertiser

    The person or company on whose behalf the placement is shown, e.g. Northwear Ltd, as the campaign wrote it. Present when the campaign names one.

    string
    <= 128 characters
    payer
    Payer

    Who paid for the placement. Present when the campaign names one.

    string
    <= 128 characters
    provider
    Provider

    The ad platform that sold the placement. Absent for a campaign-authored disclosure.

    string
    recipient_parameters
    Recipient Parameters

    What decided that this shopper is shown the placement on this request: search_query for what they searched, collection for the collection they browse, anchor for the products a recommendation is shown for, or none, alone, when nothing about the shopper did. Codes, for you to word in the shopper’s language; more may be added, so handle one you do not know generically. Present on a campaign’s placement.

    Array<string>
    >= 1 items
    Allowed values: none search_query collection anchor
    tracking
    Tracking

    Impression and click URLs to call, under the ad platform’s own key names. Absent for a campaign-authored disclosure, and when the platform returned none.

    object
    key
    additional properties
    string
    type
    required
    Type

    How the placement is disclosed. sponsored marks a paid placement.

    string
    Allowed value: sponsored
    @id
    required
    @Id

    Unique identity of the hit.

    string
    @type
    required
    @Type

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

    string
    key
    additional properties
    any
    Example
    {
    "hits": [
    {
    "@disclosure": {
    "recipient_parameters": [
    "none"
    ],
    "type": "sponsored"
    }
    }
    ]
    }

    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
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    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": {
    "error_code": "example",
    "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
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    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": {
    "error_code": "example",
    "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
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    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": {
    "error_code": "example",
    "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
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    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": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Request validation failed

    Media type application/json
    DiscoveryValidationError

    The canonical error body of a Discovery 422, with error_code typed.

    Every key of the envelope is required, as the served body always carries all three.

    object
    exception_details
    required
    DiscoveryExceptionDetails

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

    object
    error_code
    Any of:
    string
    Allowed values: filter_syntax filter_too_complex filter_unknown_field filter_type_mismatch
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    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
    required
    Any of:
    string
    Example
    {
    "exception_details": {
    "error_code": "filter_syntax"
    }
    }

    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
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    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": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Service temporarily unavailable

    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
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    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": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }