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

> Retrieve a list of invoices belonging to an entity.

Use the Prime SDK or CLI to test this endpoint by following the [quickstart](/prime/introduction/quickstart) guide and running with the following examples

<Tabs>
  <Tab title="Java">
    ```java theme={null}
    InvoiceService invoiceService = PrimeServiceFactory.createInvoiceService(client);

    ListInvoicesRequest request = new ListInvoicesRequest.Builder("ENTITY_ID_HERE").build();

    ListInvoicesResponse response = invoiceService.listInvoices(request);
    ```

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

  <Tab title=".NET">
    ```csharp wrap theme={null}
    var invoiceService = new InvoiceService(client);

    var request = new ListInvoicesRequest("ENTITY_ID_HERE");

    var response = invoiceService.ListInvoices(request);
    ```

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

  <Tab title="Go">
    ```go wrap theme={null}
    invoiceService := invoice.NewInvoiceService(client)

    request := &invoice.ListInvoicesRequest{
        EntityId: "ENTITY_ID_HERE",
    }

    response, err := invoiceService.ListInvoices(context.Background(), request)
    ```

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

  <Tab title="Python">
    ```python wrap theme={null}
    prime_client = PrimeClient(credentials)

    request = ListInvoicesRequest(
        entity_id="ENTITY_ID_HERE",
    )

    response = prime_client.list_invoices(request)
    ```

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

  <Tab title="CLI">
    ```bash wrap theme={null}
    primectl list-invoices --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 invoicesService = new InvoicesService(client);

    invoicesService.listInvoices({
        entityId: 'ENTITY_ID_HERE'
    }).then(async (response) => {
        console.log('Invoices: ', response);
    })
    ```

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


## OpenAPI

````yaml GET /v1/entities/{entity_id}/invoices
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/entities/{entity_id}/invoices:
    get:
      tags:
        - Invoice
      summary: List Invoices
      description: Retrieve a list of invoices belonging to an entity.
      operationId: PrimeRESTAPI_GetInvoices
      parameters:
        - name: entity_id
          in: path
          description: The entity ID
          required: true
          schema:
            type: string
        - name: states
          in: query
          description: Invoice states to filter the response
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - INVOICE_STATE_UNSPECIFIED
                - INVOICE_STATE_IMPORTED
                - INVOICE_STATE_BILLED
                - INVOICE_STATE_PARTIALLY_PAID
                - INVOICE_STATE_PAID
        - name: billing_year
          in: query
          description: Filter invoices by year
          schema:
            type: integer
            format: int32
        - name: billing_month
          in: query
          description: >-
            Integer representing the month to filter by, 1 for January, 12 for
            December
          schema:
            type: integer
            format: int32
        - name: cursor
          in: query
          description: Cursor used for pagination (last consumed record)
          schema:
            type: integer
            format: int32
        - name: limit
          in: query
          description: Number of items to retrieve
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_rest_api.GetInvoicesResponse
components:
  schemas:
    coinbase.public_rest_api.GetInvoicesResponse:
      type: object
      properties:
        invoices:
          type: array
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.Invoice'
    coinbase.public_rest_api.Invoice:
      title: Invoice
      type: object
      properties:
        id:
          type: string
        billing_month:
          type: integer
          format: int32
        billing_year:
          type: integer
          format: int32
        due_date:
          type: string
        invoice_number:
          type: string
        state:
          $ref: '#/components/schemas/coinbase.public_rest_api.InvoiceState'
        usd_amount_paid:
          type: number
          format: double
        usd_amount_owed:
          type: number
          format: double
        invoice_items:
          type: array
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.InvoiceItem'
    coinbase.public_rest_api.InvoiceState:
      title: States
      type: string
      default: INVOICE_STATE_UNSPECIFIED
      enum:
        - INVOICE_STATE_UNSPECIFIED
        - INVOICE_STATE_IMPORTED
        - INVOICE_STATE_BILLED
        - INVOICE_STATE_PARTIALLY_PAID
        - INVOICE_STATE_PAID
    coinbase.public_rest_api.InvoiceItem:
      title: Invoice item
      type: object
      properties:
        description:
          type: string
        currency_symbol:
          type: string
        invoice_type:
          $ref: '#/components/schemas/coinbase.public_rest_api.InvoiceType'
        rate:
          type: number
          format: double
        quantity:
          type: number
          format: double
        price:
          type: number
          format: double
        average_auc:
          type: number
          format: double
        total:
          type: number
          format: double
    coinbase.public_rest_api.InvoiceType:
      title: Types
      type: string
      default: INVOICE_TYPE_UNSPECIFIED
      enum:
        - INVOICE_TYPE_UNSPECIFIED
        - INVOICE_TYPE_AUC_FEE
        - INVOICE_TYPE_MINIMUM_FEE
        - INVOICE_TYPE_WITHDRAWAL_FEE
        - INVOICE_TYPE_NEW_WALLET_FEE
        - INVOICE_TYPE_STAKING_FEE

````