Get a template
API v2 is in public beta: endpoints and fields can change before general availability. See the changelog
/back_in_stock/templates/{key}Costs 1 rate-limit point · Rate limits
Read one back-in-stock notification's email and SMS copy. key is "signup_thank_you" (sent right after a customer signs up), "restock_alert" (sent when the product restocks) or "reminder" (the follow-up). ?locale= picks the language of the copy (omit it for the shop default); the response names it in locale. Whether it sends, and when, is GET /back_in_stock/notification_settings.
Copy holds Liquid variables such as {{product.title_incl_variant}} and {{shop.name}}, filled in for each shopper. A language with no translation of its own returns the default copy. When email.integration or sms.integration is set (Klaviyo, Postscript or Shopify Flow), that integration sends the channel's alerts, and the *_flow_verified fields come from POST /back_in_stock/templates/:key/verify_flow. A key the shop has no notification for gives 404 not_found. Edit with PATCH /back_in_stock/templates/:key; preview with POST .../send_test.
Also searched asget back in stock templateshow restock emailback in stock email copyrestock reminder templatelocalized back in stock templatesignup thank you emailthank you for signing up template
Path parameters
keystringRequiredWhich notification's template: signup_thank_you, restock_alert or reminder.
One ofsignup_thank_yourestock_alertreminder
Query parameters
localestringLanguage tag of the copy, e.g. "fr" or "pt-BR". Omit it for the shop's default language.
Returns
The template object.
Errors
not_foundThe path is valid but nothing with that id exists in this store.
invalid_paramsOne or more fields failed the action's schema.
validation_failedThe request failed validation.
Any request can also fail with auth_invalid (401) or rate_limited (429).
Every error has the same shape: see Errors and the list of error codes.
curl "https://app.stoqapp.com/api/v2/external/back_in_stock/templates/{key}" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/back_in_stock/templates/{key}", {
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://app.stoqapp.com/api/v2/external/back_in_stock/templates/{key}",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v2/external/back_in_stock/templates/{key}")
req = Net::HTTP::Get.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)curl "https://app.stoqapp.com/api/v2/external/back_in_stock/templates/{key}?locale=fr" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/back_in_stock/templates/{key}?locale=fr", {
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://app.stoqapp.com/api/v2/external/back_in_stock/templates/{key}?locale=fr",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v2/external/back_in_stock/templates/{key}?locale=fr")
req = Net::HTTP::Get.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"key": "restock_alert",
"locale": "en",
"email": {
"subject": "{{product.title_incl_variant}} is back in stock!",
"preheader": null,
"heading": "{{product.title_incl_variant}} is available now!",
"body": "Limited stock only at {{shop.name}}. Click 'Buy now' & grab yours before it goes out of stock again!",
"footer": "Questions? Just reply to this email.",
"button": {
"text": "Buy now",
"destination": "checkout",
"background_color": "#202223",
"text_color": "#ffffff",
"radius": 4
},
"colors": {
"background": "#f9f9f9",
"section": "#ffffff",
"text": "#202223"
},
"radius": 6,
"css": null,
"html": {
"enabled": false,
"template": null
},
"reviews": {
"enabled": false,
"count": 2,
"min_rating": 4,
"title": "What customers are saying"
},
"social": {
"facebook": null,
"instagram": null,
"pinterest": null,
"twitter": null,
"tiktok": null,
"whatsapp": null,
"youtube": null,
"icon_color": "#000000"
},
"unsubscribe_text": "Unsubscribe",
"consent_text": "You're getting this because you asked {{shop.name}} to let you know when {{product.title_incl_variant}} is back in stock (signed up {{signup_date}}).",
"klaviyo_flow_name": "Back in stock alert (STOQ)",
"klaviyo_flow_verified": false,
"integration": null
},
"sms": {
"body": "{{product.title_incl_variant}} is back in stock at {{shop.name}}! Buy yours now - {{product.purchase_link}}",
"link_destination": "checkout",
"klaviyo_flow_name": null,
"klaviyo_flow_verified": false,
"postscript_flow_verified": false,
"integration": null
}
}{
"errors": [
"Invalid API key"
],
"code": "auth_invalid",
"details": [
{
"code": "auth_invalid",
"message": "Invalid API key",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"Offer not found"
],
"code": "not_found",
"details": [
{
"code": "not_found",
"message": "Offer not found",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"name is required"
],
"code": "validation_failed",
"details": [
{
"code": "validation_failed",
"message": "name is required",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"Rate limit exceeded"
],
"code": "rate_limited",
"details": [
{
"code": "rate_limited",
"message": "Rate limit exceeded",
"path": null,
"value": null,
"expected": null
}
]
}