Skip to main content

Start a real subscription through the payment platform

POST 

/panel/workspaces/:workspace/subscription/new

Starts a real subscription for the workspace through the instance's active payment platform. Unlike POST /panel/workspaces/{workspace}/subscription, which only records an existing subscription, this endpoint contacts the payment platform and normally returns a checkout payload.

An active payment platform is required; without one the request fails.

Behaviour:

  1. If the workspace already has a recurring subscription, the request fails with 422.
  2. Generic-trial short-circuit — if generic trials are enabled with a trial length greater than zero, and the workspace has neither a generic subscription nor any other subscription, a generic subscription is created instead of a checkout and the request returns 409. Handle this as a success case, not an error.
  3. If the selected plan has no platform plan id for the requested billing cycle, the request fails with 422.
  4. Otherwise a checkout is created (return/cancel URLs, currency, trial days and an optional coupon) and the payment platform's response is returned unchanged.

Because step 4's body comes straight from the payment platform, its shape depends on which platform your instance uses and is not documented here.

Request

Responses

The payment platform's response, passed through unchanged (typically a checkout payload). Its shape depends on the active payment platform.