> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Error codes

> The machine-readable code on app errors: what each one means and what to do about it.

An app-facing error answers with a `code` alongside the message. Branch on the
code, not the message: messages are written for a developer to read and may be
improved, while codes are stable.

```json theme={null}
{
  "status": 400,
  "success": false,
  "message": "Tool \"get_stock\" needs a description.",
  "data": { "code": "description_required" }
}
```

Some older endpoints answer with the message only. Treat a missing `code` as
generic and fall back to the HTTP status.

## Registration errors

These come from registering a payment provider, a server-side tool or a
subagent. They mean the request was refused and **nothing was stored**.

| Code | Status | Meaning | What to do |
| - | - | - | - |
| `invalid_tool` | 400 | A tool entry is not an object. | Send `{ tools: [ {...} ] }`. |
| `invalid_tools` | 400 | `tools` is not an array. | Send an array, even for one tool. |
| `description_required` | 400 | A tool has no description. | The model needs it to know when to call. |
| `invalid_schema` | 400 | `inputSchema` is not a JSON object, is not serializable, or has no `type: "object"`. | Send a plain JSON Schema object. |
| `url_required` | 400 | A tool has no `toolUrl`. | Every tool needs an https endpoint. |
| `url_too_long` | 400 | The URL exceeds 2048 characters. | Shorten it. |
| `unsafe_url` | 400 | A URL fails the guard: not https, has credentials, or resolves to a private, loopback or reserved address. | Use a public https URL. |
| `countries_required` | 400 | A payment provider named no countries. | Send at least one ISO alpha-2 code. |
| `currencies_required` | 400 | A payment provider named no currencies. | Send at least one ISO 4217 code. |
| `too_many_tools` | 400 | More than 32 tools in one registration. | Register 32 or fewer. |
| `not_payment_capable` | 403 | The app has not been approved to offer a payment method. | Contact us; an admin sets this at review. |
| `app_inactive` | 403 | The app is not active. | Resolve the app's review status first. |
| `app_not_found` | 404 | The app does not exist. | Check the token belongs to a real app. |

## Runtime errors

These come from a call Salesive makes **to you**, and they describe why your
endpoint did not answer usefully.

| Code | Status | Meaning |
| - | - | - |
| `unreachable` | 502 | Your endpoint could not be reached. |
| `http_error` | 502 | Your endpoint answered outside the 2xx range. |
| `bad_response` | 502 | Your endpoint answered with something that could not be used, such as a non-https redirect for a payment. |
| `response_too_large` | 502 | Your answer exceeded the size cap (256 KiB for a tool). |
| `tool_disabled` | 409 | The merchant switched this tool off. It is not offered to the model. |
| `tool_not_found` | 404 | The tool is not registered for this installation. |
| `not_found` | 404 | The installation, app or record could not be found. |
| `invalid_shop` | 400 | A store id was required and was not valid. |
| `shop_mismatch` | 403 | The record does not belong to the store the token is bound to. |
| `installation_inactive` | 409 | The installation is no longer active, most often because the app was uninstalled. |

> [!NOTE]
>
> A `5xx` with one of these codes is a failure of your endpoint, not of Salesive.
> Retry what is safe to retry, and treat `tool_disabled` and
> `installation_inactive` as terminal.

## Auth and scope errors

| Code | Status | Meaning |
| - | - | - |
| `SHOP_SUSPENDED` | 403 | The store is suspended or deactivated. Every store operation is refused until it is reinstated. |

A missing scope answers `403` with the missing permission named in the message,
for example `This app is missing the required permission(s): READ_ORDERS`. There
is no code on that one; read the message, or compare your granted scopes from the
token response.

## Handling 429

A rate-limited call answers `429` with `Retry-After` and the `RateLimit-*`
headers. See [rate limits](https://docs.salesive.com/apps-api/rate-limits.md) for the bucket and the backoff
recipe. Do not retry a `4xx` that names a registration code: fix the request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.