The per-provider DLR webhook fleet and the shared status pipeline
A carrier delivery receipt (DLR) reaches Orbit on one of a fleet of dedicated webhook endpoints — one per provider. What those endpoints share is everything downstream of the wire format: a single pipeline that verifies the event, commits the message-row status, retries through a bounded queue on a transient miss, and runs the wallet refund arm when the carrier reported a terminal failure. If you integrate against delivery status — webhooks, the message status map, or billing reconciliation — the fleet-versus-shared split is the thing that decides where a behaviour lives and whose rules it follows. For where each status can move next, see Delivery lifecycle and Message status transition rules. For how DLRs leave Orbit back out to your bind, see Send-side DLR model. This page covers the inbound side — who hands a receipt in, and the one pipeline every one of them uses.The intent: from submission ack to delivery receipt
When you send a message, the carrier answers with a submission acknowledgment — asubmit_sm_resp over SMPP, or the send response from a REST provider’s API — carrying a message id. That acknowledgment says the carrier accepted the message for delivery; it is not the delivery receipt. The DLR arrives later, when the carrier learns where the message ended up, and it carries that same message id back. The webhook fleet exists to receive that second event, decode the provider’s wire format, and hand one canonical event to the shared pipeline.
The submission ack and the delivery receipt are different events on different timelines. The ack is synchronous to the send; the receipt is asynchronous and may arrive seconds or minutes later, or not at all. A provider that returns no receipts leaves the message at sent after the ack; a provider that does return receipts drives it to delivered, failed, or expired when the carrier reports back. The fleet’s job starts at the receipt — the ack is already in your send response, not in the fleet’s hands.
The reconciliation loop that keeps the fleet’s binds visible
The SMPP edge that carries the carrier path is not configured directly on the gateway. Your bind credentials, upstream carrier connectors, and DLR delivery mode live in your account configuration, and a background reconciliation loop keeps the relay consistent with them — roughly twice per minute, each pass reads the desired state, diffs it against what the gateway currently holds, and applies the difference. See SMPP edge model for the full reconciler contract and the credential-to-Jasmin-user model. On every pass the loop also reads the gateway’s view of each bind — how many live sessions your SMPP credential holds, whether an upstream carrier connector is bound — and stamps that back onto your account configuration. That stamp is what powers the bind-count and bind-status fields in the dashboard: a credential your SMPP client just connected flips tobound within about half a minute, and a connector that silently dropped its bind is flagged on the next pass. The receipt side is what this page covers; the reconciliation surface is the same loop, documented in depth in DLR and MO gateway pipeline.
The fleet: one endpoint per provider
Orbit exposes a dedicated DLR route for every channel that can return a receipt. Each is a small adapter — one route handler — that decodes its provider’s wire format into one canonical event and hands it to the shared pipeline. The fleet is the set of those routes:- SMPP carrier path (Jasmin relay) — the relay forwards each carrier
deliver_smPDU to Orbit’s SMPP DLR route; the route maps the SMPPstattoken onto the canonical vocabulary. This is the carrier path for SMS, and the same relay carries absorbed receipts for messages terminated on WhatsApp or RCS. - WhatsApp (Meta) — the Meta Graph/webhook DLR route decodes a status event into the canonical delivery states, including the WhatsApp-specific failure codes (
not_on_destination_channel,re_engagement_required,rate_limit). - SMS REST carriers — the Jasmin SMPP carrier path above is the SMS DLR route; an SMS carrier that posts receipts over REST terminates at the same shared pipeline.
- MMS — MMS delivery receipts arrive over the SMPP carrier path (the same Jasmin relay) or the carrier’s REST callback, and decode through the same canonical vocabulary as SMS.
- Email — the email DLR route decodes a bounce, delivery, or open event from the configured ESP (Resend and others) into the canonical status set.
- Fax — the fax DLR route decodes a T.38/fax completion notice.
- RCS (dotgo) — the dotgo DLR route decodes an RCS engagement event.
- Social channels — the social DLR routes decode a delivery or read event from Line, Viber, Instagram, Messenger, Discord, Telegram, WeChat, Kakao, Zalo.
deliver_sm, and neither is shaped like a fax completion notice or a Resend bounce. Each provider gets its own route because its wire format needs its own decoder. The boundary of each adapter is exactly provider wire format in, canonical event out; everything past that layer — verification, commit ordering, retry, refund — is the shared pipeline, deliberately not per-provider.
The shared pipeline
Every endpoint in the fleet terminates in the same hand-off, run in this order:- Verify and deduplicate. Replayed deliveries of the same receipt drop before anything else runs. A provider re-firing the same event gets the same ack, and the row sees the transition once.
- Validate the row and lock it. The message row is read under a row-level lock and Zod-validated against a fixed schema, so a renamed or missing column stops the write with a loud error instead of silently mis-pricing a refund or mis-gating a regression guard.
- Commit the status — or retry. If the row cannot commit at that moment (a tenant-schema blip, a Postgres failover mid-write), the event goes onto the internal DLR retry queue rather than being dropped. The provider receives a 2xx either way, so a transient commit failure never echoes back to the carrier as an error.
- Resolve in the canonical vocabulary. The provider’s native status decodes into one of the six canonical delivery states —
sent,delivered,read,failed{code},expired,rejected{code}— before the row is written. - Run the refund arm on terminal failure. When the decoded status is
failed,undelivered, orrejected, and the message row carried a pre-send charge, the wallet refund runs as part of the same hand-off, guarded below. - Fan out. Once the commit lands, the webhook event is dispatched to your subscribers, and any downstream triggers (multi-channel fallback, retention policy, verify-channel fallback) fire on the committed transition.
The retry queue: bounded backoff, not the provider’s retry
When step 3 parks an event on the internal queue, the consumer re-attempts the same status update on a widening schedule — exponential backoff keyed on attempt number, capped at 30 seconds between tries, with a hard cap of 30 attempts before the event is treated as undeliverable. That queue is ingress-side: it covers the hop into Orbit, before your subscriber webhook was ever in play. Do not confuse this queue with the egress retry queue in Webhook delivery semantics. That one re-delivers an event to your endpoint after the status committed, when your server could not accept it. The two queues sit at opposite ends of the status lifecycle and a receipt can legitimately ride either, or both, on its way through. The provider’s own webhook-retry loop is a third, unrelated thing — the internal queue exists precisely so the provider does not have to retry. The fan-out option to skip the retry queue entirely exists for one caller class: a provider that deliberately fires the same receipt at a fan-out of candidate tenants (the WhatsApp test-account DLR, which tries each verified test org until one matches). For that class the missing-row case is expected on all but one tenant, and enqueuing a 30-attempt retry per non-match would flood the queue for nothing. Every other caller enqueues normally.The refund arm
The refund on a terminal failure is not a billing afterthought — it is part of the same hand-off, with the guarantees below wired into the pipeline:- Idempotency marker. The row’s
refunded_atmetadata marker short-circuits a second refund; a replayed DLR or a retried queue job cannot re-credit the wallet. - Attempt-scoped idempotency key. The refund ledger key derives from the message’s current
external_id, so a stale DLR for a prior attempt cannot refund the original charge a second time after the row was already retried. - Charge-stamp-aware amount. The credited amount comes from the
charge_amount_centsstamp the pre-send wrote, not from the ceiling the rate table would suggest — a sub-cent charge refunds exactly what left the wallet, and a legacy row with no stamp falls back to the messageprice. - One ledger row. The explicit ledger row and the wallet balance write share one derived transaction id, so the audit record and the credit-back cannot diverge into two entries.
failed, undelivered, rejected. A sent or delivered receipt never reaches the refund arm. A channel that bills voice minutes stamps its refund under a voice_refund ledger type, so finance can split retransmission credits from carrier refunds in reconciliation. When the refund itself fails, the failure is reported on a documented metric rather than silently swallowing the credit — the customer-visible charge stays on the ledger and is scooped up by reconciliation, not lost.
What this model pins for the reader
Three rules follow from the fleet-versus-shared split, and the naming tells you which one a given behaviour belongs to:- A receipt that arrives on the wrong provider’s endpoint gets nowhere. The adapter layer is per-provider by construction; the pipeline only ever sees a canonical event.
- An adapter that skips the shared pipeline is a defect, not a feature. Status commit, retry, and refund are not re-implementable per provider; a fleet endpoint that ran a second copy of them would fork the commit ordering and the refund ledger rules.
- The provider’s retry contract never substitutes for the internal queue. The provider is acked the moment the event is either committed or parked; the queue exists so a transient commit failure does not echo back to the carrier.
How the shared pipeline absorbs provider receipts
Once an adapter decodes its provider’s wire format, the result is one canonical event in a fixed vocabulary — the same six delivery states every provider maps into:sent, delivered, read, failed{code}, expired, rejected{code}. The shared pipeline absorbs that canonical event the same way regardless of which fleet endpoint produced it: it verifies and deduplicates the receipt, locks and validates the message row, commits the status transition (or parks the event on the internal retry queue if the commit cannot land at that moment), runs the refund arm on a terminal failure, and fans the committed transition out to your webhook subscribers.
The canonical vocabulary is what lets the fleet be per-provider without forking the downstream. Each provider’s native status — a Meta delivered, a Jasmin DELIVRD, a Resend delivered, a fax completion — maps onto one of the six states before the row is written, so the commit, retry, and refund steps see one shape regardless of the carrier. See Send-side DLR model for the encoder that reads the canonical state back out to your SMPP bind, and Delivery lifecycle for which state a given receipt drives.
Where bind health lives in the dashboard
The receipt fleet and the bind-health surface are two sides of the same edge. The DLR side — the shared pipeline above — drives the message-row status your webhook subscribers see. The bind-health side is the reconciliation loop described above: on every pass it reads the gateway’s view of each bind and stamps the bind count and connector status back onto your account configuration, which is what the dashboard’s SMPP and carrier-connector status fields render. A credential that isactive but never connected shows as unbound in the dashboard within one reconciliation tick; a connected client flips it to bound; an upstream carrier connector that silently dropped its bind is flagged on the next pass. The bind-count and bind-status fields are not a separate probe — they are the reconciliation loop’s stamp, updated roughly twice per minute, so a status change you make in the dashboard or via API takes effect on the wire within about half a minute rather than instantly. See DLR and MO gateway pipeline for the full reconciliation surface.
Related
- Send-side DLR model — the canonical vocabulary every provider decodes into, and the encoder your SMPP bind reads back out.
- DLR and MO gateway pipeline — where the carrier-side SMPP edge terminates and the bind-health reconciliation loop lives.
- SMPP edge model — the relay that fronts the carrier path, the credential-to-Jasmin-user model, and the ~30-second reconciler contract behind the bind-health surface.
- The DLR model: two planes, one vocabulary — the reader’s map for telling the carrier plane from the send-side encoder plane.
- Delivery lifecycle — what each message status means and who advances it.
- Message status transition rules — the allowed status transitions the commit step enforces.
- Webhook delivery semantics — the egress-side retry and dead-letter queue your subscriber endpoint sees.
- Fallback on terminal DLR — the downstream trigger fired on a committed terminal-failure transition.