get https://api.chartmogul.com/v1/plan_groups//plans
Returns a list of plan
objects in a specific plan_group
in your ChartMogul account.
Examples
curl -X GET "https://api.chartmogul.com/v1/plan_groups/plg_1b702dbb-8621-4a63-8a2a-6641670287cc/plans?per_page=3" \
-u YOUR_API_KEY:
ChartMogul::PlanGroups::Plans.all(
plan_group_uuid: "plg_438c086b-1a20-4ee4-a82c-f2b20aac987b",
per_page: 3,
)
ChartMogul.Plan.all(config, "plg_438c086b-1a20-4ee4-a82c-f2b20aac987b", {
per_page: 3,
});
ChartMogul\PlanGroups\Plan::all([
"plan_group_uuid" => "plg_438c086b-1a20-4ee4-a82c-f2b20aac987b",
"per_page" => 3
]);
api.ListPlanGroupPlans(
&cm.Cursor{PerPage: 3},
"plg_438c086b-1a20-4ee4-a82c-f2b20aac987b"
)
chartmogul.PlanGroup.all(
config, uuid="plg_438c086b-1a20-4ee4-a82c-f2b20aac987b", per_page=3
)
Result Format
{
"plans": [
{
"name": "Bronze Plan",
"uuid": "pl_eed05d54-75b4-431b-adb2-eb6b9e543206",
"data_source_uuid": "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
"interval_count": 1,
"interval_unit": "month",
"external_id": "plan_0001"
},
{
"name": "Silver Plan",
"uuid": "pl_cdb35d54-75b4-431b-adb2-eb6b9e873425",
"data_source_uuid": "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
"interval_count": 6,
"interval_unit": "month",
"external_id": "plan_0002"
}
],
"current_page": 1, // deprecated
"total_pages": 1, // deprecated
"cursor": "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
"has_more": true
}
#<ChartMogul::PlanGroups::Plans:0x00000003eb9e18
@plans=[
#<ChartMogul::Plan:0x007fb4993f25a0
@uuid="pl_eed05d54-75b4-431b-adb2-eb6b9e543206",
@data_source_uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
@name="Bronze Plan",
@interval_count=1,
@interval_unit="month",
@external_id="plan_0001"
>,
#<ChartMogul::Plan:0x007fb4993f25a0
@uuid="pl_cdb35d54-75b4-431b-adb2-eb6b9e873425",
@data_source_uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
@name="Silver Plan",
@interval_count=6,
@interval_unit="month",
@external_id="plan_0002"
>
],
@current_page=1, # deprecated with version 4.0.0
@total_pages=1, # deprecated with version 4.0.0
@cursor="AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
@has_more=true
>
{
plans: [
{
name: "Bronze Plan",
uuid: "pl_eed05d54-75b4-431b-adb2-eb6b9e543206",
data_source_uuid: "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
interval_count: 1,
interval_unit: "month",
external_id: "plan_0001"
},
{
name: "Silver Plan",
uuid: "pl_cdb35d54-75b4-431b-adb2-eb6b9e873425",
data_source_uuid: "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
interval_count: 6,
interval_unit: "month",
external_id: "plan_0002"
}
],
current_page: 1, // deprecated
total_pages: 1, // deprecated
cursor: "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
has_more: true
}
Doctrine\Common\Collections\ArrayCollection::__set_state(array(
"elements" =>
array(
0 => ChartMogul\Plan::__set_state(array(
"uuid" => "pl_eed05d54-75b4-431b-adb2-eb6b9e543206",
"name" => "Bronze Plan",
"interval_count" => 1,
"interval_unit" => "month",
"external_id" => "plan_0001",
"data_source_uuid" => "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
)),
1 => ChartMogul\Plan::__set_state(array(
"uuid" => "pl_cdb35d54-75b4-431b-adb2-eb6b9e873425",
"name" => "Silver Plan",
"interval_count" => 6,
"interval_unit" => "month",
"external_id" => "plan_0002",
"data_source_uuid" => "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
)),
),
"current_page" => 1, # deprecated with version 6.0.0
"total_pages" => 2, # deprecated with version 6.0.0
"cursor" => "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
"has_more" => true
));
(*chartmogul.PlanGroups.Plans)(0xc0420b0f60)({
Plans: ([]*chartmogul.Plan) (len=2) {
(*chartmogul.Plan)(0xc04201aae0)({
UUID: (string) (len=39) "pl_eed05d54-75b4-431b-adb2-eb6b9e543206",
DataSourceUUID: (string) (len=39) "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
ExternalID: (string) (len=9) "plan_0001",
Name: (string) (len=11) "Bronze Plan",
IntervalCount: (uint32) 1,
IntervalUnit: (string) (len=5) "month"
}),
(*chartmogul.Plan)(0xc04201ab40)({
UUID: (string) (len=39) "pl_cdb35d54-75b4-431b-adb2-eb6b9e873425",
DataSourceUUID: (string) (len=39) "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
ExternalID: (string) (len=9) "plan_0002",
Name: (string) (len=11) "Silver Plan",
IntervalCount: (uint32) 6,
IntervalUnit: (string) (len=5) "month"
})
},
TotalPages: (uint32) 1, // deprecated with version v4
CurrentPage: (uint32) 1, // deprecated with version v4
Cursor: (string) (len=44) "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
HasMore: (bool) true
})
PlanGroup(
plans=[
<Plan{
data_source_uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
external_id="plan_0001",
interval_count=1,
interval_unit="month",
name="Bronze Plan",
uuid="pl_eed05d54-75b4-431b-adb2-eb6b9e543206"
}>,
<Plan{
data_source_uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
external_id="plan_0002",
interval_count=6,
interval_unit="month",
name="Silver Plan",
uuid="pl_cdb35d54-75b4-431b-adb2-eb6b9e873425"
}>
],
current_page=1, # deprecated with version 4.0.0
total_pages=1, # deprecated with version 4.0.0
cursor="AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
has_more=True
)
In the response, the object contains an array of plan
objects with the following data:
uuid
- The UUID of theplan
object generated by ChartMogul.data_source_uuid
- The UUID of the data source that this subscription plan belongs to.name
- Name of this plan, as specified by you.interval_count
- The number of intervals (specified in theinterval_unit
attribute) between each subscription billing.interval_unit
- The frequency with which a subscription for this plan is billed. For example, if you bill your customer every 3 months for a subscription with this plan, theninterval_count
would be3
andinterval_unit
would bemonth
.external_id
- The unique external identifier for this plan, as specified by you.
The other keys represent pagination attributes:
cursor
- A value that should be used in the next API request to fetch the next page of plans in a plan group. Request for next page should be initiated only ifhas_more
is set totrue
indicating that there are more plans in a plan group to list.has_more
- One oftrue
orfalse
depending on whether there are more pages with results for this request.total_pages
-DEPRECATED
The total number of pages with results for this request.current_page
-DEPRECATED
The page number of this response.