# Renew domain

`POST /v1/domain/@id/renew` · scope `domains:write`

Create a domain renewal order; returns the order number, invoice and total amount.

## HTTP request

| Item | Value |
| --- | --- |
| URL | `https://api.tino.vn/v1/domain/@id/renew` |
| Method | `POST` |
| Scope | `domains:write` |
| Header | `Authorization: Bearer <token>` |
| Content-Type | `application/json` |
| Tokens that can call it | app tokens (`tinoat_`), personal API tokens (`tinopat_`) |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Domain ID |
| `years` | body | string | no | Number of years |
| `pay_method` | body | integer | no | 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` is a token with the scope `domains:write`. Path parameters in the example are sample values.

SDK ([SDK & examples](/en/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"
  }
 ]
}
```

Live sample from a test account with personal data masked; long arrays and strings are trimmed (`… N more item(s)`, `… N more line(s)`).
