> 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-terms.md).

# Payment Terms

Manage payment terms in Teamleader Focus.

```php
Teamleader::paymentTerms()
```

|                          |                                                                |
| ------------------------ | -------------------------------------------------------------- |
| Class                    | `McoreServices\TeamleaderSDK\Resources\Invoicing\PaymentTerms` |
| Also available as        | `payment_terms()`                                              |
| Create / update / delete | — / — / —                                                      |
| Pagination               | No                                                             |

## Endpoints

* `paymentTerms.list`

## Filters

`list()` takes no filters.

## Methods

### `list()`

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

List all payment terms

`paymentTerms.list` takes no request body — no filter, page or sort parameter exists for it. Arguments are rejected rather than discarded.

The response carries a `meta.default` key holding the UUID of the account's default payment term. That is a bespoke meta block, unrelated to the `includes=pagination` metadata other endpoints return.

* `$filters` — Must be empty — this endpoint accepts no filters
* `$options` — Must be empty — this endpoint accepts no sorting or pagination

**Throws** `InvalidArgumentException` When any argument is passed

### `getDefault()`

```php
getDefault(): ?array
```

Get the default payment term

### `getDefaultId()`

```php
getDefaultId(): ?string
```

Get the default payment term ID

### `findByType()`

```php
findByType(string $type): array
```

Find payment terms by type

* `$type` — Payment term type (cash, end\_of\_month, after\_invoice\_date)

### `findByDays()`

```php
findByDays(int $days, ?string $type = null): ?array
```

Find a payment term by number of days

* `$days` — Number of days
* `$type` — Optional payment term type to filter by

### `find()`

```php
find(string $id): ?array
```

Find a payment term by ID

* `$id` — Payment term UUID

### `exists()`

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

Check if a payment term exists by ID

* `$id` — Payment term UUID

### `asOptions()`

```php
asOptions(): array
```

Get payment terms formatted as options for select dropdowns

### `formatPaymentTermDescription()`

```php
formatPaymentTermDescription(array $term): string
```

Format a payment term as a human-readable description

* `$term` — Payment term data

### `cash()`

```php
cash(): array
```

Get cash payment terms (immediate payment)

### `endOfMonth()`

```php
endOfMonth(): array
```

Get end of month payment terms

### `afterInvoiceDate()`

```php
afterInvoiceDate(): array
```

Get after invoice date payment terms

### `isValidType()`

```php
isValidType(string $type): bool
```

Validate payment term type

### `getResponseStructure()`

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

Get response structure documentation

## Examples

Get all payment terms:

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

Get the default payment term:

```php
$defaultTerm = Teamleader::paymentTerms()->getDefault();
```

Find payment terms by type:

```php
$cashTerms = Teamleader::paymentTerms()->findByType("cash");
```

Find payment terms by number of days:

```php
$term = Teamleader::paymentTerms()->findByDays(30);
```

Get payment terms as key-value pairs for dropdowns:

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