---
title: "List Payments"
method: GET
path: "/billing/payment/table"
tags: ["provider", "billing"]
---

# List Payments

`GET /billing/payment/table`

This endpoint aggregates patient payments and insurance payments into a single table,
then filters them according to the PaymentFetchParams. Using DISTINCT on JSON requires
either casting them to JSONB (with an equality operator) or removing DISTINCT. Here, we
cast to JSONB so that Postgres can do equality checks on the JSON objects.

## Query parameters

- `page` integer, nullable
- `per_page` integer, nullable
- `sort_by` string, nullable
- `sort_direction` 'asc' | 'desc', nullable
- `location_id` string, nullable
- `id` string, nullable
- `payer` string, nullable
- `external_patient_id` string, nullable
- `payer_type` string, nullable
- `amount` integer[], nullable
- `last4` string, nullable
- `comment` string, nullable
- `payment_mediums` string[], nullable
- `status` PaymentStatus[], nullable
- `type` string, nullable
- `tags` string[], nullable
- `created_date` union
  - string[]
  - string
- `tz` string, nullable
- `location_ids` string[], nullable
- `creator_name` string, nullable
- `merchant_account_ids` string[], nullable

## Headers

- `TENANT` string, required
- `API-KEY` string, required

## Response `200`

Successful Response

- PaymentTable
  - `items` PagePaymentTableItem, required
    - `data` PaymentTableItem[], required
      - `id` string, required
      - `firstName` string, nullable
      - `lastName` string, nullable
      - `patientId` string, nullable
      - `externalPatientId` string, nullable
      - `email` string, nullable
      - `phoneNumber` string, nullable
      - `comment` string, nullable
      - `amount` integer, required
      - `currency` string, required
      - `status` string, required
      - `paymentMedium` string, required
      - `fee` integer, required
      - `feeToPatient` integer, required
      - `paymentMethod` PaymentMethodSummary
        - `id` string, required
        - `patientId` string, nullable, required
        - `rainforestPaymentMethodId` string, required
        - `brand` string, nullable, required
        - `last4` string, nullable, required
        - `expMonth` integer, nullable, required
        - `expYear` integer, nullable, required
        - `accountHolderType` string, nullable, required
        - `accountNumberLast4` integer, nullable, required
        - `bankName` string, nullable, required
        - `routingNumber` integer, nullable, required
        - `description` string, nullable, required
        - `type` 'CARD' | 'ACH' | 'APPLE_PAY', required
        - `isDefault` boolean
        - `isArchived` boolean
      - `createdDate` string, date-time, required
      - `refunds` TableRefundOutput[], required
        - `id` string, required
        - `amount` integer, required
        - `reason` 'DUPLICATE' | 'DISPUTE' | 'BOOKING_FEE' | 'OTHER', required
        - `createdDate` string, date-time, required
        - `description` string, nullable
        - `creator` UserTiny
          - `id` string, required — The unique identifier for the user.
          - `firstName` string, nullable — The user's first name.
          - `lastName` string, nullable — The user's last name.
          - `phoneNumber` string, nullable — The user's phone number.
          - `email` string, nullable — The user's email address.
          - `type` 'PROVIDER' | 'PATIENT' | 'ASSISTANT', required
          - `locationId` string, nullable — The location of the user.
      - `creator` UserTiny
        - `id` string, required — The unique identifier for the user.
        - `firstName` string, nullable — The user's first name.
        - `lastName` string, nullable — The user's last name.
        - `phoneNumber` string, nullable — The user's phone number.
        - `email` string, nullable — The user's email address.
        - `type` 'PROVIDER' | 'PATIENT' | 'ASSISTANT', required
        - `locationId` string, nullable — The location of the user.
      - `isPaymentPlan` boolean, required
      - `items` ItemWithQuantity[] — List of items with their quantities and prices
        - `itemName` string, required
        - `description` string, nullable
        - `chargeId` string, nullable
        - `discountReason` string, nullable
        - `discountAmount` integer, nullable
        - `discountPercentage` number, nullable
        - `quantity` integer, required
        - `unit` string, nullable
        - `pricePerItem` integer, required
        - `itemType` string, nullable
      - `isInsurancePayment` boolean, required
      - `locationId` string, nullable
    - `total` integer, required
  - `hasInsurancePayments` boolean, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/decodahealth/apis/decoda-api.md) · [All operations](https://skmtc.dev/decodahealth/apis/decoda-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/decodahealth/decoda-api/revisions/4939a65a89d2/schema)
