Get widget settings
API v2 is in public beta: endpoints and fields can change before general availability. See the changelog
/back_in_stock/settings/widgetCosts 1 rate-limit point · Rate limits
Read the storefront back-in-stock signup widget configuration: the notify-me button, where it appears, and the signup form's copy, styling and inputs. ?locale= picks the language of the copy (omit it for the shop default).
Only the text fields follow ?locale=: a language with no translation of its own returns the shop default text, and locale in the response echoes the language asked for. Colors, positions, switches and SMS countries are the same in every language. optin holds the double opt-in confirmation email, used while GET /back_in_stock/settings/compliance has optin_required on. custom.javascript is read-only: STOQ support sets it. Change fields with PATCH /back_in_stock/settings/widget, sending only those to change.
Also searched asget widgetshow signup widgetview notify me buttonnotify me button settingssignup form settingswidget
Query parameters
localestringLanguage tag for the widget text, e.g. "fr" or "pt-BR". Omit it for the shop's default language.
Returns
buttonobjectShow 8 child attributesHide child attributes
textstringExample:Notify me when it's backtext_colorstringExample:#FFFFFFbackground_colorstringExample:#111111border_radiusintegerExample:4positionstringExample:float-rightfont_familystringExample:OpenSanscollection_text_colorstringExample:#FFFFFFcollection_background_colorstringExample:#202223
placementobjectShow 11 child attributesHide child attributes
enabledbooleanExample:trueshow_on_collectionbooleanExample:falseshow_on_homebooleanExample:falseshow_on_searchbooleanExample:falseshow_on_preorderbooleanExample:falseshow_if_any_variant_out_of_stockbooleanExample:falseshow_on_collection_if_any_variant_out_of_stockbooleanExample:falseavailability_check_enabledbooleanExample:truemerchant_managed_positionbooleanExample:falseselectorsobjectShow 10 child attributesHide child attributes
productnullcollectionnullcollection_insertionstringExample:afterendcollection_containernullhomenullhome_containernullsearchnullsearch_containernullrestock_notenullrestock_note_insertionstringExample:afterend
hide_by_tagobjectShow 3 child attributesHide child attributes
enabledbooleanExample:falsetagsstringExample:rocket-hidehides_buttonbooleanExample:true
formobjectShow 5 child attributesHide child attributes
copyobjectShow 12 child attributesHide child attributes
headerstringExample:Get restock alertsdescriptionstringExample:Get a notification as soon as this product is back in sto…button_textstringExample:Notify me when it's backemail_labelstringExample:Emailemail_placeholderstringExample:Email addressphone_labelstringExample:Phone numberphone_placeholderstringExample:SMSquantity_labelstringExample:Quantitycustomer_name_placeholderstringExample:NametermsstringExample:Promise we won't spam. You'll only receive notifications …promotion_consent_labelstringExample:Notify me about other news, sales, discounts & offers too!resubscribe_textstringExample:This product is out of stock. Get notified when it’s rest…
messagesobjectShow 7 child attributesHide child attributes
successstringExample:Thank you! We will notify you when the product is available.errorstringExample:Please enter a valid email addressempty_errorstringExample:Please fill in one or more of the options aboveduplicate_errorstringExample:You've already subscribed for alerts to this product.customer_name_errorstringExample:Please enter your namephone_errorstringExample:Please enter a valid phone numberdid_you_mean_errorstringExample:Did you mean %{suggested_email}? Or use %{current_email}
styleobjectShow 9 child attributesHide child attributes
background_colorstringExample:#FFFFFFtext_colorstringExample:#202223border_radiusintegerExample:8button_background_colorstringExample:#111111button_text_colorstringExample:#FFFFFFshow_imagebooleanExample:falsenote_background_colorstringExample:#f3f4f6note_text_colorstringExample:#202223note_border_radiusintegerExample:4
fieldsobjectShow 10 child attributesHide child attributes
customer_name_enabledbooleanExample:falsecustomer_name_requiredbooleanExample:falsequantity_requiredbooleanExample:falsecollect_promotion_consentbooleanExample:falsecollect_promotion_consent_defaultbooleanExample:truesms_firstbooleanExample:truesms_default_countrystringExample:ussms_restrict_countrybooleanExample:falseshop_sign_inbooleanExample:falsesms_allowed_countriesarray of anys
inlineobjectShow 3 child attributesHide child attributes
enabledbooleanExample:falseselectornullinsertionstringExample:afterend
optinobjectShow 5 child attributesHide child attributes
email_subjectstringExample:Confirm your back in stock alert registrationemail_bodystringExample:You recently registered to receive a back in stock email …success_textstringExample:Registration confirmed! You'll receive an alert when the …custom_domain_enabledbooleanExample:falseapp_proxy_path_prefixstringExample:/apps/restockrocket-production
brandingobjectShow 1 child attributeHide child attributes
powered_bybooleanExample:true
customobjectShow 2 child attributesHide child attributes
cssstring, nullablejavascriptstring, nullable
localestringExample:en
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/back_in_stock/settings/widget" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/back_in_stock/settings/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/back_in_stock/settings/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/back_in_stock/settings/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/back_in_stock/settings/widget?locale=fr" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/back_in_stock/settings/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/back_in_stock/settings/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/back_in_stock/settings/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": {
"text": "Notify me when it's back",
"text_color": "#FFFFFF",
"background_color": "#111111",
"border_radius": 4,
"position": "float-right",
"font_family": "OpenSans",
"collection_text_color": "#FFFFFF",
"collection_background_color": "#202223"
},
"placement": {
"enabled": true,
"show_on_collection": false,
"show_on_home": false,
"show_on_search": false,
"show_on_preorder": false,
"show_if_any_variant_out_of_stock": false,
"show_on_collection_if_any_variant_out_of_stock": false,
"availability_check_enabled": true,
"merchant_managed_position": false,
"selectors": {
"product": null,
"collection": null,
"collection_insertion": "afterend",
"collection_container": null,
"home": null,
"home_container": null,
"search": null,
"search_container": null,
"restock_note": null,
"restock_note_insertion": "afterend"
},
"hide_by_tag": {
"enabled": false,
"tags": "rocket-hide",
"hides_button": true
}
},
"form": {
"copy": {
"header": "Get restock alerts",
"description": "Get a notification as soon as this product is back in stock by signing up below!",
"button_text": "Notify me when it's back",
"email_label": "Email",
"email_placeholder": "Email address",
"phone_label": "Phone number",
"phone_placeholder": "SMS",
"quantity_label": "Quantity",
"customer_name_placeholder": "Name",
"terms": "Promise we won't spam. You'll only receive notifications for this product.",
"promotion_consent_label": "Notify me about other news, sales, discounts & offers too!",
"resubscribe_text": "This product is out of stock. Get notified when it’s restocked again by entering your details below!"
},
"messages": {
"success": "Thank you! We will notify you when the product is available.",
"error": "Please enter a valid email address",
"empty_error": "Please fill in one or more of the options above",
"duplicate_error": "You've already subscribed for alerts to this product.",
"customer_name_error": "Please enter your name",
"phone_error": "Please enter a valid phone number",
"did_you_mean_error": "Did you mean %{suggested_email}? Or use %{current_email}"
},
"style": {
"background_color": "#FFFFFF",
"text_color": "#202223",
"border_radius": 8,
"button_background_color": "#111111",
"button_text_color": "#FFFFFF",
"show_image": false,
"note_background_color": "#f3f4f6",
"note_text_color": "#202223",
"note_border_radius": 4
},
"fields": {
"customer_name_enabled": false,
"customer_name_required": false,
"quantity_required": false,
"collect_promotion_consent": false,
"collect_promotion_consent_default": true,
"sms_first": true,
"sms_default_country": "us",
"sms_restrict_country": false,
"shop_sign_in": false,
"sms_allowed_countries": []
},
"inline": {
"enabled": false,
"selector": null,
"insertion": "afterend"
}
},
"optin": {
"email_subject": "Confirm your back in stock alert registration",
"email_body": "You recently registered to receive a back in stock email alert for {{product.title_incl_variant}} from our store - {{shop.name}}. Please confirm your alert registration by <a href=\"{{request.activation_link}}\">clicking this link</a>",
"success_text": "Registration confirmed! You'll receive an alert when the product is restocked.",
"custom_domain_enabled": false,
"app_proxy_path_prefix": "/apps/restockrocket-production"
},
"branding": {
"powered_by": true
},
"custom": {
"css": null,
"javascript": null
},
"locale": "en"
}{
"errors": [
"Invalid API key"
],
"code": "auth_invalid",
"details": [
{
"code": "auth_invalid",
"message": "Invalid API key",
"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
}
]
}