Skip to content

Update templates

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

PATCH
/back_in_stock/templates/{stage}/{locale}
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).

stage
required
string
locale
required
string
Media typeapplication/json
object
enabled
boolean
email_template_enabled
boolean
email_reviews_enabled
boolean
email_button_text
string
>= 1 characters
email_button_destination
string
>= 1 characters
email_description
string
>= 1 characters
email_footer
string
>= 1 characters
email_preheader
string
email_header
string
>= 1 characters
email_subject
string
>= 1 characters
push_body
string
>= 1 characters
push_button_text
string
>= 1 characters
push_title
string
>= 1 characters
sms_body
string
>= 1 characters
sms_link_destination
string
>= 1 characters
klaviyo_flow_name
string
klaviyo_sms_flow_name
string
email_background_color
string
>= 1 characters
email_text_color
string
>= 1 characters
email_button_background_color
string
>= 1 characters
email_button_text_color
string
>= 1 characters
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
string
>= 1 characters
email_section_color
string
>= 1 characters
email_border_radius
email_button_border_radius
email_unsubscribe_text
string
>= 1 characters
email_reviews_title
string
>= 1 characters
email_reviews_count
email_reviews_min_rating
email_css_config
string
email_template
string

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

Success — the updated resource.

Media typeapplication/json
object

Example generated

{}

Accepted — async/bulk work was queued. Poll the returned job.

Media typeapplication/json

Returned for async/bulk work — poll the job until it reaches a terminal state.

object
job_id
string
status_url
string

Example

{
"job_id": "job_a1b2c3",
"status_url": "/api/v2/external/jobs/job_a1b2c3"
}

Missing or invalid X-Auth-Token.

Media typeapplication/json

Error envelope returned by every failed request.

object
errors
required
Array<string>

Example

{
"errors": [
"Unauthorized"
]
}

The resource does not exist for this shop, or the action path is not registered.

Media typeapplication/json

Error envelope returned by every failed request.

object
errors
required
Array<string>

Example

{
"errors": [
"Offer not found"
]
}

The request failed validation.

Media typeapplication/json

Error envelope returned by every failed request.

object
errors
required
Array<string>

Example

{
"errors": [
"name is required"
]
}

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