Assign the selected plan to one or more accounts and (re)applies it to every store under each account. The endpoint updates per account the CompanyPlan pointer/created, then each store gets a new active StorePlan from now → end-of-month. Previously active/expired StorePlans without an issued next-invoice are closed. Accounts already on the requested plan do not count. DB-transactional; a planChanged billing webhook fires per updated account.
Auth: Both (Partner or Account). authentication group under the account prefix, no extra route-level route guard — scoping is entirely in: plan_id must be a plan assignment belonging to the caller's owning partner (resolved by walking up to the plan-owning partner) and each account_ids.* must be a Company id passing an ownership check (inside the auth user's hierarchy). A Partner can target any account in its tree; an Account caller can only target accounts within its own hierarchy. Same params for both roles — only the reachable account set differs.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
plan_id | integer | Yes | Must be assigned (via company_plans, non-deleted) to the caller's plan-assignment partner. Else: "The selected plan is not available for your account." |
account_ids | array | Yes | Account (Company) IDs. |
account_ids.* | integer | Yes | Exists in company + within auth hierarchy (an ownership check). |
Rate limit: No rate limit.
Response — data.status + data.message. success with a count summary when ≥1 account updated; error when nothing changed (already active everywhere / no active stores).
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
