Messaging providers

Send a store's text and WhatsApp messages through your SMS or WhatsApp service.

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#

json
"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#

  1. The merchant installs your app and connects their account in your app's pages.

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

  3. 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 template_type to a registered template and send its template ID.

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, language and the country of to. Send marketing messages 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_type in that country, answer success: false with a clear error_code such as TEMPLATE_NOT_MAPPED or SENDER_NOT_REGISTERED and retryable: 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.

json
{
  "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

message_id

Unique per message and the same on every retry. Use it to send each message once.

channel

sms or whatsapp. Send by that channel only.

to

The recipient's number in E.164 format, such as +447700900123.

body

The finished text. Keep its characters exactly.

category

The message type's category, always one of three: authentication for one-time codes (login_otp, contact_confirmation_otp and order_tracking_code), marketing for the promotional types (review_request, checkout_recovery, cart_recovery and promotional_campaign), transactional for every other type. Pick the sender and template category by it, such as a WhatsApp authentication, utility or marketing template, and follow your service's and the destination country's rules for each. Answer 400 to any other value.

language

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 en, de, es, fr and it, and always uses the catalog spelling: a lowercase language code of two or three letters (en, ar, fil), with an uppercase region for regional variants (pt-BR, zh-TW). Tringify takes it from the order, checkout or sign-in the message is about, or uses the store's default storefront language when that recorded none. Accept every catalog language; never refuse a message because of its language. Templates exist per language: send the template approved in this language when you have one. Otherwise send body where your service allows free text; where only a template may be sent (WhatsApp, or SMS in countries that register templates, such as India), send the template in the language the merchant chose. body is in this language when the merchant translated the message into it, and in the store's default language otherwise.

template_type

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: login_otp, contact_confirmation_otp, order_confirmation, order_cancelled, order_updated, order_tracking_code, payment_refunded, payment_failed, gift_card_delivery, restock_notification, review_request, checkout_recovery, cart_recovery, fulfillment_shipped, fulfillment_out_for_delivery, fulfillment_delivered, fulfillment_delivery_failed, fulfillment_ready_for_pickup, fulfillment_picked_up, return_approved, return_declined, shipment_returned or promotional_campaign (a merchant's SMS or WhatsApp campaign, below).

variables

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 {"order.number": "#1042", "order.totals.total": "₹3,354.41"}. The paths are the same as in the type's email templates; each type's are its data_schema in GET /api/2025-01/message-templates/types. Only values the template prints are present, so map your template's placeholders to paths the merchant's wording uses.

actions

Optional: buttons the customer can answer the message with (see Customer answers). Each has a key, a kind (reply or url), a label in the message's language (at most 20 characters), a url for url buttons, and for a reply button that needs a choice, options (at most 10, each a key and a label of at most 24 characters) introduced by a prompt. At most three per message. Put them on your template's buttons; a channel without buttons ignores them, since body already links to the page that does the same.

store_id

The store. Check it against X-Tringify-Store-ID.

store_name

For display only.

campaign_id

Campaign messages only: the merchant's campaign. Every recipient of one campaign carries the same value.

template

Campaign messages only, and always on WhatsApp: the approved template the merchant chose, as name, language and fields (each template field's finished value, keyed by the field name your list_templates answer gave). Send this template as named with these values instead of body; body is then only a readable summary. Answer a failure when the template is no longer approved.

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.

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

X-Tringify-Signature

t=<timestamp>,v1=<hex HMAC-SHA256 of timestamp.raw body>.

X-Tringify-Timestamp

Unix seconds; equals t. Reject requests more than five minutes from your clock, in either direction.

X-Tringify-App-ID

Must be your app ID.

X-Tringify-Store-ID

Must equal store_id in the body.

X-Tringify-Request-ID

For your logs. Not an idempotency key.

javascript
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#

json
{ "success": true, "provider_name": "example-sms", "provider_message_id": "msg-784213" }
json
{
  "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

success

Required. true only once your service has accepted the message.

provider_message_id

Your service's reference for an accepted message.

provider_name

Optional name of your service.

error_code, error_message

Why it failed, without credentials, phone numbers or message text. Merchants see them.

retryable

On failure: false stops retries; true or leaving it out lets Tringify retry.

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.

json
{
  "status": "delivered",
  "provider_name": "example-sms",
  "provider_message_id": "msg-784213"
}

status

Meaning

sent

Your service handed the message to the carrier or to WhatsApp.

delivered

It reached the phone.

read

The recipient opened it. WhatsApp only.

failed

Your service could not deliver it. Add failure_code and failure_message, without phone numbers or message text; merchants see them.

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.

json
{
  "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 409 TEXT_CONSENT_PROVIDER_OPT_IN_NOT_ALLOWED.

  • source is always provider_reply. Each change appears in the consent history of the customer with that number and emits the text_marketing_consents/update webhook. 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.

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

action

The key of the reply button the customer tapped.

option

The key of the option they picked. Required for a button with options, refused for one without.

from

The number the reply came from, in E.164. It must be the number the message was sent to (otherwise 403 MESSAGE_REPLY_SENDER_MISMATCH).

status

answered: Tringify recorded the choice as the customer's own answer, as if they had made it on the store's page, and the order's timeline says it came from WhatsApp. closed: the choice is no longer open (already answered, decided by the store, or past its deadline) and nothing changed.

reply, url

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_INVALID or 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 url button), 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 message_id twice, at once or after a restart

One send; both answers carry the same provider_message_id.

Missing template or variable

A clear failure with retryable: false, before calling your service.

Timeout after sending

SUBMISSION_UNKNOWN, no second send.

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 send with a public HTTPS endpoint for each channel you declare, and every request is verified before your app calls its service.

  • The same message_id is sent once, also after a timeout or a restart; an unknown result is answered SUBMISSION_UNKNOWN and never sent again.

  • Failures name the reason in error_code and error_message, without credentials, phone numbers or message text, and set retryable honestly.

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