Skip to content

AI & MCP

Plan upgrades with AI

Copy page

Upgrade a hosting plan from your AI tool in two steps — options, the exact price, and confirmation with a phrase you type yourself

When a site has outgrown its plan (disk full, addon-domain or mailbox limit reached, a build running out of memory), your AI tool can suggest a higher plan and place the upgrade with your confirmation. Tools such as hosting_resource_usage, hosting_site_doctor and the plan_limit_reached error usually lead here.

The upgrade rule

The same rule as the Hostino panel:

  • Same product group: the same hosting type (Linux, WordPress, Node.js…) and the same location (Iran or Europe).
  • Higher plans only: a plan whose price for this service’s own billing cycle is higher. No downgrades.
  • The billing cycle stays the same: a monthly service stays monthly.
  • Not included: email hosting and one-click apps (upgraded in the panel). Changing location or hosting type is a migration; contact support.
  • The service must be active.

The two-step flow

StepToolScopeWhat happens
0service_upgrade_optionsservices:readAllowed plans with the price per period; read-only
1service_upgradeorders:writeThe exact prorated amount (for the days left in the current period, with estimated VAT) and a confirmation phrase; nothing changes yet
2service_upgrade_confirmorders:write + orders:confirmWith the phrase you typed, the upgrade order and an unpaid invoice are created
3prepare_invoice_payment → pay_invoice_with_creditorders:confirm + billing:payPay the invoice from credit with a second phrase, or pay it in the panel

The plan switches when the invoice is paid — automatically, without downtime.

Example confirmation phrase:

confirm upgrading example.com to WP-Core-IR 286,000 toman code 4821
  • The phrase is accepted with Persian or English digits, with or without thousands separators, is valid for about 15 minutes and locks after 5 wrong attempts.
  • The tool must never type or complete the phrase itself.
  • The amount is re-checked at confirmation. The prorated amount moves with the calendar; if it changed between steps 1 and 2, the answer is amount_changed with the new amount and phrase, and you confirm again.
  • orders:confirm is not allowed in API tokens, so confirming an upgrade is never possible with an API token — only through an OAuth connection, typed by the account owner.
  • At most 3 upgrades per account in 24 hours.

An example conversation

  1. “My hosting is full; what should I do?” The tool sees with hosting_resource_usage that the disk is 96% full and shows the higher plans with their monthly price via service_upgrade_options.
  2. “I’ll take WP-Pro.” The tool calls service_upgrade and shows the prorated amount and the confirmation phrase.
  3. You type the phrase → service_upgrade_confirm issues the invoice.
  4. “Pay it from my credit.” → prepare_invoice_payment gives the exact amount and a second phrase; once you type it, the invoice is paid and the plan switches automatically.

Errors

CodeCause
not_upgradable_hereEmail, one-click app, or a service without a regular billing cycle; use the panel or support
upgrade_not_allowedplan_id is not among the service_upgrade_options
service_not_active / service_not_foundThe service is not active or not yours
amount_changedThe prorated amount changed; the new phrase is in new_request
confirmation_mismatchThe typed phrase is wrong (attempts_left)
request_expiredExpired; call service_upgrade again
too_many_attempts / daily_limit_reachedToo many attempts or the daily limit
amount_over_limitThe amount is above the limit for this route; upgrade in the panel

REST equivalent: Purchases API → Plan upgrades.