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 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
-
401UNAUTHORIZEDThe Authorization header is missing.
-
401INVALID_TOKENThe Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.
-
401TOKEN_NOT_ACCEPTEDThe token is unknown, expired, revoked or replaced, or its app was uninstalled.
-
402SUBSCRIPTION_REQUIREDThe store does not have an active or trialing subscription.
-
403API_VERSION_UNSUPPORTEDThe credential is pinned to an API version that cannot be served.
-
403STORE_SUSPENDEDTringify has suspended the store. Every request is refused until it is reinstated.
-
403STORE_TERMINATEDTringify has terminated the store permanently. Every request is refused.
-
403STORE_API_SCOPE_REQUIREDToken is valid but lacks the required scope for this call.
-
400STORE_API_QUERY_PARAMETER_UNKNOWNThe request has a query parameter; this endpoint takes none.
-
429RATE_LIMITEDThe request allowance is exhausted. Wait for Retry-After before retrying.
Update storefront sorting
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. |
sorts
required
|
array<object> |
Storefront sorts in display order. |
Errors
-
401UNAUTHORIZEDThe Authorization header is missing.
-
401INVALID_TOKENThe Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.
-
401TOKEN_NOT_ACCEPTEDThe token is unknown, expired, revoked or replaced, or its app was uninstalled.
-
402SUBSCRIPTION_REQUIREDThe store does not have an active or trialing subscription.
-
403API_VERSION_UNSUPPORTEDThe credential is pinned to an API version that cannot be served.
-
403STORE_SUSPENDEDTringify has suspended the store. Every request is refused until it is reinstated.
-
403STORE_TERMINATEDTringify has terminated the store permanently. Every request is refused.
-
403STORE_API_SCOPE_REQUIREDToken is valid but lacks the required scope for this call.
-
400STOREFRONT_SORT_UNKNOWNA key is not one of the storefront sorts in
keys. -
400STOREFRONT_SORT_DUPLICATEA key appears more than once.
-
400STOREFRONT_SORT_NONE_VISIBLEEvery sort is hidden; keep at least one visible.
-
400STOREFRONT_SORT_LABEL_TOO_LONGA label or translation is longer than
label_max_length. -
400STOREFRONT_SORT_LABEL_INVALIDA label or translation contains control characters.
-
400STOREFRONT_SORT_LOCALE_INVALIDA
labelskey is not a language code. -
409STOREFRONT_SORT_REVISION_STALESorting changed since the supplied revision.
-
400STORE_API_BODY_PROPERTY_UNKNOWNThe body has a property this request does not accept. The message and
error.details.propertieslist the allowed and required properties (nestedfor each object or list of objects). -
400STORE_API_BODY_PROPERTY_INVALIDA body property has the wrong type (
error.details.expected_type). The message anderror.details.propertieslist the allowed and required properties. -
400STORE_API_QUERY_PARAMETER_UNKNOWNThe request has a query parameter; this endpoint takes none.
-
429RATE_LIMITEDThe request allowance is exhausted. Wait for Retry-After before retrying.