Consider a hypothetical customer-support page: payment has settled, the receipt notification is queued, and the recipient cannot open the authenticated order page. The on-call sees a growing receipt backlog beside a successful SMS submission counter. A green OTP login counter would say little about GDPR compliance, either. Neither observation establishes that the right person can retrieve the receipt. For a pharmacy order, the same boundary matters when a refill alert leads someone back into an account containing sensitive information.
Short answer: SMS OTP alone does not establish GDPR or PSD2 compliance, and NIST treats authentication over the public telephone network as restricted. A texted code can be one element of a risk-assessed authentication design, but SIM swapping and phishing leave important gaps. Keep receipt delivery separate from the decision to grant account access, and measure both paths.
That distinction determines the integration work. Wiring a messaging request into a payment callback is a small implementation task; defining what a receipt may reveal, how users authenticate, and which failures deserve a page is the larger operational commitment. The example below is a proposed design, with illustrative thresholds, rather than an incident report or a measured production result.
What should have alerted before the receipt queue grew?
The first useful signal is the age of the oldest receipt awaiting a durable processing decision after payment settlement. Queue length alone is a weak page condition: a planned burst can produce a large queue that drains promptly, while a single stranded receipt can remain invisible behind an attractive aggregate throughput chart. For the customer-support team, the relevant question is whether a settled order has reached a state that explains what happens next.
Define the states before defining the dashboard. In this design, settlement creates a receipt job; processing either records a messaging submission, records an explicitly permitted suppression, or leaves the job pending for a retry. A submission means the messaging interface accepted the request. Delivery information, when available, is another observation. Opening a link is another. Successful authentication is another again. Collapsing these into one green counter makes the alert easier to implement and much harder to trust.
A proposed SLO could require 99% of settled orders to receive a durable receipt-processing decision within 120 seconds. Those numbers are a starting point for discussion, not an industry standard or a compliance deadline. Choose the actual objective with support and payments owners, then decide whether delayed receipts warrant an immediate page or a ticket based on customer impact and the available recovery path.
Keep the denominator.
If the metric starts only when a worker consumes a job, it cannot reveal settled orders whose receipt jobs were never created. Reconcile settled orders against durable receipt records, and expose the age of unmatched orders. This earlier signal makes the page actionable: the on-call can distinguish missing work from slow work before debugging a downstream messaging integration.
Is SMS OTP enough for GDPR or PSD2 compliance?
GDPR Article 32 requires technical and organizational measures appropriate to risk; it doesn't turn the presence of a second login step into a general compliance certificate. Article 5 also makes data minimization relevant to the notification itself. A receipt or refill alert should therefore carry only the information needed for its purpose, with sensitive account details available through an appropriately protected destination. The lawful basis, retention policy, processor arrangements, and treatment of health information still need their own assessment. For pharmacy workflows, Article 9 adds a separate question about processing special categories of personal data. A successful OTP challenge cannot supply the missing legal condition for that processing. Equally, a generic notification body doesn't eliminate the need to examine recipient metadata and the surrounding processing. Authentication is one control within that assessment.
PSD2 has a different scope. Its strong customer authentication requirements concern specified payment-service activities, and the associated regulatory technical standards address independent authentication elements and, for relevant remote electronic payments, dynamic linking to the amount and payee. An order-receipt notification after settlement is not evidence that those payment-authentication requirements were satisfied. Establish which payment-service role and transaction rules apply before adding controls to the receipt worker.
NIST's Digital Identity Guidelines supply another useful boundary, particularly when their assurance requirements are adopted by a US organization or required in a relevant federal context. SP 800-63B-4 treats use of the public switched telephone network for out-of-band authentication as restricted, calls for considering indicators such as SIM changes or number porting, and does not classify manually entered OTPs as phishing-resistant. NIST guidance is not a universal US compliance law.
These distinctions prevent an expensive integration mistake: asking the notification transport to prove things that belong to payment authentication, account assurance, or data governance. SPF, defined in RFC 7208, concerns authorization to use an email domain in the relevant SMTP identities; it cannot establish the recipient's identity or compensate for a weak login flow. Messaging practices and sender authentication have operational value, but neither answers the entire access-control question.
Trace the risk through login and recovery
A SIM swap can place control of a telephone number with someone other than the intended account holder. Phishing can persuade a user to relay a valid code to an attacker. Short expiration and one-time acceptance constrain code reuse, but they don't make a relayed code bind itself to the legitimate site. The login flow must reflect the assurance required by the protected action.
For the proposed receipt workflow, a notification link should lead to an authorization decision before exposing protected order details. Avoid treating possession of the link as blanket account access. If a design deliberately uses a bearer link for a limited receipt view, specify that narrower grant, its lifetime, and exactly what information it reveals; don't silently reuse it for profile changes or refill history.
Recovery is authentication.
A stronger primary authenticator loses much of its value if changing the registered phone number or recovering the account relies on a weaker path that immediately restores the same privileges. Include these paths in the threat model and test matrix. A delivery failure must not quietly become permission to lower the authentication requirement.
This is where the integration-effort comparison becomes honest. Count enrollment, recovery, support tooling, and operational evidence alongside the first successful request.
The endpoint is rarely the whole project.
| Responsibility | Buy or delegate | Build and operate | Decision criterion |
|---|---|---|---|
| Message transport | Integrate an external messaging interface and its status semantics | Operate transport infrastructure and delivery diagnostics | Staff time for delivery operations and failure investigation |
| Authentication lifecycle | Integrate an identity service's supported assurance and recovery flows | Implement enrollment, challenge handling, recovery, and abuse controls | Required assurance and ability to maintain the complete lifecycle |
| Receipt orchestration | Adopt a workflow service with suitable durability semantics | Own the settlement reconciliation, queue, and retry state | Evidence that every settled order reaches a recorded decision |
These are responsibility boundaries, not product recommendations. Delegation can reduce the implementation surface, while introducing external dependencies and migration constraints; building retains control while putting the ongoing engineering and on-call work on the team. The trade-off is implementation effort versus operational responsibility. Evaluate the specific contract and failure behavior before estimating either option.
Instrument the decision before wiring the page
The minimal change below turns the proposed processing objective into an explicit outcome. It takes the original settlement time, so a late-arriving job cannot reset the clock, and it separates submission success from the age target. Its recorder is an interface for the application's metrics adapter; it makes no claim to perform authentication or verify delivery.
package receipt
import (
"context"
"errors"
"time"
)
type Job struct {
OrderID string
SettledAt time.Time
}
type Sender interface {
SubmitReceipt(context.Context, string) error
}
type Recorder interface {
ObserveReceipt(outcome string, ageSeconds float64)
}
func Process(ctx context.Context, job Job, sender Sender,
metrics Recorder, now func() time.Time) error {
started := now()
if job.OrderID == "" || job.SettledAt.IsZero() ||
job.SettledAt.After(started) {
return errors.New("invalid receipt job")
}
err := sender.SubmitReceipt(ctx, job.OrderID)
age := now().Sub(job.SettledAt)
outcome := "submitted_within_target"
if err != nil {
outcome = "submission_failed"
} else if age > 120*time.Second {
outcome = "submitted_after_target"
}
metrics.ObserveReceipt(outcome, age.Seconds())
return err
}
The sender resolves an authorized recipient from the order record; accepting an arbitrary destination supplied by a notification request would introduce a different trust boundary. Before using this sketch, the surrounding worker needs durable state transitions, cancellation deadlines, and a duplicate-handling policy. In particular, a timeout can leave the caller uncertain whether the remote system accepted the submission, so a retry must account for ambiguous outcomes.
Don't use order IDs, telephone numbers, email addresses, OTP values, or receipt links as metric labels. Keep the outcome set bounded and put any necessary investigation identifiers in access-controlled diagnostic records with an appropriate retention policy. Metrics should explain whether the system is meeting its objective without copying the notification's sensitive contents into another system.
The sample cannot observe jobs that never ran. Pair it with the settlement reconciliation signal described earlier and a view of pending-job age. For capacity planning, estimate incoming settled orders per second, processing time, effective downstream throughput limits, and retry amplification; then check whether the worker fleet has enough spare throughput to drain the anticipated backlog within the agreed recovery window. Average traffic is not a recovery budget.
Test delayed job creation, duplicate settlement events, ambiguous submission timeouts, invalid timestamps, and a recipient who cannot complete authentication. Use synthetic destinations and account fixtures during testing. During deployment, verify that the reconciler and worker agree on state meanings, and compare the new measurements against durable records before enabling paging.
A plausible graph is weak evidence.
Tune the page around the action it demands
Close the loop with a runbook that starts from the signal: unmatched settlement records suggest a job-creation problem; aging pending jobs suggest a processing or capacity problem; accepted submissions followed by authentication failures suggest an access-path problem. Each branch needs an owner and a permitted recovery action. None should instruct support to disclose protected details merely because the notification path is delayed.
A 120-second threshold can generate needless pages if normal settlement bursts exceed the assumed drain capacity, while an overly generous window can leave customers contacting support before operations notices the backlog. Evaluate the threshold against the proposed SLO and observed workload, then consider sustained impact and error-budget consumption when deciding when to wake someone. The false-positive cost is real work: every unnecessary page consumes attention that the next authentication or delivery failure will also need.
SMS OTP is a bounded authentication choice, not proof of EU or US compliance. For settled-order receipts and pharmacy refill alerts, the defensible implementation separates messaging from authorization, makes the applicable legal and assurance requirements explicit, and gives the on-call an early signal tied to a recovery action. Choose the integration by the work required to maintain those properties.
References
The standards below define the legal, authentication, and sender-authorization boundaries discussed above; the messaging-practices source concerns the messaging layer.
Further reading
- GDPR, including Articles 5, 9, and 32: https://eur-lex.europa.eu/eli/reg/2016/679/oj/eng
- PSD2, including Article 97: https://eur-lex.europa.eu/eli/dir/2015/2366/oj/eng
- Regulatory technical standards for strong customer authentication: https://eur-lex.europa.eu/eli/reg_del/2018/389/oj/eng
- NIST SP 800-63B-4, Authentication and Authenticator Management: https://pages.nist.gov/800-63-4/sp800-63b.html
- RFC 7208, Sender Policy Framework: https://datatracker.ietf.org/doc/html/rfc7208
- CTIA messaging interoperability and practices: https://www.ctia.org/the-wireless-industry/industry-commitments/messaging-interoperability-sms-mms
Top comments (0)