Cby Chargebee
Create a coupon
Creates a percentage, fixed-amount or free-quantity coupon that applies to an invoice or to specific items, and returns the coupon.
Description
`id`, `name` and `apply_on` are required: `invoice_amount` discounts the invoice subtotal, and `each_specified_item` discounts the items set in `item_constraints`. Set `discount_type` (`percentage`, `fixed_amount` or `offer_quantity`) with its value, and `duration_type` (`one_time`, `forever` or `limited_period`) for how long it stays on a subscription; `max_redemptions` and `valid_till` cap its use.
create-coupon.md
Create a coupon
Creates a percentage, fixed-amount or free-quantity coupon that applies to an invoice or to specific items, and returns the coupon.
id, name and apply_on are required: invoice_amount discounts the
invoice subtotal, and each_specified_item discounts the items set in
item_constraints. Set discount_type (percentage, fixed_amount or
offer_quantity) with its value, and duration_type (one_time, forever or
limited_period) for how long it stays on a subscription; max_redemptions
and valid_till cap its use.
Set up
Use the first option your agent supports.
API (official)
- Base URL: https://{site}.chargebee.com/api/v2
- Endpoint:
POST /coupons/create_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 /coupons/create_for_items | API key in $CHARGEBEE_API_KEY | Docs |