---
title: "Update storefront text"
description: "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, "
url: https://docs.stoqapp.com/v2-reference/preorders-settings/update-storefront-text/
api: "API v2 reference"
method: PATCH
path: "/preorders/settings/storefront_text"
---

# Update storefront text

`PATCH https://app.stoqapp.com/api/v2/external/preorders/settings/storefront_text`

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.

**Note:** 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.

## Headers

- `Idempotency-Key` (string): 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_format` (string): How preorder prices print on the storefront, such as &quot;{{amount}} {{currency}}&quot;. Use {{currency}}, {{currency_symbol}} and a Shopify amount variable ({{amount}}, {{amount_no_decimals}}, {{amount_with_comma_separator}} ...). &quot;&quot; goes back to the theme format. Not translated.
- `button` (object)
  - `out_of_stock_text` (string): Button text once the preorder limit is reached and the product is sold out. Every offer.
  - `add_to_cart_text` (string): Button text when the product is in stock and not on preorder. Every offer.
- `modal` (object)
  - `continue_button_text` (string): Text on the continue button of the preorder modal. Every offer.
  - `cancel_button_text` (string): Text on the cancel button of the preorder modal. Every offer.
  - `error_heading` (string): Heading of error messages in the preorder modal. Edited on the preorder translations page. Every offer.
- `locale` (string): Optional language tag (&quot;fr&quot;, &quot;de&quot;, &quot;pt-BR&quot;). The text fields are written in that language; omit for the shop's default. currency_format ignores it.

Rate limit: this call costs 2 points ([rate limits](https://docs.stoqapp.com/docs/rate-limits/)).

## Example request

```sh
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"
  }'
```

## 200

Success: the updated resource.

## 202

Saved. Returns the updated section, with also_changed for cascades.

## 401

Missing or invalid `X-Auth-Token`.

```json
{
  "errors": [
    "Invalid API key"
  ],
  "code": "auth_invalid",
  "details": [
    {
      "code": "auth_invalid",
      "message": "Invalid API key",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

## 409

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

```json
{
  "errors": [
    "A request with this Idempotency-Key is still running"
  ],
  "code": "idempotency_key_in_progress",
  "details": [
    {
      "code": "idempotency_key_in_progress",
      "message": "A request with this Idempotency-Key is still running",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

## 422

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

```json
{
  "errors": [
    "widget.button.text_color must be a hex color"
  ],
  "code": "invalid_params",
  "details": [
    {
      "code": "invalid_params",
      "message": "must be a hex color",
      "path": "widget.button.text_color",
      "value": "blue",
      "expected": {
        "type": "string"
      }
    }
  ]
}
```

## 429

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

```json
{
  "errors": [
    "Rate limit exceeded"
  ],
  "code": "rate_limited",
  "details": [
    {
      "code": "rate_limited",
      "message": "Rate limit exceeded",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

