The SDK methods on this page require
@the-meridian/sdk 1.19.0 or later. The HTTP endpoint works from any version.Recommended integration
The simplest, safest path for merchant-facing mail:sendEmail with shop context (for optional merchant metering), and logs actionable errors without breaking your app.
Like every shop-token send, it only reaches the store’s own email address and its known contacts. See Who a shop-token send can reach.
Shop context vs app context
Shop-token sends never fire
usage_event.tracked automations, so a transactional email cannot accidentally re-enter your automation graph.
variables fills the template’s {{tokens}}. On a shop-token send, Meridian also fills these itself, from what it knows about that store, the way an automation email reads them:
app_url, which links to your app in that store’s admin.- The store’s variables:
store_name,store_domain,store_primary_domain,store_status,store_currency,store_country,store_language,store_shopify_plan,store_is_shopify_plus,store_installed_at,store_active_days,store_total_revenue,store_monthly_revenue,store_total_charges,store_last_charge_amount,store_last_payment_atandstore_is_test.
variables always wins, even with an empty value, app_url included. A value Meridian does not have yet for the store reads empty, as in an automation. See From the install report, or from Shopify Partner data. An API-key send has no store, so app_url is empty there and no store variable is filled. Any other token, such as plan_name or a contact variable, comes from variables only.
The email editor flags a token your app passes, such as {{count}}, as “Not a Meridian variable”, and Meridian still fills it from variables at send time.
Meridian substitutes variables exactly as you pass them, so a date prints the way your code formats it: "2026-10-26" stays 2026-10-26. The dates Meridian fills itself (store_installed_at and store_last_payment_at) print the way automation emails print date variables: “October 26, 2026”.
Who a shop-token send can reach
A shop token stands for one store, so its sends only reach that store. Every address into must be either:
- the store’s own email address, or
- one of the store’s known contacts.
- the contacts your app sends through
identifyfrom its backend, - staff captured automatically when they use your app,
- contacts added by hand on the store’s page in the CRM.
422 (VALIDATION_ERROR) on to, before any email is sent or counted. A store with no email and no contact can’t receive a shop-token send. The error doesn’t list the store’s addresses.
To reach anyone else, send with an API key from your app’s backend. That send has no store context: no merchant billing, no app_url and no store variables.
How this differs from automations
Automations and SDK sends share the same SendGrid pipeline, quota enforcement, and deliverability tracking. They do not double-charge or conflict.
Setup
- Create and activate an email template in the Meridian dashboard.
- Copy the email’s ID. Open the email in Emails: the Email ID row at the bottom of the Inbox settings card shows it, with a Copy button. Pass it as
emailId. - Call
sendEmailfrom your app backend. Never put your API key in the browser.
Examples
Shop context (merchant billing)
App context (platform quota only)
Reliability
- Idempotency: Pass
idempotencyKeyon sends you may retry (webhook handlers, job queues). Retries with the same key, template, and recipient return the original send row instead of dispatching again. Reusing a key for a different template returnsIDEMPOTENCY_KEY_CONFLICT. - All-or-nothing per request: If any recipient in a batch fails at SendGrid, the API returns an error. Quota for failed units is released automatically.
- Rate limit: 60 requests/minute per app.
Limits and errors
- Up to 20 recipients per request.
- A shop-token send only reaches the store’s own email address and its known contacts. Any other recipient is refused (
422). See Who a shop-token send can reach. - Inactive templates are rejected (
422). - Over-quota sends return
USAGE_LIMIT_EXCEEDED(409). - An app with no verified sending domain still sends. The message leaves from
no-reply@mail.the-meridian.appand includes a note that it was sent by a Meridian user’s app, not by the Meridian platform. The app sends from the domain it selected in App settings → Email, or from the organization’s default when it selected none, and those sends do not include the note. - One exception: an app whose name contains “Meridian” needs a verified sending domain for live sends. Without one, the request returns
EMAIL_SENDING_DOMAIN_REQUIRED(409), and nothing is sent or counted against your quota. - While Meridian’s sending capacity is exhausted, sends return
SENDGRID_CAPACITY_EXHAUSTED(503) and nothing is sent or counted against your quota. Retry later. An automation’s Send Email step fails during the pause with the reason “Email send paused”.