Skip to content
Internal docs

Subscription Plan Change

Change a subscriber’s plan directly from your own dashboard or billing system, on any active subscription that belongs to your provider — not only ones an external checkout created. The change is applied immediately; there is no scheduled/timing option, because “next period” would mean kurnl’s calendar month, which is not necessarily your own billing cycle.

Endpoints

Method Path Auth Description
POST /partner/subscriptions/{subscription_id}/change-plan X-API-Key, scope provisioning:write Apply a plan change now
GET /partner/subscriptions/{subscription_id}/change-plan/preview X-API-Key, scope provisioning:read Check eligibility without applying anything

A key carrying provisioning:write already satisfies provisioning:read — the same key you use for provisioning calls works against the preview with no extra scope grant.

Change the plan

POST /partner/subscriptions/{subscription_id}/change-plan
{
"plan_version_id": "uuid"
}

Response — 200 OK

{
"subscription_id": "uuid",
"old_plan_version_id": "uuid",
"new_plan_version_id": "uuid",
"change_type": "UPGRADE",
"effective_at": "2026-09-17T14:32:01.123456+00:00",
"bandwidth_updated": true,
"manual_provisioning_required": false
}
  • change_type is UPGRADE when the new plan’s retail price is greater than or equal to the old one’s, otherwise DOWNGRADE.
  • effective_at is the moment kurnl applied the change (UTC, ISO 8601) — this is also always “now”; there is no future-dated effective_at.
  • Applying a change now clears any plan change an operator had scheduled for a later date on this subscription (kurnl’s scheduled_plan_version_id / scheduled_plan_change_on columns) — otherwise the scheduler would still apply the parked plan on its date and silently revert the one you just made.

bandwidth_updated

bandwidth_updated: false does not mean the call failed and does not mean the plan change didn’t happen. The subscription row and billing have already changed — this field only reports whether kurnl also finished re-provisioning the port to match. When it is false:

  • if manual_provisioning_required is true, the new plan is flagged for manual provisioning by design (see below) — this is the expected, common case;
  • otherwise, kurnl had no switch/port data on file for this subscription, the new plan version has no bandwidth defined, or the port-set attempt itself failed and was logged for an operator to retry.

Either way, the plan change stands. Retrying the request does not help — it will not touch the port again, and a second attempt today hits the daily limit below. If your integration polls or acts on bandwidth_updated, treat false as “an operator needs to confirm the port,” not as a reason to resubmit.

manual_provisioning_required

true when the new plan version is flagged manual_provisioning — kurnl skips automatic port re-provisioning entirely and opens an internal task for the provider’s operations team instead. bandwidth_updated is always false in this case, because the bandwidth step never runs.

Preview a change

GET /partner/subscriptions/{subscription_id}/change-plan/preview

Response — 200 OK

{
"subscription_id": "uuid",
"current_plan_version_id": "uuid",
"can_change_today": true,
"reason": null,
"eligible_plan_versions": [ { "id": "uuid", "...": "..." } ]
}

Use this before showing a customer a plan-change control, so you can disable it yourself instead of letting the customer hit a 409 on submit. It mirrors the POST’s own guards (subscription ACTIVE, once per UTC day) — whenever the preview would say can_change_today: false, the POST would refuse with the same 409 below, and vice versa.

There is intentionally no price quoted here. This is an eligibility check, not the internal change-plan preview: kurnl does not bill your customers, so a kurnl-prorated price would be meaningless at best and misleading at worst on a subscription your own billing is authoritative for.

Guardrails

Guard Behaviour
Ownership A subscription_id that does not belong to your provider — including one that does not exist at all — returns 404, never 403. This is deliberate: a 403 would confirm the id exists but belongs to someone else, letting you enumerate other providers’ subscription ids by their response code. Both endpoints return the identical 404 either way.
Subscription status Only an ACTIVE subscription can change plan. Any other status (PENDING, PENDING_INSTALL, SUSPENDED, PAYMENT_FAILED, CANCELLED, …) is a 409.
Target plan exists An unknown plan_version_id is a 400.
No-op change Submitting the subscription’s current plan_version_id is a 400 — there is nothing to change.
Target plan’s provider The target plan version must belong to your provider. A plan version belonging to another provider is a 403 — moving a subscriber to another ISP’s plan is a change-provider operation, not a plan change, and is out of scope here.
Anonymous line A subscription with no customer record (an anonymous line) cannot move to another provider at all. A plan version of another provider is a 403 with This line has no customer record and cannot switch provider. Cancel it; the new provider orders a new line. — cancel the line, and the new provider orders a new one.
Effective window The target plan version must be inside its window (effective_from / effective_to). Otherwise the POST is a 400 Plan version not active.
Audience The target plan version must be offered to existing customers (target_audience is ALL or EXISTING_SUBSCRIBERS). A version for new customers only is a 422 with detail.code = "plan_audience".
Bulk building A subscriber in a building that includes internet in the rent can only move to a bulk plan (is_bulk), and a subscriber elsewhere only to a plan that is not bulk. A mismatch is a 422 with detail.code = "bulk_plan".
Building plan selection When your provider has chosen plans for the subscriber’s building (on the building, its division or its province), the target plan must be one of them. A plan left out is a 422 with detail.code = "plan_not_offered". With no selection, every plan is allowed.
Building speed tier The target plan must fit the speed the subscriber’s line delivers (1G / 2.5G / 10G): its wholesale download speed may not exceed the tier of the subscriber’s unit — the unit’s own cap when kurnl set one, else the building’s tier. A faster plan is a 422 with detail.code = "speed_tier". A building kurnl has not classified, on a unit without a cap, gates nothing.
One change per calendar day (UTC) A subscription that already changed plan today (00:00–24:00 UTC) refuses a second change with 409. Call the preview first and disable your own control rather than letting a customer hit this on submit.
Change-history read failure If kurnl cannot read the subscription’s plan-change history for today, both endpoints fail closed with 502 rather than silently allowing a change that might exceed the daily limit.

The daily limit and the change-history read failure guard both exist on the preview too, in the same order, so a can_change_today: false from the preview and a 409/502 from the POST are never in disagreement for the same subscription at the same moment. One change to a line runs at a time: a second POST for the same subscription while the first is still running answers 409 {"detail": {"code": "action_in_progress", "message": "…"}} and changes nothing; once the first has finished, a second change the same day meets the daily limit. The same holds for kurnl’s own change-plan route and every other change to the line (a cancellation, a suspension).

Operator discounts

A kurnl operator discount on the line goes with it to the new plan: it is re-priced on the new plan’s list price and its remaining months keep running. Kurnl’s wholesale reduction follows the new price. A provider’s own campaign still ends on a plan change. The customer portal’s plan-change preview reports a continuing operator discount as campaign_continues (name, promo_price_monthly); this endpoint’s preview quotes no price.

Billing

Billing follows the subscription, not the caller — but it is two independently keyed behaviours, not one, and this endpoint covers any subscription your provider owns, so they can land differently on the same subscription:

  • Recurring invoice line. Keyed on whether this subscription has a kurnl recurring invoice at all (in_recurring_invoice_id). Every subscription created through the CKO-03 external-checkout flows has none, so its invoice line is never rebuilt for a plan change — your own billing system is authoritative for the price.
  • Proration correction (a credit note now for a downgrade, a pending line on the next invoice for an upgrade). Keyed on whether the subscriber has an Invoice Ninja client on file (independent of whether there’s a recurring invoice). If one exists, the correction is issued; if not, it self-skips.

In practice: a subscription with no recurring invoice but a subscriber who does have an Invoice Ninja client on file (kurnl knows and bills that person for something else) can still receive a proration credit note or pending line, even though its recurring invoice is never touched. Which of these two things happens on a given plan change depends on how kurnl bills that particular subscription — check in_recurring_invoice_id and the subscriber’s Invoice Ninja client rather than assuming “partner-driven” means “no billing effect at all.”

Customer notification

Whether kurnl e-mails the subscriber is decided by whether kurnl holds a subscriber record for this subscription at all — not by whether the partner API or the operator dashboard made the change:

  • A subscription created through the anonymous CKO-03 flow (no subscriber record shared with kurnl) never gets an e-mail: there is no contact on file to send it to.
  • A subscription where kurnl does hold a subscriber record — including one created through the non-anonymous CKO-03 flow — gets the same subscription.plan_changed notification an operator-triggered change would send, if that automation is enabled for your provider. The partner API does not suppress it.

If your integration expects to control whether the customer is e-mailed, check whether your provider’s plan_changed automation is enabled, rather than assuming the partner API is silent by default.

Rate limits

POST .../change-plan is limited to 120 requests/minute per API key. The GET .../change-plan/preview endpoint carries no rate limit of its own.

Error codes

Status When
401 Missing or invalid X-API-Key
400 plan_version_id not found — unknown plan version
400 That is already this subscription's plan.
403 API access is not enabled for this account — feature gate on your provider, checked before scopes
403 API key is missing the required scope (provisioning:write for the POST, provisioning:read for the preview)
403 That plan belongs to a different provider — moving a subscriber between ISPs is a change-provider operation, not a plan change.
403 This line has no customer record and cannot switch provider. Cancel it; the new provider orders a new line. — the target plan belongs to a different provider and the subscription is anonymous
404 Subscription not found, or it belongs to a different provider
409 Subscription is not ACTIVE
400 Plan version not active — the target plan version is outside its effective window
422 {"detail": {"code": "speed_tier", "message": "…", "speed_tier_mbps": 1000, "speed_tier_scope": "unit", "plan_download_mbps": 1500}} — the plan is faster than the line delivers; speed_tier_scope is "unit" when the unit’s own cap refused it, "building" for the building’s tier. Offer a plan within the tier
422 {"detail": {"code": "plan_audience", "message": "<Plan> is for new customers only.", "target_audience": "NEW_SUBSCRIBERS"}} — the plan is not offered to existing customers; offer one from eligible_plan_versions
422 {"detail": {"code": "bulk_plan", "message": "…", "building_bulk": true, "plan_bulk": false}} — the plan and the building do not match. A paid plan in a bulk building answers "This building includes internet in the rent — choose one of its included plans."; a bulk plan elsewhere answers "<Plan name> is only available in buildings that include internet in the rent."; offer a plan that fits the building
422 {"detail": {"code": "plan_not_offered", "message": "<Plan> is not offered in this building.", "building_id": "…"}} — only when a plan selection exists for the building and leaves the plan out; offer one from eligible_plan_versions
409 Subscription already changed plan today (UTC)
409 {"detail": {"code": "action_in_progress", "message": "…"}} — another change to this line is still running; nothing was changed. Retry in a few minutes
429 Rate limit exceeded (POST only — 120 requests/minute)
502 Could not verify today’s plan-change history — try again
503 Could not verify the building's speed tier; try again. — retryable
503 Could not verify the building's bulk offer; try again. — retryable
503 Could not verify the building's plan offer; try again. — retryable

See also: Subscriber Management, Subscription Status (suspend/restore).