Credit conflict
Identifiers
Section titled “Identifiers”| Field | Value |
|---|---|
| Type URI | https://echo.labstack.com/pro/problems/credit-conflict |
| Code | credit_conflict |
| HTTP status | 409 |
| HTTP status | English title |
|---|---|
| 409 | Credit ID was already used with a different amount |
When it occurs
Section titled “When it occurs”A credit was submitted with a credit ID that was already used with a different amount. Quota checks the ID atomically before it changes the balance, so this request applied nothing.
Client handling
Section titled “Client handling”To retry the original credit, resend it with the same ID and the original amount. Use a new ID for a new credit.
Example response
Section titled “Example response”If your application installs a custom handler, the body may differ.
HTTP/1.1 409 ConflictContent-Type: application/problem+jsonCache-Control: no-store
{ "code": "credit_conflict", "status": 409, "title": "Credit ID was already used with a different amount", "type": "https://echo.labstack.com/pro/problems/credit-conflict", "violated-policies": [ "requests" ]}Server correction
Section titled “Server correction”Check the original credit operation’s ID and amount. If its outcome is unknown, do not retry under a new ID.
Response fields
Section titled “Response fields”Quota administration routes
Section titled “Quota administration routes”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:
Cache-Control(always):no-storeon every administration response.
Notes:
- Returned by
POST /credits.
Admin console
Section titled “Admin console”code(string, always): The stable code above.detail(string, always): The console always sendsdetail. It is often empty and never contains the underlying error.status(integer, always): The HTTP status of the response.title(string, always): The HTTP status text, such asConflict, unless the panel supplies its own title.type(string, always): The exact type URI above.
Headers:
Cache-Control(always):no-store. The console sends it on every problem response, along with its usual security headers.
Notes:
- Fields are written in alphabetical order.
- The console rewrites every 404 response to
admin_not_foundwith an emptydetail. - The console renders this problem in its own format when a panel returns it as an
admin.ProblemErroroutside an action commit. Its title isConflictunless the panel supplies one. - When a credit action conflicts at commit, the console does not return a problem. It returns an
application/jsonaction result withaudit.codeset tocredit_conflictand outcomerefused.
Related behavior
Section titled “Related behavior”See quota for plans, credit adjustments and usage.