Subscription

Swap the subscription plan of a billable entity.

Swaps the Stripe subscription of the billable named by billable_id onto another plan without prorating, and records the new contracted monthly spend against that billable's organization. The target is the billable in the request, not the one belonging to the acting user.

post/api/subscription/swap-plan

Request

Request body

billable_idinteger required

The billable entity whose plan is swapped. Soft-deleted billables are rejected.

subscription_plan_idstring required

The Stripe price ID to swap to.

contract_monthly_spendnumber float required

The contracted monthly spend for the new plan. Stored against the billable's organization.

Example request

{
  "billable_id": 17,
  "subscription_plan_id": "price_1PmxYxC7D8t3rP7mSia7osJP",
  "contract_monthly_spend": 313.75
}

Response

The swap was attempted. A successful swap returns the new plan; a billable that cannot be swapped (no Stripe customer, no Stripe subscription, or rejected by Stripe) returns an error.

subscription_plan_idstring

The plan now active on the subscription. Absent when error is present.

errorstring

Why the swap could not be completed. Absent on success.

Example response

{
  "subscription_plan_id": "price_1PmxYxC7D8t3rP7mSia7osJP",
  "error": "This account does not have a Stripe subscription"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.