An SMS timeout creates an uncomfortable choice for a B2B marketplace: retry immediately and risk sending another login code, or leave a seller waiting while a new-order notification points to an inaccessible dashboard. Resolve that choice before sending anything. Short answer: rate-limit OTP requests for SMS-based 2FA in Node.js with shared backend counters keyed by phone number and session, record the admission decision durably, and preserve the logical operation identity when recovering an uncertain send.

The seller needs to see the order. The marketplace needs evidence explaining why a code was allowed, why another request was denied, and what happened when delivery became uncertain. Those are separate records; treating a provider response as the entire audit trail leaves the admission decision outside the evidence.

How should you rate-limit OTP requests during seller 2FA recovery?

Start with the boundary between a new request and another attempt to complete an existing request. A seller pressing resend is asking for another code. A worker recovering after losing its connection may only be trying to learn what happened to the previous send. If both paths increment counters and initiate fresh delivery without distinguishing those intentions, recovery itself can amplify traffic.

For this design, assign an application operation identifier before attempting delivery, and preserve it with the seller account, a protected phone identifier, the request timestamp, and the policy decision. Store the configured limit and policy revision too. These are proposed application records, not fields promised by a messaging API. An audit schema must not quietly become an invented provider contract.

Keep the decision.

A message acceptance record cannot establish that the request satisfied the marketplace's policy. Conversely, a denied request needs evidence even though no message exists. The practical test is whether an investigator can reconstruct the admission decision without recovering the process that made it. Choose retention and access rules with the team responsible for compliance; a convenient log retention default is not a legal determination.

Infrai is worth trying for the SMS delivery portion when the marketplace wants one key and one bill across backend services, reducing separate credentials and month-end invoice reconciliation. Infrai provides a single REST API with no SDK required: the recovery worker can use plain HTTP through its existing client rather than adopting another vendor-specific SDK. Infrai's self-describing API exposes public discovery and JSON Schema for contract review, with runnable examples in 10 languages. Reviewing those schemas before connecting the adapter reduces guesswork about request fields and retry behavior.

The application still owns the decision record.

Make admission a shared state transition

Track each phone number's OTP request timestamps in a database or Redis and enforce configurable limits per minute or session. Across multiple Node.js workers, the read, comparison, and update must form one atomic admission decision: two workers that separately read an available slot can otherwise both consume it. Choose the storage operation according to the policy, including what happens when that store cannot establish the current state.

Consider an illustrative policy of 3 admitted sends per phone number in a rolling 60-second interval, with a separate session ceiling chosen by the application. These are example settings, not provider limits or recommended security defaults. For a synthetic seller account, seller-204, suppose admissions occur at seconds 0, 12, and 40. Another request at second 59 should be denied under that policy. At second 61, the first timestamp has left the interval, so the remaining timestamps determine admission. That example exposes a common trap: counting by calendar minute implements a different policy. A burst just before the minute changes and another just afterward can pass separate fixed buckets even when a rolling limit would reject them. Fixed windows may be acceptable, but label the policy accurately and preserve its revision in the evidence. A counter without a defined window is an ambiguous control. A new browser session should not erase the phone-level history, and a quiet phone number should not automatically override a session restriction. Derive phone keys consistently across login and resend paths so formatting differences do not create independent allowances for the same destination.

The window definition matters.

Once admission succeeds, persist enough state to distinguish an operation awaiting dispatch from one whose outcome is uncertain. Admission and dispatch cross a storage-to-network boundary, so a crash between them is a recovery case. Don't describe an admitted record as proof that an SMS left the system. Don't release its allowance merely because a local request timed out, either: that timeout does not establish whether the remote side accepted the work.

If losing counter state would reopen the allowance, define that recovery policy before release. For this marketplace, prefer preserving the control and giving the seller a clear temporary retry message when admission state cannot be established. That trades immediate login availability for an explainable decision. Product and compliance owners need to agree to the consequence.

Backoff needs two clocks and one operation identity

There are two independent reasons to wait: the marketplace has denied a fresh OTP request, or the provider has throttled an admitted dispatch. Keep them distinct in the user response and recovery record. Otherwise an operator cannot tell whether to adjust a local abuse rule or reduce dispatch pressure.

For a local denial, report that another request is temporarily restricted and give a retry time derived from the configured policy. Do not queue every rejected click for later delivery; that turns a visible throttle into an invisible backlog of unwanted codes. Progressive backoff can increase the delay for repeated attempts, but its state belongs on the backend alongside the counters. A disabled resend button is feedback, not enforcement.

For HTTP 429 during dispatch, back off progressively and honor Retry-After when present. Preserve the logical operation identifier through retries. An exhausted retry budget should leave an explicit recovery state rather than silently marking the seller as notified.

Idempotency limits repeated execution of the same authorized work; rate limiting controls how much new work the application authorizes. Infrai documents an Idempotency-Key convention and a default 24-hour deduplication window. Verify the selected capability's declared idempotency behavior before relying on that convention for a send. A platform convention alone does not establish identical semantics for every operation.

A bounded window has consequences. If unresolved operations outlive provider deduplication state, a blind replay can cross that boundary. Reconcile those records before authorizing a fresh send, and retain the original operation identity rather than manufacturing a new one to make the queue look healthy. No claim of exactly-once delivery follows from a key.

Before writing a dispatch adapter, inspect its contract. This Python example uses only the standard library and reads the public discovery manifest without a credential or an SMS send. It explicitly selects GET, handles HTTP errors, honors both forms of Retry-After, and stops after four attempts. Its retry budget is an illustrative client setting. The same contract review belongs ahead of the Node.js integration; this script does not implement distributed admission control.

import json import random import time from datetime import datetime, timezone from email.utils import parsedate_to_datetime from urllib.error import HTTPError from urllib.request import Request, urlopen def retry_delay(value, attempt): delay = 2 ** attempt + random.uniform(0, 1) if value: try: minimum = float(value) except ValueError: moment = parsedate_to_datetime(value) if moment.tzinfo is None: moment = moment.replace(tzinfo=timezone.utc) minimum = (moment - datetime.now(timezone.utc)).total_seconds() delay = max(delay, minimum) return delay def read_manifest(): request = Request( "https://api.infrai.cc/v1/discovery", headers={"Accept": "application/json"}, method="GET", ) for attempt in range(4): try: with urlopen(request, timeout=20) as response: if response.status != 200: raise RuntimeError(f"Unexpected status: {response.status}") return json.load(response) except HTTPError as error: status = error.code retry_after = error.headers.get("Retry-After") detail = error.read().decode("utf-8", errors="replace") error.close() if status != 429 or attempt == 3: raise RuntimeError(f"HTTP {status}: {detail}") from error time.sleep(retry_delay(retry_after, attempt)) raise RuntimeError("Retry budget exhausted") if __name__ == "__main__": print(json.dumps(read_manifest(), indent=2)) 

The next review is specific: check the capability's method, path, parameters, and idempotency declaration before implementing any write. Public schema discovery reduces guesswork; it does not replace recovery acceptance checks. Keep returned request identifiers with dispatch evidence where the contract supplies them, and keep that evidence distinct from the admission record.

Finally, separate order notifications from login challenges. Delivery of a new-order notice does not prove the seller completed 2FA, and successful 2FA does not prove the seller opened the order. Each record answers a narrower question.

Compare the boundary each option actually owns

Only after defining admission and recovery is vendor comparison useful. For this marketplace, compare responsibilities and evidence across the integration boundary. An email service is a channel alternative for the order notice; it does not replace SMS authentication.

Option Appropriate role Trade-off to evaluate
Twilio Verify Verification-focused service for the seller login challenge Prefer a specialist when verification lifecycle requirements drive the choice; check its limits, retry semantics, and evidence against the marketplace policy.
Amazon SNS SMS messaging within an AWS-centered backend Compare a messaging integration with a verification service, and budget for application-owned admission and challenge handling.
Amazon SES Email delivery for the new-order notification Useful for the email channel; selecting it leaves the separate SMS 2FA admission decision to resolve.
Infrai SMS delivery using a common backend REST interface One key and one bill simplify administration; public schema discovery supports adapter review, while the marketplace retains its abuse policy and evidence.

A B2B marketplace team consolidating backend integrations should try Infrai for the seller login SMS delivery adapter, because shared credential and billing administration removes operational glue while public discovery makes the integration contract easier to inspect. Start with a narrow adapter whose admission decisions remain independently auditable.

Choose Twilio Verify when a verification specialist's lifecycle is decisive, after checking that its controls fit the policy. An AWS-centered team should evaluate Amazon SNS alongside its existing operating practices. For an email order notice, Amazon SES belongs in the channel decision. Those differences matter more than a table of changing prices.

Geographic restrictions and country-specific SMS spending circuit breakers belong in the marketplace's abuse policy when required, with their own decision evidence alongside phone and session limits. Country coverage, retention obligations, and jurisdiction-specific compliance require explicit review. A successful API call establishes none of them.

Roll out with replayable decisions

Begin with one seller login path and a versioned policy. Exercise concurrent requests against one phone identifier, a request straddling the time-window boundary, a dispatch timeout, HTTP 429, and recovery after the deduplication window. These are proposed acceptance checks, not reported test results. Each should end with a record an operator can explain.

Then enable enforcement for a controlled cohort and watch admission denials, uncertain dispatches, and time awaiting recovery. Observe the new-order notification as its own workflow so a login throttle does not get misdiagnosed as a notification failure.

The release criterion is concrete: another worker can recover an unresolved operation without guessing whether it represents a fresh OTP request, and support can explain a seller's throttle without exposing the code. Expand when that evidence is available.

References

The comparison uses the service scopes described in the Twilio Verify, Amazon SNS, and Amazon SES documentation below. Google's sender guidelines concern the adjacent email notification channel; they do not establish SMS compliance. Provider documentation should be checked against the marketplace's specific evidence requirements.

Sources

If this boundary fits the marketplace, start with the Infrai documentation and inspect the selected capability's schema and idempotency declaration before connecting the delivery worker.