Skip to content

JSON response

Dominik Brader edited this page May 15, 2020 · 1 revision

Synopsis

The JSON response is one of the newest response formats. It provides easy access to exported product details and filters. Our library also has some helpers that should help you to get into it easier.

Versions & Support

Since the JSON response is relatively new, there is only JSON_1.0. Our library currently does not support the JSON response in our master branch, but we are working on it. See this PR to stay up to date

Response

Like our XML_2.1 response, the JSON response is automatically parsed and with it, you have many objects that you can work with.

Request

With the JSON response you have the possibility to see all parameters that were requested.

  • query<string|null> Holds the searched query. May be null if no query was submitted.
  • first<int> Mostly known as offset, describes the first product that is shown. On the first page this may be 0.
  • count<int> Mostly known as limit, describes the count of products that should be returned. Usually this is 24, but depends on the shop.
  • serviceId<string> The identifier of the service. Unique to each language channel.
  • usergroup<string|null> The usergroup in which the user is inside. Typically used in B2B shops, allows to show specific products or product data like prices or variants for a specific group of users. May be null if no usergroup is submitted.
  • order<Order> The order in which the products are sorted. See Order for more details.

Order

The order in which the products are sorted.

  • field<string> The field in which the products are being sorted. Usually this is salesfrequency.
  • relevanceBased<bool> Whether or not relevance should have an effect on the order. Usually is true, but may be set to false when sorting by a specific field e.g. price or alphabetical.
  • direction<string> Either ASC or DESC. Describes the direction in which the products should be ordered.