A messaging provider sends a store's text messages, WhatsApp messages, or both: sign-in codes, order updates, gift cards, abandoned checkout reminders and campaigns. Tringify writes each message and calls your app once per message; your app sends it through the merchant's account with your service.
Declare it#
"providers": [
{
"service_type": "sms",
"protocol_version": "1",
"operations": ["send"],
"endpoints": { "send": "https://example.app/messages/send" },
"supports_test_mode": false
},
{
"service_type": "whatsapp",
"protocol_version": "1",
"operations": ["send"],
"endpoints": { "send": "https://example.app/messages/send" },
"supports_test_mode": false
}
]
Declare sms, whatsapp or both. Each requires the send operation. list_templates is optional: declare it to let merchants choose one of your service's approved templates for an SMS or WhatsApp campaign (WhatsApp campaigns need it). Both can use the same endpoint: each request names its channel. Sending needs no Store API scope. To report what happened to a message, request write_provider_messages; to report STOP and START replies, request write_text_consent (a release can declare it only together with an sms or whatsapp provider).
How a store uses it#
The merchant installs your app and connects their account in your app's pages.
Under Apps → Service Providers, they choose your app as the store's SMS provider, WhatsApp provider, or both. A store has one active provider per channel.
Under Marketing → Messages, they choose the channel each message goes by. Text messages are the default.
Choosing your app doesn't prove the account works. Check credentials, senders and templates when the merchant saves them, and refuse sends you can't make.
Sender rules by country#
Many countries regulate who may send business text messages and from which sender. Tringify writes each message and tells you its category and template_type; registering senders, brands and templates with carriers and regulators is done in the merchant's account with your service, and your app is responsible for sending only what that account is allowed to send. Rules change, so follow your service's and the carriers' current requirements. Common ones:
Where |
What a business sender needs |
|---|---|
United States |
Application-to-person texts from ordinary 10-digit numbers need a registered brand and campaign (10DLC). Toll-free numbers need toll-free verification before sending at volume. Short codes are leased and approved per program. |
Canada |
Toll-free numbers need verification; short codes are approved per program. Marketing needs the recipient's consent under Canada's anti-spam law. |
United Kingdom and most of Europe |
Alphanumeric sender IDs, such as the store's name, are widely allowed and recipients can't reply to them. Some countries require the sender ID to be registered first, and some carriers block unregistered ones; replies such as STOP need a number that can receive them. |
India |
Every sender (entity), sender ID (header) and message template must be registered on a carrier's DLT platform, and each message must match a registered template. Map each |
Singapore |
Alphanumeric sender IDs must be registered in the national SMS Sender ID Registry; unregistered ones are delivered as "Likely-SCAM" or blocked. |
Australia |
Sender IDs are moving to a national sender ID register; send from a registered ID or a number your account owns. |
United Arab Emirates, Saudi Arabia and other Gulf countries |
Sender IDs must be registered with the carriers or the regulator in advance, often separately for transactional and promotional messages. |
Check the merchant's senders and registrations when they connect their account, and say in your app's pages which countries they can reach.
Choose the sender and template from
channel,category,template_type,languageand the country ofto. Sendmarketingmessages only where the account and the recipient's consent allow it; Tringify only sends marketing to numbers with marketing consent, and reports STOP replies to you as below.If a message can't go out under those rules, for example there is no registered template for its
template_typein that country, answersuccess: falsewith a clearerror_codesuch asTEMPLATE_NOT_MAPPEDorSENDER_NOT_REGISTEREDandretryable: false, so the merchant sees why.
WhatsApp has one set of rules everywhere: a business-initiated message, such as an order update, must use a template Meta has approved for that language, in the right category: authentication for authentication messages, utility for transactional and marketing for marketing. Map each template_type to an approved template per language, and fill its placeholders from variables, which are keyed by data path, such as order.number.
The send request#
Tringify POSTs one JSON message to your send endpoint and waits up to 30 seconds for the answer. Use a shorter timeout for your own call to the service so you can always answer.
{
"message_id": "c5653f18-d74c-4cb4-997b-8fbccda25f53",
"channel": "whatsapp",
"to": "+447700900123",
"body": "Your order #1042 has been placed.",
"category": "transactional",
"language": "de",
"template_type": "order_confirmation",
"variables": { "order.number": "#1042", "shop.name": "Example Store" },
"store_id": "31289f25-9ddd-4521-9bcf-a1953edbec84",
"store_name": "Example Store"
}
Field |
Meaning |
|---|---|
|
Unique per message and the same on every retry. Use it to send each message once. |
|
|
|
The recipient's number in E.164 format, such as |
|
The finished text. Keep its characters exactly. |
|
The message type's category, always one of three: |
|
Always present: the shopper's storefront language, as a storefront language code. It can be any language in the supported catalog (GET /reference/languages), not only |
|
The kind of message, for picking a pre-approved template where your service requires one, as WhatsApp does, and SMS in countries that register message templates, such as India: |
|
Every value the merchant's template prints, keyed by its path in the message type's data and written as the text shows it, for example |
|
Optional: buttons the customer can answer the message with (see Customer answers). Each has a |
|
The store. Check it against |
|
For display only. |
|
Campaign messages only: the merchant's campaign. Every recipient of one campaign carries the same value. |
|
Campaign messages only, and always on WhatsApp: the approved template the merchant chose, as |
Campaign messages#
A merchant's SMS or WhatsApp campaign sends one message per recipient with template_type: "promotional_campaign", category marketing and a campaign_id. Recipients are numbers with active text marketing consent on that channel. An SMS campaign either carries the merchant's own body (personalized, with the opt-out link already in it) or a template; a WhatsApp campaign always carries a template. Report each message's outcome as below: for a campaign, the outcome counts toward the campaign's delivery report in Store Admin and the mobile app instead of an order timeline.
List templates#
When you declare list_templates, Tringify POSTs a signed request, verified like a send, to its endpoint when the merchant opens a campaign's template picker, and waits up to 15 seconds. Answer HTTP 200 with the templates your service has approved for the merchant on that channel, at most 500. Each needs name, language (a storefront language code) and body; fields lists the names your send expects in template.fields, in the order they appear. category, header, footer and buttons (type and text) are shown to the merchant. Templates without a name, a supported language or a body are left out. Answer a non-2xx status when you cannot list them; the merchant is asked to try again.
// Request
{ "store_id": "31289f25-9ddd-4521-9bcf-a1953edbec84", "channel": "whatsapp" }
// Answer
{
"templates": [
{
"name": "weekend_sale",
"language": "en",
"category": "marketing",
"body": "Hi {{1}}, our weekend sale is on: {{2}}.",
"fields": ["1", "2"],
"buttons": [{ "type": "url", "text": "Shop now" }]
}
]
}
Verify each request#
Requests to your endpoints are signed exactly like app webhooks, so the same signature check verifies both. The X-Tringify-App-ID check below applies to provider calls only: webhook deliveries do not send that header. Read the raw body before parsing it. X-Tringify-Signature has the form t=<timestamp>,v1=<hex digest> and may carry more than one v1 value: compute HMAC-SHA256 with your app's webhook signing key over <timestamp>.<raw body>, compare it in constant time with each v1 value, accept the request if any one matches, and reject a timestamp more than five minutes from your clock, in either direction. The payment protocol reference has a worked example to test your verifier against, and explains signing-key rotation: after you generate a new key, requests carry a v1 for both the new and the previous key for 72 hours, or until you finish the rotation.
Header |
Use |
|---|---|
|
|
|
Unix seconds; equals |
|
Must be your app ID. |
|
Must equal |
|
For your logs. Not an idempotency key. |
import { createHmac, timingSafeEqual } from "node:crypto";
export function verifyTringifyRequest(rawBody, headers, signingKey, appId) {
const timestamp = headers.get("X-Tringify-Timestamp") || "";
const parts = (headers.get("X-Tringify-Signature") || "").split(",");
// One v1 per signing key: accept the request if any of them matches.
const signatures = parts.filter((part) => /^v1=[a-f0-9]{64}$/.test(part))
.map((part) => Buffer.from(part.slice(3), "hex"));
if (!/^\d{10}$/.test(timestamp) || parts[0] !== `t=${timestamp}` || signatures.length === 0 ||
Math.abs(Date.now() / 1000 - Number(timestamp)) > 300 ||
headers.get("X-Tringify-App-ID") !== appId) return false;
const expected = createHmac("sha256", signingKey).update(`${timestamp}.`).update(rawBody).digest();
return signatures.some((signature) => timingSafeEqual(expected, signature));
}
Answer#
{ "success": true, "provider_name": "example-sms", "provider_message_id": "msg-784213" }
{
"success": false,
"provider_name": "example-sms",
"error_code": "TEMPLATE_NOT_MAPPED",
"error_message": "Map this message type to an approved template.",
"retryable": false
}
Field |
Meaning |
|---|---|
|
Required. |
|
Your service's reference for an accepted message. |
|
Optional name of your service. |
|
Why it failed, without credentials, phone numbers or message text. Merchants see them. |
|
On failure: |
Answer with HTTP 200 whenever you return this JSON, including failures. Accepted is not delivered: report what happened later, as below, and never describe an accepted message as delivered.
Report delivery#
With the write_provider_messages scope, report each message's outcome with your app's token: POST /api/2025-01/provider-messages/{message_id}/outcome, where message_id is the one in the send request. Report as often as your service tells you more; Tringify keeps the furthest outcome and ignores one that would go back (a late delivered after read), answering 200 either way.
{
"status": "delivered",
"provider_name": "example-sms",
"provider_message_id": "msg-784213"
}
|
Meaning |
|---|---|
|
Your service handed the message to the carrier or to WhatsApp. |
|
It reached the phone. |
|
The recipient opened it. WhatsApp only. |
|
Your service could not deliver it. Add |
failure_code and failure_message are accepted only with failed. For a message about an order, delivered, read and failed appear on the order's timeline in Store Admin and the mobile app. Tringify keeps sent messages for 24 hours; a report after that answers 404, which you can treat as done. The body takes only status, provider_name, provider_message_id, failure_code and failure_message, all strings: another property answers STORE_API_BODY_PROPERTY_UNKNOWN and a wrongly typed one STORE_API_BODY_PROPERTY_INVALID, each listing the allowed and required properties in the message and error.details.properties; a failure field sent with another status answers STORE_API_INVALID_REQUEST_BODY naming it in error.details.field.
Report STOP and START replies#
When someone replies STOP (or your service's opt-out keyword) to a message, stop marketing to them: with the write_text_consent scope, report it with POST /api/2025-01/text-marketing-consents/provider-replies. Only the store's active provider for that channel can: an SMS provider reports SMS replies, a WhatsApp provider WhatsApp replies; anything else answers 403 TEXT_CONSENT_PROVIDER_NOT_BOUND.
{
"phone": "+447700900123",
"channel": "sms",
"opt_in": false,
"source": "provider_reply"
}
opt_in: false(STOP) always withdraws marketing consent for that number on that channel, even for a number Tringify had no consent for.opt_in: true(START) restores consent only when a STOP reported this way withdrew it, and does nothing when consent is already active. It never gives new marketing consent: otherwise it answers 409TEXT_CONSENT_PROVIDER_OPT_IN_NOT_ALLOWED.sourceis alwaysprovider_reply. Each change appears in the consent history of the customer with that number and emits thetext_marketing_consents/updatewebhook. Order updates and sign-in codes are not marketing and still go out.Other replies are not passed to Tringify, except taps on a message's reply buttons (below): answer the customer from your own service, or tell them how to reach the store.
Customer answers#
Some messages ask the customer to decide something, such as what to do after a failed delivery attempt (fulfillment_delivery_failed: try again on a day they pick, change the address or phone on the store's page, or send it back) or with a shipment that came back (shipment_returned: send it again, or refund it). Those messages carry actions. Show a url button as a link. When the customer taps a reply button, report it with your app's token (write_provider_messages scope): POST /api/2025-01/provider-messages/{message_id}/reply. A button with options needs the customer's pick first: the tap opens WhatsApp's 24-hour customer-service window, so send a list message with prompt and the options, then report the pick.
// Request
{ "action": "reattempt", "option": "2026-11-12", "from": "+447700900123" }
// Answer
{ "success": true, "data": { "status": "answered", "reply": "Thank you. We'll try to deliver it again on 12 Nov 2026." } }
Field |
Meaning |
|---|---|
|
The |
|
The |
|
The number the reply came from, in E.164. It must be the number the message was sent to (otherwise 403 |
|
|
|
A short text in the message's language to send the customer, and, when set, a link to their order's page. Send both inside the open window. |
Only the app the message was handed to can report a reply, and only for an action that message carried: anything else answers 400
MESSAGE_REPLY_ACTION_INVALIDor 404.Reporting the same tap again is safe: the second answer is
closed. Remember what you sent so a repeated webhook from your service does not message the customer twice.Tringify asks for a new address or phone number only on its own page (the
urlbutton), never inside the chat.
Retries#
If your answer says it can be retried, or your endpoint fails, times out or returns something unreadable, Tringify tries again with the same message_id: up to 10 attempts in all, starting 30 seconds apart and growing to 15 minutes apart.
Claim each
(store_id, message_id)atomically before calling your service, and store the outcome, so concurrent and repeated requests send once and get the same answer.If you can't tell whether your service accepted a message, for example after a timeout, don't send it again. Answer
success: false,error_code: "SUBMISSION_UNKNOWN",retryable: false, and check your service's reports.Before each attempt Tringify checks that your app is still the store's provider for that channel. Messages queued for a provider the merchant removed or replaced are not sent.
Test#
Case |
Expected |
|---|---|
Wrong or old signature |
No call to your service. |
The same |
One send; both answers carry the same |
Missing template or variable |
A clear failure with |
Timeout after sending |
|
Provider removed in Store Admin |
Queued messages stop. |
For a real send, use a number you're allowed to message and an approved sender and template, on a development store.
Prepare for review#
For a marketplace app, the messaging declaration is reviewed with the app release; there is no separate provider submission. Before you submit, check each of these:
The declaration lists
sendwith a public HTTPS endpoint for each channel you declare, and every request is verified before your app calls its service.The same
message_idis sent once, also after a timeout or a restart; an unknown result is answeredSUBMISSION_UNKNOWNand never sent again.Failures name the reason in
error_codeanderror_message, without credentials, phone numbers or message text, and setretryablehonestly.With
write_provider_messages, outcomes are reported as your service learns them, and accepted is never reported as delivered.With
write_text_consent, STOP and START replies are reported, and only those.Sender and template rules for the countries you support are handled as above, and your app's pages tell the merchant which countries and channels work with their account.
Your app's privacy policy, terms of service and setup documentation are published and accurate, and your listing has a support email.
With the submission, include a test account or the steps to create one, the countries and channels you support, and, for each test case above, the message_id and your app's log lines for it.