Skip to main content

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.

CommandHTTPDescription
plans listGET /v1/plansList plans
plans createPOST /v1/plansCreate a plan
plans getGET /v1/plans/{id}Get a plan
plans updatePATCH /v1/plans/{id}Update a plan
plans deleteDELETE /v1/plans/{id}Archive or delete a plan
plans duplicatePOST /v1/plans/{id}/duplicateDuplicate a plan
plans bulk-archive createPOST /v1/plans/bulk-archiveArchive plans in bulk
plans bulk-delete createPOST /v1/plans/bulk-deleteDelete plans in bulk
plans bulk-move-group createPOST /v1/plans/bulk-move-groupMove plans to another group in bulk
plans items getGET /v1/plans/{id}/itemsList the plan's items
plans items updatePUT /v1/plans/{id}/itemsReplace 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​