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

# List Portfolio Fills

> Retrieve fills on a given portfolio. This endpoint requires a start_date, and returns a payload with a default limit of 100 if not specified by the user. The maximum allowed limit is 3000.

<Tip>
  **Prime CLI**

  Use the [Prime CLI](https://github.com/coinbase-samples/prime-cli) to test this endpoint by following the [quick start](/prime/introduction/quickstart) guide and running this command:

  ```bash lines wrap theme={null}
  primectl get-portfolio-fills --help
  ```
</Tip>

<Tabs>
  <Tab title="CLI">
    ```bash wrap theme={null}
    primectl get-portfolio-fills --help
    ```

    For more information, please visit the [Prime CLI](https://github.com/coinbase-samples/prime-cli).
  </Tab>

  <Tab title="TS/JS">
    ```typescript wrap theme={null}
    const ordersService = new OrdersService(client);

    ordersService.listPortfolioFills({
        portfolioId: 'PORTFOLIO_ID_HERE',
        orderId: 'ORDER_ID_HERE',
    }).then(async (response) => {
        console.log('Fills: ', response);
    })
    ```

    For more information, please visit the [Prime TS SDK](https://github.com/coinbase-samples/prime-sdk-ts).
  </Tab>
</Tabs>


## OpenAPI

````yaml GET /v1/portfolios/{portfolio_id}/fills
openapi: 3.0.1
info:
  title: REST API
  description: >-
    The Coinbase Prime REST API provides programmatic access to trading,
    custody, staking, market data, and account management functionality.
  version: '0.1'
servers:
  - url: https://api.prime.coinbase.com/
security: []
tags:
  - name: PrimeRESTAPI
paths:
  /v1/portfolios/{portfolio_id}/fills:
    get:
      tags:
        - Orders
      summary: List Portfolio Fills
      description: >-
        Retrieve fills on a given portfolio. This endpoint requires a
        start_date, and returns a payload with a default limit of 100 if not
        specified by the user. The maximum allowed limit is 3000.
      operationId: PrimeRESTAPI_GetPortfolioFills
      parameters:
        - name: portfolio_id
          in: path
          description: The portfolio ID associated with the order
          required: true
          schema:
            type: string
        - name: cursor
          in: query
          description: Cursor used for pagination (last consumed record)
          schema:
            type: string
        - name: limit
          in: query
          description: Number of items to retrieve
          schema:
            type: integer
            format: int32
        - name: start_date
          in: query
          description: A start date for the fills to be queried from
          required: true
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          description: An end date for the fills to be queried until
          schema:
            type: string
            format: date-time
        - name: sort_direction
          in: query
          description: Sorting order
          schema:
            type: string
            default: DESC
            enum:
              - DESC
              - ASC
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_rest_api.GetPortfolioFillsResponse
components:
  schemas:
    coinbase.public_rest_api.GetPortfolioFillsResponse:
      type: object
      properties:
        fills:
          title: Fills associated with the portfolio
          type: array
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.Fill'
        pagination:
          $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse'
    coinbase.public_rest_api.Fill:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the fill
          example: dc376e5b-84fa-4bdf-9f13-537b1bde8fc3
        order_id:
          type: string
          description: The order ID of the fill
          example: ba1115bc-7b3c-4b6b-ae38-585f3ab59271
        product_id:
          type: string
          description: The product ID of the fill
          example: BTC-USD
        client_product_id:
          type: string
          description: The client product ID of the fill indictating the settlment currency
          example: BTC-USDC
        side:
          $ref: '#/components/schemas/coinbase.public_rest_api.OrderSide'
        filled_quantity:
          type: string
          description: Filled size (in base asset units)
          example: '100'
        filled_value:
          type: string
          description: Filled value (in quote asset units)
          example: '25'
        price:
          type: string
          description: The price of the fill
          example: '140.91'
        time:
          type: string
          description: The date and time of the fill
          format: date-time
          example: '2021-05-31T11:59:59.000Z'
        commission:
          type: string
          description: The commission incurred for the fill
          example: '5.55'
        venue:
          type: string
          description: The name of the venue
          example: Coinbase
        venue_fees:
          type: string
          description: The venue fees incurred for the fill
          example: '2.50'
        ces_commission:
          type: string
          description: The CES commission incurred for the fill
          example: '1.25'
        product_type:
          $ref: '#/components/schemas/coinbase.public_rest_api.ProductType'
        commission_detail_total:
          $ref: '#/components/schemas/coinbase.public_rest_api.CommissionDetailTotal'
    coinbase.public_rest_api.PaginatedResponse:
      required:
        - has_next
        - next_cursor
        - sort_direction
      type: object
      properties:
        next_cursor:
          type: string
          description: Cursor to navigate to next page
        sort_direction:
          $ref: '#/components/schemas/coinbase.public_rest_api.SortDirection'
        has_next:
          type: boolean
          description: >-
            A boolean value indicating whether there are more items to paginate
            through
    coinbase.public_rest_api.OrderSide:
      title: Order side
      type: string
      description: |-
        - UNKNOWN_ORDER_SIDE: nil value
         - BUY: Buy order
         - SELL: Sell order
      enum:
        - BUY
        - SELL
    coinbase.public_rest_api.ProductType:
      title: ProductType represents the general type of product
      type: string
      description: |-
        - UNKNOWN_PRODUCT_TYPE: Unknown product type
         - SPOT: Spot product
         - FUTURE: Future product
      enum:
        - SPOT
        - FUTURE
    coinbase.public_rest_api.CommissionDetailTotal:
      type: object
      properties:
        total_commission:
          title: |-
            Total commission amount charged for the order
            This is the sum of all commission charged on the order
          type: string
        client_commission:
          title: Client commission on the trade
          type: string
          description: CB fee
        venue_commission:
          title: Venue Commission
          type: string
          description: Exchange fees
        ces_commission:
          title: CES Commission
          type: string
        financing_commission:
          title: Financing Commission
          type: string
        regulatory_commission:
          title: Regulatory Commission
          type: string
          description: NFA fees
        clearing_commission:
          title: Clearing Commission
          type: string
          description: Clearing fees
    coinbase.public_rest_api.SortDirection:
      type: string
      default: DESC
      enum:
        - DESC
        - ASC

````