> ## 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.

# Get Recent Builder Code Fills

> Returns the most recent fills attributed to the builder code owned by the authenticated account, newest first, across every account that traded with that code. The exchange retains at most 200 fills per builder code.

Use this endpoint to resynchronize after a `builderFills` WebSocket disconnect: reconnect, subscribe, then call this endpoint and de-duplicate by `fillId`. It is a short recovery window, not a fill history. For totals over an arbitrary period, use the builder-code statistics endpoint instead.

The retained window is rebuilt when the exchange restarts, so a response can contain fewer than 200 fills shortly afterwards.



## OpenAPI

````yaml /api-reference/rest-spec.json get /v1/builder_code/fills
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/builder_code/fills:
    get:
      tags:
        - Builder Code
      summary: Get Recent Builder Code Fills
      description: >-
        Returns the most recent fills attributed to the builder code owned by
        the authenticated account, newest first, across every account that
        traded with that code. The exchange retains at most 200 fills per
        builder code.


        Use this endpoint to resynchronize after a `builderFills` WebSocket
        disconnect: reconnect, subscribe, then call this endpoint and
        de-duplicate by `fillId`. It is a short recovery window, not a fill
        history. For totals over an arbitrary period, use the builder-code
        statistics endpoint instead.


        The retained window is rebuilt when the exchange restarts, so a response
        can contain fewer than 200 fills shortly afterwards.
      operationId: getBuilderCodeFills
      responses:
        '200':
          description: Recent fills attributed to the caller's builder code, newest first
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/GenericResponse'
                  - type: object
                    properties:
                      result:
                        type: array
                        description: >-
                          Up to 200 fills, newest first. An owner with no
                          recorded fills returns an empty array.
                        items:
                          $ref: '#/components/schemas/BuilderFill'
              example:
                success: true
                result:
                  - builderCodeFee: '0.2275'
                    fillId: 70a37d8f972f2494837f9dba8364cbb4
                    accountId: '10458932786832481'
                    orderId: a4c2e9f17b3d4e8c9f0a1b2c3d4e5f60
                    clientOrderId: my-order-123
                    market: AAPL-USD.P
                    price: '227.50'
                    size: '5.00'
                    side: buy
                    time: '2026-09-28T14:32:07.123456Z'
                  - builderCodeFee: '0.0508'
                    fillId: 9b1e4c2a7f0d3e5b8a6c1f4d2e9b7a3c
                    accountId: '2564891920043613872'
                    orderId: 5e8b1d3f9a2c4e6b7d0f1a3c5e7b9d2f
                    market: NVDA-USD.P
                    price: '127.10'
                    size: '2.00'
                    side: sell
                    time: '2026-09-28T14:31:55.004210Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: The authenticated account does not own a builder code.
          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:
                      - builder_code_not_found
              example:
                success: false
                error: No builder code found for this account.
                error_code: builder_code_not_found
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    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: ''
    BuilderFill:
      type: object
      description: >-
        One fill attributed to a builder code, as served by both the
        builderFills WebSocket channel and the builder-code fills endpoint.
      required:
        - builderCodeFee
        - fillId
        - orderId
        - market
        - price
        - size
        - side
        - time
      properties:
        builderCodeFee:
          type: string
          description: >-
            Exact, non-scientific decimal string containing the builder
            commission earned on this fill, in USDC. This is the charged amount,
            not the rate.
          example: '0.2275'
        fillId:
          type: string
          description: >-
            Unique fill identifier. Use it to de-duplicate overlap between a
            resynchronization response and live channel messages.
          example: 70a37d8f972f2494837f9dba8364cbb4
        accountId:
          type: string
          description: >-
            Account whose order produced this fill. Use it to attribute the fill
            to one of your users. Omitted for fills recorded before this field
            was introduced.
          example: '10458932786832481'
        orderId:
          type: string
          description: >-
            Identifier of the order that produced this fill. A single order can
            produce several fills, so use it to group fills by order. May be an
            empty string for fills recorded before this field was introduced.
          example: a4c2e9f17b3d4e8c9f0a1b2c3d4e5f60
        clientOrderId:
          type: string
          description: >-
            Client-supplied identifier set on the order that produced this fill.
            Omitted when the order was placed without one.
          example: my-order-123
        parentOrderId:
          type: string
          description: >-
            Identifier of the order that the filled order was created from, such
            as the order a triggered take-profit or stop-loss was attached to.
            Omitted when the filled order has no parent, and for fills recorded
            before this field was introduced.
          example: 5e8b1d3f9a2c4e6b7d0f1a3c5e7b9d2f
        market:
          type: string
          description: Market the fill traded in. Builder codes apply to perps only.
          example: AAPL-USD.P
        price:
          type: string
          description: Fill price as an exact decimal string.
          example: '227.50'
        size:
          type: string
          description: Fill quantity in the base asset, as an exact decimal string.
          example: '5.00'
        side:
          type: string
          enum:
            - buy
            - sell
          description: Side of the account that traded, not of the builder.
          example: buy
        time:
          type: string
          format: date-time
          description: Time the fill was created.
          example: '2026-09-28T14:32:07.123456Z'
  responses:
    Unauthorized:
      description: Authentication required. Provide a valid JWT or API key.
      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:
                  - api_key_not_found
                  - auth_expired
                  - auth_invalid
                  - auth_missing
                  - failed_to_decode_hex_signature
                  - failed_to_parse_timestamp
                  - signature_mismatch
                  - timestamp_too_far
          example:
            success: false
            error: Description of the error
            error_code: auth_missing
    Forbidden:
      description: Access denied. The authenticated account does not have permission.
      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:
                  - account_closed
                  - account_not_allowed
                  - forbidden
                  - ip_not_permitted
                  - key_doesnt_have_scope
          example:
            success: false
            error: Description of the error
            error_code: account_not_allowed
    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
    InternalServerError:
      description: Internal server error.
      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:
                  - server_is_busy
                  - service_unavailable
                  - unknown
          example:
            success: false
            error: Description of the error
            error_code: unknown
  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.