# Close ticket

## closeTicket()

Closes the ticket when the customer clicks the "close" button. This should set the ticket status to "closed". This also must be the same one you have configure in the property "$closedStatusId" at the top of your integration ([statuses](https://docs.hostware.io/developer-documentation/module/support-integrations/statuses "mention"))

### Parameters

<table><thead><tr><th width="142">Type</th><th width="166">Name</th><th>Description</th></tr></thead><tbody><tr><td>Ticket</td><td>$ticket</td><td>The Ticket object of hostware. The $ticket->ticket_provider_external_id contains the external ticket id.</td></tr></tbody></table>

### Response

None

### Example Code

```php
public function closeTicket(Ticket $ticket) {
	$response = $this->makeRequest("conversations/{$ticket->ticket_provider_external_id}", "PUT", [
		"status" => "closed",
	]);
}
```

### Testing

You can test this function by closing a ticket as a customer.
