> ## Documentation Index
> Fetch the complete documentation index at: https://jupiter-docs-beam-tx-jup-ag-submit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Reference

> HTTP status codes returned by each Trigger Order API endpoint and what causes them.

Every error response is JSON with an `error` message:

```json theme={null}
{ "error": "Order not found" }
```

Some responses include an extra `details` object (for example, `GET /vault/register` when a vault already exists).

## Authentication errors apply everywhere

Every endpoint except `POST /auth/challenge` and `POST /auth/verify` requires a JWT in the `Authorization: Bearer <token>` header. A missing, malformed, or expired token returns:

```json theme={null}
{ "error": "Unauthorized" }
```

with status `401`. When you see a `401` on an authenticated call, re-run the [challenge-response flow](/trigger/authentication) to get a fresh token. The tables below list the errors specific to each endpoint on top of this shared `401`.

## Authentication

### POST /auth/challenge

| Status | Meaning                                                                                |
| :----- | :------------------------------------------------------------------------------------- |
| `400`  | Invalid request body (bad `walletPubkey`, or `type` is not `message` or `transaction`) |
| `500`  | Failed to generate the challenge                                                       |

### POST /auth/verify

| Status | Meaning                                               |
| :----- | :---------------------------------------------------- |
| `400`  | Challenge not found, expired, or invalid request body |
| `401`  | Invalid signature, or the challenge has expired       |
| `500`  | Internal server error                                 |

## Vault

### GET /vault

| Status | Meaning                                                   |
| :----- | :-------------------------------------------------------- |
| `404`  | Vault not found. Call `GET /vault/register` to create one |
| `500`  | Failed to get vault info                                  |

### GET /vault/register

| Status | Meaning                                                               |
| :----- | :-------------------------------------------------------------------- |
| `409`  | Vault already registered. The existing vault is returned in `details` |
| `500`  | Failed to generate or store the vault                                 |

## Deposit

### POST /deposit/craft

| Status | Meaning                                                                                        |
| :----- | :--------------------------------------------------------------------------------------------- |
| `400`  | Validation error, or `userAddress` equals the vault address                                    |
| `403`  | `userAddress` does not match the authenticated wallet, or no vault is registered for this user |
| `500`  | Failed to fetch vault info or craft the deposit transaction                                    |

## Orders

### POST /orders/price

| Status | Meaning                                                                                                                                                                                   |
| :----- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400`  | Validation error (price relationships, slippage range, expiry), no vault registered, `userPubkey` equals the vault address, an invalid signed deposit transaction, or a duplicate deposit |
| `403`  | `userPubkey` does not match the authenticated wallet                                                                                                                                      |
| `500`  | Failed to fetch the trigger mint price or create the order                                                                                                                                |

### PATCH /orders/price/{id}

| Status | Meaning                                                                                       |
| :----- | :-------------------------------------------------------------------------------------------- |
| `400`  | Validation error, or the order is not in the `open` state (only `open` orders can be updated) |
| `404`  | Order not found                                                                               |
| `500`  | Failed to fetch or update the order                                                           |

### POST /orders/price/cancel/{id}

| Status | Meaning                                                                 |
| :----- | :---------------------------------------------------------------------- |
| `400`  | The order is not yet marked ready to cancel. Retry shortly              |
| `403`  | The order belongs to a different wallet                                 |
| `404`  | Order not found                                                         |
| `500`  | Failed to initiate the cancellation or craft the withdrawal transaction |

### POST /orders/price/confirm-cancel/{id}

| Status | Meaning                                                                                                       |
| :----- | :------------------------------------------------------------------------------------------------------------ |
| `400`  | Invalid transaction format, an invalid or mismatched withdrawal transaction, or a withdrawal validation error |
| `404`  | Order not found                                                                                               |
| `500`  | Failed to prepare or confirm the withdrawal                                                                   |

## History

### GET /orders/history

| Status | Meaning                                                |
| :----- | :----------------------------------------------------- |
| `403`  | You do not have permission to view these orders        |
| `404`  | Order not found (when requesting a single order by id) |

## Related

<CardGroup cols={2}>
  <Card title="Lifecycle" href="/trigger/lifecycle" icon="diagram-project">
    The full call sequence and order state machine.
  </Card>

  <Card title="Manage Orders" href="/trigger/manage-orders" icon="sliders">
    Update, cancel, and recover orders.
  </Card>
</CardGroup>
