{
  "openapi": "3.1.0",
  "info": {
    "title": "VeTrade Limit Orders API",
    "version": "2.0.0",
    "description": "Machine-native VeChain limit-order planning and read endpoints for AI agents and developer tooling. VeTrade is a VeChain DEX aggregator for swaps, trading, and limit-order workflows. The API prepares clauses and reads order state, but it does not sign or execute transactions. Authentication is not required during the current public beta."
  },
  "servers": [
    {
      "url": "https://vetrade.vet",
      "description": "Production"
    }
  ],
  "paths": {
    "/v2/limit-order-plans": {
      "post": {
        "operationId": "createLimitOrderPlan",
        "summary": "Prepare a machine-native VeChain limit-order plan",
        "description": "Return an executable creation or cancellation clause bundle for a VeTrade limit order on VeChain.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "https://vetrade.vet/schemas/limit-order-plan-request.schema.json"
              },
              "examples": {
                "create": {
                  "summary": "Prepare a limit-order creation bundle",
                  "value": {
                    "action": "create",
                    "maker": "0x1111111111111111111111111111111111111111",
                    "inputToken": "0x0000000000000000000000000000000000000000",
                    "outputToken": "0x5ef79995fe8a89e0812330e4378eb2660cede699",
                    "amountIn": "1000000000000000000",
                    "targetPrice": "1.25"
                  }
                },
                "cancel": {
                  "summary": "Prepare a limit-order cancellation bundle",
                  "value": {
                    "action": "cancel",
                    "maker": "0x1111111111111111111111111111111111111111",
                    "orderId": "42",
                    "unwrapVvetOnCancel": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Limit-order plan created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://vetrade.vet/schemas/limit-order-plan-response.schema.json"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "502": {
            "description": "Upstream node, contract, or indexed-order failure"
          }
        }
      },
      "get": {
        "operationId": "describeLimitOrderPlansEndpoint",
        "summary": "Return usage guidance for the limit-order planning endpoint",
        "responses": {
          "200": {
            "description": "Machine-readable guidance for clients that want to inspect the POST contract before sending a body"
          }
        }
      }
    },
    "/v2/limit-orders": {
      "get": {
        "operationId": "listLimitOrders",
        "summary": "List limit orders for a maker address",
        "parameters": [
          {
            "name": "maker",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["ACTIVE", "OPEN", "PARTIALLY_FILLED", "FILLED", "CANCELLED"]
            }
          },
          {
            "name": "tokenFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tokenTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Limit orders returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://vetrade.vet/schemas/limit-order-list-response.schema.json"
                }
              }
            }
          }
        }
      }
    },
    "/v2/limit-orders/{orderId}": {
      "get": {
        "operationId": "getLimitOrderStatus",
        "summary": "Read the on-chain status for a single limit order",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Limit-order status returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://vetrade.vet/schemas/limit-order-status-response.schema.json"
                }
              }
            }
          }
        }
      }
    }
  }
}
