Skip to content

Get widget settings

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

GET/back_in_stock/settings/widget

Costs 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

  • localestring

    Language tag for the widget text, e.g. "fr" or "pt-BR". Omit it for the shop's default language.

Returns

  • buttonobject
    Show 8 child attributesHide child attributes
    • textstring
      Example: Notify me when it's back
    • text_colorstring
      Example: #FFFFFF
    • background_colorstring
      Example: #111111
    • border_radiusinteger
      Example: 4
    • positionstring
      Example: float-right
    • font_familystring
      Example: OpenSans
    • collection_text_colorstring
      Example: #FFFFFF
    • collection_background_colorstring
      Example: #202223
  • placementobject
    Show 11 child attributesHide child attributes
    • enabledboolean
      Example: true
    • show_on_collectionboolean
      Example: false
    • show_on_homeboolean
      Example: false
    • show_on_searchboolean
      Example: false
    • show_on_preorderboolean
      Example: false
    • show_if_any_variant_out_of_stockboolean
      Example: false
    • show_on_collection_if_any_variant_out_of_stockboolean
      Example: false
    • availability_check_enabledboolean
      Example: true
    • merchant_managed_positionboolean
      Example: false
    • selectorsobject
      Show 10 child attributesHide child attributes
      • productnull
      • collectionnull
      • collection_insertionstring
        Example: afterend
      • collection_containernull
      • homenull
      • home_containernull
      • searchnull
      • search_containernull
      • restock_notenull
      • restock_note_insertionstring
        Example: afterend
    • hide_by_tagobject
      Show 3 child attributesHide child attributes
      • enabledboolean
        Example: false
      • tagsstring
        Example: rocket-hide
      • hides_buttonboolean
        Example: true
  • formobject
    Show 5 child attributesHide child attributes
    • copyobject
      Show 12 child attributesHide child attributes
      • headerstring
        Example: Get restock alerts
      • descriptionstring
        Example: Get a notification as soon as this product is back in sto…
      • button_textstring
        Example: Notify me when it's back
      • email_labelstring
        Example: Email
      • email_placeholderstring
        Example: Email address
      • phone_labelstring
        Example: Phone number
      • phone_placeholderstring
        Example: SMS
      • quantity_labelstring
        Example: Quantity
      • customer_name_placeholderstring
        Example: Name
      • termsstring
        Example: Promise we won't spam. You'll only receive notifications …
      • promotion_consent_labelstring
        Example: Notify me about other news, sales, discounts & offers too!
      • resubscribe_textstring
        Example: This product is out of stock. Get notified when it’s rest…
    • messagesobject
      Show 7 child attributesHide child attributes
      • successstring
        Example: Thank you! We will notify you when the product is available.
      • errorstring
        Example: Please enter a valid email address
      • empty_errorstring
        Example: Please fill in one or more of the options above
      • duplicate_errorstring
        Example: You've already subscribed for alerts to this product.
      • customer_name_errorstring
        Example: Please enter your name
      • phone_errorstring
        Example: Please enter a valid phone number
      • did_you_mean_errorstring
        Example: Did you mean %{suggested_email}? Or use %{current_email}
    • styleobject
      Show 9 child attributesHide child attributes
      • background_colorstring
        Example: #FFFFFF
      • text_colorstring
        Example: #202223
      • border_radiusinteger
        Example: 8
      • button_background_colorstring
        Example: #111111
      • button_text_colorstring
        Example: #FFFFFF
      • show_imageboolean
        Example: false
      • note_background_colorstring
        Example: #f3f4f6
      • note_text_colorstring
        Example: #202223
      • note_border_radiusinteger
        Example: 4
    • fieldsobject
      Show 10 child attributesHide child attributes
      • customer_name_enabledboolean
        Example: false
      • customer_name_requiredboolean
        Example: false
      • quantity_requiredboolean
        Example: false
      • collect_promotion_consentboolean
        Example: false
      • collect_promotion_consent_defaultboolean
        Example: true
      • sms_firstboolean
        Example: true
      • sms_default_countrystring
        Example: us
      • sms_restrict_countryboolean
        Example: false
      • shop_sign_inboolean
        Example: false
      • sms_allowed_countriesarray of anys
    • inlineobject
      Show 3 child attributesHide child attributes
      • enabledboolean
        Example: false
      • selectornull
      • insertionstring
        Example: afterend
  • optinobject
    Show 5 child attributesHide child attributes
    • email_subjectstring
      Example: Confirm your back in stock alert registration
    • email_bodystring
      Example: You recently registered to receive a back in stock email …
    • success_textstring
      Example: Registration confirmed! You'll receive an alert when the …
    • custom_domain_enabledboolean
      Example: false
    • app_proxy_path_prefixstring
      Example: /apps/restockrocket-production
  • brandingobject
    Show 1 child attributeHide child attributes
    • powered_byboolean
      Example: true
  • customobject
    Show 2 child attributesHide child attributes
    • cssstring, nullable
    • javascriptstring, nullable
  • localestring
    Example: en

Errors

404
not_found

The path is valid but nothing with that id exists in this store.

422
invalid_params

One or more fields failed the action's schema.

422
validation_failed

The 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.

GET/back_in_stock/settings/widget
curl "https://app.stoqapp.com/api/v2/external/back_in_stock/settings/widget" \
  -H "X-Auth-Token: $STOQ_API_KEY"
Response
{
  "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"
}