Skip to content

Get a template

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

GET/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

  • keystringRequired

    Which notification's template: signup_thank_you, restock_alert or reminder.

    One of signup_thank_yourestock_alertreminder

Query parameters

  • localestring

    Language tag of the copy, e.g. "fr" or "pt-BR". Omit it for the shop's default language.

Returns

The template object.

Errors

404
not_found

The path is valid but nothing with that id exists in this store.

422
invalid_params

One or more fields failed the action's schema.

422
validation_failed

The 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.

GET/back_in_stock/templates/{key}
curl "https://app.stoqapp.com/api/v2/external/back_in_stock/templates/{key}" \
  -H "X-Auth-Token: $STOQ_API_KEY"
Response
{
  "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
  }
}