Introducing the Chargebee CLI

How do I find the plans associated with a feature using the API?

Problem Statement

You want to identify which plans or items are associated with a feature and its entitlements through the API.

Solution

At present, you cannot filter features associated with a plan from the Chargebee UI. This is only possible through the API.

a) To retrieve the item entitlements for an item (plans/Addons/charges)

API used: List item entitlements for an item

Input: Plan/ Addon/Charge ID (not the item price)

Limit: Number of resources to be retrieved

Offset - Determines your position in the list for pagination

Sample API call:

curl https://imtestingqb-test.chargebee.com/api/v2/items/enterprise/item_entitlements \

 -G  

 -u {site_api_key}

 --data-urlencode limit=2 

 --data-urlencode offset="0"

b) To retrieve the entitlements for a feature

API used: List item entitlements for a feature

Input: Feature ID

Limit: Number of resources to be retrieved

Offset: Determines your position in the list for pagination.