---
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.

Note: The first `subscription_items` price must be a plan. The subscription exists only once the customer completes checkout at the returned `url`: retrieve the hosted page for the subscription and invoice rather than relying on the redirect.

## 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

Note: `{site}` is your Chargebee site name, such as `acme-test`. `CHARGEBEE_API_KEY` holds the base64 of `<api key>:`, and test and live sites have different keys.

Before anything else, confirm access with the cheapest read-only call, like a list or a search. Never send or change anything to test access.

## Rules

- Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
- Never print API keys.
