Skip to content

Update developer

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

PATCH
/preorders/settings/developer
curl --request PATCH \
--url https://app.stoqapp.com/api/v2/external/preorders/settings/developer \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <X-Auth-Token>' \
--data '{ "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" } }'

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.

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

Media typeapplication/json
object
dev_mode_enabled

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.

boolean
css

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

string
product_page
object
form

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

string
add_to_cart_button

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

string
add_to_cart_text

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

string
original_price

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

string
insertion_points
object
disclaimer
object
selector

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

string
insert_type

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.

string
Allowed values: beforebegin afterbegin beforeend afterend
payment_options
object
selector

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

string
insert_type

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.

string
Allowed values: beforebegin afterbegin beforeend afterend
terms
object
selector

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

string
insert_type

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.

string
Allowed values: beforebegin afterbegin beforeend afterend
badge
object
selector

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

string
insert_type

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.

string
Allowed values: beforebegin afterbegin beforeend afterend
discounted_price
object
selector

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

string
insert_type

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.

string
Allowed values: beforebegin afterbegin beforeend afterend
countdown_timer
object
selector

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

string
insert_type

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.

string
Allowed values: beforebegin afterbegin beforeend afterend
progress_bar
object
selector

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

string
insert_type

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.

string
Allowed values: beforebegin afterbegin beforeend afterend
collection
object
form

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

string
add_to_cart_button

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

string
badge

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

string
badge_insert_type

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.

string
Allowed values: beforebegin afterbegin beforeend afterend
home
object
form

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

string
add_to_cart_button

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

string
badge

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

string
search
object
form

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

string
add_to_cart_button

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

string
badge

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

string

Example

{
"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"
}
}

Success — the updated resource.

Media typeapplication/json
object

Example generated

{}

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

Media typeapplication/json
object

Example generated

{}

Missing or invalid X-Auth-Token.

Media typeapplication/json

Error envelope returned by every failed request.

object
errors
required
Array<string>

Example

{
"errors": [
"Unauthorized"
]
}

Invalid fields, keyed by canonical section paths. Nothing was saved.

Media typeapplication/json
object
errors
required
object
key
additional properties
Array<string>

Example generated

{
"errors": {
"additionalProperty": [
"example"
]
}
}

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

Media typeapplication/json

Error envelope returned by every failed request.

object
errors
required
Array<string>

Example

{
"errors": [
"Rate limit exceeded"
]
}
Was this page helpful?

Still stuck? Ask Quinn or chat with support