Coupons
Discounts with validity rules and usage limits. redemptions shows where each coupon was actually applied.
| Command | HTTP | Description |
|---|---|---|
coupons list | GET /v1/coupons | List coupons |
coupons create | POST /v1/coupons | Create a coupon |
coupons get | GET /v1/coupons/{id} | Get a coupon |
coupons update | PATCH /v1/coupons/{id} | Update a coupon |
coupons delete | DELETE /v1/coupons/{id} | Delete a coupon |
coupons deactivate | POST /v1/coupons/{id}/deactivate | Deactivate a coupon |
coupons redemptions | GET /v1/coupons/{id}/redemptions | List the coupon's redemptions |
Examples
--params carries query and path parameters (id, page, filters); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.
# List coupons
kobana billing coupons list --fields "id,public_id,external_id,code,name"
# Get a coupon
kobana billing coupons get --params '{"id": "COUPON_ID"}'
# Create a coupon
kobana billing coupons create \
--json '{"code": "CODE", "name": "NAME", "discount_type": "percentage", "discount_value": 0}'
# Update a coupon
kobana billing coupons update \
--params '{"id": "COUPON_ID"}' \
--json '{"name": "NAME", "external_id": "EXTERNAL_ID", "description": "DESCRIPTION"}'
# Deactivate a coupon
kobana billing coupons deactivate --params '{"id": "COUPON_ID"}'
# Delete a coupon
kobana billing coupons delete --params '{"id": "COUPON_ID"}' --dry-run
Next steps
- Customers
- Schema introspection — every parameter this resource accepts.