Storefront messages

Read and customize localized storefront response messages.

Storefront messages are localized shopper-facing responses used by storefront and hosted-action workflows. They use translation scopes: read_translations for reads and write_translations for overrides.

Every message has a stable code and a platform default. An override replaces only one store locale. Templates must preserve exactly the placeholders declared by that code; resetting an override returns the effective message to the platform default.

Endpoints#

List storefront messages

GET read_translations

List a language's messages with their platform text and the store's own.

Each message has its code, its namespace (area), the platform text in that language (default_message, or english_message when the language has none, with has_locale_default false), the store's own text (override_message, null while it uses the platform text) and the text shoppers see (effective_message). placeholders lists what the text must keep, each written {{.name}}. Messages with overrideable false are fixed by the platform.

Query parameters

Name Type Description
locale string

An enabled store language. Omit it for the default language.

Example: en
namespace string

Only messages of this area, one of namespaces in the response.

Example: cart
surface string

Only messages shown on this surface: ctx (theme pages) or hosted_action (hosted-action forms).

Example: hosted_action
search string

Search the code or the text shown, up to search_max_length characters.

Example: stock
page integer

Page number.

Default: 1
Example: 1
limit integer

Page size, up to list_max_limit.

Example: 25
sort_by string

code, namespace or effective_message.

Default: namespace
Example: code
sort_direction string

asc or desc.

Default: asc
Example: asc

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 STOREFRONT_MESSAGES_INVALID_LOCALE

    The language is not enabled for the store.

  • 400 STOREFRONT_MESSAGES_INVALID_NAMESPACE

    The namespace is not one of namespaces in the response.

  • 400 STOREFRONT_MESSAGES_INVALID_SURFACE

    The surface is not ctx or hosted_action.

  • 400 STOREFRONT_MESSAGES_INVALID_PAGE

    The page is not a positive whole number.

  • 400 STOREFRONT_MESSAGES_INVALID_LIMIT

    The limit is outside 1 to list_max_limit.

  • 400 STOREFRONT_MESSAGES_SEARCH_TOO_LONG

    The search is longer than search_max_length.

  • 400 STOREFRONT_MESSAGES_INVALID_SORT_BY

    The sort column is not code, namespace or effective_message.

  • 400 STOREFRONT_MESSAGES_INVALID_SORT_DIRECTION

    The sort direction is not asc or desc.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The query string has a parameter this request does not accept. The message and error.details.allowed_parameters list the ones it does.

  • 429 RATE_LIMITED

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

Save a storefront message

PUT write_translations

Set the store's text for one message in one language.

The text must be plain text of at most template_max_runes characters and keep every placeholder the message has, written {{.name}}. Saving the platform text while the message has no text of its own stores nothing. Shoppers see the new text within a minute, and a storefront_messages/update webhook is sent.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
locale string

An enabled store language. Omit it for the default language.

Example: en
code required string

Message code, in any case.

Example: STOREFRONT_CUSTOMER_LOGIN_SUCCESS
message_template required string

The store's text, keeping the message's placeholders.

Example: Welcome back.

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_MESSAGES_INVALID_LOCALE

    The language is not enabled for the store.

  • 400 STOREFRONT_MESSAGES_INVALID_CODE

    The code is not a storefront message.

  • 400 STOREFRONT_MESSAGES_CODE_NOT_OVERRIDEABLE

    The platform keeps this message fixed.

  • 400 STOREFRONT_MESSAGES_TEMPLATE_REQUIRED

    The text is empty. To go back to the default text, reset the message.

  • 400 STOREFRONT_MESSAGES_INVALID_TEMPLATE

    The text has HTML or control characters, or a malformed placeholder.

  • 400 STOREFRONT_MESSAGES_INVALID_PLACEHOLDER

    The text has a placeholder this message does not have.

  • 400 STOREFRONT_MESSAGES_MISSING_PLACEHOLDER

    The text leaves out a placeholder this message needs; the message names it.

  • 400 STOREFRONT_MESSAGES_TEMPLATE_TOO_LONG

    The text is longer than template_max_runes characters.

  • 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.

Reset a storefront message

DELETE write_translations

Go back to the platform text for one message in one language.

Resetting a message that already uses the platform text changes nothing and sends no webhook.

Path parameters

Name Type Description
code required string

Message code, in any case.

Example: STOREFRONT_CUSTOMER_LOGIN_SUCCESS

Query parameters

Name Type Description
locale string

An enabled store language. Omit it for the default language.

Example: en

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 STOREFRONT_MESSAGES_INVALID_LOCALE

    The language is not enabled for the store.

  • 400 STOREFRONT_MESSAGES_INVALID_CODE

    The code is not a storefront message.

  • 400 STOREFRONT_MESSAGES_CODE_NOT_OVERRIDEABLE

    The platform keeps this message fixed.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The query string has a parameter this request does not accept. The message and error.details.allowed_parameters list the ones it does.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The request body has a property; this endpoint takes no body. Send no body or an empty object {}.

  • 429 RATE_LIMITED

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

Webhook events#

Storefront message updated

EVENT storefront_messages/update App scope: read_translations Staff permission: online_store.storefront_messages:write

Fired when a store changes a storefront message's text in one language: action is saved for its own text and reset for a return to the platform text. updated_at is when the change was made, for a reset too. A latest-state topic: the same message in the same language is the same resource, so rapid changes reach you once, with the latest text.

Payload fields

Field Type Description
action string Always present
message.code string Always present
message.locale string Always present
message.namespace string Selectable in the Payload builder
message.default_message string Selectable in the Payload builder
message.override_message string | null Selectable in the Payload builder
message.effective_message string Selectable in the Payload builder
message.placeholders array Selectable in the Payload builder
message.updated_at string Selectable in the Payload builder