Skip to content

Update developer

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

PATCH/preorders/settings/developer

Costs 2 rate-limit points · Rate limits

Update the shop-wide preorder developer settings: dev mode, the custom CSS, and the theme selectors that place the Preorder button and each preorder element on product pages and on home, collection and search product cards. Selectors are used only while dev mode is on.

Deep partial. null or "" clears a selector so the theme default applies. dev_mode_enabled and css are shared with the back-in-stock widget: changing them here changes them there. Returns the developer section.

Also searched aschange preorder selectorsset preorder button selectorfix preorder button placement

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

  • dev_mode_enabledboolean

    Dev mode: place the Preorder button and preorder elements with the selectors below instead of the automatic placement. Shared with the back-in-stock widget's dev mode.

  • cssstring

    Custom CSS added on every storefront page, shared with back-in-stock. REPLACES the stored CSS; "" or null clears it.

  • product_pageobject
    Show 4 child attributesHide child attributes
    • formstring

      A CSS selector in the theme. The product form the Preorder button belongs to.

    • add_to_cart_buttonstring

      A CSS selector in the theme. The theme's add-to-cart button the Preorder button replaces.

    • add_to_cart_textstring

      A CSS selector in the theme. The element inside the add-to-cart button holding its text.

    • original_pricestring

      A CSS selector in the theme. The price the discounted preorder price strikes through.

  • insertion_pointsobject
    Show 7 child attributesHide child attributes
    • disclaimerobject
      Show 2 child attributesHide child attributes
      • selectorstring

        A CSS selector in the theme. Where the disclaimer goes on product pages.

      • insert_typestring

        Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.

        One of beforebeginafterbeginbeforeendafterend
    • payment_optionsobject
      Show 2 child attributesHide child attributes
      • selectorstring

        A CSS selector in the theme. Where the payment options goes on product pages.

      • insert_typestring

        Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.

        One of beforebeginafterbeginbeforeendafterend
    • termsobject
      Show 2 child attributesHide child attributes
      • selectorstring

        A CSS selector in the theme. Where the terms goes on product pages.

      • insert_typestring

        Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.

        One of beforebeginafterbeginbeforeendafterend
    • badgeobject
      Show 2 child attributesHide child attributes
      • selectorstring

        A CSS selector in the theme. Where the badge goes on product pages.

      • insert_typestring

        Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.

        One of beforebeginafterbeginbeforeendafterend
    • discounted_priceobject
      Show 2 child attributesHide child attributes
      • selectorstring

        A CSS selector in the theme. Where the discounted price goes on product pages.

      • insert_typestring

        Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.

        One of beforebeginafterbeginbeforeendafterend
    • countdown_timerobject
      Show 2 child attributesHide child attributes
      • selectorstring

        A CSS selector in the theme. Where the countdown timer goes on product pages.

      • insert_typestring

        Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.

        One of beforebeginafterbeginbeforeendafterend
    • progress_barobject
      Show 2 child attributesHide child attributes
      • selectorstring

        A CSS selector in the theme. Where the progress bar goes on product pages.

      • insert_typestring

        Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.

        One of beforebeginafterbeginbeforeendafterend
  • collectionobject
    Show 4 child attributesHide child attributes
    • formstring

      A CSS selector in the theme. The product card form on collection pages.

    • add_to_cart_buttonstring

      A CSS selector in the theme. The add-to-cart button on collection page product cards.

    • badgestring

      A CSS selector in the theme. Where the preorder badge goes on collection page product cards.

    • badge_insert_typestring

      Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.

      One of beforebeginafterbeginbeforeendafterend
  • homeobject
    Show 3 child attributesHide child attributes
    • formstring

      A CSS selector in the theme. The product card form on home pages.

    • add_to_cart_buttonstring

      A CSS selector in the theme. The add-to-cart button on home page product cards.

    • badgestring

      A CSS selector in the theme. Where the preorder badge goes on home page product cards.

  • searchobject
    Show 3 child attributesHide child attributes
    • formstring

      A CSS selector in the theme. The product card form on search pages.

    • add_to_cart_buttonstring

      A CSS selector in the theme. The add-to-cart button on search page product cards.

    • badgestring

      A CSS selector in the theme. Where the preorder badge goes on search page product cards.

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/developer
curl -X PATCH "https://app.stoqapp.com/api/v2/external/preorders/settings/developer" \
  -H "X-Auth-Token: $STOQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dev_mode_enabled": true,
    "css": "string",
    "product_page": {
      "form": "string",
      "add_to_cart_button": "string",
      "add_to_cart_text": "Preorder now",
      "original_price": "string"
    },
    "insertion_points": {
      "disclaimer": {
        "selector": "string",
        "insert_type": "beforebegin"
      },
      "payment_options": {
        "selector": "string",
        "insert_type": "beforebegin"
      },
      "terms": {
        "selector": "string",
        "insert_type": "beforebegin"
      },
      "badge": {
        "selector": "string",
        "insert_type": "beforebegin"
      },
      "discounted_price": {
        "selector": "string",
        "insert_type": "beforebegin"
      },
      "countdown_timer": {
        "selector": "string",
        "insert_type": "beforebegin"
      },
      "progress_bar": {
        "selector": "string",
        "insert_type": "beforebegin"
      }
    },
    "collection": {
      "form": "string",
      "add_to_cart_button": "string",
      "badge": "string",
      "badge_insert_type": "beforebegin"
    },
    "home": {
      "form": "string",
      "add_to_cart_button": "string",
      "badge": "string"
    },
    "search": {
      "form": "string",
      "add_to_cart_button": "string",
      "badge": "string"
    }
  }'
Response
No body