# Yêu cầu huỷ dịch vụ

`POST /v1/service/@id/cancel` · quyền `services:write`

Gửi yêu cầu huỷ dịch vụ.

## HTTP request

| Mục | Giá trị |
| --- | --- |
| URL | `https://api.tino.vn/v1/service/@id/cancel` |
| Method | `POST` |
| Quyền (scope) | `services:write` |
| Header | `Authorization: Bearer <token>` |
| Content-Type | `application/json` |
| Token gọi được | token ứng dụng (`tinoat_`), token API cá nhân (`tinopat_`) |

## Tham số

| Tên | Vị trí | Kiểu | Bắt buộc | Mô tả |
| --- | --- | --- | --- | --- |
| `id` | đường dẫn | string | có | ID dịch vụ |
| `immediate` | body | string | không | set to false to terminate service at the end of billing date, true - terminate immediately |
| `reason` | body | string | không | Reason for this request |

## Example request

```bash
curl -X POST "https://api.tino.vn/v1/service/100001/cancel" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "immediate": "<immediate>",
  "reason": "<reason>"
}'
```

`$TINO_TOKEN` là token có quyền `services:write`. Tham số đường dẫn trong ví dụ là giá trị mẫu.

SDK ([SDK & Ví dụ](/docs/sdk)): Python `client.services.cancel(id, id=...)`, Node.js `await client.services.cancel(id, { id: ... });`, PHP `$client->services->cancel($id, ['id' => ...]);`.

## Example response

```json
{
 "info": [
  "cancell_sent"
 ]
}
```

Mẫu thật từ tài khoản thử, đã che dữ liệu cá nhân; mảng và chuỗi dài được rút gọn (`… N more item(s)`, `… N more line(s)`).
