Backend
API settings
API request
All APIs receive requests that always contain the following fields:
In addition, the request may get the "lang" field - the page's language code, exactly as the page states it. First the "data-lurazon-lang" attribute on the tag in which the catalog is generated is checked, and only if it is not set - the "lang" attribute of the page's root "html" tag. The field is passed only when this code matches the identifier of one of the languages added in the console, otherwise (and always on a site without added languages) it is not passed:
If a language with the identifier "fr" is added in the console, the "lang" field contains:
In the code examples below (as well as in the examples of backend requests and responses further in the documentation) the same identifiers repeat - this is intentional, to show that the same filters, options and entities are meant in different examples:
"FilterVehicleType" - the "Vehicle type" filter (type "Checkboxes")
"OptionSUV" - the "SUV" option of the "Vehicle type" filter
"FilterBrand" - the "Brand" filter (type "Radio buttons")
"OptionAudi" - the "Audi" option of the "Brand" filter
"FilterPrice" - the "Price" filter (type "Numeric")
"new" - the "Newest" sorting option
"12" - the "12 products" option of the number of shown results
Options API
If the "Options API" field is filled in the template, this API must be created on the same domain and at the same path as specified in the field. This API must use the POST method, the request body is JSON. The answer must have the 200 status and a JSON body, any other answer is ignored
API request
This API receives requests with the following keys - by them the backend decides which page it answers for:
"template" - the template's identifier
"domain" - the domain of the page the template is built on
"path" - the page's path: the site's routes are not used with a custom API, so this is what the custom routing works by
"lang" - the page's language code (e.g. "fr"), passed only when it matches the identifier of one of the languages added in the console
API response
This API must respond with the following fields, as needed:
"filters" - an ordered array of filters, each filter of the array must be a dictionary containing the following keys:
"id" - a required field, specifies the identifier of the filter's field (its key in "fields"), must be passed as a string value
"type" - a required field, specifies the filter's type, must be passed as a string value and be one of the values listed below:
"c" - the "Checkboxes" filter type
"r" - the "Radio buttons" filter type
"n" - the "Numeric" filter type
"attrs" - an optional field, a dictionary of the filter's own attributes for its "Filter" and "Applied filter" elements: each key is an attribute's name, each value must be a string. "class" is added to the element's classes, any other attribute replaces the one of the same name. Event handler attributes ("on…") and values that are not strings are ignored
"fields" - the dictionary of the fields the page uses: the fields of the filters and the selector fields the "Object field: Selectors" elements show. Its keys are the fields' identifiers, each field must be a dictionary containing the following keys:
"label" - a required field for the field of a filter, specifies the filter's label, must be passed as a string value
"key" - an optional field, specifies the field's unique key, used instead of the identifier in the link and only for filters of the types: "Checkboxes" and "Radio buttons". Must be passed as a string value
"range" - an optional field, used only for filters of the type "Numeric", specifies the lowest and the highest value of the filter, must be passed as an array of two numbers. When passed, the filter's range slider takes them at once and they are not requested separately
"dependField" and "dependOption" - optional fields, make the field's filter dependent: it carries the "Filter unavailable" state until the filter of the field "dependField" has the option "dependOption" chosen (or one nested in it). Must be passed as string values. When that field is not a filter of the page, the dependency is ignored
"options" - an optional field, specifies all options of this field, used for filters of the types: "Checkboxes" and "Radio buttons" and for the "Object field: Selectors" elements. Must be passed as an ordered array of the field's options, each option of the array must be a dictionary containing the following keys:
"id" - a required field, specifies the option's identifier, unique for this field, must be passed as a string value
"label" - a required field, specifies the option's label, must be passed as a string value
"key" - an optional field, specifies the option's unique key, used instead of the identifier in the link, must be passed as a string value
"children" - an optional field, specifies the child options, used only for filters of the type: "Checkboxes" and for the "Object field: Selectors" elements. Must be passed as an ordered array of options
"sort" - the sorting settings dictionary, containing the following keys:
"options" - a required field, specifies all sorting options, must be passed as an ordered array of options, each option of the array must be a dictionary containing the following keys:
"id" - a required field, specifies the sorting option's unique identifier, must be passed as a string value
"label" - a required field, specifies the option's label, must be passed as a string value
"limit" - the settings dictionary of the number of shown results per page, containing the following keys:
"options" - a required field, specifies all options for limiting the number of shown results, must be passed as an ordered array of options, each option of the array must be a dictionary containing the following keys:
"id" - a required field, specifies the unique identifier of the option limiting the number of shown results, an integer must be passed as a string value
"label" - a required field, specifies the option's label, must be passed as a string value
The site's server passes this same answer in the "options" field of the skeleton request
Results API
If the "Results API" field is filled in the template, this API must be created on the same domain and at the same path as specified in the field. This API must use the POST method, the request body is JSON. The answer must have the 200 status and a JSON body, any other answer is ignored
API request
This API receives requests that additionally contain the "results" dictionary with the following keys:
"fields" - an array of the keys of the values that must be calculated and returned
"numbers" - the request requires returning the value ranges for filters of the "Numeric" type. The list of the identifiers of the filters for which the value ranges must be calculated and returned is passed in "filtersNumbers"
"facets" - the request requires returning the facets for filters of the "Checkboxes" and "Radio buttons" types. The list of the identifiers of the filters for which the facets must be calculated and returned is passed in "filtersFacets"
"objects" - the request requires returning the search results, taking into account the filter values passed via the keys: "valueSearch", "valueFilters", "valueSort", "valuePage", "valueLimit"
"count" - the request requires returning the number of search results, taking into account the filter values passed via the keys: "valueSearch", "valueFilters", "valueSort", "valuePage", "valueLimit"
"filtersNumbers" - an array of the identifiers of the filters of the "Numeric" type for which the ranges of possible values need to be returned
"filtersFacets" - an array of the identifiers of the filters of the "Checkboxes" and "Radio buttons" types for whose options the facets need to be returned
"valueSearch" - the string value of the template's search box, may be empty
"valueFilters" - a dictionary each key of which is a filter identifier with a value specific to the corresponding filter type. An example of the values passed for the corresponding filter types can be obtained with the functions: "filtersApplied" and "filtersCurrent" on the frontend
"valueSort" - a string value that is the identifier of a sorting option. This value is passed only when sorting has been applied for the template
"valuePage" - a numeric value that is the page the user is on. This value is passed only when limiting the number of shown results has been applied for the template
"valueLimit" - a numeric value that is the identifier of an option of the number of shown results: the same identifier as in the Options API response, only as a number. This value is passed only when limiting the number of shown results has been applied for the template
API response
When a request arrives at this endpoint, the template expects to receive in response only what is passed in the "results.fields" array. If this array contains only "count", then "{ count: ... }" must be returned, if "objects" and "count" then: { objects: ... , count: ... } and so on
The template takes the fields of these objects by the source fields of its elements (e.g. "String source"): a field of the site's structure - when the object has the field under its identifier, "Custom" - when it has the field under the backend's own key, written in the custom ID field (e.g. "String custom ID")
Objects management
The following endpoints are used for adding and deleting objects via the API. It is convenient when an entity on the site is updated or deleted and needs to be sent to Lurazon for synchronization right away
Authorization
To pass data to the following APIs successfully, a correct request must be built and authorized via a JWT encoded with the "HS256" algorithm
The request must contain the following data:
"site" - the site's identifier
"token" - the authorization JWT
"list" - an array with the data needed by the API, which must not be empty and must hold no more than 1000 items. The whole request body must not exceed 16 MB - send a larger number of objects in several requests
The authorization JWT must encode a dictionary containing the keys: "type" with the value "objects" and "site" with the value of the site's identifier. The token's expiration ("exp") is required and must be no more than 3600 seconds ahead, otherwise the token is rejected. We recommend about 15 seconds
Add/update API
Send POST requests to https://objects.lurazon.com/set
To create or update objects, their list must be added to the "list" array. Each object must be a dictionary containing the keys:
"id" - a required string value that is the entity's unique identifier. Lurazon's search returns it with the object as "idExternal"
"fieldsLurazon" - a dictionary, each key of which is the identifier of a field registered in the site's console (the one the console shows). The value of each key is a dictionary containing the following keys:
"value" - the value of this field, which must be passed in the corresponding format:
For the "API selector" and "Multi selector" field types - an array of string values of option identifiers. For "Multi selector" only those saved in the console must be passed
For the "Single selector" field type - a string value of an option identifier saved in the console as one of the options
For the "String" and "Textarea" field types - a string value
For the "Number" field type - a number or a string with a number (e.g. 25000 or "25000.50", the fraction after a dot). A string that is not a number is not accepted
For the "Date" field type - a string value containing a date, best in the ISO 8601 format (a time zone offset in it is taken into account), or a timestamp in milliseconds. The date is stored in the UTC time zone. A date without a time zone ("2026-03-14", "2026-03-14 09:30") is read in the site's time zone (UTC when it is not set), so pass the zone ("Z" or an offset) for exact results. A value that cannot be read as a date is not saved
For the "Image" field type - an array of string values that are links to images
"translations" - a dictionary with the field's translations, whose values are applied only to the fields for which translation is enabled in the console. Each key is a language identifier set in the console, and its value must be in the same format as the value for "value", which in turn is applied as the default translation
"fieldsClient" - a dictionary of the same shape, keyed by the identifiers the site's backend gave the fields through the structure API, with the option identifiers it gave the options as the values of the "Multi selector" and "Single selector" fields. One of the two dictionaries is required, both may be sent; a field sent under both is written from "fieldsLurazon"
"unpublished" - an optional boolean value, if it equals 'true', the object is saved as unpublished
A request example (the field and option identifiers are the same as in the examples of the "API settings" section):
An object with an identifier that does not exist on the site yet is created, one with an existing identifier is fully overwritten. The response with the code 200 is a dictionary with the keys:
"required" - an array of the identifiers of the objects that were not saved: a missing or invalid value of a field with the "Required field" parameter
"failed" - an array of the identifiers of the objects that were not saved for any other reason (invalid "fieldsLurazon" / "fieldsClient", the objects limit, a write error). An object without a valid identifier and a repeat of an identifier are only in "reasons"
"reasons" - a dictionary with the reasons why an object was not saved or was saved with remarks. The key is the object's position in the "list" array, starting from 0. The value is an array of entries in the "{ reason, field, fieldClient, language, value }" format, where "field", "language" and "value" are given only when they relate to the reason, and "fieldClient" - the field's identifier as sent in "fieldsClient" - only with an entry about a field sent there. Objects saved without remarks are not included. The possible values of "reason":
"id" - the object is not saved: its identifier is missing, not a string, empty, longer than 64 characters or contains a space
"duplicate" - the object is not saved: its identifier already came earlier in this "list" (the earlier one is processed)
"fields" - the object is not saved: neither "fieldsLurazon" nor "fieldsClient" is given, or one of them is not a dictionary
"required" - the object is not saved: the required field "field" is missing or its value is invalid (every such field is listed)
"limit" - the object is not saved: the trial period's objects limit
"write" - the object is not saved: a write error
"skipped" - the object is saved, a part of it is left out: the value of the field "field" is invalid. With "language" - only that translation (unknown language, not a string, too long). With "value" - only that item of a list value (not an option of the field, not a valid key). A value "null" (or an empty list "[]" for a list field) leaves a field empty on purpose and is not reported
"translations" - the object is saved without the translations of the field "field": "translations" is not a dictionary or the field is not translatable
"unknown" - the object is saved, the field "field" (or "fieldClient") is ignored: there is no such field to write (not in the structure, a system one the API does not set, or no field made through the structure API under that identifier)
"field-duplicate" - the object is saved, the field "field" is written from "fieldsLurazon": it was sent under both dictionaries
"unpublished" - the object is saved as published: "unpublished" is not a boolean
If the request is refused, its code and a short word in the response body say why:
400 "body" - the request body is not JSON, or the "site", "token" or "list" key is missing or of the wrong kind
400 "list" - the "list" array is empty or longer than 1000 items
413 "body" - the request body is larger than 16 MB
403 "site" - there is no site with such an identifier
403 "token" - the JWT is not signed with the site's secret, is not of the "objects" type or was issued for another site
403 "token-exp" - the JWT has expired, has no "exp" or its "exp" is more than 3600 seconds ahead
403 "blocked" - the site is blocked (an unpaid invoice or deletion), objects are not accepted
500 "err" - a server error
Delete API
Send POST requests to https://objects.lurazon.com/del
To delete objects, the list of their identifiers must be added to the "list" array - the string values of "id" passed when adding:
Identifiers that do not exist on the site are ignored. The response with the code 200 is a dictionary with the "failed" key - an array of the identifiers of the objects that were not deleted because of a write error. The codes 400, 413 and 403 - as in the add/update API. The code 400 with the body "list" also when "list" holds no valid identifier
Structure management
The following endpoints are used for creating, updating and deleting the fields of the site's structure via the API - with the options of the "Multi selector" and "Single selector" fields, nested ones included. It is convenient when the fields are already described on the site's backend (a catalog's attributes and their values) and are to be made in Lurazon by it rather than by hand in the console. A field or an option made this way carries the identifier the backend gave it, and that identifier is what a later request finds it by - so the objects can be sent under the same identifiers (the "fieldsClient" dictionary of the objects API). The fields made in the console carry no such identifier and are not touched by the API
Authorization
The request is built and authorized the same way as for the objects management: it must contain "site" - the site's identifier, "token" - the authorization JWT, and "list" - an array with the data needed by the API, which must not be empty and must hold no more than 1000 items, the whole request body no larger than 16 MB. The authorization JWT must encode a dictionary containing the keys: "type" with the value "structure" and "site" with the value of the site's identifier. The token's expiration ("exp") is required and must be no more than 3600 seconds ahead, otherwise the token is rejected. We recommend about 15 seconds
Fields add/update API
Send POST requests to https://structure.lurazon.com/field/set
To create or update fields, their list must be added to the "list" array. Each field must be a dictionary containing the keys:
"id" - a required string value that is the field's identifier on your side (up to 64 characters, no spaces). A field under an identifier that exists on the site is updated, under a new one - created
"key" - an optional string value, the field's key in the site's default language (what the console shows as the key of a field; a route's token matches an option by its key). Not given or empty - the field is saved without a key, nothing is put in its place. As in the console, keeping it unique and fit for an address is yours to do
"title" - a required non-empty string value, the field's name in the default language
"translations" - an optional dictionary with the translations: each key is a language identifier set in the console, its value is a dictionary with "key" and "title" in that language, each optional - one not given falls back to the default language's
"type" - a required string value, the field's type: "multi" (Multi selector), "single" (Single selector), "api" (API selector), "string" (String), "text" (Textarea), "number" (Number), "date" (Date), "image" (Image). The type of a field that exists cannot be changed
"required" - an optional boolean value, the "Required field" parameter of the field
"translatable" - an optional boolean value, whether the field's values are translated; for the "String" and "Textarea" types only
"depends" - an optional dictionary "{ field, option }" with the identifiers (yours) of another field made through this API and of its option: the field is shown while that option, or one nested under it, is chosen. The field depended on must already exist, or come earlier in the same "list"
"options" - for the "Multi selector" and "Single selector" types only: an array of the field's options, each a dictionary with "id", "key", "title" and "translations" of the same meaning, and "options" - its nested options, 5 levels at most. The identifier of an option must be unique within the field. The array replaces the field's options as a whole, in its order:
An option found under its identifier anywhere in the field's current options keeps its Lurazon identifier, and with it every object value under it - even when it is renamed or moved to another level
An option under a new identifier is created
An option not sent is deleted together with its values in the objects - unless a route's condition or another field's dependency still names it; then the whole field is left as it is and the response says so
A request example:
A field with an identifier that does not exist on the site yet is created, one with an existing identifier is fully overwritten - a parameter or the dependency not sent is cleared. A field is either saved whole or left out whole; the rest of the list is processed. The response with the code 200 is a dictionary with the keys:
"failed" - an array of the identifiers of the fields that were not saved. A field without a valid identifier and a repeat of an identifier are only in "reasons"
"fields" - a dictionary with the identifiers the saved fields have in Lurazon (the ones the console shows): the key is the field's identifier on your side, the value is "{ id, options }" - the field's Lurazon identifier and a dictionary of its options' ones, nested or not, by their identifiers on your side. Objects may be sent under either set of identifiers ("fieldsLurazon" / "fieldsClient" of the objects API)
"reasons" - a dictionary with the reasons why a field was not saved or was saved with remarks. The key is the field's position in the "list" array, starting from 0. The value is an array of entries in the "{ reason, option, used, language }" format, where "option" (the identifier of the option on your side), "used" and "language" are given only when they relate to the reason. Fields saved without remarks are not included. The possible values of "reason":
"id" - the field is not saved: its identifier is missing, not a string, empty, longer than 64 characters or contains a space
"duplicate" - the field is not saved: its identifier already came earlier in this "list" (the earlier one is processed)
"key" - the field is not saved: "key" is not a string
"title" - the field is not saved: "title" is missing, not a string or empty
"type" - the field is not saved: "type" is not one of the types above, or differs from the type the field already has
"options" - the field is not saved: "options" is not an array, an option (named in "option" when known) has no valid identifier or no title, or its key is not a string, an identifier is met twice in the field, the options nest deeper than 5 levels, or options are given for a type that has none
"depends" - the field is not saved: "depends" is not a dictionary, or names no field made through this API, or no option of it
"used" - the field is not saved: the option "option", which the new options drop, is still in use - "used" lists where ("route" - a route's condition, "depends" - another field's dependency). Free it in the console first, or keep the option
"limit" - the field is not saved: the trial period's limit of 10 fields
"write" - the field is not saved: a write error
"skipped" - the field is saved, the translation into the language "language" (of the option "option", when given) is left out: unknown language, not a dictionary, a key not a string, a title not a string or empty
"translations" - the field is saved without the translations (of the option "option", when given): "translations" is not a dictionary
"required" - the field is saved as not required: "required" is not a boolean
"translatable" - the field is saved as not translatable: "translatable" is not a boolean, or the type cannot be translated
If the request is refused, its code and a short word in the response body say why:
400 "body" - the request body is not JSON, or the "site", "token" or "list" key is missing or of the wrong kind
400 "list" - the "list" array is empty or longer than 1000 items; a delete's list holds no valid identifier
413 "body" - the request body is larger than 16 MB
403 "site" - there is no site with such an identifier
403 "token" - the JWT is not signed with the site's secret, is not of the "structure" type or was issued for another site
403 "token-exp" - the JWT has expired, has no "exp" or its "exp" is more than 3600 seconds ahead
403 "blocked" - the site is blocked (an unpaid invoice or deletion), the structure is not accepted
500 "err" - a server error
Fields delete API
Send POST requests to https://structure.lurazon.com/field/del
To delete fields, the list of their identifiers must be added to the "list" array - the string values of "id" passed when adding:
Identifiers no field made through this API carries are ignored. A field still in use is not deleted: named by a search, filters or sort list, by a route (a token's binding, or a condition on one of its options) or by another field's dependency on one of its options - free it in the console first. The values of a deleted field are removed from the objects. The response with the code 200 is a dictionary with the "failed" key - an array of the identifiers of the fields that were not deleted - and "reasons", by the field's position in "list", with the one possible reason "used" and "used" - where the field is in use: "search", "filter", "sort", "route", "depends":