Skip to content

Update pages

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
    Show 1 child attributeHide child attributes
    • enabledboolean

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

  • collectionobject
    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
    Show 1 child attributeHide child attributes
    • enabledboolean

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

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/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 '{
    "home": {
      "enabled": true
    },
    "collection": {
      "enabled": true,
      "show_badge_if_any_variant_is_preorder": true
    },
    "search": {
      "enabled": true
    }
  }'
Response
No body