Machine-native surface

Errors

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

VeTrade returns instructive error messages. The message explains what to change before retrying.

Common API error codes

  • INVALID_JSON
  • INVALID_REQUEST
  • INVALID_QUERY
  • INVALID_ORDER_ID
  • METHOD_NOT_ALLOWED
  • UPSTREAM_ROUTER_ERROR
  • UPSTREAM_LIMIT_ORDER_ERROR

Error envelope

{
  "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\" so the API can build clauses for a real wallet context."
        }
      ]
    },
    "requestId": "REQUEST_ID",
    "docsUrl": "https://vetrade.vet/developers/ai/overview"
  }
}

Validation tip

When a request fails, inspect details.issues first. Those are the fields you need to correct before retrying.

This error envelope applies to:

  • /v2/swap-plans
  • /v2/limit-order-plans
  • /v2/limit-orders
  • /v2/limit-orders/{orderId}