patch https://api.chartmogul.com/v1/plan_groups/
Updates a plan_group
object in your ChartMogul account.
Examples
curl -X PATCH "https://api.chartmogul.com/v1/plan_groups/plg_eed05d54-75b4-431b-adb2-eb6b9e543206" \
-u YOUR_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"name": "Growth Plans",
"plans": ["pl_5d42c34e-c720-4a5b-8deb-a73ee2585803", "pl_14483884-6d43-47a9-ae1c-c362c2036c1d"]
}'
plan_group = ChartMogul::PlanGroup.retrieve("plg_eed05d54-75b4-431b-adb2-eb6b9e543206")
plan_group.name = "Growth Plans"
plan_grpoup.plans = [
"pl_5d42c34e-c720-4a5b-8deb-a73ee2585803",
"pl_14483884-6d43-47a9-ae1c-c362c2036c1d",
]
plan_group.update!
ChartMogul.PlanGroup.modify(
config,
"plg_eed05d54-75b4-431b-adb2-eb6b9e543206",
{
name: "Growth Plans",
plans: [
"pl_5d42c34e-c720-4a5b-8deb-a73ee2585803",
"pl_14483884-6d43-47a9-ae1c-c362c2036c1d",
],
}
);
ChartMogul\PlanGroup::update(
["plan_group_uuid" => "plg_eed05d54-75b4-431b-adb2-eb6b9e543206"],
[
"name" => "Growth Plans",
"plans" => [
"pl_5d42c34e-c720-4a5b-8deb-a73ee2585803",
"pl_14483884-6d43-47a9-ae1c-c362c2036c1d"
]
]
);
api.UpdatePlanGroup(
&cm.PlanGroup{
Name: "Growth Plans",
Plans: []*string{
"pl_5d42c34e-c720-4a5b-8deb-a73ee2585803",
"pl_14483884-6d43-47a9-ae1c-c362c2036c1d"
}
})
chartmogul.PlanGroup.modify(
config,
uuid="plg_eed05d54-75b4-431b-adb2-eb6b9e543206",
data={
"name": "Growth Plans",
"plans": [
"pl_5d42c34e-c720-4a5b-8deb-a73ee2585803",
"pl_14483884-6d43-47a9-ae1c-c362c2036c1d",
],
},
)
Result Format
{
"uuid": "plg_eed05d54-75b4-431b-adb2-eb6b9e543206",
"name": "Growth Plans",
"plans_count": 2
}
#<ChartMogul::PlanGroup:0x007fb4993f25a0
@uuid="plg_eed05d54-75b4-431b-adb2-eb6b9e543206",
@name="Growth Plans",
@plans_count=2
>
{
uuid: "plg_eed05d54-75b4-431b-adb2-eb6b9e543206",
name: "Growth Plans",
plans_count: 2
}
ChartMogul\PlanGroup::__set_state(array(
"uuid" => "plg_eed05d54-75b4-431b-adb2-eb6b9e5432066",
"name" => "Growth Plans",
"plans_count" => 2,
));
(*chartmogul.PlanGroup)(0xc04203e5a0)({
UUID: (string) (len=39) "plg_eed05d54-75b4-431b-adb2-eb6b9e543206",
Name: (string) (len=11) "Growth Plans",
PlansCount: (uint32) 2
})
<PlanGroup{
plans_count=2,
name="Growth Plans",
uuid="plg_eed05d54-75b4-431b-adb2-eb6b9e543206"
}>
In the response, the JSON
object contains the following data:
uuid
- The UUID of theplan_group
object generated by ChartMogul.name
- Name of this plan group, as specified by you.plans_count
- The number of plans in the plan group.