Update shipping update
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/shipping_update';const options = { method: 'PATCH', headers: {'X-Auth-Token': '<X-Auth-Token>', 'Content-Type': 'application/json'}, body: '{"email":{"subject":"string","heading":"string","body":"string","klaviyo_flow_name":"Summer Sneaker Drop"},"locale":"fr"}'};
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/shipping_update \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: <X-Auth-Token>' \ --data '{ "email": { "subject": "string", "heading": "string", "body": "string", "klaviyo_flow_name": "Summer Sneaker Drop" }, "locale": "fr" }'Update the shipping-update email STOQ sends when a preorder ships late or its date changes: its subject, heading, body and optional Klaviyo flow. The body is the GET shape, email{…}; an optional body locale writes the copy in that language only (omit it for the shop default).
Note: Deep partial: absent fields are unchanged, unknown or read-only keys are rejected. Errors are 422 keyed “template.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Email subject of the shipping-update email. Liquid variables such as {{order.name}} work.
Heading at the top of the shipping-update email.
Message body of the shipping-update email.
Klaviyo flow to trigger for the shipping update instead of sending it here. Only used while the email platform is Klaviyo.
Language the translated fields are written in, such as ‘fr’ or ‘pt-BR’. Omitted: the shop’s default language. Untranslated fields ignore it.
Example
{ "email": { "subject": "string", "heading": "string", "body": "string", "klaviyo_flow_name": "Summer Sneaker Drop" }, "locale": "fr"}Responses
Section titled “Responses”Success — the updated resource.
object
Example generated
{}Saved. Returns the updated section, with also_changed for cascades.
object
Example generated
{}Missing or invalid X-Auth-Token.
Error envelope returned by every failed request.
object
Example
{ "errors": [ "Unauthorized" ]}Invalid fields, keyed by canonical section paths. Nothing was saved.
object
object
Example generated
{ "errors": { "additionalProperty": [ "example" ] }}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