> 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/deals/quotations.md).

# Quotations

Manage quotations in Teamleader Focus.

```php
Teamleader::quotations()
```

|                          |                                                                       |
| ------------------------ | --------------------------------------------------------------------- |
| Class                    | `McoreServices\TeamleaderSDK\Resources\Deals\Quotations`              |
| Create / update / delete | ✓ / ✓ / ✓                                                             |
| Pagination               | `page_size` / `page_number`; no totals — a short page is the last one |

## Endpoints

* `quotations.accept`
* `quotations.create`
* `quotations.delete`
* `quotations.download`
* `quotations.info`
* `quotations.list`
* `quotations.send`
* `quotations.update`

## Filters

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

| Filter | Description                           |
| ------ | ------------------------------------- |
| `ids`  | Array of quotation UUIDs to filter by |

## Includes

`list()` and `info()` accept the same includes:

`expiry`

## Accepted values

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

| Constant          | Values                                                                                                                                                                                                           |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DISCOUNT_TYPES`  | `percentage`                                                                                                                                                                                                     |
| `EXPIRY_ACTIONS`  | `lock`, `none`                                                                                                                                                                                                   |
| `RECIPIENT_TYPES` | `contact`, `company`                                                                                                                                                                                             |
| `SENDER_TYPES`    | `user`, `department`                                                                                                                                                                                             |
| `SEND_FIELDS`     | `quotations`, `from`, `recipients`, `subject`, `content`, `language`, `attachments`                                                                                                                              |
| `SEND_LANGUAGES`  | `en`, `nl`, `fr`, `ch`, `jp`, `de`, `es`, `pt`, `it`, `gr`, `tr`, `cs`, `so`, `sk`, `ru`, `ko`, `ir`, `iq`, `hu`, `gh`, `bg`, `bs`, `br`, `ar`, `ag`, `al`, `af`, `ro`, `pl`, `ca`, `da`, `uk`, `no`, `fi`, `sv` |
| `STATUSES`        | `open`, `accepted`, `refused`, `expired`                                                                                                                                                                         |
| `UPDATE_FIELDS`   | `name`, `currency`, `grouped_lines`, `text`, `document_template_id`, `discounts`, `expiry`                                                                                                                       |

## Methods

### `info()`

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

Get quotation information

* `$id` — Quotation UUID
* `$includes` — `expiry` — returned when the account has access to quotation expiry

**Throws** `InvalidArgumentException` When another include is requested

### `withExpiry()`

```php
withExpiry(): self
```

Include the `expiry` block in the next list() or info() request

### `create()`

```php
create(array $data): array
```

Create a new quotation

quotations.create requires `deal_id` and nothing else. Before v2.2.5 the SDK also required grouped\_lines or text, which the specification does not.

* `$data` — Quotation data

**Throws** `InvalidArgumentException`

### `update()`

```php
update(string $id, array $data): array
```

Update a quotation

* `$id` — Quotation UUID
* `$data` — Updated quotation data

**Throws** `InvalidArgumentException`

### `delete()`

```php
delete(string $id): array
```

Delete a quotation

* `$id` — Quotation UUID

### `accept()`

```php
accept(string $id): array
```

Mark a quotation as accepted

* `$id` — Quotation UUID

### `send()`

```php
send(array $data): array
```

Send one or more quotations via email

* `$data` — Send parameters including quotations, sender, recipients, subject, content, and language

### `download()`

```php
download(string $id, string $format = 'pdf'): array
```

Download a quotation in a specific format

* `$id` — Quotation UUID
* `$format` — Download format (default: 'pdf')

### `byIds()`

```php
byIds(array $ids): array
```

Get quotations by specific IDs

* `$ids` — Array of quotation UUIDs

### `list()`

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

List quotations with enhanced filtering and pagination

* `$filters` — Filters to apply
* `$options` — Additional options (pagination via page.size / page.number)

### `byStatus()`

> **Deprecated** since v2.2.2 — quotations.list has no `status` filter. The API ignored it and returned every quotation, so this method never filtered anything. Fetch and filter client-side on `data[].status`. Removed in v3.0.

```php
byStatus($status): array
```

Get quotations by status

* `$status` — Single status or array of statuses

**Throws** `InvalidArgumentException` Always

### `getResponseStructure()`

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

Get response structure documentation

## Examples

Get all quotations:

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

Get specific quotations by ID:

```php
$quotations = Teamleader::quotations()->list(['ids' => ['uuid1', 'uuid2']]);
```

Get a single quotation:

```php
$quotation = Teamleader::quotations()->info('quotation-uuid');
```

Get a quotation with its expiry settings:

```php
$quotation = Teamleader::quotations()->withExpiry()->info('quotation-uuid');
```

Create a new quotation:

```php
$quotation = Teamleader::quotations()->create(['deal_id' => 'deal-uuid', 'currency' => ['code' => 'EUR'], 'grouped_lines' => [...]]);
```

Update a quotation:

```php
Teamleader::quotations()->update('quotation-uuid', ['grouped_lines' => [...]]);
```

Accept a quotation:

```php
Teamleader::quotations()->accept('quotation-uuid');
```

Send a quotation via email:

```php
Teamleader::quotations()->send(['quotations' => ['uuid1'], 'from' => [...], 'recipients' => [...], 'subject' => '...', 'content' => '...', 'language' => 'en']);
```

Download a quotation as PDF:

```php
$download = Teamleader::quotations()->download('quotation-uuid', 'pdf');
```
