Developer docs

Errors

Error envelopes, warnings, and recovery guidance for swap and limit-order tooling.

Read error.code, error.action and error.details.issues before retrying. Preserve requestId when reporting a problem. Never include signer secrets in a report.

Code, cause and correction

CodeCauseCorrective actionRetry
INVALID_JSONBody is not valid JSONSend one JSON object with the JSON content typeAfter fixing syntax
INVALID_REQUESTRequired or typed body fields failed validationCorrect each field in details.issues; check raw versus decimal unitsAfter correcting fields
INVALID_QUERYOrder-list query is invalidCheck maker address, status and paginationAfter correcting query
INVALID_ORDER_IDOrder ID cannot be parsedSupply a valid order ID in the pathAfter correcting ID
UPSTREAM_QUOTE_API_ERRORSwap quote could not be preparedCheck token pair, amount, routing inputs and quote serviceAfter the cause changes; avoid a tight loop
UPSTREAM_TRANSFER_PLAN_ERRORTransfer preparation failedCheck tokens, recipient resolution, runtime config and node healthAfter correcting input or recovery
UPSTREAM_LIMIT_ORDER_ERROROrder plan or read failed upstreamCheck order/maker and current node or service healthAfter correcting input or recovery

These are the codes emitted by the checked-in v2 handlers. A proxy or unsupported HTTP method may return a different response, including non-JSON; inspect status and content type before parsing. The former UPSTREAM_ROUTER_ERROR label is not the swap handler's current code.

Error envelope

Illustrative field-validation response:

{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Correct the request body fields before retrying /v2/swap-plans.",
    "action": "Update the listed fields and send the same request again.",
    "details": {
      "issues": [{ "field": "recipient", "message": "Provide recipient when mode is wallet_bound." }]
    },
    "requestId": "REQUEST_ID",
    "docsUrl": "https://vetrade.vet/developers/ai/overview"
  }
}

Endpoint coverage

EndpointValidationUpstream failure
POST /v2/swap-plansINVALID_JSON, INVALID_REQUESTUPSTREAM_QUOTE_API_ERROR
POST /v2/transfer-plansINVALID_JSON, INVALID_REQUESTUPSTREAM_TRANSFER_PLAN_ERROR
POST /v2/limit-order-plansINVALID_JSON, INVALID_REQUESTUPSTREAM_LIMIT_ORDER_ERROR
GET /v2/limit-ordersINVALID_QUERYUPSTREAM_LIMIT_ORDER_ERROR
GET /v2/limit-orders/{orderId}INVALID_ORDER_IDUPSTREAM_LIMIT_ORDER_ERROR

Technical coverage checked against website/functions/v2 on 23 October 2026. MCP wraps tool failures in its own JSON-RPC/tool response; inspect field issues there too. A warning inside a successful plan is not the same as a failed HTTP request.

Safe retry boundary

Planning retries do not broadcast transactions. A local execution timeout is different: inspect the transaction ID, receipt and local execution cache before another submission. Do not clear execution state merely to make an error disappear.

Fix swap units · Transfer recipient rules · Limit-order tasks · MCP troubleshooting.