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

# Errors

> How the merchant MCP reports failures: HTTP-level rejections, isError tool results with stable error codes, and retry rules for timed-out writes.

Failures surface at two levels. Authentication, origin, host and rate-limit problems are rejected **before** MCP, as plain HTTP responses. Everything that happens inside a tool call comes back as an MCP tool result with `isError: true`.

## HTTP-Level

| Status | Cause | Body |
| - | - | - |
| `401` | Missing or invalid credential | `{ "error": "Missing credentials" }` (or `Invalid access token`, or `API keys are not accepted by this MCP server; connect with OAuth` when an `x-api-key` header is sent) with a `WWW-Authenticate: Bearer realm="OAuth", resource_metadata="…"` header; start OAuth discovery |
| `400` / `403` | `Host` header missing or not the public hostname | `{ "error": "Missing Host header" }` / `{ "error": "Invalid Host header" }` |
| `403` | `Origin` header not on the allow-list | `{ "error": "Origin not allowed" }` |
| `403` | The account's **MCP access** is set to **Off** | `{ "error": "MCP access is turned off for this account" }` |
| `403` | An OAuth user without access to all venues | `{ "error": "MCP access requires access to all venues" }` |
| `429` | More than 60 requests in a minute for this user | `{ "error": "Rate limit exceeded" }` with `Retry-After` in seconds |

These are outside the MCP envelope; an MCP client library typically raises them as transport errors.

## Tool Errors

A failed tool call is a normal JSON-RPC success whose result has `isError: true`, a single text block and **no** `structuredContent`:

```json theme={null}
{
  "isError": true,
  "content": [
    {
      "type": "text",
      "text": "{\"error\":{\"code\":\"INVALID_INPUT\",\"message\":\"Date range cannot exceed 90 local calendar dates, including both endpoints.\",\"nextSteps\":[\"Split the period into ranges of at most 90 dates, or use run-report (up to 366 dates) for totals over a longer period.\"],\"retryable\":false}}"
    }
  ]
}
```

Parse the text as JSON to get:

| Field | Meaning |
| - | - |
| `code` | One of the codes below. Stable; branch on this |
| `message` | Short, safe description. For `INVALID_INPUT` it names the problem; for other codes it is a fixed phrase |
| `nextSteps` | Instructions an agent can follow |
| `retryable` | Currently always `false` — see [Retrying](#retrying) |

Arguments that fail a tool's input schema (a wrong type, a value out of range, an unknown enum value, a malformed date or an offset-less write timestamp) never reach the tool. The MCP SDK answers them with an `isError: true` result whose text is plain, not JSON, for example `MCP error -32602: Input validation error: Invalid arguments for tool list-orders: dateBasis: Invalid option`. Treat it like `INVALID_INPUT`.

Nothing else from the underlying failure is exposed: no stack traces, SQL, upstream responses or internal IDs. Every request is logged server-side with the `x-request-id` echoed on the HTTP response; quote it when contacting support.

## Codes

| Code | When | Typical fix |
| - | - | - |
| `INVALID_INPUT` | A check made by the tool: a range longer than the tool allows, `from` after `to`, `period` combined with `from`/`to`, an account-wide stats query on a multi-currency account, `get-menu` by `venueId` when the venue has more than one active menu | Correct the arguments; `message` says what failed |
| `PERMISSION_DENIED` | The credential cannot act on this account or venue, or a write was called on an account with **Read only** MCP access | Check the token, or the account's **MCP access** setting |
| `NOT_FOUND` | The venue, order, menu or link does not exist **on this account** — resources on other accounts look identical to non-existent ones (except `create-payment-link`, which answers `PERMISSION_DENIED` for another account's venue) | Call `list-venues` (or the relevant list tool) and check the ID |
| `CONFLICT` | State prevents the write, e.g. a discount code already used at that venue | Read the current state, then decide |
| `TIMEOUT` | The tool exceeded 30 seconds, or an upstream call timed out | Narrow the query. For a write, **check state before retrying** |
| `UPSTREAM_UNAVAILABLE` | A dependency (database, payments provider) could not be reached | Wait, then retry reads; check state before retrying writes |
| `INTERNAL_ERROR` | Anything unexpected | Retry reads once; email [mcp@storekit.com](mailto:mcp@storekit.com) with the request ID if it persists |

## Retrying

Reads (`readOnlyHint: true`) are safe to retry after `TIMEOUT`, `UPSTREAM_UNAVAILABLE` or `INTERNAL_ERROR`, with backoff.

Writes are different. `create-discount-code`, `update-discount-code`, `create-payment-link`, `snooze-menu-items`, `snooze-menu-categories` and `snooze-venue` are marked `idempotentHint: false`, and no write takes an idempotency key. A `TIMEOUT` is returned when the 30-second budget runs out, which can happen **after** the change has been committed — the code or link may already exist. Before retrying a write:

1. Read the current state: `list-discount-codes` for a code (with `showArchived: true` after an archive), `list-payment-links` filtered by venue for a link (look for the title or reference), `get-menu` or `list-snoozed-items` for menu changes, `list-venues` for a store snooze.
2. Only call the write again if the change is absent.

Never retry writes automatically. This is why `retryable` is `false` on every code today: the server does not know whether your write landed, so it does not tell you to retry.

## Validation Errors From Your Client

Because errors carry no `structuredContent`, spec-compliant clients (including the official TypeScript SDK) skip output-schema validation on them and surface the envelope. If your client instead reports a `-32602` or "structured content does not match schema" error, it is validating the *text* against the tool's `outputSchema`; read the text block directly.


## Related topics

- [Response Format](https://storekit.com/docs/developers/mcp/response-format.md)
- [storekit Payments Setup](https://storekit.com/docs/guides/payments/storekit-payments-setup.md)
- [Zonal (Aztec)](https://storekit.com/docs/guides/integrations/pos/zonal.md)
- [Orders Failing: Till Offline](https://storekit.com/docs/guides/integrations/pos/lightspeed/till-offline.md)
- [Promotional Banners](https://storekit.com/docs/guides/marketing/promotional-banners.md)


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