---
id: payments-list
title: Payments List
description: Paginated table of payments with filtering, export, and quick actions for ops teams.
sidebar_position: 31
---

import {
  CodeBlock,
  PropsMarkdownTable,
  PartsMarkdownTable,
  getPropsFromDocs,
  getComponentParts,
  getWebcomponentsVersion,
  ComponentBox,
  setUpMocks,
} from '../helpers';
import docsJson from '../docs.json';
import componentTreeJson from '../component-tree.json';
import '@justifi/webcomponents/dist/module/justifi-payments-list';

{setUpMocks()}

## Overview

Component to render a formated list of payments for the requested account.

## Props, Events & Methods

<PropsMarkdownTable
  props={getPropsFromDocs('justifi-payments-list', docsJson)}
/>

### Events

- `click-event`: emitted when users select a row or click an inline action; `event.detail` surfaces `payment_id`.
- `error-event`: surfaces API or token errors for logging.

## Theming & Layout

<PartsMarkdownTable
  parts={getComponentParts('justifi-payments-list', componentTreeJson)}
/>

# Example Usage

---

<ComponentBox>
  <justifi-payments-list account-id="123" auth-token="123abc" />
</ComponentBox>

---

<CodeBlock>{`<!DOCTYPE html>
<html dir="ltr" lang="en">

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
  <title>justifi-payments-list</title>

<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@justifi/webcomponents@${getWebcomponentsVersion()}/dist/webcomponents/webcomponents.esm.js"
></script>

<script
  nomodule
  src="https://cdn.jsdelivr.net/npm/@justifi/webcomponents@${getWebcomponentsVersion()}/dist/webcomponents/webcomponents.js"
></script>

  <style>
      ::part(font-family) {
        font-family: georgia;   
      }
        
      ::part(color) {
        color: darkslategray;
      }

      ::part(background-color) {
        background-color: transparent;
      }
    </style>

</head>

<body>
  <!-- Optional: add the filters component -->
  <justifi-filters
    account-id="acc_123"
    auth-token="authToken"
    target="payments"
  ></justifi-filters>
  <justifi-payments-list
    account-id="acc_123"
    auth-token="authToken"
    columns="created_at,customer_name,payment_amount,status"
  />
</body>

<script>
  (function () {
    const paymentsList = document.querySelector('justifi-payments-list');

    paymentsList.addEventListener('click-event', (event) => {
      // 'click-event' is emitted when a user clicks on a table row, or clicks on the next or previous page buttons
      // event.detail.name describes the action that was clicked - it could be 'nextPage', 'previousPage', or 'tableRow'
      // event.detail.data will be included if the action was 'tableRow', and will contain the data for the row that was clicked
      
      if (event.detail.name === 'tableRow') {
        // Here is where you would handle the click event
        console.log('data from click-event', event.detail.data);
      }
    });

    paymentsList.addEventListener('error-event', (event) => {
      // here is where you would handle the error
      console.error('error-event', event.detail);
    });
  })();
</script>

</html>`}</CodeBlock>
