# Search synonyms

Manage locale-specific equivalent search terms for product discovery.

Search synonym groups expand recognized words or phrases to the alternatives in that group. Expansion is case-insensitive and scoped to the store and search language. Search itself matches other forms of a word in the search language, so `jumpers` finds a product titled Jumper without a group. A group applies only to terms typed as written: `jumpers` does not use a group holding `jumper`, so add the plural or other forms shoppers type as terms of their own. A group's terms also find each other's word forms in the search language: with a group holding `bag` and `tote`, `bag` finds a product titled Totes. In predictive search, a group applies once its whole term has been typed. Other query words, product visibility, and active filters still apply; equivalent terms do not guarantee identical ranking. Changes apply to every storefront search in that language (the search page, predictive search and searching within a collection) from the next request, without a search index rebuild.

Use `GET /search-synonyms/locales` to discover enabled languages for these groups. Reads require `read_search`; writes require `write_search`, which also grants read access. The token must be valid and the store must have an active or trialing subscription. Use [Authentication](/store-api/getting-started/authentication), [Rate limits](/store-api/getting-started/rate-limits), and [Errors](/store-api/getting-started/errors) for the shared request rules.

## Group response fields

A group has the following fields in list, create, and update responses. Create and update also return a top-level success `code` and `message`. Create returns HTTP 201 on success; the other endpoints return HTTP 200.

| Field | Type | Meaning |
| --- | --- | --- |
| `id` | string | Group UUID. Always present. |
| `store_id` | string | Owning store UUID. Always present and resolved from the token. |
| `locale` | string | Enabled store language code. Always present; there is no wildcard group. |
| `terms` | array of strings | Complete set of 2–25 terms. Always present. Leading and trailing whitespace is removed, repeated spaces become one, and Unicode text is normalized. Case and order are preserved. |
| `created_at` | string | Creation time in the store timezone, as an RFC 3339 timestamp with the store's numeric offset (for example `2026-08-03T16:30:00+02:00`). Always present. |
| `updated_at` | string | Last successful update time in the store timezone, in the same format as `created_at`. Always present. |

Timestamps carry the store timezone's offset at that moment, so the offset can change with daylight saving time; compare instants, not strings.

## Webhooks and language removal

Subscribe to `search_synonyms/create`, `search_synonyms/update`, and `search_synonyms/delete` below when maintaining a copy. An app subscribes to them with `read_search`. The update event contains the resulting group; the delete event contains its deletion snapshot. A bulk delete sends one delete event for each group it removes. Webhook payload timestamps use the same store-timezone format as responses.

Removing a language from the store deletes its groups, without a separate group-delete event for each one. A mirror must also handle `store/locales/deleted`; adding the language again does not restore those groups. See [Languages](/store-api/store/languages) for the language-deletion event and its subscription requirements.

## Endpoints

## List search synonym languages

`GET /api/2025-01/search-synonyms/locales`

Returns the enabled language codes, display labels, and default-language flag using Search read access. Use the returned locale code when creating or moving a group.

Scope: `read_search`

```curl
curl 'https://api-store.tringify.com/api/2025-01/search-synonyms/locales' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{
  "success": true,
  "data": {
    "locales": [
      {
        "locale": "en",
        "label": "English",
        "native_name": "English",
        "selector_label": "English",
        "rtl": false,
        "is_default": true,
        "created_at": "2026-07-01T10:15:00-04:00"
      },
      {
        "locale": "de",
        "label": "German",
        "native_name": "Deutsch",
        "selector_label": "Deutsch (German)",
        "rtl": false,
        "is_default": false,
        "created_at": "2026-07-08T18:40:00-04:00"
      },
      {
        "locale": "es",
        "label": "Spanish",
        "native_name": "Español",
        "selector_label": "Español (Spanish)",
        "rtl": false,
        "is_default": false,
        "created_at": "2026-07-08T18:40:00-04:00"
      },
      {
        "locale": "fr",
        "label": "French",
        "native_name": "Français",
        "selector_label": "Français (French)",
        "rtl": false,
        "is_default": false,
        "created_at": "2026-07-08T18:40:00-04:00"
      },
      {
        "locale": "it",
        "label": "Italian",
        "native_name": "Italiano",
        "selector_label": "Italiano (Italian)",
        "rtl": false,
        "is_default": false,
        "created_at": "2026-07-08T18:40:00-04:00"
      }
    ],
    "max_languages": 5
  }
}
```

## Search synonym limits

`GET /api/2025-01/search-synonyms/limits`

Returns validation and list controls. `list_page_size` is the default page size; `list_max_limit` is the maximum accepted size. `page_size_options` suggests UI choices, but any integer from 1 to `list_max_limit` is accepted. `max_terms_per_group` limits terms in one group; `max_groups_per_store` limits the groups a store can have across its languages. `bulk_delete_max` is the most group IDs one bulk delete accepts. `max_term_length` and `search_max_length` count Unicode code points. `sort_columns` lists the accepted sort keys. All fields shown in the response are present.

Scope: `read_search`

```curl
curl 'https://api-store.tringify.com/api/2025-01/search-synonyms/limits' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{
  "success": true,
  "data": {
    "list_page_size": 25,
    "list_max_limit": 100,
    "page_size_options": [
      10,
      25,
      50,
      100
    ],
    "search_max_length": 100,
    "max_terms_per_group": 25,
    "max_groups_per_store": 1000,
    "bulk_delete_max": 100,
    "max_term_length": 64,
    "sort_columns": [
      "created_at",
      "updated_at",
      "locale"
    ]
  }
}
```

## List search synonyms

`GET /api/2025-01/search-synonyms`

Omit `locale` to list groups across the store's languages. A supplied locale must be enabled on the store. `data.groups` is an array of complete group objects; `data.total` is the number of groups matching the filters before pagination. `data.store_total` is the number of groups in the store across all languages, whatever the filters. An empty result or a page beyond the end returns `groups: []` and the matching total. The default order is `created_at` descending; ties use ID descending. See the group response fields above.

Scope: `read_search`

```curl
curl 'https://api-store.tringify.com/api/2025-01/search-synonyms?locale=en&page=1&per_page=25&search=tee&sort_by=updated_at&sort_direction=desc' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{
  "success": true,
  "data": {
    "groups": [
      {
        "id": "3e41dbac-a931-4c43-9ff0-d430fa7b79c1",
        "store_id": "786b2499-ee1c-4c00-8e71-3512f4676369",
        "locale": "en",
        "terms": [
          "tee",
          "t-shirt"
        ],
        "created_at": "2026-08-03T16:30:00+02:00",
        "updated_at": "2026-08-03T16:30:00+02:00"
      }
    ],
    "total": 1,
    "store_total": 1
  }
}
```

## Create search synonyms

`POST /api/2025-01/search-synonyms`

Send JSON with an enabled language code and 2–25 terms. Leading and trailing whitespace is removed, repeated spaces become one, and Unicode text is normalized. Saved case and order are preserved. Each trimmed term can contain at most 64 Unicode code points. Empty terms and case-insensitive duplicates are rejected. A trimmed term cannot already belong to another group in the same store and language; that conflict returns 409. The same term can be used in another language. Success returns HTTP 201 with the complete group plus `code: SEARCH_SYNONYM_CREATED` and an English message, and emits `search_synonyms/create`.

Scope: `write_search`

```curl
curl -X POST 'https://api-store.tringify.com/api/2025-01/search-synonyms' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "locale": "en",
  "terms": [
    "tee",
    "t-shirt"
  ]
}'
```

Response:

```json
{
  "success": true,
  "data": {
    "id": "3e41dbac-a931-4c43-9ff0-d430fa7b79c1",
    "store_id": "786b2499-ee1c-4c00-8e71-3512f4676369",
    "locale": "en",
    "terms": [
      "tee",
      "t-shirt"
    ],
    "created_at": "2026-08-03T16:30:00+02:00",
    "updated_at": "2026-08-03T16:30:00+02:00"
  },
  "code": "SEARCH_SYNONYM_CREATED",
  "message": "Synonym group created."
}
```

## Update search synonyms

`PUT /api/2025-01/search-synonyms/{synonymId}`

This PUT merges the supplied fields. Omitted or null fields retain their current values. A supplied `terms` array replaces the whole group; it does not append. The create validation rules still apply, so an empty array cannot clear a group. Changing `locale` moves the group to that enabled language and checks term ownership there. An update that changes nothing, including `{}`, returns the group as it is, without changing `updated_at` or emitting an event. The response contains the complete saved group with `code: SEARCH_SYNONYM_UPDATED` and an English message. A well-formed ID absent from the token's store returns 404.

Scope: `write_search`

```curl
curl -X PUT 'https://api-store.tringify.com/api/2025-01/search-synonyms/3e41dbac-a931-4c43-9ff0-d430fa7b79c1' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "locale": "en",
  "terms": [
    "tee",
    "t-shirt"
  ]
}'
```

Response:

```json
{
  "success": true,
  "data": {
    "id": "3e41dbac-a931-4c43-9ff0-d430fa7b79c1",
    "store_id": "786b2499-ee1c-4c00-8e71-3512f4676369",
    "locale": "en",
    "terms": [
      "tee",
      "t-shirt"
    ],
    "created_at": "2026-08-03T16:30:00+02:00",
    "updated_at": "2026-08-03T16:35:00+02:00"
  },
  "code": "SEARCH_SYNONYM_UPDATED",
  "message": "Synonym group updated."
}
```

## Delete search synonyms

`DELETE /api/2025-01/search-synonyms/{synonymId}`

Removes the group from the token's store and emits `search_synonyms/delete`. Success has a code and message, with no data object. Repeating the deletion of a well-formed ID returns 404 once the group is absent; there is no restore endpoint.

Scope: `write_search`

```curl
curl -X DELETE 'https://api-store.tringify.com/api/2025-01/search-synonyms/3e41dbac-a931-4c43-9ff0-d430fa7b79c1' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{
  "success": true,
  "code": "SEARCH_SYNONYM_DELETED",
  "message": "Synonym group deleted."
}
```

## Bulk delete search synonyms

`POST /api/2025-01/search-synonyms/bulk-delete`

Send up to `bulk_delete_max` group IDs (see the limits endpoint). Duplicate IDs count once. The groups found in the token's store are deleted together in one transaction, each emitting `search_synonyms/delete`; an ID that cannot be deleted is reported in `data.failed` with a `reason`: `INVALID_INPUT` when it is not a well-formed UUID, `SEARCH_SYNONYM_NOT_FOUND` when it names no group in the store. The rest are still deleted. `data.deleted` lists the deleted IDs. The top-level `code` is `SEARCH_SYNONYM_BULK_DELETED` with an English message counting the deleted groups.

Scope: `write_search`

```curl
curl -X POST 'https://api-store.tringify.com/api/2025-01/search-synonyms/bulk-delete' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": [
    "3e41dbac-a931-4c43-9ff0-d430fa7b79c1"
  ]
}'
```

Response:

```json
{
  "success": true,
  "code": "SEARCH_SYNONYM_BULK_DELETED",
  "message": "2 synonym groups deleted.",
  "data": {
    "deleted": [
      "3e41dbac-a931-4c43-9ff0-d430fa7b79c1",
      "9b0f6c27-55d1-4e0e-8d3a-0c4a7e2f1b90"
    ],
    "failed": [
      {
        "id": "5a2c9e4d-1f7b-4c8a-9e63-2d0b7f4a8c15",
        "reason": "SEARCH_SYNONYM_NOT_FOUND"
      }
    ]
  }
}
```

## Webhook events

## Search synonym group created

Event: `search_synonyms/create` · App scope: `read_search` · Staff permission: `online_store.search:write`

Fired after a search synonym group is created. The search_synonym object describes the saved group. Its created_at and updated_at values, like every webhook timestamp, are in the store's time zone with its offset (RFC 3339).

```json
{
  "search_synonym": {
    "created_at": "2026-08-03T14:30:00-04:00",
    "id": "3e41dbac-a931-4c43-9ff0-d430fa7b79c1",
    "locale": "en",
    "terms": [
      "tee",
      "t-shirt"
    ],
    "updated_at": "2026-08-03T14:30:00-04:00"
  }
}
```

## Search synonym group deleted

Event: `search_synonyms/delete` · App scope: `read_search` · Staff permission: `online_store.search:write`

Fired for each search synonym group deleted, including each group of a bulk delete. The search_synonym object is the group snapshot loaded for deletion. Its created_at and updated_at values describe that group; updated_at is not the deletion time. Removing a store language also removes its groups, without a separate search_synonyms/delete event for each group. Integrations mirroring groups should also handle store/locales/deleted.

```json
{
  "search_synonym": {
    "created_at": "2026-08-03T14:30:00-04:00",
    "id": "3e41dbac-a931-4c43-9ff0-d430fa7b79c1",
    "locale": "en",
    "terms": [
      "tee",
      "t-shirt"
    ],
    "updated_at": "2026-08-03T14:35:00-04:00"
  }
}
```

## Search synonym group updated

Event: `search_synonyms/update` · App scope: `read_search` · Staff permission: `online_store.search:write`

Fired after a group update that changes its language or terms; an update that changes nothing sends no event. The search_synonym object contains the resulting group, not a before/after diff. Its timestamps are in the store's time zone with its offset (RFC 3339); updated_at is the group update time.

```json
{
  "search_synonym": {
    "created_at": "2026-08-03T14:30:00-04:00",
    "id": "3e41dbac-a931-4c43-9ff0-d430fa7b79c1",
    "locale": "en",
    "terms": [
      "tee",
      "t-shirt"
    ],
    "updated_at": "2026-08-03T14:35:00-04:00"
  }
}
```

