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?page=1&per_page=3" \
-u YOUR_API_KEY:
ChartMogul::PlanGroups::Plans.all(page: 1, per_page: 200)
ChartMogul.Plan.all(config, 'plg_438c086b-1a20-4ee4-a82c-f2b20aac987b', { page: 1, per_page: 20 } function (err, res) {
// asynchronously called
});
<?php
ChartMogul\PlanGroups\Plan::all(["per_page" => 3]);
?>
api.ListPlanGroupPlans(&cm.ListPlansParams{Cursor: cm.Cursor{Page: "1", PerPage: "20"}}, "planGroupUUID")
chartmogul.PlanGroup.all(config, uuid='plg_438c086b-1a20-4ee4-a82c-f2b20aac987b', page=1, per_page = 20)
Result Format
{
"plans":[
{"name": "A Test Plan",
"uuid": "pl_2f7f4360-3633-0138-f01f-62b37fb4c770",
"data_source_uuid": "ds_424b9628-5405-11ea-ab18-e3a0f4f45097",
"interval_count": 1,
"interval_unit": "month",
"external_id": "2f7f4360-3633-0138-f01f-62b37fb4c770"
},
{
"name": "An another Test Plan",
"uuid": "pl_3011ead0-3633-0138-f020-62b37fb4c770",
"data_source_uuid": "ds_424b9628-5405-11ea-ab18-e3a0f4f45097",
"interval_count": 1,
"interval_unit": "month",
"external_id": "3011ead0-3633-0138-f020-62b37fb4c770"
}
],
"current_page": 1,
"total_pages": 1
}
#<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"
>,
#<ChartMogul::Plan:0x007fb4993f25a0
@uuid="pl_ab225d54-7ab4-421b-cdb2-eb6b9e553462",
@data_source_uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
@name="Gold Plan",
@interval_count=1,
@interval_unit="year",
@external_id="plan_0003"
>
],
@current_page=1,
@total_pages=1>
{
"plans":[
{"name": "A Test Plan",
"uuid": "pl_2f7f4360-3633-0138-f01f-62b37fb4c770",
"data_source_uuid": "ds_424b9628-5405-11ea-ab18-e3a0f4f45097",
"interval_count": 1,
"interval_unit": "month",
"external_id": "2f7f4360-3633-0138-f01f-62b37fb4c770"
},
{
"name": "An another Test Plan",
"uuid": "pl_3011ead0-3633-0138-f020-62b37fb4c770",
"data_source_uuid": "ds_424b9628-5405-11ea-ab18-e3a0f4f45097",
"interval_count": 1,
"interval_unit": "month",
"external_id": "3011ead0-3633-0138-f020-62b37fb4c770"
}
],
"current_page": 1,
"total_pages": 1
}
<?php
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",
)),
2 =>
ChartMogul\Plan::__set_state(array(
"uuid" => "pl_ab225d54-7ab4-421b-cdb2-eb6b9e553462",
"name" => "Gold Plan",
"interval_count" => 1,
"interval_unit" => "year",
"external_id" => "plan_0003",
"data_source_uuid" => "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
)),
),
"current_page" => 1,
"total_pages" => 2
));
?>
(*chartmogul.PlanGroups.Plans)(0xc0420b0f60)({
Plans: ([]*chartmogul.Plan) (len=3) {
(*chartmogul.Plan)(0xc04201aae0)({
UUID: (string) (len=39) "pl_86382dae-ee0c-11e6-ba5f-d71bf57a88d3",
DataSourceUUID: (string) (len=39) "ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11",
ExternalID: (string) (len=9) "plan_0004",
Name: (string) (len=12) "Awesome Plan",
IntervalCount: (uint32) 1,
IntervalUnit: (string) (len=5) "month"
}),
(*chartmogul.Plan)(0xc04201ab40)({
UUID: (string) (len=39) "pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694",
DataSourceUUID: (string) (len=39) "ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11",
ExternalID: (string) (len=9) "plan_0002",
Name: (string) (len=9) "Gold Plan",
IntervalCount: (uint32) 1,
IntervalUnit: (string) (len=5) "month"
}),
(*chartmogul.Plan)(0xc04201aba0)({
UUID: (string) (len=39) "pl_9599eaf6-ee09-11e6-ae39-c7c8fe81e14e",
DataSourceUUID: (string) (len=39) "ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11",
ExternalID: (string) (len=9) "plan_0001",
Name: (string) (len=11) "Bronze Plan",
IntervalCount: (uint32) 1,
IntervalUnit: (string) (len=5) "month"
})
},
TotalPages: (uint32) 1,
CurrentPage: (uint32) 1
})
PlanGroup(plans=[
<Plan{
data_source_uuid='ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11',
external_id='plan_0004',
interval_count=1,
interval_unit='month',
name='Awesome Plan',
uuid='pl_86382dae-ee0c-11e6-ba5f-d71bf57a88d3'}>,
<Plan{
data_source_uuid='ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11',
external_id='plan_0002',
interval_count=1,
interval_unit='month',
name='Gold Plan',
uuid='pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694'}>,
<Plan{
data_source_uuid='ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11',
external_id='plan_0001',
interval_count=1,
interval_unit='month',
name='Bronze Plan',
uuid='pl_9599eaf6-ee09-11e6-ae39-c7c8fe81e14e'}>],
current_page=1,
total_pages=1)
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:
total_pages
- The total number of pages with results for this request.current_page
- The page number of this response.