> For the complete documentation index, see [llms.txt](https://teamleader-sdk.mcore-services.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://teamleader-sdk.mcore-services.dev/api-reference/invoicing/payment-methods.md).

# Payment Methods

Manage payment methods in Teamleader Focus.

```php
Teamleader::paymentMethods()
```

|                          |                                                                       |
| ------------------------ | --------------------------------------------------------------------- |
| Class                    | `McoreServices\TeamleaderSDK\Resources\Invoicing\PaymentMethods`      |
| Also available as        | `payment_methods()`                                                   |
| Create / update / delete | — / — / —                                                             |
| Pagination               | `page_size` / `page_number`; no totals — a short page is the last one |

## Endpoints

* `paymentMethods.list`

## Filters

Passed as the first argument to `list()`. Any other key throws.

| Filter   | Description                          |
| -------- | ------------------------------------ |
| `ids`    | Array of payment method UUIDs        |
| `status` | Array of statuses (active, archived) |

## Methods

### `list()`

```php
list(array $filters = [], array $options = []): array
```

List payment methods with filtering and pagination

* `$filters` — Filter parameters
* `$options` — Pagination options

### `active()`

```php
active(array $additionalFilters = [], array $options = []): array
```

Get active payment methods

* `$additionalFilters` — Additional filters to apply
* `$options` — Pagination options

### `archived()`

```php
archived(array $additionalFilters = [], array $options = []): array
```

Get archived payment methods

* `$additionalFilters` — Additional filters to apply
* `$options` — Pagination options

### `byIds()`

```php
byIds(array $ids, array $options = []): array
```

Get payment methods by specific IDs

* `$ids` — Array of payment method UUIDs
* `$options` — Pagination options

### `findByName()`

```php
findByName(string $name, bool $activeOnly = true): ?array
```

Find a payment method by name

* `$name` — Payment method name to search for
* `$activeOnly` — Whether to search only active payment methods

### `exists()`

```php
exists(string $id): bool
```

Check if a payment method exists by ID

* `$id` — Payment method UUID

### `all()`

```php
all(array $filters = [], int $maxPages = 10): array
```

Get all payment methods (convenience method that handles pagination)

* `$filters` — Filters to apply
* `$maxPages` — Maximum number of pages to fetch (default: 10)

### `asOptions()`

```php
asOptions(bool $activeOnly = true): array
```

Get payment methods formatted as options for select dropdowns

* `$activeOnly` — Whether to include only active payment methods

### `getResponseStructure()`

```php
getResponseStructure(): array
```

Get response structure documentation

## Examples

Get all payment methods:

```php
$paymentMethods = Teamleader::paymentMethods()->list();
```

Get specific payment methods by IDs:

```php
$paymentMethods = Teamleader::paymentMethods()->byIds(['uuid1', 'uuid2']);
```

Get only active payment methods:

```php
$paymentMethods = Teamleader::paymentMethods()->active();
```

Get only archived payment methods:

```php
$paymentMethods = Teamleader::paymentMethods()->archived();
```

Find a payment method by name:

```php
$method = Teamleader::paymentMethods()->findByName("Credit Card");
```

Get payment methods as key-value pairs for dropdowns:

```php
$options = Teamleader::paymentMethods()->asOptions();
```
