Plans
What gets subscribed to: price, billing period and the list of items the plan delivers. The bulk-* operations act on many plans at once.
| Command | HTTP | Description |
|---|---|---|
plans list | GET /v1/plans | List plans |
plans create | POST /v1/plans | Create a plan |
plans get | GET /v1/plans/{id} | Get a plan |
plans update | PATCH /v1/plans/{id} | Update a plan |
plans delete | DELETE /v1/plans/{id} | Archive or delete a plan |
plans duplicate | POST /v1/plans/{id}/duplicate | Duplicate a plan |
plans bulk-archive create | POST /v1/plans/bulk-archive | Archive plans in bulk |
plans bulk-delete create | POST /v1/plans/bulk-delete | Delete plans in bulk |
plans bulk-move-group create | POST /v1/plans/bulk-move-group | Move plans to another group in bulk |
plans items get | GET /v1/plans/{id}/items | List the plan's items |
plans items update | PUT /v1/plans/{id}/items | Replace the plan's items |
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 plans
kobana billing plans list \
--fields "id,public_id,external_id,organization_id,company_id"
# Get a plan
kobana billing plans get --params '{"id": "PLAN_ID"}'
# Create a plan
kobana billing plans create --json '{"name": "NAME", "slug": "SLUG"}'
# Update a plan
kobana billing plans update \
--params '{"id": "PLAN_ID"}' \
--json '{"external_id": "EXTERNAL_ID", "company_id": "COMPANY_ID", "plan_group_id": "PLAN_GROUP_ID"}'
# Duplicate a plan
kobana billing plans duplicate --params '{"id": "PLAN_ID"}'
# Archive or delete a plan
kobana billing plans delete --params '{"id": "PLAN_ID"}' --dry-run
Next steps
- Plan groups
- Schema introspection — every parameter this resource accepts.