List billing periods for web hosting
GET /api/v2/shared-hosting/{accountId}/actions/billing-cycle
List the billing periods a web hosting account can switch to, with the price of each in the account’s currency. To change the period, pick a row from cycles and send it to POST /api/v2/shared-hosting/{accountId}/actions/billing-cycle. actions.canChangeBillingCycle is closed while an order or an unpaid renewal invoice is open for the account. Those invoices are listed in blockingInvoices. The gate is also closed when the plan has no other period. The gate is closed with code: "overdue_invoice" when the paid period has ended and the renewal invoice is still unpaid. It is also closed with that code when an invoice in blockingInvoices is past its dueAt. That invoice must be paid first. Sending cancelExistingInvoice: true does not lift it. The account must be active. A contact needs permission to place orders.
Authentication: An API key with the scope read:hosting. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).Example
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/billing-cycle" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 The billing periods and whether the period can be changed now.
{ "currentBillingCycle": "annually", "cycles": [ { "billingCycle": "monthly", "amount": 19, "currencyCode": "SEK", "isCurrent": false }, { "billingCycle": "annually", "amount": 99, "currencyCode": "SEK", "isCurrent": true } ], "actions": { "canChangeBillingCycle": { "allowed": true, "reason": null } }}{ "currentBillingCycle": "annually", "cycles": [ { "billingCycle": "monthly", "amount": 79, "currencyCode": "SEK", "isCurrent": false }, { "billingCycle": "annually", "amount": 708, "currencyCode": "SEK", "isCurrent": true } ], "blockingInvoices": [ { "id": "inv_01hxa3b4c5d6e7f8g9h0j1k2m3", "number": "202600001", "amount": 885, "currencyCode": "SEK", "dueAt": "2026-10-27T00:00:00.000Z", "status": "unpaid", "paymentUrl": "/billing?invoice=202600001" } ], "actions": { "canChangeBillingCycle": { "allowed": false, "reason": "The paid period has ended and the renewal invoice is unpaid. Pay it first, then change the billing cycle.", "code": "overdue_invoice" } }}Response fields
currentBillingCyclestringmonthly, quarterly, semiannually, annually, biennially, triennially, free.cyclesarray of objectbillingCyclestringmonthly, quarterly, semiannually, annually, biennially, triennially, free.amountnumbercurrencyCode.currencyCodestringisCurrentbooleanblockingInvoicesarray of objectidstring or nullnumberstring or nullamountnumber or nullcurrencyCodestringdueAtstring or nullstatusstringunpaid.paymentUrlstring or nullactionsobjectcanChangeBillingCycleobjectallowedbooleanreasonstring or nullcodestring or nullErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller; code is shared_hosting_not_found. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |