Change subscription plan

View as Markdown
Changes a subscription to a new plan immediately or schedules the change for end of period.

Authentication

AuthorizationBearer
API key obtained from the Afternoon dashboard

Path parameters

idstringRequiredformat: "cuid"

Request

This endpoint expects an object.
target_plan_codestringRequiredformat: "^[a-z0-9]+(?:_[a-z0-9]+)*$">=1 character
Target plan code to transition this subscription to
change_modeenumRequired

When to change plan: “now” transitions immediately, “end_of_period” transitions at the end of the current billing cycle

Allowed values:
cancel_now_prepaid_refund_policyenumOptional

Applies only when change_mode is “now”: refund prorated prepaid fixed fees or skip refunds.

Allowed values:

Response

Plan change completed or scheduled
successboolean
statusenum
Whether plan transition is complete now or scheduled
Allowed values:
old_subscriptionobject
new_subscriptionobject
request_idstring

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
409
Conflict Error
500
Internal Server Error