> For the complete documentation index, see [llms.txt](https://tri.gitbook.io/tri-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tri.gitbook.io/tri-doc/liquidity-pool/balance/balance-error-codes.md).

# Balance Error Codes

Every failure of the balance endpoints comes back as `application/problem+json`: a readable `title` and `detail`, a stable `code` to branch on, `param` when a particular field is at fault, and `deposit_id` when the attempt did create a deposit.

```json
{
    "title": "Deposit result is unknown",
    "status": 409,
    "detail": "The payment may have gone through; the operation is recorded. Contact support before retrying.",
    "code": "needs_reconciliation",
    "deposit_id": "3f7a1c9e-8b02-4d51-9a6e-2c14f0d7b9aa"
}
```

**Codes**

<table data-full-width="true" data-search="false"><thead><tr><th width="250">Code</th><th width="90">HTTP</th><th>Meaning</th><th width="280">What to do</th></tr></thead><tbody><tr><td><code>not_found</code></td><td>404</td><td>The client, employee, Individual Consumption or deposit does not exist, or belongs to another client.</td><td>Check the address.</td></tr><tr><td><code>client_level_balance_unavailable</code></td><td>404</td><td>A Business account holds balances per employee, so the client-level balance does not exist for it.</td><td>Address an employee or an Individual Consumption.</td></tr><tr><td><code>idempotency_key_required</code></td><td>400</td><td>A deposit was sent without the Idempotency-Key header.</td><td>Send a key unique to this attempt.</td></tr><tr><td><code>invalid_idempotency_key</code></td><td>422</td><td>The key is longer than 48 characters.</td><td>Shorten the key.</td></tr><tr><td><code>idempotency_key_reuse</code></td><td>409</td><td>This key was already used for a different amount or a different holder.</td><td>Use a new key.</td></tr><tr><td><code>operation_in_progress</code></td><td>409</td><td>A deposit with this key is still being processed.</td><td>Wait and repeat the request with the same key.</td></tr><tr><td><code>previous_attempt_failed</code></td><td>409</td><td>An earlier attempt with this key failed.</td><td>Repeat with a new key.</td></tr><tr><td><code>card_declined</code></td><td>402</td><td>The payment provider declined the card.</td><td>Repeat with a new key, or use another card.</td></tr><tr><td><code>card_unusable</code></td><td>422</td><td>The saved card could not be used at all.</td><td>Add the card again.</td></tr><tr><td><code>no_credit_card</code></td><td>422</td><td>The holder has no saved card, so there is nothing to charge.</td><td>Add a card first (see Add Credit Card / Add Credit Card For Individual Consumption).</td></tr><tr><td><code>needs_reconciliation</code></td><td>409</td><td>The card may have been charged while the balance was not credited. The operation is recorded.</td><td><strong>Do not repeat.</strong> Contact Triangle support with the deposit_id.</td></tr><tr><td><code>deposit_failed</code></td><td>422</td><td>The deposit did not go through for a reason without a code of its own; detail explains it.</td><td>Read detail, then repeat with a new key.</td></tr><tr><td><code>invalid_autofill_balance</code></td><td>422</td><td><code>autofill_balance</code> is missing or is not a boolean, or both <code>employee_id</code> and <code>individual_consumption_id</code> were sent at once.</td><td>Send <code>autofill_balance</code> as true or false, and at most one holder identifier — neither of them means the client's own balance.</td></tr><tr><td><code>invalid_amount</code></td><td>422</td><td>The amount is not a decimal string with at most two decimals, or is out of range.</td><td>Send the amount as a string, e.g. "10.00".</td></tr><tr><td><code>unsupported_currency</code></td><td>422</td><td>A currency other than USD was sent.</td><td>Send USD.</td></tr><tr><td><code>invalid_filter</code></td><td>422</td><td>A journal filter is not valid; param names it.</td><td>Correct the named parameter.</td></tr><tr><td><code>internal_error</code></td><td>500</td><td>The request failed on our side.</td><td>Repeat later; for a deposit keep the same key.</td></tr></tbody></table>
