# 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 /api/2025-01/storefront-messages`

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.

Scope: `read_translations`

```curl
curl 'https://api-store.tringify.com/api/2025-01/storefront-messages?limit=25&locale=en&namespace=cart&page=1&search=stock&sort_by=code&sort_direction=asc&surface=hosted_action' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"locales":[{"locale":"en","label":"English","native_name":"English","rtl":false,"is_default":true}],"selected_locale":"en","default_locale":"en","namespaces":["account"],"surfaces":["ctx","hosted_action"],"messages":[{"code":"STOREFRONT_CUSTOMER_LOGIN_SUCCESS","family":"action_message","namespace":"account","surfaces":["ctx","hosted_action"],"english_message":"Signed in.","default_message":"Signed in.","has_locale_default":true,"override_message":null,"effective_message":"Signed in.","placeholders":[],"overrideable":true,"template_max_length":500,"template_rune_length":0}],"total":1,"page":1,"limit":20,"limits":{"list_default_limit":20,"list_max_limit":200,"page_size_options":[20,50,100,200],"search_max_length":100,"template_max_runes":500}}}
```

## Save a storefront message

`PUT /api/2025-01/storefront-messages/overrides`

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.

Scope: `write_translations`

```curl
curl -X PUT 'https://api-store.tringify.com/api/2025-01/storefront-messages/overrides' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "code": "STOREFRONT_CUSTOMER_LOGIN_SUCCESS",
  "locale": "en",
  "message_template": "Welcome back."
}'
```

Response:

```json
{"success":true,"data":{"message":{"code":"STOREFRONT_CUSTOMER_LOGIN_SUCCESS","family":"action_message","namespace":"account","surfaces":["ctx","hosted_action"],"english_message":"Signed in.","default_message":"Signed in.","has_locale_default":true,"override_message":"Welcome back.","effective_message":"Welcome back.","placeholders":[],"overrideable":true,"updated_at":"2026-08-03T20:00:00-04:00","template_max_length":500,"template_rune_length":13}}}
```

## Reset a storefront message

`DELETE /api/2025-01/storefront-messages/overrides/{code}`

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

Scope: `write_translations`

```curl
curl -X DELETE 'https://api-store.tringify.com/api/2025-01/storefront-messages/overrides/STOREFRONT_CUSTOMER_LOGIN_SUCCESS?locale=en' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"message":{"code":"STOREFRONT_CUSTOMER_LOGIN_SUCCESS","family":"action_message","namespace":"account","surfaces":["ctx","hosted_action"],"english_message":"Signed in.","default_message":"Signed in.","has_locale_default":true,"override_message":null,"effective_message":"Signed in.","placeholders":[],"overrideable":true,"template_max_length":500,"template_rune_length":0}}}
```

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

```json
{
  "action": "saved",
  "message": {
    "code": "AVAILABILITY_GIFT_ONLY",
    "default_message": "Example text",
    "effective_message": "Example text",
    "locale": "fr",
    "namespace": "cart",
    "override_message": null,
    "placeholders": [],
    "updated_at": "2026-06-09T12:00:00-04:00"
  }
}
```

