Insufficient credits
Identifiers
Section titled “Identifiers”| Field | Value |
|---|---|
| Type URI | https://echo.labstack.com/pro/problems/insufficient-credits |
| Code | insufficient_credits |
| HTTP status | 402 |
| HTTP status | English title |
|---|---|
| 402 | Request cannot be satisfied as prepaid credits are insufficient |
When it occurs
Section titled “When it occurs”The prepaid credit balance does not cover the request’s cost.
Client handling
Section titled “Client handling”Add credits or reduce the request’s cost before retrying. An unchanged request remains refused while its cost exceeds the available balance. violated-policies names the credits limit.
Example response
Section titled “Example response”If your application installs a custom handler, the body may differ.
HTTP/1.1 402 Payment RequiredContent-Type: application/problem+json
{ "code": "insufficient_credits", "status": 402, "title": "Request cannot be satisfied as prepaid credits are insufficient", "type": "https://echo.labstack.com/pro/problems/insufficient-credits", "violated-policies": [ "requests" ]}Server correction
Section titled “Server correction”Check the verified tenant, selected plan and credit meter before adding funds. Reuse a credit adjustment ID only with its original amount.
Response fields
Section titled “Response fields”Quota middleware
Section titled “Quota middleware”code(string, always): The stable code above.type(string, always): The exact type URI above.title(string, always): English title. Quota administration routes use their own titles for some codes.status(integer, always): The HTTP status of the response.detail(string, optional): Human-readable explanation, omitted when empty. Its wording is not a stable format.violated-policies(array, always): IDs of the limits involved:[]when there are none, never null.
Headers:
RateLimit-Policy,RateLimit(conditional): Draft-11 rate-limit fields. The middleware sends them whenHeadersisDraft11(the default) orDraft11AndLegacy. It skips them when the plan has no limit to report.UsageHandlernever sends them.X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset(conditional): Legacy rate-limit fields, sent by the middleware whenHeadersisLegacyorDraft11AndLegacy.
Related behavior
Section titled “Related behavior”See quota for plans, credit adjustments and usage.