{
  "openapi": "3.1.0",
  "info": {
    "title": "Order API",
    "description": "Endpoints are authenticated with an API key: send api-access-key, api-timestamp, and api-signature on each request. Public endpoints (security: []) take no key.",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.pax.markets",
      "description": "Production API"
    }
  ],
  "paths": {
    "/v1/order/submit": {
      "post": {
        "tags": [
          "OrderService"
        ],
        "summary": "Submit order",
        "description": "Place a limit order.",
        "operationId": "OrderService_SubmitOrder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/paxorder_apiSubmitOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiSubmitOrderResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [
              "trade"
            ],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    },
    "/v1/order/active": {
      "get": {
        "tags": [
          "OrderService"
        ],
        "summary": "Get active orders",
        "description": "List the account's open orders, whether pending or resting.",
        "operationId": "OrderService_GetActiveOrders",
        "parameters": [
          {
            "in": "query",
            "name": "market_id",
            "description": "Return only orders on this market. Omit for every market.",
            "schema": {
              "type": "string",
              "format": "uint64"
            },
            "style": "form"
          }
        ],
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiGetActiveOrdersResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    },
    "/v1/order/{order_id}": {
      "get": {
        "tags": [
          "OrderService"
        ],
        "summary": "Get order",
        "description": "Fetch one order by order_id.",
        "operationId": "OrderService_GetOrder",
        "parameters": [
          {
            "in": "path",
            "name": "order_id",
            "description": "Id of the order to fetch.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiGetOrderResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    },
    "/v1/order/list": {
      "get": {
        "tags": [
          "OrderService"
        ],
        "summary": "Get orders",
        "description": "List the account's orders, newest first, optionally narrowed to one market and one status.",
        "operationId": "OrderService_GetOrders",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "description": "Maximum orders to return, from 1 to 1000. Defaults to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Cursor from the previous response's next_cursor. Omit for the first page.",
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "order_status",
            "description": "Return only orders in this status.",
            "schema": {
              "$ref": "#/components/schemas/paxcommonOrderStatus"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "market_id",
            "description": "Return only orders on this market. Omit for every market.",
            "schema": {
              "type": "string",
              "format": "uint64"
            },
            "style": "form"
          }
        ],
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiGetOrdersResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    },
    "/v1/order/cancel-liquidity": {
      "post": {
        "tags": [
          "OrderService"
        ],
        "summary": "Cancel liquidity order",
        "description": "Cancel a quantity of the account's resting liquidity at one price level.",
        "operationId": "OrderService_CancelLiquidityOrder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/paxorder_apiCancelLiquidityOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiCancelLiquidityOrderResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [
              "trade"
            ],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    },
    "/v1/order/cancel-all": {
      "post": {
        "tags": [
          "OrderService"
        ],
        "summary": "Cancel all orders",
        "description": "Cancel every resting order for the account, optionally limited to one market.",
        "operationId": "OrderService_CancelAllOrders",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/paxorder_apiCancelAllOrdersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiCancelAllOrdersResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [
              "trade"
            ],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    },
    "/v1/order/status-updates": {
      "get": {
        "tags": [
          "OrderService"
        ],
        "summary": "Get order status updates",
        "description": "Read the full status update history of one order. Updates can take up to 15 minutes to appear here.",
        "operationId": "OrderService_GetOrderStatusUpdates",
        "parameters": [
          {
            "in": "query",
            "name": "order_id",
            "description": "Order whose history to read.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "limit",
            "description": "Maximum updates to return, from 1 to 1000. Defaults to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Cursor from the previous response's next_cursor. Omit for the first page.",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiGetOrderStatusUpdatesResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    },
    "/v1/order/status-updates/fills/recent": {
      "get": {
        "tags": [
          "OrderService"
        ],
        "summary": "Get recent fill order status updates",
        "description": "Read the account's most recent fills, newest first. A fill is a status update where the order traded. Covers the last 10,000 fills per account.",
        "operationId": "OrderService_GetRecentFillOrderStatusUpdates",
        "parameters": [
          {
            "in": "query",
            "name": "market_id",
            "description": "Return only updates for orders on this market.",
            "schema": {
              "type": "string",
              "format": "uint64"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "limit",
            "description": "Maximum updates to return, from 1 to 1000. Defaults to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Cursor from the previous response's next_cursor. Omit to start at the newest update.",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiGetRecentFillOrderStatusUpdatesResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    },
    "/v1/order/status-updates/fills/since": {
      "get": {
        "tags": [
          "OrderService"
        ],
        "summary": "Get fill order status updates since",
        "description": "Read the account's fills from a point in time onward, oldest first. A fill is a status update where the order traded. Covers the last 10,000 fills per account.",
        "operationId": "OrderService_GetFillOrderStatusUpdatesSince",
        "parameters": [
          {
            "in": "query",
            "name": "since_time_ms",
            "description": "Return updates at or after this time, in Unix milliseconds.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "int64"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "market_id",
            "description": "Return only updates for orders on this market.",
            "schema": {
              "type": "string",
              "format": "uint64"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "limit",
            "description": "Maximum updates to return, from 1 to 1000. Defaults to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Cursor from the previous response's next_cursor. Omit to start at since_time_ms.",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiGetFillOrderStatusUpdatesSinceResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    },
    "/v1/order/status-updates/by-time": {
      "get": {
        "tags": [
          "OrderService"
        ],
        "summary": "Get order status updates by time",
        "description": "Fetch order status updates in a time range of up to 7 days, ordered oldest to newest. Updates appear up to 30 minutes after they happen.",
        "operationId": "OrderService_GetOrderStatusUpdatesByTime",
        "parameters": [
          {
            "in": "query",
            "name": "start_time_ms",
            "description": "Return updates at or after this time, in Unix milliseconds.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "int64"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "end_time_ms",
            "description": "Return updates before this time, in Unix milliseconds. At most 7 days after start_time_ms.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "int64"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "market_id",
            "description": "Return only updates for orders on this market.",
            "schema": {
              "type": "string",
              "format": "uint64"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "limit",
            "description": "Maximum updates to return, from 1 to 10000. Defaults to 10000.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Cursor from the previous response's next_cursor, with the same time range and market_id.",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiGetOrderStatusUpdatesByTimeResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    },
    "/v1/order/submit-batch-omni": {
      "post": {
        "tags": [
          "OrderService"
        ],
        "summary": "Batch submit omni orders",
        "description": "Place orders and cancel liquidity in one request.",
        "operationId": "OrderService_BatchSubmitOmniOrders",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/paxorder_apiBatchSubmitOmniOrdersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxorder_apiBatchSubmitOmniOrdersResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiAccessKey": [
              "trade"
            ],
            "ApiTimestamp": [],
            "ApiSignature": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "LegacyErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "description": "Why the request failed. Requests stopped before reaching the endpoint, for example by authentication, send an object with a code and a message; errors from the endpoint itself send a string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              }
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "paxcommonSide": {
        "description": "Side of an order.\n\n- `ASK`: Sell the base asset.\n- `BID`: Buy the base asset.",
        "x-enum-numbers": [
          1,
          2
        ],
        "x-enum-descriptions": {
          "ASK": "Sell the base asset.",
          "BID": "Buy the base asset."
        },
        "type": "string",
        "enum": [
          "ASK",
          "BID"
        ]
      },
      "paxcommonTimeInForce": {
        "description": "Time in force.\n\n- `IOC`: Immediate or cancel.\n- `GTC`: Good until canceled.\n- `ALO`: Add liquidity only: rests if it would not cross, else canceled.",
        "x-enum-numbers": [
          1,
          2,
          3
        ],
        "x-enum-descriptions": {
          "ALO": "Add liquidity only: rests if it would not cross, else canceled.",
          "GTC": "Good until canceled.",
          "IOC": "Immediate or cancel."
        },
        "type": "string",
        "enum": [
          "IOC",
          "GTC",
          "ALO"
        ]
      },
      "paxclientOrder": {
        "type": "object",
        "properties": {
          "side": {
            "description": "Side to place on.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonSide"
              }
            ]
          },
          "market_id": {
            "description": "Market to place on.",
            "type": "string",
            "format": "uint64"
          },
          "qty": {
            "description": "Quantity to place, a multiple of the market's step size. Must be positive except on a cancel lambda.",
            "type": "string",
            "format": "int64"
          },
          "ticks": {
            "description": "Limit price in ticks, from 1 to the market's max_ticks.",
            "type": "integer",
            "format": "int32"
          },
          "tif": {
            "description": "How long the order stays live.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonTimeInForce"
              }
            ]
          },
          "is_leverage": {
            "description": "Trade on margin. Currently disabled.",
            "type": "boolean"
          }
        },
        "required": [
          "side",
          "market_id",
          "qty",
          "ticks",
          "tif",
          "is_leverage"
        ]
      },
      "paxorder_apiSubmitOrderRequest": {
        "type": "object",
        "properties": {
          "order": {
            "description": "The order to place.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxclientOrder"
              }
            ]
          },
          "client_order_id": {
            "description": "Client-assigned id, at most 36 bytes. Omit or leave empty for none. Rejected if it matches another of the account's live orders.",
            "type": "string"
          }
        },
        "required": [
          "order"
        ]
      },
      "paxorder_apiSubmitOrderResponse": {
        "type": "object",
        "properties": {
          "order_id": {
            "description": "Exchange-assigned order id.",
            "type": "string"
          }
        },
        "required": [
          "order_id"
        ]
      },
      "paxorder_apiGetActiveOrdersRequest": {
        "type": "object",
        "properties": {
          "market_id": {
            "description": "Return only orders on this market. Omit for every market.",
            "type": "string",
            "format": "uint64"
          }
        }
      },
      "paxcommonOrigin": {
        "description": "What placed an order.\n\n- `EXOGENOUS`: Placed directly through the API.\n- `LAMBDA`: Placed by a lambda program.\n- `ADMIN`: System-initiated, such as cancels ahead of maintenance or shutdown.",
        "x-enum-numbers": [
          1,
          2,
          3
        ],
        "x-enum-descriptions": {
          "ADMIN": "System-initiated, such as cancels ahead of maintenance or shutdown.",
          "EXOGENOUS": "Placed directly through the API.",
          "LAMBDA": "Placed by a lambda program."
        },
        "type": "string",
        "enum": [
          "EXOGENOUS",
          "LAMBDA",
          "ADMIN"
        ]
      },
      "paxudUDOrder": {
        "type": "object",
        "properties": {
          "side": {
            "description": "Side the order was placed on.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonSide"
              }
            ]
          },
          "market_id": {
            "description": "Market the order was placed on.",
            "type": "string",
            "format": "uint64"
          },
          "qty": {
            "description": "Quantity submitted. Negative for a cancel order.",
            "type": "string",
            "format": "int64"
          },
          "ticks": {
            "description": "Limit price in ticks.",
            "type": "integer",
            "format": "int32"
          },
          "tif": {
            "description": "Time in force the order was placed with.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonTimeInForce"
              }
            ]
          },
          "origin": {
            "description": "What placed the order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonOrigin"
              }
            ]
          },
          "lambda_id": {
            "description": "Exchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.",
            "type": "string"
          }
        },
        "required": [
          "side",
          "market_id",
          "qty",
          "ticks",
          "tif",
          "origin",
          "lambda_id"
        ]
      },
      "paxudUDOrderEntry": {
        "type": "object",
        "properties": {
          "order_id": {
            "description": "Exchange-assigned order id.",
            "type": "string"
          },
          "client_order_id": {
            "description": "The order's client_order_id. Empty if none was sent.",
            "type": "string"
          },
          "order": {
            "description": "The order as placed.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxudUDOrder"
              }
            ]
          },
          "qty_filled_make": {
            "description": "Quantity filled as maker so far.",
            "type": "string",
            "format": "int64"
          },
          "qty_filled_take": {
            "description": "Quantity filled as taker so far.",
            "type": "string",
            "format": "int64"
          },
          "qty_canceled": {
            "description": "Quantity canceled so far.",
            "type": "string",
            "format": "int64"
          }
        },
        "required": [
          "order_id",
          "client_order_id",
          "order",
          "qty_filled_make",
          "qty_filled_take",
          "qty_canceled"
        ]
      },
      "paxorder_apiGetActiveOrdersResponse": {
        "type": "object",
        "properties": {
          "orders": {
            "description": "List of the account's open orders.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/paxudUDOrderEntry"
            }
          }
        }
      },
      "paxorder_apiGetOrderRequest": {
        "type": "object",
        "properties": {
          "order_id": {
            "description": "Id of the order to fetch.",
            "type": "string"
          }
        },
        "required": [
          "order_id"
        ]
      },
      "paxcommonOrderStatus": {
        "description": "Status of an order.\n\n- `ORDER_STATUS_PENDING`: Accepted, not yet acknowledged by the matching engine.\n- `ORDER_STATUS_RESTING`: On the book with quantity left to fill.\n- `ORDER_STATUS_FILLED`: Fully filled.\n- `ORDER_STATUS_CANCELED`: Canceled with nothing filled.\n- `ORDER_STATUS_PARTIAL`: Partly filled, with the rest canceled.\n- `ORDER_STATUS_REJECTED`: Rejected.",
        "x-enum-numbers": [
          1,
          2,
          3,
          4,
          5,
          6
        ],
        "x-enum-descriptions": {
          "ORDER_STATUS_CANCELED": "Canceled with nothing filled.",
          "ORDER_STATUS_FILLED": "Fully filled.",
          "ORDER_STATUS_PARTIAL": "Partly filled, with the rest canceled.",
          "ORDER_STATUS_PENDING": "Accepted, not yet acknowledged by the matching engine.",
          "ORDER_STATUS_REJECTED": "Rejected.",
          "ORDER_STATUS_RESTING": "On the book with quantity left to fill."
        },
        "type": "string",
        "enum": [
          "ORDER_STATUS_PENDING",
          "ORDER_STATUS_RESTING",
          "ORDER_STATUS_FILLED",
          "ORDER_STATUS_CANCELED",
          "ORDER_STATUS_PARTIAL",
          "ORDER_STATUS_REJECTED"
        ]
      },
      "paxorder_apiGetOrderResponse": {
        "type": "object",
        "properties": {
          "order_id": {
            "description": "Exchange-assigned order id.",
            "type": "string"
          },
          "market_id": {
            "description": "Market the order was placed on.",
            "type": "string",
            "format": "uint64"
          },
          "side": {
            "description": "Side the order was placed on.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonSide"
              }
            ]
          },
          "qty": {
            "description": "Quantity submitted. Negative for a cancel order.",
            "type": "string",
            "format": "int64"
          },
          "ticks": {
            "description": "Limit price in ticks.",
            "type": "integer",
            "format": "int32"
          },
          "tif": {
            "description": "Time in force the order was placed with.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonTimeInForce"
              }
            ]
          },
          "order_status": {
            "description": "Current status.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonOrderStatus"
              }
            ]
          },
          "origin": {
            "description": "What placed the order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonOrigin"
              }
            ]
          },
          "qty_filled_make": {
            "description": "Quantity filled as maker.",
            "type": "string",
            "format": "int64"
          },
          "qty_filled_take": {
            "description": "Quantity filled as taker.",
            "type": "string",
            "format": "int64"
          },
          "qty_canceled": {
            "description": "Quantity canceled.",
            "type": "string",
            "format": "int64"
          },
          "fill_value": {
            "description": "Total value filled, in the quote asset's native units.",
            "type": "string",
            "format": "int64"
          },
          "client_order_id": {
            "description": "Client-assigned id from the submit request. Empty if none was sent.",
            "type": "string"
          },
          "created_time_ms": {
            "description": "When the order was accepted, in Unix milliseconds.",
            "type": "string",
            "format": "int64"
          },
          "updated_time_ms": {
            "description": "When the order last changed, in Unix milliseconds.",
            "type": "string",
            "format": "int64"
          },
          "lambda_id": {
            "description": "Exchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.",
            "type": "string"
          }
        },
        "required": [
          "order_id",
          "market_id",
          "side",
          "qty",
          "ticks",
          "tif",
          "order_status",
          "origin",
          "qty_filled_make",
          "qty_filled_take",
          "qty_canceled",
          "fill_value",
          "client_order_id",
          "created_time_ms",
          "updated_time_ms",
          "lambda_id"
        ]
      },
      "paxorder_apiGetOrdersRequest": {
        "type": "object",
        "properties": {
          "limit": {
            "description": "Maximum orders to return, from 1 to 1000. Defaults to 1000.",
            "type": "integer",
            "format": "int32"
          },
          "cursor": {
            "description": "Cursor from the previous response's next_cursor. Omit for the first page.",
            "type": "string"
          },
          "order_status": {
            "description": "Return only orders in this status.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonOrderStatus"
              }
            ]
          },
          "market_id": {
            "description": "Return only orders on this market. Omit for every market.",
            "type": "string",
            "format": "uint64"
          }
        }
      },
      "paxorder_apiGetOrdersResponse": {
        "type": "object",
        "properties": {
          "orders": {
            "description": "List of orders on this page.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/paxorder_apiGetOrderResponse"
            }
          },
          "next_cursor": {
            "description": "Pass as cursor to fetch the next page. Absent on the last page.",
            "type": "string"
          }
        }
      },
      "paxorder_apiCancelLiquidityOrderRequest": {
        "type": "object",
        "properties": {
          "market_id": {
            "description": "Market to cancel on.",
            "type": "string",
            "format": "uint64"
          },
          "qty": {
            "description": "Quantity to cancel. Must be positive.",
            "type": "string",
            "format": "int64"
          },
          "side": {
            "description": "Side to cancel on.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonSide"
              }
            ]
          },
          "ticks": {
            "description": "Price level to cancel at, in ticks.",
            "type": "integer",
            "format": "int32"
          },
          "client_order_id": {
            "description": "Client-assigned id for the cancel, at most 36 bytes. Omit or leave empty for none.",
            "type": "string"
          }
        },
        "required": [
          "market_id",
          "qty",
          "side",
          "ticks"
        ]
      },
      "paxorder_apiCancelLiquidityOrderResponse": {
        "type": "object",
        "properties": {
          "order_id": {
            "description": "Exchange-assigned id of the cancel order.",
            "type": "string"
          }
        },
        "required": [
          "order_id"
        ]
      },
      "paxorder_apiCancelAllOrdersRequest": {
        "type": "object",
        "properties": {
          "market_id": {
            "description": "Cancel only this market's orders. Omit for every market.",
            "type": "string",
            "format": "uint64"
          }
        }
      },
      "paxorder_apiCancelAllOrdersResponse": {
        "type": "object",
        "properties": {
          "order_ids": {
            "description": "List of exchange-assigned cancel order ids, one per price level canceled.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "paxorder_apiGetOrderStatusUpdatesRequest": {
        "type": "object",
        "properties": {
          "order_id": {
            "description": "Order whose history to read.",
            "type": "string"
          },
          "limit": {
            "description": "Maximum updates to return, from 1 to 1000. Defaults to 1000.",
            "type": "integer",
            "format": "int32"
          },
          "cursor": {
            "description": "Cursor from the previous response's next_cursor. Omit for the first page.",
            "type": "string"
          }
        },
        "required": [
          "order_id"
        ]
      },
      "paxcommonOrderStatusUpdateReason": {
        "description": "Why the system rejected or canceled an order.\n\n- `OSU_REASON_UNSPECIFIED`: None.\n- `OSU_REASON_ADMIN_CANCELED`: Canceled by the system, such as ahead of maintenance or shutdown.\n- `OSU_REASON_INSUFFICIENT_BALANCE`: Refused because the account cannot fund the order.\n- `OSU_REASON_DUPLICATE_CLIENT_ID`: Refused because `client_order_id` is already in use by a live order.\n- `OSU_REASON_EXCHANGE_ERROR`: Refused because of an internal exchange error. The order was not placed.\n- `OSU_REASON_ALO_WOULD_CROSS`: Canceled because the ALO order would have crossed the book.\n- `OSU_REASON_EXCHANGE_UNAVAILABLE`: Refused because the exchange is not accepting orders right now.\n- `OSU_REASON_CAPACITY_REACHED`: Refused because the exchange has no capacity for another active lambda account right now.\n- `OSU_REASON_INVALID_ORDER`: Refused because the order failed validation.",
        "default": "OSU_REASON_UNSPECIFIED",
        "x-enum-numbers": [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8
        ],
        "x-enum-descriptions": {
          "OSU_REASON_ADMIN_CANCELED": "Canceled by the system, such as ahead of maintenance or shutdown.",
          "OSU_REASON_ALO_WOULD_CROSS": "Canceled because the ALO order would have crossed the book.",
          "OSU_REASON_CAPACITY_REACHED": "Refused because the exchange has no capacity for another active lambda account right now.",
          "OSU_REASON_DUPLICATE_CLIENT_ID": "Refused because `client_order_id` is already in use by a live order.",
          "OSU_REASON_EXCHANGE_ERROR": "Refused because of an internal exchange error. The order was not placed.",
          "OSU_REASON_EXCHANGE_UNAVAILABLE": "Refused because the exchange is not accepting orders right now.",
          "OSU_REASON_INSUFFICIENT_BALANCE": "Refused because the account cannot fund the order.",
          "OSU_REASON_INVALID_ORDER": "Refused because the order failed validation.",
          "OSU_REASON_UNSPECIFIED": "None."
        },
        "type": "string",
        "enum": [
          "OSU_REASON_UNSPECIFIED",
          "OSU_REASON_ADMIN_CANCELED",
          "OSU_REASON_INSUFFICIENT_BALANCE",
          "OSU_REASON_DUPLICATE_CLIENT_ID",
          "OSU_REASON_EXCHANGE_ERROR",
          "OSU_REASON_ALO_WOULD_CROSS",
          "OSU_REASON_EXCHANGE_UNAVAILABLE",
          "OSU_REASON_CAPACITY_REACHED",
          "OSU_REASON_INVALID_ORDER"
        ]
      },
      "paxudUDTimeInfo": {
        "type": "object",
        "properties": {
          "hw_ser_time_ns": {
            "description": "When the event was sequenced by the exchange, in Unix nanoseconds. A maker fill carries the taking order's time. 0 for a rejected order, or for an order the system canceled when the exchange restarted.",
            "type": "string",
            "format": "uint64"
          }
        },
        "required": [
          "hw_ser_time_ns"
        ]
      },
      "paxudUDOrderStatusUpdate": {
        "type": "object",
        "properties": {
          "osu_id": {
            "description": "Exchange-assigned id of this status update.",
            "type": "string"
          },
          "order_id": {
            "description": "Exchange-assigned id of the order this update belongs to.",
            "type": "string"
          },
          "client_order_id": {
            "description": "The order's client_order_id. Empty if none was sent.",
            "type": "string"
          },
          "qty_filled_make": {
            "description": "Quantity filled as maker in this update.",
            "type": "string",
            "format": "int64"
          },
          "qty_filled_take": {
            "description": "Quantity filled as taker in this update.",
            "type": "string",
            "format": "int64"
          },
          "qty_canceled": {
            "description": "Quantity canceled in this update.",
            "type": "string",
            "format": "int64"
          },
          "fill_value": {
            "description": "Value filled in this update, in the quote asset's native units.",
            "type": "string",
            "format": "int64"
          },
          "fee_rebate": {
            "description": "Rebate paid, or fee charged when negative, in the quote asset's native units.",
            "type": "string",
            "format": "int64"
          },
          "order": {
            "description": "The order as placed.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxudUDOrder"
              }
            ]
          },
          "order_status": {
            "description": "Order status after this update.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonOrderStatus"
              }
            ]
          },
          "reason": {
            "description": "Why the system refused or canceled the order, if it did.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonOrderStatusUpdateReason"
              }
            ]
          },
          "tm_info": {
            "description": "Timestamps of this update.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxudUDTimeInfo"
              }
            ]
          }
        },
        "required": [
          "osu_id",
          "order_id",
          "client_order_id",
          "qty_filled_make",
          "qty_filled_take",
          "qty_canceled",
          "fill_value",
          "fee_rebate",
          "order",
          "order_status",
          "reason",
          "tm_info"
        ]
      },
      "paxorder_apiOrderStatusUpdateEntry": {
        "type": "object",
        "properties": {
          "osu": {
            "description": "The status update, as streamed.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxudUDOrderStatusUpdate"
              }
            ]
          },
          "updated_time_ms": {
            "description": "When this update happened, in Unix milliseconds.",
            "type": "string",
            "format": "int64"
          }
        },
        "required": [
          "osu",
          "updated_time_ms"
        ]
      },
      "paxorder_apiGetOrderStatusUpdatesResponse": {
        "type": "object",
        "properties": {
          "order_status_updates": {
            "description": "List of status updates on this page.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/paxorder_apiOrderStatusUpdateEntry"
            }
          },
          "next_cursor": {
            "description": "Pass as cursor to fetch the next page. Absent on the last page.",
            "type": "string"
          }
        }
      },
      "paxorder_apiGetRecentFillOrderStatusUpdatesRequest": {
        "type": "object",
        "properties": {
          "market_id": {
            "description": "Return only updates for orders on this market.",
            "type": "string",
            "format": "uint64"
          },
          "limit": {
            "description": "Maximum updates to return, from 1 to 1000. Defaults to 1000.",
            "type": "integer",
            "format": "int32"
          },
          "cursor": {
            "description": "Cursor from the previous response's next_cursor. Omit to start at the newest update.",
            "type": "string"
          }
        }
      },
      "paxorder_apiGetRecentFillOrderStatusUpdatesResponse": {
        "type": "object",
        "properties": {
          "order_status_updates": {
            "description": "List of status updates on this page.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/paxorder_apiOrderStatusUpdateEntry"
            }
          },
          "next_cursor": {
            "description": "Pass as cursor to page further back. Absent on the last page.",
            "type": "string"
          }
        }
      },
      "paxorder_apiGetFillOrderStatusUpdatesSinceRequest": {
        "type": "object",
        "properties": {
          "since_time_ms": {
            "description": "Return updates at or after this time, in Unix milliseconds.",
            "type": "string",
            "format": "int64"
          },
          "market_id": {
            "description": "Return only updates for orders on this market.",
            "type": "string",
            "format": "uint64"
          },
          "limit": {
            "description": "Maximum updates to return, from 1 to 1000. Defaults to 1000.",
            "type": "integer",
            "format": "int32"
          },
          "cursor": {
            "description": "Cursor from the previous response's next_cursor. Omit to start at since_time_ms.",
            "type": "string"
          }
        },
        "required": [
          "since_time_ms"
        ]
      },
      "paxorder_apiGetFillOrderStatusUpdatesSinceResponse": {
        "type": "object",
        "properties": {
          "order_status_updates": {
            "description": "List of status updates on this page.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/paxorder_apiOrderStatusUpdateEntry"
            }
          },
          "next_cursor": {
            "description": "Pass as cursor to fetch the next page. Absent on the last page.",
            "type": "string"
          }
        }
      },
      "paxorder_apiGetOrderStatusUpdatesByTimeRequest": {
        "type": "object",
        "properties": {
          "start_time_ms": {
            "description": "Return updates at or after this time, in Unix milliseconds.",
            "type": "string",
            "format": "int64"
          },
          "end_time_ms": {
            "description": "Return updates before this time, in Unix milliseconds. At most 7 days after start_time_ms.",
            "type": "string",
            "format": "int64"
          },
          "market_id": {
            "description": "Return only updates for orders on this market.",
            "type": "string",
            "format": "uint64"
          },
          "limit": {
            "description": "Maximum updates to return, from 1 to 10000. Defaults to 10000.",
            "type": "integer",
            "format": "int32"
          },
          "cursor": {
            "description": "Cursor from the previous response's next_cursor, with the same time range and market_id.",
            "type": "string"
          }
        },
        "required": [
          "start_time_ms",
          "end_time_ms"
        ]
      },
      "paxorder_apiGetOrderStatusUpdatesByTimeResponse": {
        "type": "object",
        "properties": {
          "order_status_updates": {
            "description": "List of status updates on this page.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/paxorder_apiOrderStatusUpdateEntry"
            }
          },
          "next_cursor": {
            "description": "Pass as cursor to fetch the next page. Absent on the last page.",
            "type": "string"
          }
        }
      },
      "paxorder_apiOmniOrder": {
        "type": "object",
        "properties": {
          "message": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "SubmitOrder": {
                    "description": "Place an order.",
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/paxorder_apiSubmitOrderRequest"
                      }
                    ]
                  }
                },
                "required": [
                  "SubmitOrder"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "CancelLiquidityOrder": {
                    "description": "Cancel resting liquidity at a price level.",
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/paxorder_apiCancelLiquidityOrderRequest"
                      }
                    ]
                  }
                },
                "required": [
                  "CancelLiquidityOrder"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "paxorder_apiBatchSubmitOmniOrdersRequest": {
        "type": "object",
        "properties": {
          "omni_orders": {
            "description": "List of entries to apply, in the order given. At most 40 per request.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/paxorder_apiOmniOrder"
            },
            "maxItems": 40
          }
        }
      },
      "paxorder_apiOmniOrderResult": {
        "type": "object",
        "properties": {
          "order_id": {
            "description": "Exchange-assigned order id. Empty if refused.",
            "type": "string"
          },
          "client_order_id": {
            "description": "The entry's client_order_id. Empty if none was sent.",
            "type": "string"
          },
          "accepted": {
            "description": "True if the exchange took the order.",
            "type": "boolean"
          },
          "reason": {
            "description": "Why the entry was refused. OSU_REASON_UNSPECIFIED if accepted.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxcommonOrderStatusUpdateReason"
              }
            ]
          },
          "message": {
            "description": "Error message for a refused entry.",
            "type": "string"
          }
        },
        "required": [
          "order_id",
          "client_order_id",
          "accepted",
          "reason",
          "message"
        ]
      },
      "paxorder_apiBatchSubmitOmniOrdersResponse": {
        "type": "object",
        "properties": {
          "results": {
            "description": "One result per entry, in request order.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/paxorder_apiOmniOrderResult"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ApiAccessKey": {
        "type": "apiKey",
        "in": "header",
        "name": "api-access-key",
        "description": "The key id of the API key making the request. Endpoints that need more than read access list `trade` or `withdraw` as a role."
      },
      "ApiTimestamp": {
        "type": "apiKey",
        "in": "header",
        "name": "api-timestamp",
        "description": "Request timestamp in milliseconds since the Unix epoch. Requests outside recvWindow are rejected."
      },
      "ApiSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "api-signature",
        "description": "Signature over the request, produced with the API key's secret."
      }
    }
  },
  "security": [
    {
      "ApiAccessKey": [],
      "ApiTimestamp": [],
      "ApiSignature": []
    }
  ],
  "tags": [
    {
      "name": "OrderService"
    }
  ]
}