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 language for that country uses /{locale}, 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 read_storefront

Get live Preferences limits.

Returns the current maximum length for every permalink segment.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

Get preferences

GET read_storefront

Get the store-wide favicon and permalink structure.

These settings apply to every storefront in the store.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

Set favicon

PUT write_storefront

Set or remove the store-wide favicon.

Pass a site asset image id, or null to remove the favicon. Assigning an image also requires read_site_assets.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
favicon_file_id required string|null

Site asset image id, or null to remove the favicon.

Example: null

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 400 INVALID_INPUT

    The id is malformed, the file is not an image, or it is not a site asset.

  • 404 NOT_FOUND

    The file does not exist in this store.

  • 400 STORE_API_INVALID_REQUEST_BODY

    The body has an unknown field or is missing favicon_file_id.

Get permalinks

GET read_storefront

Get every storefront permalink segment.

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

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

Update permalinks

PUT write_storefront

Replace the full storefront permalink structure.

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. Renames create URL redirects transactionally.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
permalinks required object

Complete permalink object returned by the read endpoint.

Example: {"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"}

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 400 STORE_API_INVALID_REQUEST_BODY

    The body has an unknown field or is missing required permalinks.

  • 400 STOREFRONT_PERMALINK_EMPTY

    A permalink value is empty.

  • 400 STOREFRONT_PERMALINK_TOO_LONG

    A permalink value exceeds the live maximum.

  • 400 STOREFRONT_PERMALINK_INVALID_CHARS

    A permalink contains characters outside lowercase letters, numbers, and hyphens.

  • 400 STOREFRONT_PERMALINK_RESERVED

    A permalink uses a reserved route or locale code.

  • 400 STOREFRONT_PERMALINK_DUPLICATE

    Two incompatible routes use the same permalink.

Age gate limits

GET read_storefront

Get the allowed age gate values.

Returns the minimum age and remember-days ranges, the copy length limits, the country limit, the allowed modes, and default_copy: the platform text an empty copy field shows, with {age} standing for min_age.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

Get age gate

GET read_storefront

Get the store-wide 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. Empty copy fields use the platform text in the shopper's language. revision changes on every saved change.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

Update age gate

PUT write_storefront

Replace the store-wide 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. {age} in the copy is replaced with min_age. Send expected_revision to refuse the change when someone saved in between. Storefront pages show the change at once.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
age_gate required object

The complete age gate, as returned by Get age gate without revision.

Example: {"enabled":true,"min_age":18,"show_to":"selected_countries","countries":["DE","FR"],"remember_mode":"days","remember_days":30,"decline_action":"message","decline_url":"","heading":"","body":"","confirm_label":"","decline_label":""}
expected_revision string

revision from Get age gate. A concurrent change returns CONFLICT.

Example: 9f2c4f3b7d1e0a6c5b8e2d4f1a3c6e9b0d2f4a6c8e1b3d5f7a9c0e2b4d6f8a1c

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 400 STORE_API_INVALID_REQUEST_BODY

    The body has an unknown field, is missing age_gate, or a field has the wrong type.

  • 400 AGE_GATE_SHOW_TO_INVALID

    show_to is not all or selected_countries.

  • 400 AGE_GATE_MIN_AGE_INVALID

    min_age is outside 13 to 25.

  • 400 AGE_GATE_REMEMBER_INVALID

    remember_mode is not session or days.

  • 400 AGE_GATE_REMEMBER_DAYS_INVALID

    remember_days is outside 1 to 30.

  • 400 AGE_GATE_DECLINE_ACTION_INVALID

    decline_action is not message or redirect.

  • 400 AGE_GATE_DECLINE_URL_REQUIRED

    decline_action is redirect and decline_url is empty.

  • 400 AGE_GATE_DECLINE_URL_INVALID

    decline_url is not an absolute https address, has user information, or is longer than 2048 characters.

  • 400 AGE_GATE_TEXT_INVALID

    A copy field is longer than its limit or contains control characters.

  • 400 AGE_GATE_COUNTRIES_REQUIRED

    The gate is enabled for selected countries with no country.

  • 400 AGE_GATE_COUNTRIES_TOO_MANY

    More countries than max_countries.

  • 400 AGE_GATE_COUNTRY_INVALID

    A country code is not a known ISO 3166-1 alpha-2 code.

  • 409 CONFLICT

    expected_revision no longer matches: the age gate changed since it was read.

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 the store-wide favicon or permalink structure changes.

Payload fields

Field Type Description
preferences.favicon_file_id string Selectable in the Payload builder
preferences.permalinks.product string Selectable in the Payload builder
preferences.permalinks.shop string Selectable in the Payload builder
preferences.permalinks.category string Selectable in the Payload builder
preferences.permalinks.category_list string Selectable in the Payload builder
preferences.permalinks.collection string Selectable in the Payload builder
preferences.permalinks.collection_list string Selectable in the Payload builder
preferences.permalinks.vendor string Selectable in the Payload builder
preferences.permalinks.vendor_list string Selectable in the Payload builder
preferences.permalinks.brand string Selectable in the Payload builder
preferences.permalinks.brand_list string Selectable in the Payload builder
preferences.permalinks.blog string Selectable in the Payload builder
preferences.permalinks.blog_list string Selectable in the Payload builder
preferences.permalinks.blog_category string Selectable in the Payload builder
preferences.permalinks.page string Selectable in the Payload builder
preferences.permalinks.policy string Selectable in the Payload builder
preferences.permalinks.search string Selectable in the Payload builder
preferences.updated_at string Selectable in the Payload builder
changed_fields array Selectable in the Payload builder