x402sms
Guides

Error handling

Every error the API returns and what to do about it.

All errors are JSON: { "error": "message" }.

Client errors (4xx)

StatusWhenAction
400Unknown service/country/operator, malformed bodyCheck against /v1/services, /v1/countries, /v1/operators
400accepted in your payment payload doesn't match the requirements (scheme, network, asset, payTo, or amount too low)Re-read the 402 and echo requirements exactly
401Wrong or missing accessTokenUse the token returned at order time
402Payment verification failed (bad signature, expired authorization, insufficient USDC/allowance)Fix the payment and retry — nothing was charged
404Activation id not foundCheck the id
409NO_NUMBERS — no inventory for that combinationNot charged. Try another country/operator, or retry later
409Cancel/retry on a finished activationInspect status first

Server errors (5xx)

StatusWhenAction
500Misconfiguration on our sideContact support
502Temporary service error, price feed failure, or settlement failureSafe to retry. Settlement failures retry automatically on the next poll — you will never be double-charged
503NO_BALANCE — activation capacity temporarily exhaustedNot charged. Retry later

Idempotency & safety rules for agents

  1. Paying twice for the same order is impossible — each activation binds to one verified payment payload.
  2. Settlement happens once — repeated polls after completed return the stored code and never settle again.
  3. Never charged for failurecancelled, expired, and failed orders always settle $0.
  4. Polling is free — status endpoints are not x402-gated.

On this page