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

# List Payments

> List all payments with filtering and pagination

<Note>
  This endpoint retrieves a paginated list of payments. Use filters to narrow results by status, date range, amount, and more.
</Note>

## Authentication

This endpoint requires a valid API key with `payments:read` permissions.

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Query Parameters

<ParamField query="limit" type="integer">
  Number of items to return (default: 20, max: 100)
</ParamField>

<ParamField query="starting_after" type="string">
  Cursor for pagination (payment ID)
</ParamField>

<ParamField query="ending_before" type="string">
  Cursor for reverse pagination (payment ID)
</ParamField>

<ParamField query="status" type="string">
  Filter by status: "pending", "processing", "succeeded", "failed", "cancelled"
</ParamField>

<ParamField query="customer_id" type="string">
  Filter by customer ID
</ParamField>

<ParamField query="order_id" type="string">
  Filter by order ID
</ParamField>

<ParamField query="invoice_id" type="string">
  Filter by invoice ID
</ParamField>

<ParamField query="payment_method_type" type="string">
  Filter by payment method: "card", "ach", "wire", "paypal"
</ParamField>

<ParamField query="created_from" type="string">
  Filter by creation date start (ISO 8601)
</ParamField>

<ParamField query="created_to" type="string">
  Filter by creation date end (ISO 8601)
</ParamField>

<ParamField query="amount_min" type="integer">
  Minimum amount in cents
</ParamField>

<ParamField query="amount_max" type="integer">
  Maximum amount in cents
</ParamField>

<ParamField query="currency" type="string">
  Filter by currency code
</ParamField>

### Response

<ResponseField name="object" type="string">
  Object type, always "list"
</ResponseField>

<ResponseField name="data" type="array">
  Array of payment objects
</ResponseField>

<ResponseField name="has_more" type="boolean">
  Whether more items exist
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://api.stateset.com/v1/payments?status=succeeded&limit=10' \
  --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```javascript Node.js theme={null}
  const payments = await stateset.payments.list({
    status: 'succeeded',
    limit: 10,
    created_from: '2024-01-01'
  });
  ```

  ```python Python theme={null}
  payments = stateset.payments.list(
    status='succeeded',
    limit=10,
    created_from='2024-01-01'
  )
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "object": "list",
    "data": [
      {
        "id": "pay_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
        "object": "payment",
        "amount": 15000,
        "currency": "USD",
        "status": "succeeded",
        "created_at": "2024-01-19T15:30:00Z",
        "payment_method": {
          "type": "card",
          "card": {
            "last4": "4242",
            "brand": "visa"
          }
        },
        "customer_id": "cust_abc123",
        "order_id": "order_123456",
        "description": "Payment for Order #123456"
      },
      {
        "id": "pay_7823f083-bb2c-54d6-bf6d-1b8e3fc75f41",
        "object": "payment",
        "amount": 25000,
        "currency": "USD",
        "status": "succeeded",
        "created_at": "2024-01-19T12:15:00Z",
        "payment_method": {
          "type": "ach",
          "ach": {
            "last4": "6789",
            "bank_name": "Chase"
          }
        },
        "customer_id": "cust_def456",
        "invoice_id": "inv_789012",
        "description": "Invoice payment"
      }
    ],
    "has_more": true,
    "url": "/v1/payments"
  }
  ```
</ResponseExample>
