Skip to content

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

accountIdstringrequired
The web hosting account ID (acct_…).

Body

productSlugstringrequired
The plan to move to, from availableOptions[].productSlug on the GET.
dryRunboolean
Return the price without changing anything. Default false.
cancelExistingInvoiceboolean
Cancel an unpaid invoice that blocks the change. Default false.

Example

POST /api/v2/shared-hosting/{accountId}/actions/upgrade
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
}'

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
}
Response fields
dryRunboolean
One of true.
statusstring
One of preview.
changeKindstring
One of upgrade, downgrade.
currentProductobject or null
newProductobject or null
paymentInvoicenull
What an upgrade would invoice now. Null for a downgrade.
renewalInvoiceobject
The renewal price on the new plan.
amountnumber
currencyCodestring
servicePeriodEndAtstring or null
End of the period the immediate charge covers. For a bandwidth-only increase this is the next monthly bandwidth reset. For a prorated increase of a recurring resource it is the end of the current paid period. Absent when the preview is not a charge for the current period.
paymentMethodsobject
cardobject
methodstring
The payment method, the same as its key in paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.
labelstring
The method’s name, for display.
availableboolean
visibleboolean
Present for restricted methods. When false, don’t show the method to the customer.
reasonstring or null
Why the method cannot be used, when available is false.
checkoutModestring or null
The kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of payment, sepa_bank_transfer_payment, alipay_payment.
requirementsobject
What the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestring
invoiceCurrencyCodesarray of string
accountCountryCodestring
accountCountryExcludedCodestring
A billing country this method does not accept.
accountTypestring
One of private, organisation.
accountCurrencyCodestring
requiresCardVerificationboolean
Whether a saved card or an earlier successful card payment is needed.
availableBalanceobject
amountnumber
currencyCodestring
minimumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
maximumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
accountCreditobject
methodstring
The payment method, the same as its key in paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.
labelstring
The method’s name, for display.
availableboolean
visibleboolean
Present for restricted methods. When false, don’t show the method to the customer.
reasonstring or null
Why the method cannot be used, when available is false.
checkoutModestring or null
The kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of payment, sepa_bank_transfer_payment, alipay_payment.
requirementsobject
What the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestring
invoiceCurrencyCodesarray of string
accountCountryCodestring
accountCountryExcludedCodestring
A billing country this method does not accept.
accountTypestring
One of private, organisation.
accountCurrencyCodestring
requiresCardVerificationboolean
Whether a saved card or an earlier successful card payment is needed.
availableBalanceobject
amountnumber
currencyCodestring
minimumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
maximumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
swishobject
methodstring
The payment method, the same as its key in paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.
labelstring
The method’s name, for display.
availableboolean
visibleboolean
Present for restricted methods. When false, don’t show the method to the customer.
reasonstring or null
Why the method cannot be used, when available is false.
checkoutModestring or null
The kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of payment, sepa_bank_transfer_payment, alipay_payment.
requirementsobject
What the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestring
invoiceCurrencyCodesarray of string
accountCountryCodestring
accountCountryExcludedCodestring
A billing country this method does not accept.
accountTypestring
One of private, organisation.
accountCurrencyCodestring
requiresCardVerificationboolean
Whether a saved card or an earlier successful card payment is needed.
availableBalanceobject
amountnumber
currencyCodestring
minimumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
maximumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
bankgiroobject
methodstring
The payment method, the same as its key in paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.
labelstring
The method’s name, for display.
availableboolean
visibleboolean
Present for restricted methods. When false, don’t show the method to the customer.
reasonstring or null
Why the method cannot be used, when available is false.
checkoutModestring or null
The kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of payment, sepa_bank_transfer_payment, alipay_payment.
requirementsobject
What the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestring
invoiceCurrencyCodesarray of string
accountCountryCodestring
accountCountryExcludedCodestring
A billing country this method does not accept.
accountTypestring
One of private, organisation.
accountCurrencyCodestring
requiresCardVerificationboolean
Whether a saved card or an earlier successful card payment is needed.
availableBalanceobject
amountnumber
currencyCodestring
minimumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
maximumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
sepaobject
methodstring
The payment method, the same as its key in paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.
labelstring
The method’s name, for display.
availableboolean
visibleboolean
Present for restricted methods. When false, don’t show the method to the customer.
reasonstring or null
Why the method cannot be used, when available is false.
checkoutModestring or null
The kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of payment, sepa_bank_transfer_payment, alipay_payment.
requirementsobject
What the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestring
invoiceCurrencyCodesarray of string
accountCountryCodestring
accountCountryExcludedCodestring
A billing country this method does not accept.
accountTypestring
One of private, organisation.
accountCurrencyCodestring
requiresCardVerificationboolean
Whether a saved card or an earlier successful card payment is needed.
availableBalanceobject
amountnumber
currencyCodestring
minimumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
maximumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
alipayobject
methodstring
The payment method, the same as its key in paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.
labelstring
The method’s name, for display.
availableboolean
visibleboolean
Present for restricted methods. When false, don’t show the method to the customer.
reasonstring or null
Why the method cannot be used, when available is false.
checkoutModestring or null
The kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of payment, sepa_bank_transfer_payment, alipay_payment.
requirementsobject
What the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestring
invoiceCurrencyCodesarray of string
accountCountryCodestring
accountCountryExcludedCodestring
A billing country this method does not accept.
accountTypestring
One of private, organisation.
accountCurrencyCodestring
requiresCardVerificationboolean
Whether a saved card or an earlier successful card payment is needed.
availableBalanceobject
amountnumber
currencyCodestring
minimumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
maximumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
cryptoobject
methodstring
The payment method, the same as its key in paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.
labelstring
The method’s name, for display.
availableboolean
visibleboolean
Present for restricted methods. When false, don’t show the method to the customer.
reasonstring or null
Why the method cannot be used, when available is false.
checkoutModestring or null
The kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of payment, sepa_bank_transfer_payment, alipay_payment.
requirementsobject
What the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestring
invoiceCurrencyCodesarray of string
accountCountryCodestring
accountCountryExcludedCodestring
A billing country this method does not accept.
accountTypestring
One of private, organisation.
accountCurrencyCodestring
requiresCardVerificationboolean
Whether a saved card or an earlier successful card payment is needed.
availableBalanceobject
amountnumber
currencyCodestring
minimumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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.
maximumAmountobject
amountnumber
currencyCodestring
comparisonstring
How the payment amount must compare with amount. 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 string
actionsobject
canPayWithAvailableMethodobject
allowedboolean
True when the action can be called now.
reasonstring or null
Why the action is blocked, ready to show. Null when allowed is true.
actionsobject
canCommitobject
allowedboolean
True when the action can be called now.
reasonstring or null
Why the action is blocked, ready to show. Null when allowed is true.
scheduledboolean
True for a downgrade, which takes effect at the next period.
scheduledChangeobject
statusstring
One of preview, scheduled, awaiting_payment, paid, applying, applied, needs_attention, cancelling, cancelled.
effectiveAtstring or null
invoiceIssueAtstring or null
targetobject
productSlugstring
resourcesobject
The resources after the change, as checked by the server. For a VPS plan change storageGb can be larger than the new plan’s disk. The primary disk cannot be made smaller.
billingobject
amountnumber or null
currencyCodestring
billingCyclestring
One of monthly, quarterly, semiannually, annually, biennially, triennially, free.
actionsobject
canCancelobject
allowedboolean
True when the action can be called now.
reasonstring or null
Why the action is blocked, ready to show. Null when allowed is true.
capacityWarningobject
Warns that the account uses more storage than the smaller plan includes. You can still schedule the downgrade. Usage is checked again when the change is due. The change is not applied while usage is still above the new plan.
storageUsedGbnumber
Disk the account uses now, in GB.
storageLimitGbnumber
Storage the new plan includes, in GB.
reasonstring
What is over the limit and what to do before the change takes effect, ready to show.

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 names the missing resource: shared_hosting_not_found, scheduled_change_not_found.
409The 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.
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.
502The 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.