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

# Update buy orders

> Updates the spend cap, FDV cap, or validity of one or more active buy orders.

Each item is processed independently. The response is always HTTP 200 once authenticated and the body is valid — check the per-item `ok` flag in `results` (index-aligned to your request) for each outcome.



## OpenAPI

````yaml https://thefirm.biz/api/public/v1/openapi.json patch /api/public/v1/orders
openapi: 3.1.0
info:
  title: AutoBoy Public API
  version: 0.1.0
  description: >-
    REST API for AutoBoy — browse projects, view detailed stats about your own
    launch, create buy orders and manage your AutoBoy smart wallet.


    ## Authentication


    Most endpoints require an API key, sent as a bearer token:


    ```

    Authorization: Bearer autoboy_…

    ```


    ## Quick start


    1. **Request a key** — `POST /api/public/v1/api-key-requests`

    2. **Register a project** — `POST /api/public/v1/projects`.


    New to AutoBoy? Read the product docs https://docs.thefirm.biz.
servers:
  - url: https://thefirm.biz
security: []
tags:
  - name: API Keys
    description: Request, create, and inspect API keys.
  - name: Projects
    description: Browse projects and their buyers.
  - name: Buy Orders
    description: Read and manage the API key owner's pre-launch buy orders.
  - name: AutoBoy Wallet
    description: Balances of, and withdrawals from, the AutoBoy smart wallet.
  - name: Feedback
    description: Send feedback to The Firm.
paths:
  /api/public/v1/orders:
    patch:
      tags:
        - Buy Orders
      summary: Update buy orders
      description: >-
        Updates the spend cap, FDV cap, or validity of one or more active buy
        orders.


        Each item is processed independently. The response is always HTTP 200
        once authenticated and the body is valid — check the per-item `ok` flag
        in `results` (index-aligned to your request) for each outcome.
      operationId: updateBuyOrders
      requestBody:
        required: true
        description: The buy orders to update, keyed by project slug.
        content:
          application/json:
            schema:
              type: object
              properties:
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      slug:
                        type: string
                        minLength: 1
                        description: >-
                          Public project slug identifying the buy order to
                          update.
                        example: thefirm
                      maxSpendUsdc:
                        type: string
                        pattern: ^\d+(\.\d+)?$
                        description: >-
                          New per-buy USDC spend cap. Omit to keep the current
                          value.
                        example: '50'
                      maxFdvUsdc:
                        type:
                          - string
                          - 'null'
                        pattern: ^\d+(\.\d+)?$
                        description: >-
                          New maximum FDV cap, in USDC. Omit to keep the current
                          cap; pass an explicit null to clear it — no FDV cap,
                          so the project is bought as quickly as possible.
                        example: '5000000'
                      expiresInMs:
                        type: integer
                        minimum: 1000
                        maximum: 86400000
                        description: >-
                          New validity window, in milliseconds. Omit to keep the
                          current value.
                        example: 86400000
                    required:
                      - slug
                  minItems: 1
                  maxItems: 50
              required:
                - items
      responses:
        '200':
          description: Per-item results for the batch.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyOrderMutationResponse'
              example:
                results:
                  - slug: thefirm
                    ok: true
                    status: created
                  - slug: charms
                    ok: true
                    status: unchanged
                  - slug: no-such-project
                    ok: false
                    code: unknown_project
                    message: No project matches the slug
        '400':
          description: Malformed JSON, an invalid body, or an over-limit batch.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Bad request
                message: Invalid request body
        '401':
          description: Missing, invalid, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingAuthorizationHeader:
                  value:
                    error: Unauthorized
                    message: Missing or invalid Authorization header
                invalidApiKey:
                  value:
                    error: Unauthorized
                    message: Invalid API key
        '500':
          description: An unexpected server-side error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Internal server error
                message: Failed to update buy orders
      security:
        - apiKeyAuth: []
components:
  schemas:
    BuyOrderMutationResponse:
      type: object
      properties:
        results:
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  slug:
                    type: string
                    example: thefirm
                  ok:
                    type: boolean
                    enum:
                      - true
                  status:
                    type: string
                    enum:
                      - created
                      - updated
                      - deleted
                      - unchanged
                      - already_deleted
                    example: created
                required:
                  - slug
                  - ok
                  - status
              - type: object
                properties:
                  slug:
                    type: string
                    example: no-such-project
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                    enum:
                      - unknown_project
                      - already_exists
                      - not_found
                      - not_modifiable
                      - invalid_value
                      - duplicate_in_request
                    example: unknown_project
                  message:
                    type: string
                    example: No project matches the slug
                required:
                  - slug
                  - ok
                  - code
                  - message
      required:
        - results
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
      required:
        - error
        - message
      example:
        error: Bad request
        message: Invalid request body
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: API key issued via POST /api/public/v1/api-keys.

````