> 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/other/cloud-platforms.md).

# Cloud Platforms

Fetch cloud platform URLs for deals, invoices, quotations and tickets.

```php
Teamleader::cloudPlatforms()
```

|                          |                                                              |
| ------------------------ | ------------------------------------------------------------ |
| Class                    | `McoreServices\TeamleaderSDK\Resources\Other\CloudPlatforms` |
| Create / update / delete | — / — / —                                                    |
| Pagination               | No                                                           |

## Endpoints

* `cloudPlatforms.url`

## Filters

`list()` takes no filters.

## Accepted values

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

| Constant | Values                                   |
| -------- | ---------------------------------------- |
| `TYPES`  | `deal`, `invoice`, `quotation`, `ticket` |

## Methods

### `url()`

```php
url(string $type, string $id): array
```

Fetch cloud platform URL for a specific resource type and ID

* `$type` — Resource type (invoice, quotation, or ticket)
* `$id` — Resource UUID

**Throws** `InvalidArgumentException`

### `dealUrl()`

```php
dealUrl(string $dealId): array
```

Get cloud platform URL for an invoice Convenience method for invoice-specific URLs

* `$invoiceId` — Invoice UUID

### `invoiceUrl()`

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

### `quotationUrl()`

```php
quotationUrl(string $quotationId): array
```

Get cloud platform URL for a quotation Convenience method for quotation-specific URLs

* `$quotationId` — Quotation UUID

### `ticketUrl()`

```php
ticketUrl(string $ticketId): array
```

Get cloud platform URL for a ticket Convenience method for ticket-specific URLs

* `$ticketId` — Ticket UUID

### `batchUrls()`

```php
batchUrls(string $type, array $ids): array
```

Get cloud platform URLs for multiple resources of the same type This is a convenience method that calls the API multiple times

* `$type` — Resource type
* `$ids` — Array of resource UUIDs

**Throws** `InvalidArgumentException`

### `getUrl()`

```php
getUrl(string $type, string $id): string
```

**Throws** `TeamleaderException` When the call returns no URL — an error response used to raise an "undefined array key" warning and a TypeError instead

### `getDealUrl()`

```php
getDealUrl(string $dealId): string
```

### `getInvoiceUrl()`

```php
getInvoiceUrl(string $invoiceId): string
```

Extract just the URL string for an invoice

* `$invoiceId` — Invoice UUID

### `getQuotationUrl()`

```php
getQuotationUrl(string $quotationId): string
```

Extract just the URL string for a quotation

* `$quotationId` — Quotation UUID

### `getTicketUrl()`

```php
getTicketUrl(string $ticketId): string
```

Extract just the URL string for a ticket

* `$ticketId` — Ticket UUID

### `getSupportedTypes()`

```php
getSupportedTypes(): array
```

Get all supported resource types

### `isTypeSupported()`

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

Check if a resource type is supported

### `getResponseStructure()`

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

Get response structure documentation

### `list()`

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

Override list method as it's not supported for cloud platforms

### `info()`

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

Override info method as it's not supported for cloud platforms

## Examples

Get cloud platform URL for an invoice:

```php
$result = Teamleader::cloudPlatforms()->url("invoice", "invoice-uuid");
$url = $result["data"]["url"];
```

Get cloud platform URL for a quotation:

```php
$result = Teamleader::cloudPlatforms()->url("quotation", "quotation-uuid");
$url = $result["data"]["url"];
```

Get cloud platform URL for a ticket:

```php
$result = Teamleader::cloudPlatforms()->url("ticket", "ticket-uuid");
$url = $result["data"]["url"];
```

Redirect user to invoice in cloud platform:

```php
$result = Teamleader::cloudPlatforms()->url("invoice", $invoiceId);
return redirect($result["data"]["url"]);
```

Get cloud platform URLs for multiple resources:

```php
$invoiceIds = ["uuid1", "uuid2", "uuid3"];
$urls = [];

foreach ($invoiceIds as $id) {
    $result = Teamleader::cloudPlatforms()->url("invoice", $id);
    $urls[$id] = $result["data"]["url"];
}
```
