Change the plan of a web hosting account
POST /api/v2/shared-hosting/{accountId}/actions/upgrade
Move a web hosting account to a bigger or smaller plan. Pick a productSlug from GET /api/v2/shared-hosting/{accountId}/actions/upgrade. Send dryRun: true first to see the price without changing anything. An upgrade creates an order for the price difference. Its invoice is in paymentInvoice with status: awaiting_payment. Pay it to finish the upgrade. An upgrade that costs nothing returns status: applied. An unpaid invoice for the account blocks an upgrade with 409 existing_invoice_blocking. Pay it or resend with cancelExistingInvoice: true. A downgrade is scheduled for the end of the paid period (status: scheduled, scheduledChange.effectiveAt). The current plan stays until then and no refund is made for the current period. When the account uses more disk than the smaller plan includes, the downgrade is still scheduled with a capacityWarning. Free up space before the effective date or the change cannot be applied. Only one plan change can be scheduled at a time. A downgrade cannot be scheduled while the account is set to be cancelled. Changes to or from reseller hosting need support. The account must be active. A contact needs permission to place orders.
Authentication: An API key with the scopes write:billing and write:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).Body
productSlugstringrequiredavailableOptions[].productSlug on the GET.dryRunbooleancancelExistingInvoicebooleanExample
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/upgrade" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productSlug": "webbhotell-business", "dryRun": true }'curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/upgrade" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productSlug": "webbhotell-business" }'curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/upgrade" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productSlug": "webbhotell-business", "cancelExistingInvoice": true }'curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/upgrade" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "productSlug": "webbhotell-start" }'Responses
200 The preview when dryRun is true. Otherwise the result of the change.
{ "status": "awaiting_payment", "changeKind": "upgrade", "currentProduct": { "slug": "webbhotell-start", "name": "Start" }, "newProduct": { "slug": "webbhotell-business", "name": "Business" }, "paymentInvoice": { "id": "inv_01hxa3b4c5d6e7f8g9h0j1k2m3", "number": "202600001", "amount": 100, "currencyCode": "SEK", "dueAt": "2026-11-16T00:00:00.000Z", "status": "unpaid", "paymentUrl": "/billing?invoice=202600001" }, "renewalInvoice": null}{ "status": "scheduled", "changeKind": "downgrade", "scheduled": true, "currentProduct": { "slug": "webbhotell-business", "name": "Business" }, "newProduct": { "slug": "webbhotell-start", "name": "Start" }, "scheduledChange": { "status": "scheduled", "effectiveAt": "2026-12-01T00:00:00.000Z", "invoiceIssueAt": "2026-11-01T00:00:00.000Z", "target": { "productSlug": "webbhotell-start", "billing": { "amount": 99, "currencyCode": "SEK", "billingCycle": "annually" } }, "actions": { "canCancel": { "allowed": true, "reason": null } } }, "paymentInvoice": null, "renewalInvoice": null}Response fields
dryRunbooleantrue.statusstringpreview.changeKindstringupgrade, downgrade.currentProductobject or nullnewProductobject or nullpaymentInvoicenullrenewalInvoiceobjectamountnumbercurrencyCodestringservicePeriodEndAtstring or nullpaymentMethodsobjectcardobjectmethodstringpaymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringavailablebooleanvisiblebooleanreasonstring or nullavailable is false.checkoutModestring or nullpayment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectinvoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringaccountTypestringprivate, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanavailableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.accountCreditobjectmethodstringpaymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringavailablebooleanvisiblebooleanreasonstring or nullavailable is false.checkoutModestring or nullpayment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectinvoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringaccountTypestringprivate, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanavailableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.swishobjectmethodstringpaymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringavailablebooleanvisiblebooleanreasonstring or nullavailable is false.checkoutModestring or nullpayment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectinvoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringaccountTypestringprivate, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanavailableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.bankgiroobjectmethodstringpaymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringavailablebooleanvisiblebooleanreasonstring or nullavailable is false.checkoutModestring or nullpayment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectinvoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringaccountTypestringprivate, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanavailableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.sepaobjectmethodstringpaymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringavailablebooleanvisiblebooleanreasonstring or nullavailable is false.checkoutModestring or nullpayment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectinvoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringaccountTypestringprivate, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanavailableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.alipayobjectmethodstringpaymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringavailablebooleanvisiblebooleanreasonstring or nullavailable is false.checkoutModestring or nullpayment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectinvoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringaccountTypestringprivate, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanavailableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.cryptoobjectmethodstringpaymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringavailablebooleanvisiblebooleanreasonstring or nullavailable is false.checkoutModestring or nullpayment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectinvoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringaccountTypestringprivate, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanavailableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringamount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.availablePaymentMethodsarray of stringactionsobjectcanPayWithAvailableMethodobjectallowedbooleanreasonstring or nullallowed is true.actionsobjectcanCommitobjectallowedbooleanreasonstring or nullallowed is true.scheduledbooleanscheduledChangeobjectstatusstringpreview, scheduled, awaiting_payment, paid, applying, applied, needs_attention, cancelling, cancelled.effectiveAtstring or nullinvoiceIssueAtstring or nulltargetobjectproductSlugstringresourcesobjectstorageGb can be larger than the new plan’s disk. The primary disk cannot be made smaller.billingobjectamountnumber or nullcurrencyCodestringbillingCyclestringmonthly, quarterly, semiannually, annually, biennially, triennially, free.actionsobjectcanCancelobjectallowedbooleanreasonstring or nullallowed is true.capacityWarningobjectstorageUsedGbnumberstorageLimitGbnumberreasonstringErrors
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 names the missing resource: shared_hosting_not_found, scheduled_change_not_found. |
| 409 | The change is blocked. Nothing was changed. existing_invoice_blocking: an unpaid invoice exists. Pay it or resend with cancelExistingInvoice: true. scheduled_change_in_progress: a plan change is already scheduled. Cancel it first. service_cancellation_pending: the account is set to be cancelled. Withdraw the cancellation to schedule a downgrade. unsupported_plan_transition: changes to or from reseller hosting need support. renewal_period_review_required: the renewal periods need a review by support. billing_change_busy: another billing change is running. Try again shortly. scheduled_change_processing_unavailable: scheduled changes are unavailable right now. Try again later. |
| 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. |
| 502 | The plan change was made but the next renewal invoice could not be created (upstream_renewal_regeneration_failed). Do not retry. Contact support so billing can be put right. |