Sorting

Choose the product sorts the storefront offers, their order and names.

Use these endpoints to configure the sorts shoppers can pick on storefront product listings (Catalog › Sorting in Store Admin). Reads require read_products and updates write_products.

The storefront sorts are Featured (featured), Best sellers (best_selling), Newest (created_at), A to Z (title) and price low to high and high to low (price_asc, price_desc). Recently updated is a back-office sort and is never offered on a storefront; search pages offer Best match (relevance) first. GET lists every storefront sort once, in storefront order, hidden ones included. An empty label means Tringify's name (platform_label), which Tringify provides in every storefront language; labels holds the store's own name per other store language. Pass locale to name platform_label in a given language.

PUT replaces the list: send sorts in storefront order with the current revision. Sorts left out keep Tringify's defaults (visible, at the end). Keep at least one visible. A stale revision returns 409 STOREFRONT_SORT_REVISION_STALE. On the storefront, themes receive the offered sorts in products.sort.options, each with its label in the shopper's language; a request for a hidden sort uses the page's default sort.

Endpoints#

Get storefront sorting

GET read_products

Get the product sorts the storefront offers, in order, with their names.

Every storefront sort is listed once, in storefront order, including hidden ones. label is the store's own name in its default language; empty means Tringify's name (platform_label, and platform_labelled true), which Tringify provides in every storefront language. labels holds the store's own name per other store language. Recently updated is a back-office sort and is never offered on a storefront; search pages add Best match first. keys lists the storefront sorts and label_max_length bounds names. revision is 0 until the store first saves.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Update storefront sorting

PUT write_products

Replace the storefront's sort order, visibility and names.

Send sorts in storefront order with the revision from GET. Sorts you leave out keep Tringify's defaults (visible, at the end). Keep at least one visible. An empty label returns the sort to Tringify's name; a labels entry with an empty name removes that translation. A stale revision returns STOREFRONT_SORT_REVISION_STALE. A request for a hidden sort on the storefront falls back to the page's default sort.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
revision required integer

The revision from the latest GET or update response.

Example: 3
sorts required array<object>

Storefront sorts in display order.

Example: [{"key":"featured","visible":true,"label":"Our picks","labels":{"de":"Unsere Auswahl"}},{"key":"title","visible":false,"label":""}]

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 400 STOREFRONT_SORT_UNKNOWN

    A key is not one of the storefront sorts in keys.

  • 400 STOREFRONT_SORT_DUPLICATE

    A key appears more than once.

  • 400 STOREFRONT_SORT_NONE_VISIBLE

    Every sort is hidden; keep at least one visible.

  • 400 STOREFRONT_SORT_LABEL_TOO_LONG

    A label or translation is longer than label_max_length.

  • 400 STOREFRONT_SORT_LABEL_INVALID

    A label or translation contains control characters.

  • 400 STOREFRONT_SORT_LOCALE_INVALID

    A labels key is not a language code.

  • 409 STOREFRONT_SORT_REVISION_STALE

    Sorting changed since the supplied revision.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.