Skip to content

Update storefront text

API v2 is in public beta: endpoints and fields can change before general availability. See the changelog

PATCH/preorders/settings/storefront_text

Costs 2 rate-limit points · Rate limits

Update the shop-wide preorder storefront text: the currency format, the button's out-of-stock and add-to-cart text, and the preorder modal's continue and cancel buttons and error heading. Shared by every preorder offer, not per offer.

Deep partial. Shop-wide: one change applies to every preorder offer. The per-offer Preorder button text and per-state overrides are on the offer's widget and advanced settings. Text fields are written in locale (optional); currency_format is not translated. Returns the section.

Also searched aschange preorder currency formatchange preorder out of stock textchange preorder add to cart textchange preorder modal continue buttonchange preorder modal cancel buttonchange preorder error headingtranslate preorder modal buttons

Headers

  • Idempotency-Keystring

    A fresh unique key for every write (a new UUID, say); reuse it only to retry that write. Keys are remembered for 1 hour: the same key and the same request within that hour returns the first result, with Idempotent-Replayed: true, without running again; the same key with a different method, path or body is refused (422 idempotency_key_reused); a retry while the first is still running gets 409 idempotency_key_in_progress. Keys are per store. Server errors and rate limits are not kept, so their retry runs.

Request body

  • currency_formatstring

    How preorder prices print on the storefront, such as "{{amount}} {{currency}}". Use {{currency}}, {{currency_symbol}} and a Shopify amount variable ({{amount}}, {{amount_no_decimals}}, {{amount_with_comma_separator}} ...). "" goes back to the theme format. Not translated.

  • buttonobject
    Show 2 child attributesHide child attributes
    • out_of_stock_textstring

      Button text once the preorder limit is reached and the product is sold out. Every offer.

    • add_to_cart_textstring

      Button text when the product is in stock and not on preorder. Every offer.

  • modalobject
    Show 3 child attributesHide child attributes
    • continue_button_textstring

      Text on the continue button of the preorder modal. Every offer.

    • cancel_button_textstring

      Text on the cancel button of the preorder modal. Every offer.

    • error_headingstring

      Heading of error messages in the preorder modal. Edited on the preorder translations page. Every offer.

  • localestring

    Optional language tag ("fr", "de", "pt-BR"). The text fields are written in that language; omit for the shop's default. currency_format ignores it.

Errors

401

Missing or invalid X-Auth-Token.

409

An earlier request with the same Idempotency-Key is still running. Wait, then resend the same request with the same key.

422

Invalid fields: one details entry per field error, its path the canonical section path. Nothing was saved.

429

Rate limited: cost-weighted per token (read 1, write 2; 360 points / 60s). Check Retry-After.

Every error has the same shape: see Errors.

PATCH/preorders/settings/storefront_text
curl -X PATCH "https://app.stoqapp.com/api/v2/external/preorders/settings/storefront_text" \
  -H "X-Auth-Token: $STOQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "currency_format": "string",
    "button": {
      "out_of_stock_text": "Preorder now",
      "add_to_cart_text": "Preorder now"
    },
    "modal": {
      "continue_button_text": "Preorder now",
      "cancel_button_text": "Preorder now",
      "error_heading": "string"
    },
    "locale": "fr"
  }'
Response
No body