Payment required
PAYMENT_REQUIRED with HTTP 402 is a reserved code. The API does not send it today.
What it means
No v3 route answers 402 at the moment. Plan limits are reported in other ways:
- Monthly credits used up:
RATE_LIMITEDwithlimitType: "monthly". - A feature that is not in your plan:
FORBIDDENon the company routes. Everywhere else the block is left out of the response.
The code is listed so that clients are ready for new error codes. The list of codes can grow at any time.
Example response
This is how the body would look:
Response (402)
{
"type": "https://docs.finlight.me/errors/payment-required",
"title": "Payment required",
"status": 402,
"detail": "...",
"code": "PAYMENT_REQUIRED",
"requestId": "req-123"
}
How to fix
If you ever get this code:
- Check your plan and billing in the finlight dashboard.
- If everything looks fine there, contact support with the
requestId.
Retry
Do not retry. Treat it like any error code you do not know: report it and stop.
In the SDKs
The client libraries have no special class for this code. It arrives as the base API error with apiKind other, and code is PAYMENT_REQUIRED. It is not retried.
| Language | Error |
|---|---|
| TypeScript, Python | FinlightApiError |
| Ruby | Finlight::ApiError |
| .NET, Java, PHP | FinlightApiException |
| Go | *finlight.APIError with APIKind == finlight.APIKindOther |
| Rust | Error::Api with api_kind() == ApiErrorKind::Other |