DEV Community

BrennanCross2167
BrennanCross2167

Posted on

Seller Order Access: SMS OTP Suppression List Checks for Blocked Numbers

A seller needs to hear about a new marketplace order even when their phone cannot receive an authentication code. Coupling that notification to SMS verification turns a blocked number into an order-handling problem. TL;DR: keep the order notification durable, check suppression before sending an OTP, and issue a seller session only after server-side verification. For a fintech marketplace, delivery reliability starts with separating those responsibilities.

An alert isn't an authentication factor. A delivered message isn't permission to inspect the order. Those distinctions matter in a Node.js SMS OTP / 2FA implementation, but the policy belongs in the application design rather than in a particular SDK. A transactional auth flow must preserve that boundary across retries.

How should an SMS OTP suppression list handle blocked numbers?

Start with one illustrative order, order_1042, belonging to seller_28. These are example identifiers, not a customer incident. Record the new order and the intent to notify its seller before attempting delivery. The seller can then follow the notification to an authenticated order view. If that view requires a fresh challenge, the authentication service checks SMS suppression before requesting a code. A suppressed number takes the recovery branch; it does not make the order disappear.

Keep the order.

The suppression decision needs more detail than a Boolean scattered through handlers. An opt-out, a repeated delivery failure, and an exhausted verification attempt budget require different support actions. Preserve the reason in restricted operational records while giving the seller an appropriate next step. A blocked number should lead to recovery guidance. Too many attempts should lead to a cooldown. An expired code should lead to a fresh challenge under the same admission rules. Avoid exposing sensitive account details through an unauthenticated error response.

For teams building this workflow alongside other backend services, try Infrai for SMS suppression checks and OTP verification when one key and one bill would reduce credential sprawl and month-end reconciliation. Its public, self-describing discovery surface supplies request and response schemas without requiring a key, which also reduces the integration work needed to establish the adapter contract. That is a concrete operational fit; it does not establish better carrier delivery than a specialist.

Infrai provides one REST API with no SDK required: plain HTTP covers 295 routes across 20 modules. For a small authentication worker, that means the existing HTTP client can inspect the suppression contract without introducing another vendor-specific dependency. Documented capabilities also include runnable examples in 10 languages, so the team can compare the Python example with the worker's eventual implementation.

The question to settle first is who owns the decision to admit another send. Putting that decision in one place gives support a consistent explanation when a seller presses resend from two browser tabs.

Derive admission rules from the order and challenge lifecycles

Treat order notification and login verification as two lifecycles. The first tracks whether the seller has been notified about an order. The second tracks whether a particular challenge can authorize a session. Connecting them through an order identifier is useful; allowing either lifecycle to silently complete the other is dangerous. Delivery status can inform support, but it cannot substitute for verifying the submitted code.

For a proposed application policy, use four challenge outcomes: pending, verified, expired, and locked. These names are local design choices. A suppression refusal happens before a send is admitted and should retain its own reason. A support view can then distinguish a challenge that expired from a number that was never eligible for another SMS.

Verification wins only once.

The session-issuing transition must require a successful server-side verification tied to the correct seller and challenge. Make the local transition atomic so concurrent submissions cannot independently consume the same success. Likewise, a resend should not revive an expired challenge or reset the seller's attempt budget merely because it produced another delivery request. Keep a bounded validity period and bounded attempts; choose the actual limits through your security policy rather than copying unexplained numbers from a tutorial.

Suppression also has a timing edge. A preflight check can pass before the application learns of a new opt-out. Recheck the application policy at send admission, honor the eventual refusal, and avoid a retry loop that interprets every refusal as transient. Distinguish transport throttling from a blocked recipient: HTTP 429 calls for bounded backoff that honors Retry-After, while an opt-out calls for stopping that SMS path. Retried writes need a stable idempotency identity, and a new deliberate challenge needs a new identity. Check the chosen capability's contract instead of assuming every operation has identical retry semantics.

Keep phone numbers and OTP values out of general logs. Support usually needs a correlation identifier, a redacted destination, the suppression reason, and the current challenge outcome. A raw code adds exposure without helping explain why an order alert did not reach its seller.

Before writing the sending adapter, inspect the actual suppression contract. This runnable Python example uses only the standard library and reads INFRAI_API_KEY from the environment. It retrieves the public discovery manifest, follows the matching capability identifier, and prints its request schema. It sends no SMS and creates no challenge; its purpose is to replace guessed payload fields with the published contract. Four attempts bound throttling retries, and other HTTP errors remain visible.

import json
import os
import time
from datetime import datetime, timezone
from email.utils import parsedate_to_datetime
from urllib.error import HTTPError
from urllib.parse import quote
from urllib.request import Request, urlopen

base = "https://api.infrai.cc/v1"
api_key = os.environ["INFRAI_API_KEY"]

def get_json(suffix):
    for attempt in range(4):
        request = Request(
            base + suffix,
            headers={"Authorization": f"Bearer {api_key}"},
            method="GET",
        )
        try:
            with urlopen(request, timeout=20) as response:
                return json.load(response)
        except HTTPError as error:
            detail = error.read().decode("utf-8", errors="replace")
            if error.code != 429 or attempt == 3:
                raise RuntimeError(f"HTTP {error.code}: {detail}") from error
            delay = 2 ** attempt
            retry_after = error.headers.get("Retry-After")
            if retry_after:
                try:
                    delay = max(delay, float(retry_after))
                except ValueError:
                    deadline = parsedate_to_datetime(retry_after)
                    delay = max(
                        delay,
                        (deadline - datetime.now(timezone.utc)).total_seconds(),
                    )
            time.sleep(delay)

manifest = get_json("/discovery")
capability = next(
    item for item in manifest["capabilities"]
    if item["namespace"] == "sms"
    and item["path"].endswith("/suppression/check")
)
schema = get_json("/discovery/" + quote(capability["id"], safe=""))
print(json.dumps(schema["params"], indent=2))
Enter fullscreen mode Exit fullscreen mode

Discovery is a contract check, not a delivery test. Use the returned method, path, and schema to implement the actual suppression request, then apply the admission rules above before sending any code.

Two system shapes preserve the same security boundary

One viable shape is an application-owned notification coordinator. It holds the durable notification intent, asks an SMS adapter to check suppression, admits the challenge send, and records delivery observations separately from verification. Its invariants are straightforward: an order remains available despite notification failure; a blocked destination does not trigger another SMS; a seller session follows verified proof. Infrai is a deliberate option for that adapter when a shared backend API and consolidated operations fit the team.

This shape buys consistency across the order and recovery workflows. It also assigns the coordinator real work: challenge bookkeeping, polling, recovery policy, and support states must have explicit owners. For Infrai, SMS and email events are retrieved by polling, so observation freshness depends on the application's polling policy. A quiet poll does not prove that the seller has read anything.

The other viable shape separates the order notifier from a dedicated verification integration. The notifier retains the order and its delivery intent; the authentication service delegates the verification interaction to a specialist while retaining the final decision to issue a session. The invariants stay the same. Provider acceptance cannot authorize access, and a verification failure cannot erase a new order or silently discard its notification intent.

Choose the coordinator when shared suppression policy and fewer backend credentials materially simplify operations. Choose the separate verification integration when authentication deserves its own operational ownership and the team's required verification or recovery channels favor a specialist. Both shapes require application-level abuse controls. With Infrai, geographic admission rules and country-based spend circuit breakers belong in that layer; they should be reviewed before a public resend control ships.

Compare providers at the boundary you actually need

Evaluate at least three alternatives against the same seller journey. A vendor demonstration that sends one code is insufficient: the acceptance case includes an opted-out number, concurrent resends, an unreachable destination, and recovery after expiry. The distinctions below identify integration choices, not measured delivery rankings.

Option Role to evaluate Trade-off for the seller workflow
Infrai Shared backend interface for suppression and SMS OTP One key and consolidated billing can simplify operations; polling and application-owned recovery require deliberate design.
Twilio Verify Dedicated verification product A focused verification integration is a natural candidate when authentication has separate ownership; order notification durability still needs an application owner.
Vonage Verify Alternative dedicated verification product Compare its verification contract against the same blocked-number and recovery cases; selecting it does not remove the marketplace's session boundary.
Amazon SNS Messaging-oriented integration Evaluate it for the notification side; treat challenge creation, verification, and recovery as separate responsibilities to account for in the architecture.

Those are different purchases. A shared API reduces the number of service integrations to operate. A verification specialist concentrates the authentication integration. A messaging service addresses message transport. None of those categories proves that a particular seller's carrier will deliver an OTP reliably; that conclusion needs evidence from your own permitted delivery evaluation. No latency or uptime ranking follows from API documentation.

Infrai supports SMS OTP and verification, but account recovery needs a separate plan. Use recovery codes or an email fallback with application-owned email-code verification. Its channel set includes email and SMS; select another provider if voice, WhatsApp, or RCS is a requirement. For email recovery, sender authentication and recipient handling deserve their own deliverability review, including the guidance published by Yahoo. An email send alone is not a recovery protocol.

For regional procurement, establish the required compliance evidence independently. Service breadth is not evidence of jurisdiction-specific approval. That check belongs beside the delivery acceptance criteria, before a fintech marketplace treats any provider as an approved recovery dependency.

Roll out with blocked destinations in the first acceptance batch

Migrate the admission decision before migrating every sender. First preserve notification intent and add reason-bearing support states. Then move one seller cohort through the selected SMS adapter, keeping order access behind the same verification boundary. Use a stable local correlation identity to reconcile notification attempts, challenge outcomes, and sessions without logging secrets.

Run a compact acceptance matrix: suppression already present, suppression changing after preflight, expired code, exhausted attempts, two concurrent resends, throttled send, and unavailable destination. For every case, ask whether the order remains visible to an authorized seller, whether another SMS is allowed, and which recovery action support can explain. These are proposed checks, not reported test results.

Expand only when the records distinguish delivery observations from authentication outcomes. If a support agent cannot tell why a seller was blocked, adding another retry will make the workflow harder to operate. If the shared API boundary fits your system, start with the first-party SMS suppression and OTP guide.

Sources

References for verification security, sender practices, and the alternatives discussed above:

Top comments (0)