Send Test Email Template
POST/api/store-email-templates/:id/test-send
Sends the (possibly unsaved) template to up to 3 addresses through the store's real sender identity, with the subject prefixed "[Test] " and no CC or BCC.
settings:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token and the email_templates.update permission. Limited to 10 per user per hour (429).
Body fields:
to(array of emails, max 3) — defaults to your own emailsample_record_id(int|null) — record to fill the email from; null uses sample datastore_id(int|null) — sender store; defaults to the template's storesubject,preheader,html_body— unsaved content; the saved values are used when omitted. An explicit"preheader": null(a cleared field) sends no preheader instead of the saved oneinclude_attachments(bool) — attach the template's documents generated for the sample record
Returns 422 store_sender_missing when the store has no sender email address.
Scopes: API tokens need settings:write; when sample_record_id is set, also the read scope of the template context's records (sales_order / bulk_sales_order / sales_credit → orders:read; purchase_order → purchase-orders:read; vendor_credit → accounting:read; bulk_purchase_order → suppliers:read; warehouse_transfer → warehouses:read), else 403 insufficient_scope.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Content
Response Headers
Too Many Requests