See plan history
As admin:
GET https://:subdomain.cobot.me/api/memberships/:membership_id/plans
- Authentication required:
- yes, additionally user must be a space admin
- Scope required:
- read_memberships
Example
URL:
GET https://co-up.cobot.me/api/memberships/1235/plans
Response:
[{
"name": "basic",
"parent_plan": {"id": "320475"},
"price_per_cycle": "100.0",
"price_per_cycle_in_cents": 10000,
"cycle_duration": 1,
"currency": "EUR",
"terms": "pay immediately",
"description": "basic plan",
"cancellation_period": 30,
"minimum_commitment": 0,
"hidden": false,
"total_price_per_cycle": "100.0",
"tax_rate": "19.0",
"time_passes": [],
"canceled_to": null,
"extras": [
{
"name": "Locker",
"price_in_cents": 2000,
"price": "20.0",
"tax_rate": "19.0",
"time_passes": [],
"canceled_to": null,
"extras": [
{
"name": "Locker",
"price_in_cents": 2000,
"price": "20.0",
"tax_rate": "19.0",
"currency": "EUR"
}
]
}]
"currency": "EUR"
}
]
}]
In the response the parent_plan will reference the original plan of the space that was used to setup this plan.
Change Plan
As admin:
POST https://:subdomain.cobot.me/api/memberships/:membership_id/plans
Changes the plan of the membership either to the given date or when the next change is possible.
As member:
POST https://:subdomain.cobot.me/api/membership/plan
Changes the plan of the membership when the next change is possible.
- Authentication required:
- yes, additionally user must be a space admin or member
- Scope required:
- write_memberships
Example
As admin:
URL:
POST https://co-up.cobot.me/api/memberships/1235/plans
Body:
{
"plan_id": "320475",
"change_date": "2011-10-30",
"extras": ["33"]
}
As member:
URL:
POST https://co-up.cobot.me/api/membership/plan
Body:
{
"plan_id": "320475",
"extras": ["33"]
}
Response:
{
"name": "basic",
"parent_plan": { "id": "320475" },
"price_per_cycle": "100.0",
"price_per_cycle_in_cents": 10000,
"cycle_duration": 1,
"currency": "EUR",
"terms": "pay immediately",
"description": "basic plan",
"cancellation_period": 30,
"minimum_commitment": 0,
"hidden": false,
"total_price_per_cycle": "100.0",
"tax_rate": "19.0",
"time_passes": [],
"canceled_to": null,
"starts_at": "2011/10/30",
"extras": [
{
"name": "Locker",
"price_in_cents": 2000,
"price": "20.0",
"tax_rate": "19.0",
"currency": "EUR"
}
]
}
The change_date parameter is optional. It allows to enforce when the plan is changed in the future. If you don't provide it the plan will be changed as soon the cancellation period of the current plan allows it. On success returns a status code of 201 and the new plan as JSON with starts_at being the date the plan becomes active. If the plan is invalid returns 422 and the errors as JSON.
In order to add extras to the membership's plan you pass in the ids of the extras from the original plan.
In the response the parent_plan will reference the original plan of the space that was used to setup this plan.
Customize Member's current Plan
As admin:
URL:
PUT https://:subdomain.cobot.me/api/memberships/:membership_id/plan
Body:
Customizes the current plan of a member.
- Authentication required:
- yes, additionally user must be a space admin
- Scope required:
- write_memberships
Example
URL:
PUT https://co-up.cobot.me/api/memberships/9f663e11ef7383e82cca0dd07a751d78/plan
Body:
{
"name": "plan with credits",
"booking_credits": [
{
"price_per_hour": "30.0",
"included_unit": "hours",
"included_value": "5.0",
"resource_ids": ["12345", "67890"]
}
]
}
Response:
{
"name": "plan with credits",
"parent_plan": { "id": "320475" },
"price_per_cycle": "100.0",
"price_per_cycle_in_cents": 10000,
"cycle_duration": 1,
"currency": "EUR",
"terms": "pay immediately",
"description": "basic plan",
"cancellation_period": 30,
"minimum_commitment": 0,
"hidden": false,
"total_price_per_cycle": "100.0",
"tax_rate": "19.0",
"time_passes": [],
"canceled_to": null,
"extras": [],
"booking_credits": [
{
"resources": [
{ "id": "12345", "name": "Room" },
{ "id": "67890", "name": "Room 2" }
],
"hours": "5.0",
"price_per_hour": "30.0"
}
]
}
Customize Member's upcoming Plan
As admin:
URL:
PUT https://:subdomain.cobot.me/api/memberships/:membership_id/upcoming_plan
Body:
Customizes the upcoming plan of a member.
- Authentication required:
- yes, additionally user must be a space admin
- Scope required:
- write_memberships
Example
URL:
PUT https://co-up.cobot.me/api/memberships/9f663e11ef7383e82cca0dd07a751d78/upcoming_plan
Body:
{
"name": "new upcoming plan"
}
Response:
{
"name": "new upcoming plan",
"parent_plan": { "id": "320475" },
"price_per_cycle": "100.0",
"price_per_cycle_in_cents": 10000,
"total_price_per_cycle": "100.0",
"cycle_duration": 1,
"currency": "EUR",
"terms": "pay immediately",
"description": "basic plan",
"cancellation_period": 30,
"minimum_commitment": 0,
"hidden": false,
"total_price_per_cycle": "100.0",
"tax_rate": "19.0",
"time_passes": [],
"canceled_to": null,
"starts_at": "2016/10/10",
"extras": []
}