List VPS billing cycle options
GET /api/v2/vps/{id}/actions/billing-cycle
List the billing cycles a VPS can switch to and the price of each. currentBillingCycle is the cycle it has now. Each amount is the price for one period of that cycle, with the VPS’s current resources, in the account’s currency.
Check actions.canChangeBillingCycle before you call POST /api/v2/vps/{id}/actions/billing-cycle. The gate is closed while an unpaid invoice or open order exists for the VPS. blockingInvoices then lists those invoices. It is also closed when the plan has only one cycle.
Authentication: An API key with the scope read:vm. About keys and scopes
Request
Path parameters
idstringrequiredThe VPS ID (
vps_…).Example
curl "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/billing-cycle" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 The billing cycle options.
{ "currentBillingCycle": "monthly", "cycles": [ { "billingCycle": "monthly", "amount": 99, "currencyCode": "SEK", "isCurrent": true }, { "billingCycle": "annually", "amount": 999, "currencyCode": "SEK", "isCurrent": false } ], "actions": { "canChangeBillingCycle": { "allowed": true, "reason": null } }}Response fields
currentBillingCyclestringThe billing cycle the VPS has now. One of
monthly, quarterly, semiannually, annually, biennially, triennially, free.cyclesarray of objectThe cycles the VPS can have.
billingCyclestringThe billing cycle. One of
monthly, quarterly, semiannually, annually, biennially, triennially, free.amountnumberPrice for one period of this cycle.
currencyCodestringISO 4217 currency code.
isCurrentbooleantrue for the cycle the VPS has now.blockingInvoicesarray of objectUnpaid invoices that block a change. Present only when there are some.
idstring or nullThe invoice ID.
numberstring or nullThe invoice number.
amountnumber or nullInvoice total.
currencyCodestringISO 4217 currency code.
dueAtstring or nullWhen the invoice is due.
statusstringInvoice status. One of
unpaid, paid, cancelled, refunded, collections, unknown.paymentUrlstring or nullClient-area path where the invoice can be paid.
actionsobjectcanChangeBillingCycleobjectWhether the billing cycle can be changed now.
reason says why not.allowedbooleanreasonstring 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 vps_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. |