Cby Chargebee
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.
Description
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.
create-checkout.md
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.
Built from these files in the repository
The layout and the rules come from lib/catalog/render-markdown.ts, the set-up wording from lib/catalog/render-access.ts.
Ways in
| Route | Source | Call | Required | Docs |
|---|---|---|---|---|
| Official | POST /hosted_pages/checkout_new_for_items | API key in $CHARGEBEE_API_KEY | Docs |