Skip to content

Send a test notification

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

POST/back_in_stock/templates/{key}/send_test

Costs 2 rate-limit points · Rate limits

Send a back-in-stock notification template to one email address as a test, rendered against a sample alert in the body locale (omit it for the shop default language). Matches the template page's Send test email button.

email defaults to the shop's reply-to address (reply_to_address on GET /account/sending); one address only. shopify_variant_id and shopify_product_id (both gids, send both or neither) pick the product shown. Fails (422) when email sending is turned off for the shop.

Also searched assend test emailsend a test back in stock emailpreview the restock email in my inboxtest the signup thank you email

Path parameters

  • keystringRequired

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

    One of signup_thank_yourestock_alertreminder

Headers

  • Idempotency-Keystring

    A fresh unique key for every write (a new UUID, say); reuse it only to retry that write. Keys are remembered for 1 hour: the same key and the same request within that hour returns the first result, with Idempotent-Replayed: true, without running again; the same key with a different method, path or body is refused (422 idempotency_key_reused); a retry while the first is still running gets 409 idempotency_key_in_progress. Keys are per store. Server errors and rate limits are not kept, so their retry runs.

Request body

  • localestring

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

  • emailstring, nullable

    Address to send the test to, one only. Default the shop's reply-to address.

  • shopify_variant_idstring, nullable

    Shopify variant gid of the product shown in the test. Send with shopify_product_id or neither.

  • shopify_product_idstring, nullable

    Shopify product gid of the product shown in the test. Send with shopify_variant_id or neither.

Returns

  • sent_tostring
    Example: owner@example.com

Errors

404
not_found

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

409
idempotency_key_in_progress

An earlier request with the same Idempotency-Key is still running. Wait, then resend the same request with the same key.

422
validation_failed

The action refused the request for a reason that is not a single bad field.

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.

POST/back_in_stock/templates/{key}/send_test
curl -X POST "https://app.stoqapp.com/api/v2/external/back_in_stock/templates/{key}/send_test" \
  -H "X-Auth-Token: $STOQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "owner@example.com",
    "shopify_variant_id": "gid://shopify/ProductVariant/47284734423096",
    "shopify_product_id": "gid://shopify/Product/8784906035384"
  }'
Response
{
  "sent_to": "owner@example.com"
}