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/preorders/templates/example';const options = { method: 'PATCH', headers: {'X-Auth-Token': '<X-Auth-Token>', 'Content-Type': 'application/json'}, body: '{"email_subject":"string","email_preheader":"string","email_header":"string","email_description":"string","email_button_text":"Preorder now","email_footer":"string","email_reviews_title":"string","push_title":"string","push_body":"string","push_button_text":"Preorder now","sms_body":"string","klaviyo_flow_name":"Summer Sneaker Drop","klaviyo_sms_flow_name":"Summer Sneaker Drop","email_background_color":"#1A1A1A","email_section_color":"#1A1A1A","email_text_color":"#1A1A1A","email_border_radius":"string","email_button_background_color":"#1A1A1A","email_button_text_color":"#1A1A1A","email_button_border_radius":"string","email_css_config":"string","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_reviews_enabled":true,"email_reviews_count":5,"email_reviews_min_rating":"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/preorders/templates/example \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: <X-Auth-Token>' \ --data '{ "email_subject": "string", "email_preheader": "string", "email_header": "string", "email_description": "string", "email_button_text": "Preorder now", "email_footer": "string", "email_reviews_title": "string", "push_title": "string", "push_body": "string", "push_button_text": "Preorder now", "sms_body": "string", "klaviyo_flow_name": "Summer Sneaker Drop", "klaviyo_sms_flow_name": "Summer Sneaker Drop", "email_background_color": "#1A1A1A", "email_section_color": "#1A1A1A", "email_text_color": "#1A1A1A", "email_border_radius": "string", "email_button_background_color": "#1A1A1A", "email_button_text_color": "#1A1A1A", "email_button_border_radius": "string", "email_css_config": "string", "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_reviews_enabled": true, "email_reviews_count": 5, "email_reviews_min_rating": "string" }'Update the position-0 preorder confirmation email/SMS template for a locale.
Note: Deep partial over the template fields. Rejects HTML (except in email_css_config) and runs Template validations and callbacks. email_reviews_title is the heading for the Judge.me reviews section that renders on the preorder confirmation email (for example “What customers are saying”). Colours are flat hex fields. Social links and the social icon colour are shared: saving one sets it on every notification template of the shop.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
{ "email_subject": "string", "email_preheader": "string", "email_header": "string", "email_description": "string", "email_button_text": "Preorder now", "email_footer": "string", "email_reviews_title": "string", "push_title": "string", "push_body": "string", "push_button_text": "Preorder now", "sms_body": "string", "klaviyo_flow_name": "Summer Sneaker Drop", "klaviyo_sms_flow_name": "Summer Sneaker Drop", "email_background_color": "#1A1A1A", "email_section_color": "#1A1A1A", "email_text_color": "#1A1A1A", "email_border_radius": "string", "email_button_background_color": "#1A1A1A", "email_button_text_color": "#1A1A1A", "email_button_border_radius": "string", "email_css_config": "string", "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_reviews_enabled": true, "email_reviews_count": 5, "email_reviews_min_rating": "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