Skip to content

Update page settings

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

PATCH/preorders/settings/pages

Costs 2 rate-limit points · Rate limits

Update the Preorder pages settings (Preorders > Settings > Pages): the Preorder button on the home, collection and search pages, and the collection-page badge rule. Shop-wide, not per offer. Locations and markets are PATCH /account/markets; CSS selectors are PATCH /preorders/settings/developer.

Deep partial: absent fields are unchanged; unknown keys are rejected. Returns the pages section.

Also searched asshow preorder on collection pagehide preorder on collection pageshow preorder on home pageshow preorder on search pageturn off preorder on search pageshow preorder badge if any variant is preorder

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

  • homeobject

    The Preorder button on products listed on the home page.

    Show 1 child attributeHide child attributes
    • enabledboolean

      Show the Preorder button on products listed on the home page.

  • collectionobject

    The Preorder button and preorder badge on products listed on collection pages.

    Show 2 child attributesHide child attributes
    • enabledboolean

      Show the Preorder button on products listed on collection pages.

    • show_badge_if_any_variant_is_preorderboolean

      Show the offer's preorder badge on a product card when any variant is on preorder, not only the variant the card shows first. The editor shows it under Collection page; it applies to every product list with the Preorder button on. The badge shows only for offers with Add badge on. Turning collection pages on does not need it: leave it out unless the merchant asks about the badge.

  • searchobject

    The Preorder button on products listed on search results pages.

    Show 1 child attributeHide child attributes
    • enabledboolean

      Show the Preorder button on products listed on search results pages.

Returns

  • homeobject
    Show 1 child attributeHide child attributes
    • enabledboolean
      Example: false
  • collectionobject
    Show 2 child attributesHide child attributes
    • enabledboolean
      Example: true
    • show_badge_if_any_variant_is_preorderboolean
      Example: false
  • searchobject
    Show 1 child attributeHide child attributes
    • enabledboolean
      Example: false

Errors

409
idempotency_key_in_progress

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

422
invalid_params

One or more fields failed the action's schema.

Any request can also fail with auth_invalid (401) or rate_limited (429).

Every error has the same shape: see Errors and the list of error codes.

PATCH/preorders/settings/pages
curl -X PATCH "https://app.stoqapp.com/api/v2/external/preorders/settings/pages" \
  -H "X-Auth-Token: $STOQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "collection": {
      "enabled": true
    }
  }'
Response
{
  "home": {
    "enabled": false
  },
  "collection": {
    "enabled": true,
    "show_badge_if_any_variant_is_preorder": false
  },
  "search": {
    "enabled": false
  }
}