# Preferences

Read the store-wide favicon, permalink structure, and age gate and update them through the Store API.

Preferences apply across every storefront in the store. Permalink values are logical route segments; the storefront runtime combines them with the active domain, country, and language address. On a shared domain, the primary country and language live at the root, another non-regional language for that country uses `/{locale}`; a regional language always includes the country, such as `/pt-BR-us`, and another country uses `/{locale}-{country}`. A country-pinned domain serves that country's default language at the root and its other languages under `/{locale}`.

Changing a permalink and creating its compatibility redirects are one transaction. Either the complete route change commits or nothing changes.

The age gate asks visitors to confirm a minimum age when they enter any storefront in the store. It is a confirmation, not an identity check. Store Admin and the mobile app show it under Settings > Compliance. Every storefront page includes the gate while the page content stays in the HTML, so search engines and advertising crawlers still see the store. A visitor's answer is kept in a first-party cookie for the browser session or for `remember_days` days. The visitor country is the one the consent banner uses; in selected-countries mode a visitor whose country is unknown sees the gate. Age gate changes publish no webhook event.

## Endpoints

## Preferences limits

`GET /api/2025-01/preferences/limits`

Returns the current maximum length for every permalink segment.

Scope: `read_storefront`

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

Response:

```json
{"success":true,"data":{"permalink_max_length":50}}
```

## Get preferences

`GET /api/2025-01/preferences`

These settings apply to every storefront in the store.

Scope: `read_storefront`

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

Response:

```json
{"success":true,"data":{"favicon_file_id":null,"favicon_url":null,"permalinks":{"product":"product","collection":"collection","category":"category","page":"page","policy":"policy","blog":"blog","vendor":"vendor","brand":"brand","shop":"shop","blog_category":"blog-category","search":"search","vendor_list":"vendors","brand_list":"brands","collection_list":"collections","category_list":"categories","blog_list":"blogs"}}}
```

## Set favicon

`PUT /api/2025-01/preferences/favicon`

Pass a site asset image id, or null to remove the favicon. Assigning an image also requires read_site_assets. The response is the saved preferences, as Get preferences returns them.

Scope: `write_storefront`

```curl
curl -X PUT 'https://api-store.tringify.com/api/2025-01/preferences/favicon' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "favicon_file_id": null
}'
```

Response:

```json
{"success":true,"data":{"favicon_file_id":null,"favicon_url":null,"permalinks":{"product":"product","collection":"collection","category":"category","page":"page","policy":"policy","blog":"blog","vendor":"vendor","brand":"brand","shop":"shop","blog_category":"blog-category","search":"search","vendor_list":"vendors","brand_list":"brands","collection_list":"collections","category_list":"categories","blog_list":"blogs"}}}
```

## Get permalinks

`GET /api/2025-01/preferences/permalinks`

Returns all detail and listing route segments used by the storefront URL resolver.

Scope: `read_storefront`

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

Response:

```json
{"success":true,"data":{"permalinks":{"product":"product","collection":"collection","category":"category","page":"page","policy":"policy","blog":"blog","vendor":"vendor","brand":"brand","shop":"shop","blog_category":"blog-category","search":"search","vendor_list":"vendors","brand_list":"brands","collection_list":"collections","category_list":"categories","blog_list":"blogs"}}}
```

## Update permalinks

`PUT /api/2025-01/preferences/permalinks`

Send all permalink fields. Values must be unique unless the corresponding detail and listing routes are allowed to share a segment. Unknown fields are rejected. A value cannot be the web page address of a custom content type (a type's `address` or `address_translations`), which are set on each type. Renames create URL redirects transactionally.

Scope: `write_storefront`

```curl
curl -X PUT 'https://api-store.tringify.com/api/2025-01/preferences/permalinks' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "permalinks": {
    "blog": "blog",
    "blog_category": "blog-category",
    "blog_list": "blogs",
    "brand": "brand",
    "brand_list": "brands",
    "category": "category",
    "category_list": "categories",
    "collection": "collection",
    "collection_list": "collections",
    "page": "page",
    "policy": "policy",
    "product": "product",
    "search": "search",
    "shop": "shop",
    "vendor": "vendor",
    "vendor_list": "vendors"
  }
}'
```

Response:

```json
{"success":true,"data":{"permalinks":{"product":"product","collection":"collection","category":"category","page":"page","policy":"policy","blog":"blog","vendor":"vendor","brand":"brand","shop":"shop","blog_category":"blog-category","search":"search","vendor_list":"vendors","brand_list":"brands","collection_list":"collections","category_list":"categories","blog_list":"blogs"}}}
```

## Age gate limits

`GET /api/2025-01/preferences/age-gate/limits`

Returns the minimum age and remember-days ranges, the decline URL length limit, the country limit and the allowed modes. The gate's text is storefront messages: `AGE_GATE_HEADING`, `AGE_GATE_BODY`, `AGE_GATE_CONFIRM`, `AGE_GATE_DECLINE`, `AGE_GATE_DECLINED_HEADING` and `AGE_GATE_DECLINED_BODY` (namespace `preferences`), set per language with the storefront messages endpoints.

Scope: `read_storefront`

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

Response:

```json
{"success":true,"data":{"min_age_lowest":13,"min_age_highest":25,"remember_days_lowest":1,"remember_days_highest":30,"decline_url_max_length":2048,"max_countries":249,"show_to_options":["all","selected_countries"],"remember_options":["session","days"],"decline_action_options":["message","redirect"]}}
```

## Get age gate

`GET /api/2025-01/preferences/age-gate`

The age gate is shown on every storefront in the store when a visitor enters, to all visitors or to visitors from `countries`. A visitor whose country is unknown sees it in selected-countries mode. Its text is the `AGE_GATE_*` storefront messages, in the shopper's language. `revision` changes on every saved change.

Scope: `read_storefront`

```curl
curl 'https://api-store.tringify.com/api/2025-01/preferences/age-gate' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"age_gate":{"enabled":true,"min_age":18,"show_to":"selected_countries","countries":["DE","FR"],"remember_mode":"days","remember_days":30,"decline_action":"message","decline_url":"","revision":"9f2c4f3b7d1e0a6c5b8e2d4f1a3c6e9b0d2f4a6c8e1b3d5f7a9c0e2b4d6f8a1c"}}}
```

## Update age gate

`PUT /api/2025-01/preferences/age-gate`

Send every field of `age_gate`; unknown fields are rejected. Country codes are ISO 3166-1 alpha-2, upper-cased and deduplicated; they are cleared when `show_to` is `all`. `remember_days` is used when `remember_mode` is `days`. `decline_url` is required when `decline_action` is `redirect`; it must be an absolute `https://` address. Send `expected_revision` to refuse the change when someone saved in between. Storefront pages show the change at once.

Scope: `write_storefront`

```curl
curl -X PUT 'https://api-store.tringify.com/api/2025-01/preferences/age-gate' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "age_gate": {
    "countries": [
      "DE",
      "FR"
    ],
    "decline_action": "message",
    "decline_url": "",
    "enabled": true,
    "min_age": 18,
    "remember_days": 30,
    "remember_mode": "days",
    "show_to": "selected_countries"
  },
  "expected_revision": "9f2c4f3b7d1e0a6c5b8e2d4f1a3c6e9b0d2f4a6c8e1b3d5f7a9c0e2b4d6f8a1c"
}'
```

Response:

```json
{"success":true,"code":"AGE_GATE_UPDATED","message":"Age gate settings saved.","data":{"age_gate":{"enabled":true,"min_age":18,"show_to":"selected_countries","countries":["DE","FR"],"remember_mode":"days","remember_days":30,"decline_action":"message","decline_url":"","revision":"9f2c4f3b7d1e0a6c5b8e2d4f1a3c6e9b0d2f4a6c8e1b3d5f7a9c0e2b4d6f8a1c"}}}
```

## Get express checkout

`GET /api/2025-01/preferences/express-checkout`

`express_checkout_enabled` is the store's "Show express buttons" switch: express checkout wallet buttons (such as Apple Pay and Google Pay) on product and cart pages, where the theme places them. It is on by default; buttons appear only once a payment provider in `providers` is `ready` for the shopper's market and currency. `providers` lists the store's active payment providers whose app offers express checkout: their wallets (`id` and display `name`), the currencies they take, the markets they serve (`market_ids`) and `ready`, false while the provider has not finished setting up express checkout.

Scope: `read_storefront`

```curl
curl 'https://api-store.tringify.com/api/2025-01/preferences/express-checkout' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"express_checkout_enabled":true,"providers":[{"binding_id":"2b7c3e9a-5d1f-4a8e-9c6b-0f3d2e1a4b5c","name":"Fake Pay","mode":"test","wallets":[{"id":"apple_pay","name":"Apple Pay"},{"id":"google_pay","name":"Google Pay"}],"currencies":["AUD","USD"],"market_ids":["7f1e2d3c-4b5a-4968-8a7b-6c5d4e3f2a1b"],"ready":true}]}}
```

## Update express checkout

`PUT /api/2025-01/preferences/express-checkout`

Send `express_checkout_enabled`. Storefront pages show the change within seconds.

Scope: `write_storefront`

```curl
curl -X PUT 'https://api-store.tringify.com/api/2025-01/preferences/express-checkout' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "express_checkout_enabled": true
}'
```

Response:

```json
{"success":true,"data":{"express_checkout_enabled":true,"providers":[{"binding_id":"2b7c3e9a-5d1f-4a8e-9c6b-0f3d2e1a4b5c","name":"Fake Pay","mode":"test","wallets":[{"id":"apple_pay","name":"Apple Pay"},{"id":"google_pay","name":"Google Pay"}],"currencies":["AUD","USD"],"market_ids":["7f1e2d3c-4b5a-4968-8a7b-6c5d4e3f2a1b"],"ready":true}]}}
```

## Webhook events

Subscribe when an integration mirrors the store-wide favicon or permalink structure.

## Online Store preferences updated

Event: `storefront_preferences/update` · App scope: `read_storefront` · Staff permission: `online_store.preferences:write`

Fired when store-wide Online Store preferences change, including the favicon or permalink structure. Also sent when a deleted Site Assets file was the favicon: `favicon_file_id` is now empty.

```json
{
  "changed_fields": [
    "permalinks"
  ],
  "preferences": {
    "favicon_file_id": null,
    "permalinks": {
      "blog": "blog",
      "blog_category": "blog-category",
      "blog_list": "blogs",
      "brand": "brand",
      "brand_list": "brands",
      "category": "category",
      "category_list": "categories",
      "collection": "collection",
      "collection_list": "collections",
      "page": "page",
      "policy": "policy",
      "product": "item",
      "search": "search",
      "shop": "shop",
      "vendor": "vendor",
      "vendor_list": "vendors"
    },
    "updated_at": "2026-06-09T12:00:00-04:00"
  }
}
```

