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

# Modify an order

> Changes the fee limit on a resting order. Only the fee changes; the order remains in `pending` status with its original size and side.
Outside the lock window, the fee can move in either direction. During the lock window, the new value must be more competitive than the current value (lower for BURN orders, higher for MINT orders); a less competitive value returns error 137005. Setting `feeBps` to null converts the order to a market order.



## OpenAPI

````yaml openapi/match.yaml post /v1/match/orders/modify
openapi: 3.1.0
info:
  title: Circle Match API
  description: >
    The Circle Match API provides endpoints for Circle Match, a periodic

    batch-auction venue that coordinates USDC burn demand with USDC mint demand

    for eligible Circle Mint customers.


    ## Authentication


    All REST endpoints require a Bearer token:


    ```

    Authorization: Bearer <API_KEY>

    ```


    ## WebSocket


    Real-time auction state and account events are delivered over a persistent

    WebSocket connection at `wss://api.circle.com/v1/match/ws` (production) or

    `wss://api-sandbox.circle.com/v1/match/ws` (sandbox).


    Obtain a short-lived ticket with `POST /v1/match/ws/ticket`, then pass two

    `Sec-WebSocket-Protocol` values in the upgrade request:


    - `circle-match.v1`

    - `ticket.<jwt>` — the ticket value, prefixed with `ticket.`


    After connection, subscribe to the `market` channel for public auction state

    or the `account` channel for private order and fill events. See the Circle

    Match WebSocket reference for the full protocol specification.


    ## Error codes


    | Code   | HTTP | Description |

    |--------|------|-------------|

    | 136001 | 400  | Auction locked — cancellations and less-competitive fee
    changes not accepted |

    | 136002 | 400  | Auction settling — try again after settlement completes |

    | 137001 | 400  | Insufficient available balance |

    | 137002 | 400  | Invalid wallet |

    | 137003 | 400  | Wallet not found |

    | 137004 | 409  | Idempotency key reused with different parameters |

    | 137005 | 400  | Fee change not more competitive during lock window |

    | 137006 | 409  | Self-match violation — open order on opposite side of same
    auction |

    | 137007 | 400  | Invalid fiat account |

    | 137008 | 400  | Maximum orders per auction reached |

    | 137009 | 400  | Transaction limit exceeded |

    | 137010 | 400  | Entity not eligible for Circle Match |

    | 138001 | 400  | Withdrawal amount exceeds available balance |

    | 138002 | 400  | Withdrawal request invalid |

    | 138003 | 404  | No Circle Match account found for this entity |

    | 138004 | 400  | Invalid withdrawal destination |

    | 139001 | 400  | Circle Match wallet invalid |
  version: 1.0.0
servers:
  - url: https://api.circle.com
    description: Production
  - url: https://api-sandbox.circle.com
    description: Sandbox
security:
  - BearerAuth: []
tags:
  - name: Account
    description: Account balance and activity summary
  - name: Orders
    description: Place, list, retrieve, cancel, and modify orders
  - name: Withdrawals
    description: Withdraw restricted mint-side USDC
  - name: WebSocket
    description: Obtain a WebSocket connection ticket
paths:
  /v1/match/orders/modify:
    post:
      tags:
        - Orders
      summary: Modify an order
      description: >-
        Changes the fee limit on a resting order. Only the fee changes; the
        order remains in `pending` status with its original size and side.

        Outside the lock window, the fee can move in either direction. During
        the lock window, the new value must be more competitive than the current
        value (lower for BURN orders, higher for MINT orders); a less
        competitive value returns error 137005. Setting `feeBps` to null
        converts the order to a market order.
      operationId: modifyOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifyOrderRequest'
            example:
              auctionId: 42
              orderId: 550e8400-e29b-41d4-a716-446655440000
              feeBps: '3'
      responses:
        '200':
          description: Order modified
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - auctionId
                      - orderId
                      - status
                    properties:
                      auctionId:
                        type: integer
                        example: 42
                      orderId:
                        type: string
                        format: uuid
                        example: 550e8400-e29b-41d4-a716-446655440000
                      status:
                        type: string
                        enum:
                          - pending
                        example: pending
        '400':
          description: >-
            Bad request. Error code: `137005` — during the lock window the new
            fee is less competitive than the current fee.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ModifyOrderRequest:
      type: object
      required:
        - auctionId
        - orderId
      properties:
        auctionId:
          type: integer
          description: Auction cycle that contains the order to modify
          example: 42
        orderId:
          type: string
          format: uuid
          description: UUID of the order to modify
          example: 550e8400-e29b-41d4-a716-446655440000
        feeBps:
          oneOf:
            - type: string
            - type: 'null'
          description: >-
            New fee limit in basis points. During the lock window the new value
            must be more competitive than the current value (lower for BURN,
            higher for MINT). Set to null to convert the order to a market
            order.
          example: '3'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: Circle error code
          example: 137001
        message:
          type: string
          description: Human-readable error description
          example: Insufficient available balance
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````