Get widget
API v2 is in public beta: endpoints and fields can change before general availability. See the changelog
/preorders/offers/{id}/widgetCosts 1 rate-limit point · Rate limits
Read the widget configuration for a preorder offer.
button.text_color and background_color only show while custom_colors_enabled is true; otherwise the theme's button colors are used. The disclaimer and the badge show only while show_disclaimer and show_badge are true. The payment and savings breakdown is payments.show_payment_widget, not part of this section. locale returns the texts in that language. Edit with PATCH /preorders/offers/:id/widget.
Also searched asget widgetshow widgetview button settingsview badge settingsview disclaimer settingspreorder ui
Path parameters
idstringRequiredThe offer's ID, from
GET /preorders/offers.
Query parameters
localestringLanguage for translated text, such as fr or pt-BR. Omit for the shop's default language.
Returns
buttonobjectText and colors of the preorder button.
Show 4 child attributesHide child attributes
button_textstringPreorder button label.
custom_colors_enabledbooleantrue uses text_color and background_color; false uses the theme's own button colors.
text_colorstringButton text color, as hex. Used when custom_colors_enabled is true.
background_colorstringButton background color, as hex. Used when custom_colors_enabled is true.
disclaimerobjectThe disclaimer line shown under the preorder button.
Show 5 child attributesHide child attributes
show_disclaimerbooleanWhether the disclaimer line shows under the button.
disclaimer_textstringText of the disclaimer line.
text_colorstringDisclaimer text color, as hex.
background_colorstringDisclaimer background color, as hex.
border_radiusintegerDisclaimer corner radius in pixels.
badgeobjectThe preorder badge shown on product pages and product cards.
Show 4 child attributesHide child attributes
show_badgebooleanWhether the preorder badge shows.
badge_textstringLabel printed on the preorder badge.
text_colorstringBadge text color, as hex.
background_colorstringBadge background color, as hex.
Errors
not_foundThe path is valid but nothing with that id exists in this store.
invalid_paramsOne or more fields failed the action's schema.
validation_failedThe request failed validation.
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.
curl "https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/widget" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/widget", {
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/widget",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/widget")
req = Net::HTTP::Get.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)curl "https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/widget?locale=fr" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/widget?locale=fr", {
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/widget?locale=fr",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/widget?locale=fr")
req = Net::HTTP::Get.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"button": {
"button_text": "Preorder Now",
"custom_colors_enabled": true,
"text_color": "#ffffff",
"background_color": "#8700d3"
},
"disclaimer": {
"show_disclaimer": true,
"disclaimer_text": "Expected to ship by August 2026",
"text_color": "#FFFFFF",
"background_color": "#1F2937",
"border_radius": 4
},
"badge": {
"show_badge": true,
"badge_text": "Pre-Order",
"text_color": "#FFFFFF",
"background_color": "#000000"
}
}{
"errors": [
"Invalid API key"
],
"code": "auth_invalid",
"details": [
{
"code": "auth_invalid",
"message": "Invalid API key",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"Offer not found"
],
"code": "not_found",
"details": [
{
"code": "not_found",
"message": "Offer not found",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"name is required"
],
"code": "validation_failed",
"details": [
{
"code": "validation_failed",
"message": "name is required",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"Rate limit exceeded"
],
"code": "rate_limited",
"details": [
{
"code": "rate_limited",
"message": "Rate limit exceeded",
"path": null,
"value": null,
"expected": null
}
]
}