> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ondoperps.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Amend Spot order

> Amend a resting Spot limit order in place by exchange ID or client-prefixed ID. Send `size`, `price`, or both, with the order's current `version`; an omitted field keeps its value. `size` is the new total base size, including filled quantity. A stale `version` returns 409 `amend_version_mismatch` and changes nothing. Reducing the size at the same price keeps queue priority. A larger size or a new price moves the order to the back of its price level, and a new price that crosses the book trades immediately as a taker. An amend that needs more free balance than you have returns `insufficient_funds`. If the server directs a price amend to `/v1/spot/orders/{orderID}/delayed`, re-sign it for that exact path with a fresh timestamp. Size-only amends and amends with `postOnly: true` are not delayed. An order placed as post-only is always amended as post-only, so an amend whose new price would match returns `post_only_has_match`; send `postOnly: true` to also skip the delay for its price amends.

See the [Spot API guide](/api-reference/spot-api-guide). Requires authentication; API-key scope: `trade`.



## OpenAPI

````yaml /api-reference/rest-spec.json patch /v1/spot/orders/{orderID}
openapi: 3.0.3
info:
  title: Ondo Perps REST API
  version: '1.0'
  description: >-
    REST API for Ondo Perps: account, wallet, deposits/withdrawals, API keys,
    Spot trading, internal transfers, and perpetual futures trading.
servers:
  - url: https://api.ondoperps.xyz
security:
  - BearerAuth: []
paths:
  /v1/spot/orders/{orderID}:
    patch:
      tags:
        - Spot trading
      summary: Amend Spot order
      description: >-
        Amend a resting Spot limit order in place by exchange ID or
        client-prefixed ID. Send `size`, `price`, or both, with the order's
        current `version`; an omitted field keeps its value. `size` is the new
        total base size, including filled quantity. A stale `version` returns
        409 `amend_version_mismatch` and changes nothing. Reducing the size at
        the same price keeps queue priority. A larger size or a new price moves
        the order to the back of its price level, and a new price that crosses
        the book trades immediately as a taker. An amend that needs more free
        balance than you have returns `insufficient_funds`. If the server
        directs a price amend to `/v1/spot/orders/{orderID}/delayed`, re-sign it
        for that exact path with a fresh timestamp. Size-only amends and amends
        with `postOnly: true` are not delayed. An order placed as post-only is
        always amended as post-only, so an amend whose new price would match
        returns `post_only_has_match`; send `postOnly: true` to also skip the
        delay for its price amends.


        See the [Spot API guide](/api-reference/spot-api-guide). Requires
        authentication; API-key scope: `trade`.
      operationId: patchSpotOrdersOrderID
      parameters:
        - name: orderID
          in: path
          required: true
          description: >-
            Exchange order ID or client: followed by the original clientOrderId.
            URL-encode the path.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmendOrderReq'
            example:
              price: '599.5'
              version: 0
      responses:
        '200':
          description: Amended order
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/GenericResponse'
                  - type: object
                    properties:
                      result:
                        $ref: '#/components/schemas/SpotOrder'
              example:
                success: true
                result:
                  orderId: 197ec08e001658690721be129e7fa595
                  side: buy
                  price: '599.5'
                  size: '2'
                  market: SPY-USDC
                  filledSize: '0'
                  lastFillSize: '0'
                  filledCost: '0'
                  fee: '0'
                  status: open
                  createdAt: '2026-10-20T08:21:37.457839Z'
                  amendedAt: '2026-10-20T08:25:52.581560Z'
                  version: 1
                  type: limit
                  timeInForce: GTC
        '400':
          description: Validation error; inspect error_code and error.
        '409':
          description: >-
            The order was amended after the `version` you sent. Read the order
            again before you retry.
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    AmendOrderReq:
      type: object
      required:
        - version
      description: >-
        Send `size`, `price`, or both. Any other field returns
        `amend_field_not_supported`.
      properties:
        size:
          type: string
          description: >-
            New total order size in base currency, including any quantity
            already filled. Must be greater than the order's `filledSize` and
            aligned to the market's size increment. Omit to keep the current
            size.
          example: '12.00'
        price:
          type: string
          description: >-
            New limit price, aligned to the market's price increment. Omit to
            keep the current price.
          example: '228.00'
        version:
          type: integer
          minimum: 0
          description: >-
            The order's `version` from your latest view of it: the number of
            times it has been amended, `0` if never. If the order was amended
            since, the request returns `amend_version_mismatch`.
          example: 0
        postOnly:
          type: boolean
          description: >-
            If `true`, the amend returns `post_only_has_match` instead of
            trading when the new price would match. Applies to this amend only
            and does not change the order's own post-only setting. An order
            placed as post-only is always amended as post-only, so `false` does
            not let it trade.
          default: false
          example: false
    GenericResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          description: Whether the request was successful
          example: true
        error:
          type: string
          description: Error message, present only on failure
          example: ''
        error_code:
          type: string
          description: >-
            Semantic error code. See each endpoint's error responses for the
            specific codes it can return.
        deprecated:
          type: string
          description: Deprecation notice, if applicable
          example: ''
    SpotOrder:
      type: object
      required:
        - orderId
        - side
        - price
        - size
        - market
        - filledSize
        - lastFillSize
        - filledCost
        - fee
        - status
        - createdAt
        - type
      properties:
        orderId:
          type: string
          description: Internal order ID
          example: 70a37d8f972f2494837f9dba8364cbb4
        clientOrderId:
          type: string
          description: Client-provided order ID (if set)
          example: order123
        side:
          type: string
          description: buy or sell
          enum:
            - buy
            - sell
          example: buy
        price:
          type: string
          description: Limit price
          example: '1.55'
        size:
          type: string
          description: Order quantity in base currency
          example: '20.30'
        market:
          type: string
          description: Trading market
          example: SPY-USDC
        filledSize:
          type: string
          description: Quantity of the order that has been filled
          example: '5.403'
        lastFillSize:
          type: string
          description: Quantity filled in the most recent trade
          example: '5.403'
        filledCost:
          type: string
          description: Cost of the filled portion of the order (filledSize × fill price)
          example: '8.37465'
        fee:
          type: string
          description: >-
            Fee in the asset received: base equivalent quantity for buys, USDC
            for sells. Zero during the launch promotion.
          example: '0.0837'
        status:
          type: string
          description: Order status
          enum:
            - open
            - fullyfilled
            - canceled
          example: open
        createdAt:
          type: string
          format: date-time
          description: Order creation time
          example: '2022-06-16T12:35:11.123456Z'
        filledAt:
          type: string
          format: date-time
          description: Time when the order was fully filled (if applicable)
          example: '2022-06-16T12:35:11.123456Z'
        canceledAt:
          type: string
          format: date-time
          description: Order cancellation time (if cancelled)
          example: '2022-06-16T12:35:11.123456Z'
        amendedAt:
          type: string
          format: date-time
          description: Time of the order's most recent amend (if amended)
          example: '2026-10-20T08:25:52.581560822Z'
        version:
          type: integer
          description: >-
            Number of times the order has been amended. Omitted until the first
            amend; treat a missing value as `0`. Send it as `version` when you
            amend the order.
          example: 1
        cancelReason:
          type: string
          description: >-
            Cancellation reason when provided. Treat this as an extensible
            string.
          example: liquidation
        type:
          type: string
          description: Order type
          enum:
            - limit
            - market
          example: limit
        timeInForce:
          type: string
          description: Time in force (GTC or IOC). Not returned for market orders.
          enum:
            - GTC
            - IOC
          example: GTC
  responses:
    TooManyRequests:
      description: Rate limit exceeded. Slow down request frequency.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                description: Human-readable error message
              error_code:
                type: string
                enum:
                  - too_many_requests
          example:
            success: false
            error: Description of the error
            error_code: too_many_requests
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ApiKeyAuth:
      type: apiKey
      in: header
      name: ONDO-KEY-ID
      description: >-
        Also send ONDO-TIMESTAMP and ONDO-SIGN. See
        /api-reference/api_key_authentication for exact HMAC signing; the key ID
        alone is insufficient.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.