> 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/expenses/bookkeeping-submissions.md).

# Bookkeeping Submissions

Manage bookkeeping submissions for expense documents in Teamleader Focus.

```php
Teamleader::bookkeepingSubmissions()
```

|                          |                                                                         |
| ------------------------ | ----------------------------------------------------------------------- |
| Class                    | `McoreServices\TeamleaderSDK\Resources\Expenses\BookkeepingSubmissions` |
| Create / update / delete | — / — / —                                                               |
| Pagination               | No                                                                      |

## Endpoints

* `bookkeepingSubmissions.list`

## Filters

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

| Filter    | Description                                          |
| --------- | ---------------------------------------------------- |
| `subject` | REQUIRED: Filter by financial document (id and type) |

## Accepted values

Public constants on the class. Body fields and enum values outside these lists throw before the request is sent.

| Constant        | Values                                             |
| --------------- | -------------------------------------------------- |
| `STATUSES`      | `sending`, `confirmed`, `failed`                   |
| `SUBJECT_TYPES` | `incomingInvoice`, `incomingCreditNote`, `receipt` |

## Methods

### `list()`

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

List bookkeeping submissions for a specific financial document

Note: The subject filter (document id and type) is REQUIRED by the API

* `$filters` — Filters to apply (must include subject with id and type)
* `$options` — Additional options (not used for this endpoint)

**Throws** `InvalidArgumentException` When subject filter is missing or invalid

### `forDocument()`

```php
forDocument(string $documentId, string $documentType): array
```

Get bookkeeping submissions for a specific financial document

* `$documentId` — UUID of the financial document
* `$documentType` — incomingInvoice, incomingCreditNote or receipt

**Throws** `InvalidArgumentException` When document type is invalid

### `forInvoice()`

```php
forInvoice(string $invoiceId): array
```

Get bookkeeping submissions for an incoming invoice

* `$invoiceId` — UUID of the incoming invoice

### `forCreditNote()`

```php
forCreditNote(string $creditNoteId): array
```

Get bookkeeping submissions for an incoming credit note

* `$creditNoteId` — UUID of the incoming credit note

### `forReceipt()`

```php
forReceipt(string $receiptId): array
```

Get bookkeeping submissions for a receipt

* `$receiptId` — UUID of the receipt

### `byStatus()`

```php
byStatus(string $documentId, string $documentType, string $status): array
```

Filter submissions by status

* `$documentId` — UUID of the financial document
* `$documentType` — Type of document
* `$status` — Status to filter by: sending, confirmed, or failed

**Throws** `InvalidArgumentException` When status is invalid

### `confirmed()`

```php
confirmed(string $documentId, string $documentType): array
```

Get confirmed submissions for a document

* `$documentId` — UUID of the financial document
* `$documentType` — Type of document

### `failed()`

```php
failed(string $documentId, string $documentType): array
```

Get failed submissions for a document

* `$documentId` — UUID of the financial document
* `$documentType` — Type of document

### `sending()`

```php
sending(string $documentId, string $documentType): array
```

Get sending submissions for a document

* `$documentId` — UUID of the financial document
* `$documentType` — Type of document

### `latest()`

```php
latest(string $documentId, string $documentType): ?array
```

Get the latest submission for a document

* `$documentId` — UUID of the financial document
* `$documentType` — Type of document

### `hasConfirmed()`

```php
hasConfirmed(string $documentId, string $documentType): bool
```

Check if a document has any confirmed submissions

* `$documentId` — UUID of the financial document
* `$documentType` — Type of document

### `hasFailed()`

```php
hasFailed(string $documentId, string $documentType): bool
```

Check if a document has any failed submissions

* `$documentId` — UUID of the financial document
* `$documentType` — Type of document

### `statistics()`

```php
statistics(string $documentId, string $documentType): array
```

Get submission statistics for a document

* `$documentId` — UUID of the financial document
* `$documentType` — Type of document

### `info()`

```php
info($id, $includes = null): array
```

Override info method as individual submission info is not supported

**Throws** `InvalidArgumentException`

## Examples

Get all bookkeeping submissions for a specific document:

```php
$submissions = Teamleader::bookkeepingSubmissions()->forDocument("document-uuid", "incomingInvoice");
```

Get submissions for an incoming invoice:

```php
$submissions = Teamleader::bookkeepingSubmissions()->forInvoice("invoice-uuid");
```

Get submissions for an incoming credit note:

```php
$submissions = Teamleader::bookkeepingSubmissions()->forCreditNote("credit-note-uuid");
```

Get submissions for a receipt:

```php
$submissions = Teamleader::bookkeepingSubmissions()->forReceipt("receipt-uuid");
```
