This endpoint creates a new subscription for a billing account. The subscription is tied to a specific plan.
curl -X POST "https://frontier.example.com/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"plan_id": "plan_123",
"skip_trial": false,
"metadata": {}
}'
{
"subscription": {
"id": "sub_123",
"customer_id": "billing_acc_123",
"plan_id": "plan_123",
"provider_id": "sub_stripe123",
"state": "active",
"metadata": {},
"created_at": "2023-06-07T05:39:56.961Z",
"updated_at": "2023-06-07T05:39:56.961Z",
"current_period_start_at": "2023-06-07T05:39:56.961Z",
"current_period_end_at": "2023-07-07T05:39:56.961Z",
"billing_cycle_anchor_at": "2023-06-07T05:39:56.961Z",
"trial_ends_at": "2023-06-21T05:39:56.961Z"
}
}