Skip to main content
Every error response is JSON with an error message:
{ "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:
{ "error": "Unauthorized" }
with status 401. When you see a 401 on an authenticated call, re-run the challenge-response flow 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

StatusMeaning
400Invalid request body (bad walletPubkey, or type is not message or transaction)
500Failed to generate the challenge

POST /auth/verify

StatusMeaning
400Challenge not found, expired, or invalid request body
401Invalid signature, or the challenge has expired
500Internal server error

Vault

GET /vault

StatusMeaning
404Vault not found. Call GET /vault/register to create one
500Failed to get vault info

GET /vault/register

StatusMeaning
409Vault already registered. The existing vault is returned in details
500Failed to generate or store the vault

Deposit

POST /deposit/craft

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

Orders

POST /orders/price

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

PATCH /orders/price/

StatusMeaning
400Validation error, or the order is not in the open state (only open orders can be updated)
404Order not found
500Failed to fetch or update the order

POST /orders/price/cancel/

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

POST /orders/price/confirm-cancel/

StatusMeaning
400Invalid transaction format, an invalid or mismatched withdrawal transaction, or a withdrawal validation error
404Order not found
500Failed to prepare or confirm the withdrawal

History

GET /orders/history

StatusMeaning
403You do not have permission to view these orders
404Order not found (when requesting a single order by id)

Lifecycle

The full call sequence and order state machine.

Manage Orders

Update, cancel, and recover orders.