v1

latestOpenAPI 3.1.02026-07-241765501.1 MB
Sort options

Create or replace sort options

🔐 This endpoint requires HTTP authentication (either Basic or Bearer). For authenticating with Bearer token, required scopes are: sort_options(w).

Create or replace existing sort options. When providing sort options, every combination of sort_by and sort_order must be unique. For instance, there can only be one sort option that has a sort_by with value price and a sort_order with value ascending.

put/v1/sort_options

Query parameters

keystring required

The key of the index to use.

Example:key_K2pX7vBnU0bgA5xp
sectionstring

The section of the index to use. Defaults to Products.

Example:Products
cstring

The ID of the client and version that the request is coming from, such as cio-js-2.90.

Example:cio-js-2.90

Request body

Example request

{
  "sort_options": [
    {
      "display_name": "Price: Low to High",
      "path_in_metadata": "data.price",
      "position": 1,
      "sort_by": "price"
    }
  ]
}

Response

OK

Example response

{
  "sort_options": [
    {
      "display_name": "Price: Low to High",
      "path_in_metadata": "data.price",
      "position": 1,
      "sort_by": "price"
    }
  ]
}