Update templates
BetaAPI v2 is in public beta: endpoints, fields and behaviour can change before general availability. See the changelog
const url = 'https://app.stoqapp.com/api/v2/external/back_in_stock/templates/example/example';const options = { method: 'PATCH', headers: {'X-Auth-Token': '<X-Auth-Token>', 'Content-Type': 'application/json'}, body: '{"enabled":true,"email_template_enabled":true,"email_reviews_enabled":true,"email_button_text":"Preorder now","email_button_destination":"string","email_description":"string","email_footer":"string","email_preheader":"string","email_header":"string","email_subject":"string","push_body":"string","push_button_text":"Preorder now","push_title":"string","sms_body":"string","sms_link_destination":"string","klaviyo_flow_name":"Summer Sneaker Drop","klaviyo_sms_flow_name":"Summer Sneaker Drop","email_background_color":"#1A1A1A","email_text_color":"#1A1A1A","email_button_background_color":"#1A1A1A","email_button_text_color":"#1A1A1A","email_facebook_link":"string","email_instagram_link":"string","email_pinterest_link":"string","email_twitter_link":"string","email_tiktok_link":"string","email_whatsapp_link":"string","email_youtube_link":"string","email_social_icon_color":"#1A1A1A","email_section_color":"#1A1A1A","email_border_radius":"string","email_button_border_radius":"string","email_unsubscribe_text":"Preorder now","email_reviews_title":"string","email_reviews_count":5,"email_reviews_min_rating":"string","email_css_config":"string","email_template":"string"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://app.stoqapp.com/api/v2/external/back_in_stock/templates/example/example \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: <X-Auth-Token>' \ --data '{ "enabled": true, "email_template_enabled": true, "email_reviews_enabled": true, "email_button_text": "Preorder now", "email_button_destination": "string", "email_description": "string", "email_footer": "string", "email_preheader": "string", "email_header": "string", "email_subject": "string", "push_body": "string", "push_button_text": "Preorder now", "push_title": "string", "sms_body": "string", "sms_link_destination": "string", "klaviyo_flow_name": "Summer Sneaker Drop", "klaviyo_sms_flow_name": "Summer Sneaker Drop", "email_background_color": "#1A1A1A", "email_text_color": "#1A1A1A", "email_button_background_color": "#1A1A1A", "email_button_text_color": "#1A1A1A", "email_facebook_link": "string", "email_instagram_link": "string", "email_pinterest_link": "string", "email_twitter_link": "string", "email_tiktok_link": "string", "email_whatsapp_link": "string", "email_youtube_link": "string", "email_social_icon_color": "#1A1A1A", "email_section_color": "#1A1A1A", "email_border_radius": "string", "email_button_border_radius": "string", "email_unsubscribe_text": "Preorder now", "email_reviews_title": "string", "email_reviews_count": 5, "email_reviews_min_rating": "string", "email_css_config": "string", "email_template": "string" }'Update a localized back-in-stock notification template. stage is “initial” (the back-in-stock alert), “reminder” (the follow-up reminder) or “signup_thank_you” (the email/SMS sent right after a customer signs up); 0 and 1 are aliases for initial and reminder. enabled (true/false) turns the reminder or the signup thank-you on or off; the initial alert cannot be disabled here. email_button_destination and sms_link_destination each accept only “checkout” or “product”. Social links (email_facebook_link, email_instagram_link, email_pinterest_link, email_twitter_link, email_tiktok_link, email_whatsapp_link, email_youtube_link) take the profile URL without https:// and show as icons in the email; they are the ONLY place for social links — never put links in the footer. Colours (email_background_color, email_text_color, email_button_background_color, email_button_text_color) are flat hex fields — there is no nested style object. email_template_enabled (true/false) is the “Use HTML template” switch: false goes back to the standard STOQ email, true uses the custom HTML email template (email_template). Colours, corner radii and the Judge.me reviews block are shared by every stage of the alert; social links, the social icon colour and email_unsubscribe_text by every template of the shop.
Note: Deep partial over the template fields plus the stage’s enabled switch. Rejects HTML except in email_template and email_css_config, and runs Template validations and callbacks. email_button_destination and sms_link_destination each accept only “checkout” or “product” (product page).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
{ "enabled": true, "email_template_enabled": true, "email_reviews_enabled": true, "email_button_text": "Preorder now", "email_button_destination": "string", "email_description": "string", "email_footer": "string", "email_preheader": "string", "email_header": "string", "email_subject": "string", "push_body": "string", "push_button_text": "Preorder now", "push_title": "string", "sms_body": "string", "sms_link_destination": "string", "klaviyo_flow_name": "Summer Sneaker Drop", "klaviyo_sms_flow_name": "Summer Sneaker Drop", "email_background_color": "#1A1A1A", "email_text_color": "#1A1A1A", "email_button_background_color": "#1A1A1A", "email_button_text_color": "#1A1A1A", "email_facebook_link": "string", "email_instagram_link": "string", "email_pinterest_link": "string", "email_twitter_link": "string", "email_tiktok_link": "string", "email_whatsapp_link": "string", "email_youtube_link": "string", "email_social_icon_color": "#1A1A1A", "email_section_color": "#1A1A1A", "email_border_radius": "string", "email_button_border_radius": "string", "email_unsubscribe_text": "Preorder now", "email_reviews_title": "string", "email_reviews_count": 5, "email_reviews_min_rating": "string", "email_css_config": "string", "email_template": "string"}Responses
Section titled “Responses”Success — the updated resource.
object
Example generated
{}Accepted — async/bulk work was queued. Poll the returned job.
Returned for async/bulk work — poll the job until it reaches a terminal state.
object
Example
{ "job_id": "job_a1b2c3", "status_url": "/api/v2/external/jobs/job_a1b2c3"}Missing or invalid X-Auth-Token.
Error envelope returned by every failed request.
object
Example
{ "errors": [ "Unauthorized" ]}The resource does not exist for this shop, or the action path is not registered.
Error envelope returned by every failed request.
object
Example
{ "errors": [ "Offer not found" ]}The request failed validation.
Error envelope returned by every failed request.
object
Example
{ "errors": [ "name is required" ]}Rate limited — cost-weighted per token (read 1, write 2; 360 points / 60s). Check Retry-After.
Error envelope returned by every failed request.
object
Example
{ "errors": [ "Rate limit exceeded" ]}Thanks for letting us know.
Still stuck? Ask Quinn or chat with support