asksteps: move a paid account to another plan
asksteps_change_planMoves an account that already pays to a different plan. THIS SPENDS THE CUSTOMER'S MONEY. Requires "billing:write", the account owner, and a purchase mandate the owner granted in the studio with a maximum plan, a spending cap and an expiry date. The first call NEVER changes anything: it returns "confirmation_required" together with the exact net price. Read that price to the user, get their agreement, and only then call again with confirm = true. A downgrade needs the mandate to allow it, because shrinking limits can switch features off. If the account has no subscription with the payment provider yet, you get "checkout_required" and a link — a first purchase is not something an agent can complete. Every executed change is emailed to the account owner.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Set to true only AFTER you told the user the price and they agreed. Without it nothing is charged. | |
| interval | No | "month" (default) or "year". A yearly change commits twelve months at once. | |
| plan_code | Yes | Plan code to move to. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Link where the user completes the purchase themselves. Give it to them verbatim. | |
| note | Yes | One sentence for the user. On "confirmation_required" it names the plan, the price and what changes — read it out before asking. | |
| status | Yes | Outcome. One of: "changed" (the plan is now different), "confirmation_required" (read the note to the user and call again with confirm = true if they agree), "checkout_required" (give them the url; only they can enter payment details), "not_allowed" (outside the mandate — the note says which limit), "not_connected", "error". Authorisation can also refuse before the tool runs: "plan_required" (the account's plan does not include agent access), "not_enabled" (the account owner has not switched agent access on), "owner_required" (only the account owner may do this), "mandate_required" (the owner has not granted a mandate for this). The note then says what the user has to do. | |
| interval | No | The billing interval this price refers to: "month" or "year". | |
| planCode | No | The plan code after the change, when something changed. | |
| priceCents | No | The net price per interval in cents, so you can state it exactly instead of estimating. |