Skip to content

Change a domain's renewal period

POST /api/v2/domains/{id}/billing-cycle

Change how many years a domain renews for at a time. Read GET /api/v2/domains/{id}/billing-cycle right before. Send only a period that appears in that GET response’s options[]. Send billingCycle for 1, 2 or 3 years. Send periodYears for a longer row. When you send both, they must name the same period. A period the domain does not offer returns 400 invalid_request. So does any change on a premium domain. The new period and its price apply from the next renewal. No invoice is created now. An unpaid renewal or another open order returns 409 existing_invoice_blocking. The order is then in pendingRenewalOrder or pendingOrder and its invoice in existingInvoice. Contacts on the account need permission to place orders.

Authentication: An API key with the scopes write:domains and write:billing. About keys and scopes

Request

Path parameters

idstringrequired
The domain ID (dom_…).

Body

billingCyclestring
The period for 1, 2 or 3 years. One of annually, biennially, triennially.
periodYearsinteger | string
The period in years, for a row where billingCycle is null. 1 to 9.

Example

POST /api/v2/domains/{id}/billing-cycle
curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/billing-cycle" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"billingCycle": "biennially"
}'

Responses

200 The domain’s billing after the change.

Response 200
{
"billing": {
"amount": 338,
"currencyCode": "SEK",
"billingCycle": "biennially",
"periodYears": 2
}
}
Response fields
billingobject
amountnumber
Renewal price for one billing period, in currencyCode.
currencyCodestring
billingCyclestring or null
The billing cycle for a period of 1 to 3 years. Null for 4 to 9 years. Read periodYears then. One of annually, biennially, triennially.
periodYearsinteger or null
1 to 9.
initialAmountnumber
Price of the first period, when it differs from the renewal price.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is domain_not_found.
409An unpaid renewal or another open order blocks the change (existing_invoice_blocking). Pay or cancel the order in pendingRenewalOrder or pendingOrder first.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.