x402sms
Concepts

Activation lifecycle

States, timeouts, and status transitions of a number activation.

Every activation moves through a small state machine.

waiting_code ──SMS arrives──> completed   (payment settles)
waiting_code ──cancel──> cancelled        ($0 settled)
waiting_code ──~18 min──> expired         ($0 settled)
completed ──retry──> waiting_code         (another SMS, free)

States

StateMeaningCharged?
waiting_codeNumber issued, waiting for SMSNot yet
completedSMS code delivered, payment settledYes
cancelledCancelled by you before delivery$0
expiredNumber timed out$0

Timing

  • Numbers stay active for ~18 minutes from issuance (see expiresAt)
  • After the first code arrives you can request another SMS for the same number via POST /v1/numbers/{id}/retry — additional codes within the number's lifetime are delivered at no extra charge
  • A background sweeper retires stale activations automatically; they appear as expired

Access control

Ordering returns an accessToken. It is required for status polls, cancel, and retry — pass it as Authorization: Bearer <token> (preferred) or ?token=<token>. Tokens are per-activation and unguessable; there are no accounts and no cross-activation permissions.

Errors worth handling

HTTPCauseYour payment
409 NO_NUMBERSNo numbers for that service/country/operator right nowNever settled — retry later or change country/operator
503 NO_BALANCEActivation capacity temporarily exhaustedNever settled — retry later
502Settlement or temporary service failurePoll again; settlement retries automatically
409 in-progressA settle/cancel is currently running for this activationWait a few seconds and poll again

On this page