Skip to main content
This endpoint creates a new checkout session for subscribing to a plan or purchasing a product. It returns a checkout URL that redirects users to complete payment.
curl -X POST "https://frontier.example.com/v1beta1/organizations/{org_id}/billing/{billing_id}/checkouts" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "subscription_body": {
      "plan": "plan_123",
      "skip_trial": false,
      "cancel_after_trial": false
    },
    "success_url": "https://acme.com/success",
    "cancel_url": "https://acme.com/cancel"
  }'
{
  "checkout_session": {
    "id": "checkout_123",
    "checkout_url": "https://checkout.stripe.com/c/pay/cs_test_123",
    "success_url": "https://acme.com/success",
    "cancel_url": "https://acme.com/cancel",
    "state": "open",
    "plan": "plan_123",
    "created_at": "2023-06-07T05:39:56.961Z",
    "updated_at": "2023-06-07T05:39:56.961Z",
    "expire_at": "2023-06-07T06:39:56.961Z"
  }
}

Checkout Options

subscription_body
object
Subscription configuration for the checkout session.
product_body
object
Product configuration for one-time purchase.
setup_body
object
Setup configuration for payment method or customer portal.
success_url
string
required
URL to redirect to after successful checkout
cancel_url
string
required
URL to redirect to if checkout is cancelled

Build docs developers (and LLMs) love