All error codes
billing_required
HTTP 402Not retryableA payment method or billing setup is required before purchasing premium numbers.
How to resolve
- Add a payment method in API portal billing settings, then retry the purchase.
Example response
JSON
{
"object": "error",
"code": "billing_required",
"message": "A payment method or billing setup is required before purchasing premium numbers.",
"request_id": "req_example123",
"docs_url": "https://docs.statxt.com/api/errors/billing_required",
"retryable": false,
"recommended_action": "Add a payment method in the API portal billing settings, then retry."
}SDK handling
TypeScript
import { StatxtClient, StatxtApiError } from "@statxt/sdk"
const client = new StatxtClient({ apiKey: process.env.STATXT_API_KEY! })
try {
await client.messages.send({ ... })
} catch (err) {
if (err instanceof StatxtApiError && err.code === "billing_required") {
// A payment method or billing setup is required before purchasing premium numbers.
console.error(err.requestId) // include in support tickets
}
}Public reference: /docs/errors/billing_required