> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://useroot.docs.buildwithfern.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://useroot.docs.buildwithfern.com/_mcp/server.

# List payins

GET https://api.useroot.com/api/payins

Retrieves a paginated list of payins. Supports filtering by various criteria including payer name, amount range, creation date, rail type, status, and subaccount.

**Success Responses**

| Status Code | Description                                        |
| ----------- | -------------------------------------------------- |
| 200         | OK - The list of payins was successfully retrieved |

**Error Responses**

| Status Code | Error Code              | Description                                       |
| ----------- | ----------------------- | ------------------------------------------------- |
| 400         | VALIDATION\_ERROR       | The provided query parameters failed validation   |
| 400         | INVALID\_STATUS\_VALUES | One or more invalid status values were provided   |
| 401         | AUTHENTICATION\_ERROR   | Authentication credentials are invalid or missing |
| 403         | AUTHORIZATION\_ERROR    | You do not have permission to perform this action |

**Example Error Response for Invalid Status**

```http
{
  "error_code": "INVALID_STATUS_VALUES",
  "message": "Invalid status values: invalid_status, another_invalid",
  "details": {
    "invalid_statuses": ["invalid_status", "another_invalid"],
    "valid_statuses": ["approved", "canceled", "created", "debited", "failed", "initiated", "settled"]
  }
}
```

Reference: https://useroot.docs.buildwithfern.com/api-reference/payins-api/list-payins

## Authentication

- `x-api-key` header (required) — RootPay API key sent in the x-api-key header. Keys are environment-scoped: live_* for production, test_* for sandbox.

## Request

### Query parameters

- `cursor` (string, optional, nullable) — Cursor for pagination. Use the next_cursor from the previous response to get the next page.
- `limit` (integer, optional, default: 50) — Number of items to return per page. Maximum is 500.
- `payer_name` (string, optional, nullable) — Filter payins by a case-insensitive substring match on the payer's name.
- `amount_gte` (integer, optional, nullable) — Return payins whose amount_in_cents is greater than or equal to this value (in cents).
- `amount_lte` (integer, optional, nullable) — Return payins whose amount_in_cents is less than or equal to this value (in cents).
- `created_at_gte` (datetime, optional, nullable) — Return payins created on or after this date (YYYY-MM-DD).
- `created_at_lte` (datetime, optional, nullable) — Return payins created on or before this date (YYYY-MM-DD).
- `rail` (list of enum, optional, nullable) — Filter by rail (standard_ach, same_day_ach). Can provide multiple rails as separate parameters (e.g., ?rail=standard_ach&rail=same_day_ach).
  - Allowed values: `instant_card`, `instant_bank`, `same_day_ach`, `standard_ach`, `wire`, `{'instant_card', 'instant_bank'}`, `{'standard_ach', 'same_day_ach'}`, `{'standard_ach', 'wire'}`
- `status` (list of enum, optional, nullable) — Filter by the payin's latest status. Can provide multiple statuses as separate parameters (e.g., ?status=created&status=approved). Valid values: created, approved, initiated, debited, settled, failed, canceled.
  - Allowed values: `created`, `approved`, `initiated`, `debited`, `settled`, `failed`, `canceled`
- `subaccount_id` (string, optional, nullable) — Filter payins by subaccount ID. Only returns payins associated with the specified subaccount.

## Response

### 200

List of payins retrieved successfully

- `data` (list of object, required)
  - `id` (string, required)
  - `payer_id` (string, required)
  - `amount_in_minor_units` (integer, required) — Amount in the currency's minor units (e.g. cents for USD).
  - `currency_code` (string, required)
  - `rail` (string, required)
  - `status` (enum, required) — Current status of the payin. One of: created, approved, initiated, debited, settled, failed, canceled.
    - Allowed values: `created`, `approved`, `initiated`, `debited`, `settled`, `failed`, `canceled`
  - `status_recorded_at` (datetime, required)
  - `payin_metadata` (map from string to any, required)
  - `created_at` (datetime, required)
  - `updated_at` (datetime, required)
  - `amount_in_cents` (integer, required, deprecated) — Deprecated. Use amount_in_minor_units instead. Still accepted and returned for backward compatibility.
  - `client_metadata` (map from string to any, optional)
  - `scheduled_date` (date, optional, nullable) — Caller-chosen send day in the schedule timezone (currently America/New_York), or null when immediate.
- `has_more` (boolean, required)
- `total_count` (integer, optional, nullable, default: 0)
- `next_cursor` (string, optional, nullable)
- `previous_cursor` (string, optional, nullable)

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "789e0123-e89b-12d3-a456-426614174000",
      "payer_id": "456e7890-e89b-12d3-a456-426614174001",
      "amount_in_minor_units": 25000,
      "currency_code": "USD",
      "rail": "standard_ach",
      "status": "created",
      "status_recorded_at": "2024-03-20T12:00:00Z",
      "payin_metadata": {
        "payment_method": {
          "account_last_four": "1234",
          "routing_number": "021000021"
        },
        "payer": {
          "name": "John Smith",
          "email": "john.smith@example.com"
        }
      },
      "created_at": "2024-03-20T12:00:00Z",
      "updated_at": "2024-03-20T12:00:00Z",
      "amount_in_cents": 25000,
      "client_metadata": {}
    },
    {
      "id": "789e0123-e89b-12d3-a456-426614174000",
      "payer_id": "456e7890-e89b-12d3-a456-426614174001",
      "amount_in_minor_units": 25000,
      "currency_code": "USD",
      "rail": "standard_ach",
      "status": "initiated",
      "status_recorded_at": "2024-03-20T12:01:00Z",
      "payin_metadata": {
        "payment_method": {
          "account_last_four": "1234",
          "routing_number": "021000021",
          "end_to_end_id": "ACH20240320123456789"
        },
        "payer": {
          "name": "John Smith",
          "email": "john.smith@example.com"
        }
      },
      "created_at": "2024-03-20T12:00:00Z",
      "updated_at": "2024-03-20T12:00:00Z",
      "amount_in_cents": 25000,
      "client_metadata": {}
    },
    {
      "id": "789e0123-e89b-12d3-a456-426614174002",
      "payer_id": "456e7890-e89b-12d3-a456-426614174001",
      "amount_in_minor_units": 50000,
      "currency_code": "USD",
      "rail": "same_day_ach",
      "status": "created",
      "status_recorded_at": "2024-03-20T12:00:00Z",
      "payin_metadata": {
        "payment_method": {
          "account_last_four": "1234",
          "routing_number": "021000021"
        },
        "payer": {
          "name": "John Smith",
          "email": "john.smith@example.com"
        }
      },
      "created_at": "2024-03-20T12:00:00Z",
      "updated_at": "2024-03-20T12:00:00Z",
      "amount_in_cents": 50000,
      "client_metadata": {}
    },
    {
      "id": "789e0123-e89b-12d3-a456-426614174003",
      "payer_id": "456e7890-e89b-12d3-a456-426614174001",
      "amount_in_minor_units": 25000,
      "currency_code": "USD",
      "rail": "standard_ach",
      "status": "canceled",
      "status_recorded_at": "2024-03-20T12:05:00Z",
      "payin_metadata": {
        "payment_method": {
          "account_last_four": "1234",
          "routing_number": "021000021"
        },
        "payer": {
          "name": "John Smith",
          "email": "john.smith@example.com"
        }
      },
      "created_at": "2024-03-20T12:00:00Z",
      "updated_at": "2024-03-20T12:00:00Z",
      "amount_in_cents": 25000,
      "client_metadata": {}
    }
  ],
  "has_more": false,
  "total_count": 4
}
```

**SDK Code**

```python List of payins
import requests

url = "https://api.useroot.com/api/payins"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript List of payins
const url = 'https://api.useroot.com/api/payins';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go List of payins
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.useroot.com/api/payins"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby List of payins
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payins")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java List of payins
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.useroot.com/api/payins")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php List of payins
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.useroot.com/api/payins', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp List of payins
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payins");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift List of payins
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/payins")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```