Skip to content

Update templates

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

PATCH
/preorders/templates/{locale}
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.

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

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

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