# Gia hạn tên miền

`POST /v1/domain/@id/renew` · quyền `domains:write`

Tạo đơn gia hạn tên miền; trả số đơn, hoá đơn và tổng tiền.

## HTTP request

| Mục | Giá trị |
| --- | --- |
| URL | `https://api.tino.vn/v1/domain/@id/renew` |
| Method | `POST` |
| Quyền (scope) | `domains: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 tên miền |
| `years` | body | string | không | Number of years |
| `pay_method` | body | integer | không | Payment method ID |

## Example request

```bash
curl -X POST "https://api.tino.vn/v1/domain/200001/renew" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "years": "<years>",
  "pay_method": "<pay_method>"
}'
```

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

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

## Example response

```json
{
 "order_num": 626303876,
 "invoice_id": "1201939",
 "total": "588109",
 "items": [
  {
   "type": "Domain Renew",
   "id": "200001",
   "name": "example.com",
   "product_id": "1435"
  }
 ]
}
```

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)`).
