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

# List all Payments

export const get_pagination_defaults = (resource_name = 'records') => [{
  name: 'from_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on or after the date provided.`
}, {
  name: 'to_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on or before the date provided.`
}, {
  name: 'page',
  type: 'string',
  required: false,
  description: `The page number to return.`
}, {
  name: 'page_cursor',
  type: 'string',
  required: false,
  description: <>
        The ID of a resource from which a page should start or end. Mutually exclusive with <code>page</code>.
      </>
}, {
  name: 'page_limit',
  type: 'string',
  required: false,
  description: `The number of ${resource_name} to return per page. Default and maximum is 100.`
}];

export const ParamList = ({items = [], is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen || false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map((enum_item, index) => <div key={`enum-${index}`}>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </div>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns a list of Payment objects.

## Query Parameters

<ParamList
  items={[
{
name: 'source',
type: 'string',
required: false,
description: 'The ID of the Payment\'s source.',
},
{
name: 'destination',
type: 'string',
required: false,
description: 'The ID of the Payment\'s destination.',
},
{
name: 'acc_id',
type: 'string',
required: false,
description: 'The ID of either the Payment\'s source or destination.',
},
{
name: 'source_holder_id',
type: 'string',
required: false,
description: 'The ID of the Payment\'s source holder (Entity).',
},
{
name: 'destination_holder_id',
type: 'string',
required: false,
description: 'The ID of the Payment\'s destination holder (Entity).',
},
{
name: 'holder_id',
type: 'string',
required: false,
description: 'The ID of either of the Payment\'s source or destination holder (Entity).',
},
{
name: 'status',
type: 'string',
required: false,
description: 'The Payment\'s status.',
},
...get_pagination_defaults('Payments'),
]}
/>

## Returns

Returns a list of Payment objects.

<RequestExample>
  ```bash cURL theme={null}
  curl "https://production.methodfi.com/payments?from_date=2024-03-13&to_date=2024-03-15&status=pending" \
    -H "Method-Version: 2026-03-30" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js theme={null}
  const payments = await method.payments.list({
    from_date: '2024-03-13',
    to_date: '2024-03-15',
    status: 'pending',
  });
  ```

  ```python Python theme={null}
  payments = method.payments.list({
    'from_date': '2024-03-13',
    'to_date': '2024-03-15',
    'status': 'pending'
  })
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "data": [
      {
        "id": "pmt_VeCfmkwGKb",
        "source": "acc_hmap9mbgfLcf9",
        "destination": "acc_YXDrjADGjC76U",
        "amount": 5000,
        "description": "Loan Pmt",
        "status": "processing",
        "estimated_completion_date": "2024-03-21",
        "source_trace_id": "203942084920",
        "source_settlement_date": "2024-03-15",
        "source_status": "sent",
        "destination_trace_id": "304820184832",
        "destination_settlement_date": "2024-03-21",
        "destination_status": "processing",
        "destination_payment_method": "electronic",
        "reversal_id": null,
        "reversal_account": "acc_hmap9mbgfLcf9",
        "payment_instrument": null,
        "fee": null,
        "type": "standard",
        "error": null,
        "metadata": null,
        "created_at": "2024-03-14T16:15:26.074Z",
        "updated_at": "2024-03-14T16:15:26.074Z"
      }
    ]
  }
  ```
</ResponseExample>
