{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/paradex/main/json-schema/paradex-responses-order-resp-schema.json",
  "title": "responses.OrderResp",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paradex-openapi.yml#/components/schemas/responses.OrderResp",
  "type": "object",
  "properties": {
    "account": {
      "description": "Paradex Account",
      "type": "string"
    },
    "avg_fill_price": {
      "description": "Average fill price of the order",
      "type": "string"
    },
    "cancel_reason": {
      "description": "Reason for order cancellation if it was closed by cancel",
      "type": "string"
    },
    "client_id": {
      "description": "Client order id provided by the client at order creation",
      "type": "string"
    },
    "created_at": {
      "description": "Order creation time",
      "type": "integer"
    },
    "flags": {
      "description": "Order flags",
      "type": "array",
      "items": {
        "$ref": "#/$defs/responses.OrderFlag"
      }
    },
    "id": {
      "description": "Unique order identifier generated by Paradex",
      "type": "string"
    },
    "instruction": {
      "description": "Execution instruction for order matching",
      "allOf": [
        {
          "$ref": "#/$defs/responses.OrderInstruction"
        }
      ]
    },
    "last_updated_at": {
      "description": "Order last update time.  No changes once status=CLOSED",
      "type": "integer"
    },
    "market": {
      "description": "Market",
      "type": "string"
    },
    "price": {
      "description": "Order price. 0 for MARKET orders",
      "type": "string"
    },
    "published_at": {
      "description": "Timestamp in milliseconds when order was sent to the client",
      "type": "integer"
    },
    "received_at": {
      "description": "Timestamp in milliseconds when order was received by API service",
      "type": "integer"
    },
    "remaining_size": {
      "description": "Remaining size of the order",
      "type": "string"
    },
    "request_info": {
      "description": "Additional request information for orders",
      "allOf": [
        {
          "$ref": "#/$defs/responses.RequestInfo"
        }
      ]
    },
    "seq_no": {
      "description": "Unique increasing number (non-sequential) that is assigned to this order update and changes on every order update. Can be used to deduplicate multiple feeds. WebSocket and REST responses use independently generated seq_no per event.",
      "type": "integer"
    },
    "side": {
      "description": "Order side",
      "allOf": [
        {
          "$ref": "#/$defs/responses.OrderSide"
        }
      ]
    },
    "size": {
      "description": "Order size",
      "type": "string"
    },
    "status": {
      "description": "Order status",
      "allOf": [
        {
          "$ref": "#/$defs/responses.OrderStatus"
        }
      ]
    },
    "stp": {
      "description": "Self Trade Prevention mode",
      "allOf": [
        {
          "$ref": "#/$defs/responses.STPMode"
        }
      ]
    },
    "timestamp": {
      "description": "Order signature timestamp",
      "type": "integer"
    },
    "trigger_price": {
      "description": "Trigger price for stop order",
      "type": "string"
    },
    "type": {
      "description": "Order type",
      "allOf": [
        {
          "$ref": "#/$defs/responses.OrderType"
        }
      ]
    }
  },
  "$defs": {
    "responses.OrderFlag": {
      "type": "string",
      "enum": [
        "REDUCE_ONLY",
        "STOP_CONDITION_BELOW_TRIGGER",
        "STOP_CONDITION_ABOVE_TRIGGER",
        "INTERACTIVE",
        "TARGET_STRATEGY_VWAP",
        "MMP"
      ],
      "x-enum-varnames": [
        "FlagsReduceOnly",
        "FlagsStopConditionBelowTrigger",
        "FlagsStopConditionAboveTrigger",
        "FlagsInteractive",
        "FlagsTargetStrategyVWAP",
        "FlagsMMP"
      ]
    },
    "responses.OrderInstruction": {
      "type": "string",
      "enum": [
        "GTC",
        "POST_ONLY",
        "IOC",
        "RPI"
      ],
      "x-enum-varnames": [
        "OrderInstructionGTC",
        "OrderInstructionPostOnly",
        "OrderInstructionIOC",
        "OrderInstructionRPI"
      ]
    },
    "responses.OrderSide": {
      "type": "string",
      "enum": [
        "BUY",
        "SELL"
      ],
      "x-enum-varnames": [
        "OrderSideBuy",
        "OrderSideSell"
      ]
    },
    "responses.OrderStatus": {
      "type": "string",
      "enum": [
        "NEW",
        "UNTRIGGERED",
        "OPEN",
        "CLOSED"
      ],
      "x-enum-varnames": [
        "OrderStatusNew",
        "OrderStatusUntriggered",
        "OrderStatusOpen",
        "OrderStatusClosed"
      ]
    },
    "responses.OrderType": {
      "type": "string",
      "enum": [
        "MARKET",
        "LIMIT",
        "STOP_LIMIT",
        "STOP_MARKET",
        "TAKE_PROFIT_LIMIT",
        "TAKE_PROFIT_MARKET",
        "STOP_LOSS_MARKET",
        "STOP_LOSS_LIMIT"
      ],
      "x-enum-varnames": [
        "OrderTypeMarket",
        "OrderTypeLimit",
        "OrderTypeStopLimit",
        "OrderTypeStopMarket",
        "OrderTypeTakeProfitLimit",
        "OrderTypeTakeProfitMarket",
        "OrderTypeStopLossMarket",
        "OrderTypeStopLossLimit"
      ]
    },
    "responses.RequestInfo": {
      "type": "object",
      "properties": {
        "id": {
          "description": "Request id",
          "type": "string"
        },
        "message": {
          "description": "Error message for failed requests",
          "type": "string"
        },
        "request_type": {
          "description": "Type of request (MODIFY_ORDER)",
          "type": "string"
        },
        "status": {
          "description": "Status of modify order request",
          "type": "string"
        }
      }
    },
    "responses.STPMode": {
      "type": "string",
      "enum": [
        "EXPIRE_MAKER",
        "EXPIRE_TAKER",
        "EXPIRE_BOTH"
      ],
      "x-enum-comments": {
        "STPModeExpireBoth": "Expire both maker and taker orders if self cross",
        "STPModeExpireMaker": "Expire maker orders if self cross",
        "STPModeExpireTaker": "Expire taker orders if self cross"
      },
      "x-enum-varnames": [
        "STPModeExpireMaker",
        "STPModeExpireTaker",
        "STPModeExpireBoth"
      ]
    }
  }
}