Skip to content

Update payment failed

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

PATCH
/preorders/templates/payment_failed
curl --request PATCH \
--url https://app.stoqapp.com/api/v2/external/preorders/templates/payment_failed \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <X-Auth-Token>' \
--data '{ "email": { "subject": "string", "heading": "string", "body": "string", "button_text": "Preorder now", "klaviyo_flow_name": "Summer Sneaker Drop" }, "locale": "fr" }'

Update the payment-failed email STOQ sends when the remaining balance of a partially paid preorder cannot be charged: its subject, heading, body, button text 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.”. Returns the template.

Media typeapplication/json
object
email
object
subject

Email subject of the payment-failed email, sent when the remaining balance of a partially paid preorder cannot be charged.

string
heading

Heading at the top of the payment-failed email.

string
body

Message body of the payment-failed email.

string
button_text

Text of the button that takes the customer to complete the payment.

string
klaviyo_flow_name

Klaviyo flow to trigger when a preorder payment fails, instead of sending the email here. Only used while the email platform is Klaviyo.

string
locale

Language the translated fields are written in, such as ‘fr’ or ‘pt-BR’. Omitted: the shop’s default language. Untranslated fields ignore it.

string

Example

{
"email": {
"subject": "string",
"heading": "string",
"body": "string",
"button_text": "Preorder now",
"klaviyo_flow_name": "Summer Sneaker Drop"
},
"locale": "fr"
}

Success — the updated resource.

Media typeapplication/json
object

Example generated

{}

Saved. Returns the updated section, with also_changed for cascades.

Media typeapplication/json
object

Example generated

{}

Missing or invalid X-Auth-Token.

Media typeapplication/json

Error envelope returned by every failed request.

object
errors
required
Array<string>

Example

{
"errors": [
"Unauthorized"
]
}

Invalid fields, keyed by canonical section paths. Nothing was saved.

Media typeapplication/json
object
errors
required
object
key
additional properties
Array<string>

Example generated

{
"errors": {
"additionalProperty": [
"example"
]
}
}

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