---
ref: tool:chargebee/create-checkout
name: Create a checkout for a new subscription
company: company:chargebee
workflows: []
access: [api]
tags: [capability:collect-payments, category:payments, has:api]
docs: https://apidocs.chargebee.com/docs/api/hosted_pages/create-checkout-for-a-new-subscription
updated: 2026-09-27
---

# Create a checkout for a new subscription

Creates a Chargebee-hosted checkout page for the plan and add-on prices you pass and returns it with the URL to send the customer.

Pass the prices as `subscription_items[item_price_id][0]`, `[1]` and so on,
with quantities; the first must be a plan. `customer[id]`, `coupon_ids` and
`redirect_url` are optional. Completing checkout at the returned `url` creates
the subscription. Don't rely on the redirect for critical post-checkout work:
retrieve the hosted page to get the subscription and invoice.

## Set up

Use the first option your agent supports.

### API (official)

- Base URL: https://{site}.chargebee.com/api/v2
- Endpoint: `POST /hosted_pages/checkout_new_for_items`
- Auth: send the header `Authorization: Basic $CHARGEBEE_API_KEY`
- Docs: https://apidocs.chargebee.com/docs/api

Before doing anything else, make one read-only call to confirm access.

## Rules

- Ask the user before anything that sends messages, costs money, or changes data.
- Never print API keys.
