Kalshi orders API

Order management endpoints

Operations 16

GET /portfolio/orders Get Orders #
POST /portfolio/orders Create Order #
GET /portfolio/orders/{order_id} Get Order #
DELETE /portfolio/orders/{order_id} Cancel Order #
POST /portfolio/orders/batched Batch Create Orders #
DELETE /portfolio/orders/batched Batch Cancel Orders #
POST /portfolio/orders/{order_id}/amend Amend Order #
POST /portfolio/orders/{order_id}/decrease Decrease Order #
GET /portfolio/orders/queue_positions Get Queue Positions for Orders #
GET /portfolio/orders/{order_id}/queue_position Get Order Queue Position #
POST /portfolio/events/orders Create Order (V2) #
POST /portfolio/events/orders/batched Batch Create Orders (V2) #
DELETE /portfolio/events/orders/batched Batch Cancel Orders (V2) #
DELETE /portfolio/events/orders/{order_id} Cancel Order (V2) #
POST /portfolio/events/orders/{order_id}/amend Amend Order (V2) #
POST /portfolio/events/orders/{order_id}/decrease Decrease Order (V2) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/kalshi-orders-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

kalshi-orders-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Kalshi Trade API Manual Endpoints account Orders API
  version: 3.19.0
  description: Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
servers:
- url: https://external-api.kalshi.com/trade-api/v2
  description: Production Trade API server
- url: https://api.elections.kalshi.com/trade-api/v2
  description: Production shared API server, also supported
- url: https://external-api.demo.kalshi.co/trade-api/v2
  description: Demo Trade API server
- url: https://demo-api.kalshi.co/trade-api/v2
  description: Demo shared API server, also supported
tags:
- name: orders
  description: Order management endpoints
paths:
  /portfolio/orders:
    get:
      operationId: GetOrders
      summary: Get Orders
      description: 'Restricts the response to orders that have a certain status: resting, canceled, or executed.

        Orders that have been canceled or fully executed before the historical cutoff are only available via `GET /historical/orders`. Resting orders will always be available through this endpoint. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.

        '
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      parameters:
      - $ref: '#/components/parameters/TickerQuery'
      - $ref: '#/components/parameters/MultipleEventTickerQuery'
      - $ref: '#/components/parameters/MinTsQuery'
      - $ref: '#/components/parameters/MaxTsQuery'
      - $ref: '#/components/parameters/StatusQuery'
      - $ref: '#/components/parameters/LimitQuery'
      - $ref: '#/components/parameters/CursorQuery'
      - $ref: '#/components/parameters/SubaccountQuery'
      responses:
        '200':
          description: Orders retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrdersResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      operationId: CreateOrder
      summary: Create Order
      description: ' Endpoint for submitting orders in a market. Each user is limited to 200 000 open orders at a time.'
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderRequest'
      responses:
        '201':
          description: Order created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/orders/{order_id}:
    get:
      operationId: GetOrder
      summary: Get Order
      description: ' Endpoint for getting a single order.'
      x-mint:
        content: '<Note>

          **Rate limit:** 2 tokens per request. Other endpoints use the default cost of 10 tokens per request unless noted on their own page. See [Rate Limits and Tiers](/getting_started/rate_limits).

          </Note>

          '
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      parameters:
      - $ref: '#/components/parameters/OrderIdPath'
      responses:
        '200':
          description: Order retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      operationId: CancelOrder
      summary: Cancel Order
      description: ' Endpoint for canceling orders. The value for the orderId should match the id field of the order you want to decrease. Commonly, DELETE-type endpoints return 204 status with no body content on success. But we can''t completely delete the order, as it may be partially filled already. Instead, the DeleteOrder endpoint reduce the order completely, essentially zeroing the remaining resting contracts on it. The zeroed order is returned on the response payload as a form of validation for the client.'
      x-mint:
        content: '<Note>

          **Rate limit:** 2 tokens per request. Other endpoints use the default cost of 10 tokens per request unless noted on their own page. See [Rate Limits and Tiers](/getting_started/rate_limits).

          </Note>

          '
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      parameters:
      - $ref: '#/components/parameters/OrderIdPath'
      - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
      - $ref: '#/components/parameters/ExchangeIndexQuery'
      responses:
        '200':
          description: Order cancelled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelOrderResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/orders/batched:
    post:
      operationId: BatchCreateOrders
      summary: Batch Create Orders
      description: Endpoint for submitting a batch of orders. The maximum batch size scales with your tier's write budget — see [Rate Limits and Tiers](/getting_started/rate_limits).
      x-mint:
        content: '<Note>

          **Rate limit:** 10 tokens per order in the batch — billed per item, so total cost for a batch of N orders is N × 10. Other endpoints cost 10 tokens per request (not per item) unless noted on their own page. See [Rate Limits and Tiers](/getting_started/rate_limits).

          </Note>

          '
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCreateOrdersRequest'
      responses:
        '201':
          description: Batch order creation completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCreateOrdersResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      operationId: BatchCancelOrders
      summary: Batch Cancel Orders
      description: Endpoint for cancelling a batch of orders. The maximum batch size scales with your tier's write budget — see [Rate Limits and Tiers](/getting_started/rate_limits).
      x-mint:
        content: '<Note>

          **Rate limit:** 2 tokens per order in the batch — billed per item, so total cost for a batch of N cancels is N × 2. Other endpoints cost 10 tokens per request unless noted on their own page. See [Rate Limits and Tiers](/getting_started/rate_limits).

          </Note>

          '
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCancelOrdersRequest'
      responses:
        '200':
          description: Batch order cancellation completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCancelOrdersResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/orders/{order_id}/amend:
    post:
      operationId: AmendOrder
      summary: Amend Order
      description: ' Endpoint for amending the max number of fillable contracts and/or price in an existing order. Max fillable contracts is `remaining_count` + `fill_count`.'
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      parameters:
      - $ref: '#/components/parameters/OrderIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmendOrderRequest'
      responses:
        '200':
          description: Order amended successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmendOrderResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/orders/{order_id}/decrease:
    post:
      operationId: DecreaseOrder
      summary: Decrease Order
      description: ' Endpoint for decreasing the number of contracts in an existing order. This is the only kind of edit available on order quantity. Cancelling an order is equivalent to decreasing an order amount to zero.'
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      parameters:
      - $ref: '#/components/parameters/OrderIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecreaseOrderRequest'
      responses:
        '200':
          description: Order decreased successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecreaseOrderResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/orders/queue_positions:
    get:
      operationId: GetOrderQueuePositions
      summary: Get Queue Positions for Orders
      description: ' Endpoint for getting queue positions for all resting orders. Queue position represents the number of contracts that need to be matched before an order receives a partial or full match, determined using price-time priority.'
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      parameters:
      - name: market_tickers
        in: query
        description: Comma-separated list of market tickers to filter by
        schema:
          type: string
      - name: event_ticker
        in: query
        description: Event ticker to filter by
        schema:
          type: string
      - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
      responses:
        '200':
          description: Queue positions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderQueuePositionsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/orders/{order_id}/queue_position:
    get:
      operationId: GetOrderQueuePosition
      summary: Get Order Queue Position
      description: ' Endpoint for getting an order''s queue position in the order book. This represents the amount of orders that need to be matched before this order receives a partial or full match. Queue position is determined using a price-time priority.'
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      parameters:
      - $ref: '#/components/parameters/OrderIdPath'
      responses:
        '200':
          description: Queue position retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderQueuePositionResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/events/orders:
    post:
      operationId: CreateOrderV2
      summary: Create Order (V2)
      description: Endpoint for submitting event-market orders using the V2 request/response shape (single-book `bid`/`ask` side and fixed-point dollar prices). The legacy `/portfolio/orders` endpoint will be deprecated no earlier than May 6, 2026 — clients should migrate to this path.
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderV2Request'
      responses:
        '201':
          description: Order created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderV2Response'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/events/orders/batched:
    post:
      operationId: BatchCreateOrdersV2
      summary: Batch Create Orders (V2)
      description: Endpoint for submitting a batch of event-market orders using the V2 request/response shape. The maximum batch size scales with your tier's write budget — see [Rate Limits and Tiers](/getting_started/rate_limits).
      x-mint:
        content: '<Note>

          **Rate limit:** 10 tokens per order in the batch — billed per item, so total cost for a batch of N orders is N × 10. Other endpoints cost 10 tokens per request (not per item) unless noted on their own page. See [Rate Limits and Tiers](/getting_started/rate_limits).

          </Note>

          '
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCreateOrdersV2Request'
      responses:
        '201':
          description: Batch order creation completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCreateOrdersV2Response'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      operationId: BatchCancelOrdersV2
      summary: Batch Cancel Orders (V2)
      description: Endpoint for cancelling a batch of event-market orders using the V2 response shape. The maximum batch size scales with your tier's write budget — see [Rate Limits and Tiers](/getting_started/rate_limits).
      x-mint:
        content: '<Note>

          **Rate limit:** 2 tokens per order in the batch — billed per item, so total cost for a batch of N cancels is N × 2. Other endpoints cost 10 tokens per request unless noted on their own page. See [Rate Limits and Tiers](/getting_started/rate_limits).

          </Note>

          '
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCancelOrdersV2Request'
      responses:
        '200':
          description: Batch order cancellation completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCancelOrdersV2Response'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/events/orders/{order_id}:
    delete:
      operationId: CancelOrderV2
      summary: Cancel Order (V2)
      description: Endpoint for cancelling event-market orders using the V2 response shape. Returns `{order_id, client_order_id, reduced_by}` rather than a full order object.
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      parameters:
      - $ref: '#/components/parameters/OrderIdPath'
      - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
      - $ref: '#/components/parameters/ExchangeIndexQuery'
      responses:
        '200':
          description: Order cancelled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelOrderV2Response'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/events/orders/{order_id}/amend:
    post:
      operationId: AmendOrderV2
      summary: Amend Order (V2)
      description: Endpoint for amending the price and/or max fillable count of an existing event-market order using the V2 request/response shape. The request `count` is the updated total/max fillable count, equal to already filled count plus desired resting remaining count. This behavior matches the v1 amend endpoints; only the request/response shape differs.
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      parameters:
      - $ref: '#/components/parameters/OrderIdPath'
      - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmendOrderV2Request'
      responses:
        '200':
          description: Order amended successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmendOrderV2Response'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /portfolio/events/orders/{order_id}/decrease:
    post:
      operationId: DecreaseOrderV2
      summary: Decrease Order (V2)
      description: Endpoint for decreasing the remaining count of an existing event-market order using the V2 request/response shape. Exactly one of `reduce_by` or `reduce_to` must be provided.
      tags:
      - orders
      security:
      - kalshiAccessKey: []
        kalshiAccessSignature: []
        kalshiAccessTimestamp: []
      parameters:
      - $ref: '#/components/parameters/OrderIdPath'
      - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecreaseOrderV2Request'
      responses:
        '200':
          description: Order decreased successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecreaseOrderV2Response'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    CursorQuery:
      name: cursor
      in: query
      description: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
      schema:
        type: string
        x-go-type-skip-optional-pointer: true
    TickerQuery:
      name: ticker
      in: query
      description: Filter by market ticker
      schema:
        type: string
        x-go-type-skip-optional-pointer: true
    SubaccountQueryDefaultPrimary:
      name: subaccount
      in: query
      description: Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0.
      schema:
        type: integer
    LimitQuery:
      name: limit
      in: query
      description: Number of results per page. Defaults to 100.
      schema:
        type: integer
        format: int64
        minimum: 1
        maximum: 1000
        default: 100
        x-oapi-codegen-extra-tags:
          validate: omitempty,min=1,max=1000
    SubaccountQuery:
      name: subaccount
      in: query
      description: Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts.
      schema:
        type: integer
    MaxTsQuery:
      name: max_ts
      in: query
      description: Filter items before this Unix timestamp
      schema:
        type: integer
        format: int64
    OrderIdPath:
      name: order_id
      in: path
      required: true
      description: Order ID
      schema:
        type: string
    MultipleEventTickerQuery:
      name: event_ticker
      in: query
      description: Event tickers to filter by, as a comma-separated list (maximum 10).
      schema:
        type: string
        x-go-type-skip-optional-pointer: true
    ExchangeIndexQuery:
      name: exchange_index
      in: query
      schema:
        $ref: '#/components/schemas/ExchangeIndex'
      x-go-type-skip-optional-pointer: true
    StatusQuery:
      name: status
      in: query
      description: Filter by status. Possible values depend on the endpoint.
      schema:
        type: string
    MinTsQuery:
      name: min_ts
      in: query
      description: Filter items after this Unix timestamp
      schema:
        type: integer
        format: int64
  schemas:
    CreateOrderV2Response:
      type: object
      required:
      - order_id
      - fill_count
      - remaining_count
      - ts_ms
      properties:
        order_id:
          type: string
        client_order_id:
          type: string
        fill_count:
          $ref: '#/components/schemas/FixedPointCount'
          description: Number of contracts filled immediately upon placement.
        remaining_count:
          $ref: '#/components/schemas/FixedPointCount'
          description: Number of contracts remaining after placement. For IOC orders, this reflects the final state after unfilled contracts are canceled.
        average_fill_price:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Volume-weighted average fill price. Only present when fill_count > 0.
        average_fee_paid:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Volume-weighted average fee paid per contract for fills resulting from this request. Only present when fill_count > 0.
        ts_ms:
          type: integer
          format: int64
          description: Matching engine timestamp at which the order was processed, as Unix epoch milliseconds.
    FixedPointDollars:
      type: string
      description: US dollar amount as a fixed-point decimal string with up to 6 decimal places of precision. This is the maximum supported precision; valid quote intervals for a given market are constrained by that market's price level structure.
      example: '0.5600'
    BatchCancelOrdersV2Request:
      type: object
      required:
      - orders
      properties:
        orders:
          type: array
          x-oapi-codegen-extra-tags:
            validate: required,dive
          description: An array of orders to cancel, each optionally specifying a subaccount.
          items:
            type: object
            required:
            - order_id
            properties:
              order_id:
                type: string
                description: Order ID to cancel.
              subaccount:
                type: integer
                minimum: 0
                default: 0
                description: Optional subaccount number to use for this cancellation (0 for primary, 1-32 for subaccounts).
                x-go-type-skip-optional-pointer: true
              exchange_index:
                allOf:
                - $ref: '#/components/schemas/ExchangeIndex'
                default: 0
                x-go-type-skip-optional-pointer: true
    AmendOrderRequest:
      type: object
      required:
      - ticker
      - side
      - action
      properties:
        subaccount:
          type: integer
          minimum: 0
          description: Optional subaccount number to use for this amendment (0 for primary, 1-32 for subaccounts)
          default: 0
          x-go-type-skip-optional-pointer: true
        ticker:
          type: string
          description: Market ticker
        side:
          type: string
          enum:
          - 'yes'
          - 'no'
          description: Side of the order
        action:
          type: string
          enum:
          - buy
          - sell
          description: Action of the order
        client_order_id:
          type: string
          description: The original client-specified order ID to be amended
          x-go-type-skip-optional-pointer: true
        updated_client_order_id:
          type: string
          description: The new client-specified order ID after amendment
          x-go-type-skip-optional-pointer: true
        yes_price:
          type: integer
          minimum: 1
          maximum: 99
          description: Updated yes price for the order in cents
        no_price:
          type: integer
          minimum: 1
          maximum: 99
          description: Updated no price for the order in cents
        yes_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Updated yes price for the order in fixed-point dollars. Exactly one of yes_price, no_price, yes_price_dollars, and no_price_dollars must be passed.
        no_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Updated no price for the order in fixed-point dollars. Exactly one of yes_price, no_price, yes_price_dollars, and no_price_dollars must be passed.
        count:
          type: integer
          minimum: 1
          description: Updated quantity for the order (whole contracts only). If updating quantity, provide count or count_fp; if both provided they must match.
        count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the updated quantity for the order. If updating quantity, provide count or count_fp; if both provided they must match.
        exchange_index:
          allOf:
          - $ref: '#/components/schemas/ExchangeIndex'
          default: 0
          x-go-type-skip-optional-pointer: true
    BookSide:
      type: string
      enum:
      - bid
      - ask
      description: 'Side of the book for an order or trade. For event markets, this refers to the YES leg only: `bid` means buy YES, `ask` means sell YES. (Selling YES is economically equivalent to buying NO at `1 - price`, but this endpoint quotes everything from the YES side.)'
    AmendOrderV2Response:
      type: object
      required:
      - order_id
      - ts_ms
      properties:
        order_id:
          type: string
        client_order_id:
          type: string
        remaining_count:
          $ref: '#/components/schemas/FixedPointCount'
          x-omitempty: false
          description: Number of resting contracts remaining after the amend. This is the actual post-amend resting quantity, not the request's total/max fillable count. Only present when the amend caused a fill or changed the resting size.
        fill_count:
          $ref: '#/components/schemas/FixedPointCount'
          x-omitempty: false
          description: Number of contracts filled as a result of the amend crossing the book. Only present when fills occurred or remaining size changed.
        average_fill_price:
          $ref: '#/components/schemas/FixedPointDollars'
          x-omitempty: false
          description: Volume-weighted average fill price for fills resulting from the amend. Only present when fills occurred.
        average_fee_paid:
          $ref: '#/components/schemas/FixedPointDollars'
          x-omitempty: false
          description: Volume-weighted average fee paid per contract for fills resulting from the amend. Only present when fills occurred.
        ts_ms:
          type: integer
          format: int64
          description: Matching engine timestamp at which the amend was processed, as Unix epoch milliseconds.
    BatchCreateOrdersIndividualResponse:
      type: object
      properties:
        client_order_id:
          type:
          - string
          - 'null'
        order:
          allOf:
          - $ref: '#/components/schemas/Order'
        error:
          allOf:
          - $ref: '#/components/schemas/ErrorResponse'
    DecreaseOrderV2Response:
      type: object
      required:
      - order_id
      - remaining_count
      - ts_ms
      properties:
        order_id:
          type: string
        client_order_id:
          type: string
        remaining_count:
          $ref: '#/components/schemas/FixedPointCount'
          description: Number of contracts remaining after the decrease.
        ts_ms:
          type: integer
          format: int64
          description: Matching engine timestamp at which the decrease was processed, as Unix epoch milliseconds.
    BatchCreateOrdersV2Request:
      type: object
      required:
      - orders
      properties:
        orders:
          type: array
          x-oapi-codegen-extra-tags:
            validate: required,dive
          items:
            $ref: '#/components/schemas/CreateOrderV2Request'
    BatchCancelOrdersRequest:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
          description: An array of order IDs to cancel
          deprecated: true
        orders:
          type: array
          items:
            $ref: '#/components/schemas/BatchCancelOrdersRequestOrder'
          description: An array of orders to cancel, each optionally specifying a subaccount
    BatchCancelOrdersResponse:
      type: object
      required:
      - orders
      properties:
        orders:
          type: array
          items:
 

# --- truncated at 32 KB (59 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/kalshi/refs/heads/main/openapi/kalshi-orders-api-openapi.yml