New subscription checkout
Enterprise Only
This endpoint is only available in the Enterprise package and requires the authenticated user to be a Super Admin.
Payment Platform Required
This endpoint is only available if a payment platform (Stripe, Paddle, etc.) has been configured in Mixpost. The response will generate a checkout link for creating a subscription through the configured payment platform.
Method: POST
URL: https://example.com/<MIXPOST_CORE_PATH>/api/panel/workspaces/{workspaceUuid}/subscription/new
Authorization: Bearer <token>
Body:
{
"plan_id": 1,
"cycle": "monthly",
"coupon": null
}
| Key | Format | Required | Description |
|---|---|---|---|
plan_id | integer | required | The ID of the subscription plan defined in Mixpsot Dashboard |
cycle | string | required | Billing cycle: monthly or yearly |
coupon | string | optional | Coupon code for discount |
Response:
- 200
- 401
- 403
- 404
- 409
- 422
The response format depends on the configured payment platform. Typically includes a checkout URL.
{
"url": "https://checkout.stripe.com/pay/cs_test_..."
}
{
"message": "Unauthenticated."
}
{
"message": "Access forbidden."
}
{
"message": "Workspace not found."
}
Returned when a generic trial subscription was created instead.
{
"message": "Validation errors",
"errors": {
"created_generic_subscription": ["Subscription created."]
}
}
{
"message": "Validation errors",
"errors": {
"subscription": ["You cannot subscribe to a plan while you have an active subscription."]
}
}
{
"message": "Validation errors",
"errors": {
"plan_id": ["Platform plan not found."]
}
}