Browse

subscription_required error

subscription_required is returned with HTTP 402. Retryable: no. Sending the same request again returns the same error. Nothing is charged for this error.

What it means

This needs an active subscription.

Most likely cause

The request needs an active plan and the account has none. The usual case is buying a top-up: top-ups are for subscribers, and a trial does not count.

How to fix it

Subscribe from the billing page of the dashboard, then retry.

Example

Checkout uses the signed-in dashboard session token, not an API key. A top-up for an account with no active plan returns HTTP 402. Start a plan first.

Terminal
curl -i -X POST https://YOUR_API_HOST/v1/me/billing/checkout -H "Authorization: Bearer $FIREBASE_ID_TOKEN" -H "Content-Type: application/json" -d '{"offer":"topup"}'

An error response is one JSON envelope. Branch on code, never on the message text. The message and fix of a real response can be more specific than the defaults shown here.

{
  "error": {
    "code": "subscription_required",
    "message": "This needs an active subscription.",
    "fix": "Subscribe from the billing page of the dashboard, then retry.",
    "docs_url": "https://lookvalid.com/docs/errors/subscription_required",
    "retryable": false,
    "request_id": "req_3fK9pQ2xVb7LmN4sTz8WcA"
  }
}

See also