GET https://:subdomain.cobot.me/api/plans
Returns all plans for a space.
You can optionally authenticate with the read_plans
scope. This will add the welcome_message
attribute to the plans JSON and also show hidden plans.
Example
GET https://co-up.cobot.me/api/plans
Response:
[ { "id": "12345", "name": "basic", "color": "#b4c300", "photo": "/url/to/photo.jpg", "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": 1, "hidden": false, "tax_rate": "19.0", "signup_charge": { "amount": "100.00", "tax_rate": "0.0", "description": "Deposit", "accounting_code": "DEP" }, "booking_credits": [ { "resources": [ { "id": "a87hdg", "name": "Room" }, { "id": "dskjh1", "name": "Room 2" } ], "hours": "3.0", "price_per_hour": "5.0" } ], "time_passes": [ { "id": "0", "name": "Day Pass", "price_in_cents": 1000, "price": "10.00", "tax_rate": "19.0", "currency": "EUR", "timespans": "4-3:59", "parsed_timespans": [ { "from_hour": 4, "from_minute": 0, "to_hour": 3, "to_minute": 59, "weekdays": [] } ], "included_per_timespan": 7, "included_timespan": "month", "discounts": [ { "number_of_passes": 10, "price_in_cents": 10000, "price": "100.00", "tax_rate": "19.0", "currency": "EUR" } ] } ], "extras": [ { "id": "1", "name": "Locker", "price_in_cents": 1500, "price": "15.00", "tax_rate": "19.0", "currency": "EUR" } ] } ]
GET https://:subdomain.cobot.me/api/plans/:plan_id
Returns the details for a single plan.
GET https://co-up.cobot.me/api/plans/12345
Response:
{ "id": "12345", "name": "basic", "color": "#b4c300", "photo": "/url/to/photo.jpg", "price_per_cycle": "100.0", "cycle_duration": 1, "currency": "EUR", "terms": "pay immediately", "description": "basic plan", "cancellation_period": 30, "minimum_commitment": 1, "hidden": false, "signup_charge": { "amount": "100.00", "tax_rate": "0.0", "description": "Deposit", "accounting_code": "DEP" }, "booking_credits": [ {"resources":[ {"id": "a87hdg", "name":"Room"}, {"id": "dskjh1", "name":"Room 2"}], "hours":"3.0", "price_per_hour":"5.0" } ], "time_passes": [ { "id": "0", "name": "Day Pass", "price_in_cents": 1000, "price": "10.00" "currency": "EUR", "timespans": "4-3:59", "parsed_timespans": [ {"from_hour": 4, "from_minute": 0, "to_hour": 3, "to_minute": 59, "weekdays": []} ], "included_per_timespan": 7, "included_timespan": "month", "discounts": [ { "number_of_passes": 10, "price_in_cents": 10000, "price": "100.00", "currency": "EUR" } ] } ], "extras": [ { "id": "1", "name": "Locker", "price_in_cents": 1500, "price": "15.00", "currency": "EUR" } ] }
POST https://subdomain.cobot.me/plans
Creates a plan for a space.
URL:
POST https://co-up.cobot.me/api/plans
Body:
{ "id": "12345", "name": "Basic Plan", "color": "#b4c300", "photo": "/url/to/photo.jpg", "description": "For basic members", "price_per_cycle": "95.5", "cycle_duration": 2, "currency": "EUR", "terms": "Pay immediately", "cancellation_period": 30, "minimum_commitment": 1, "hidden": false, "signup_charge": { "amount": "100.00", "tax_rate": "0.0", "description": "Deposit", "accounting_code": "DEP" }, "time_passes": [ { "name": "Day Pass", "price_in_cents": 1000, "included_per_timespan": 4, "included_timespan": "month", "timespans": "4-3:59", "parsed_timespans": [ { "from_hour": 4, "from_minute": 0, "to_hour": 3, "to_minute": 59, "weekdays": [] } ], "discounts": [ { "number_of_passes": 10, "price_in_cents": 10000 } ] } ], "extras": [ { "name": "Locker", "price_in_cents": 2000 } ] }
Returns a 201 response with the plan's attributes on success, 422 if the plan could not be created due to missing/invalid attributes (validation errors are returned as JSON).
PUT https://:subdomain.cobot.me/api/plans/:plan_id
Updates a plan.
URL:
PUT https://co-up.cobot.me/api/plans/5e0cf837aad41efc609aedab319422d6
Body:
{ "id": "12345", "name": "Basic Plan", "color": "#b4c300", "photo": "/url/to/photo.jpg", "description": "For basic members", "price_per_cycle": "95.5", "cycle_duration": 2, "currency": "EUR", "terms": "Pay immediately", "cancellation_period": 30, "minimum_commitment": 1, "hidden": false, "signup_charge": { "amount": "100.00", "tax_rate": "0.0", "description": "Deposit", "accounting_code": "DEP" }, "time_passes": [ { "name": "Day Pass", "price_in_cents": 1000, "included_per_timespan": 4, "included_timespan": "month", "timespans": "4-3:59", "parsed_timespans": [ { "from_hour": 4, "from_minute": 0, "to_hour": 3, "to_minute": 59, "weekdays": [] } ], "discounts": [ { "number_of_passes": 10, "price_in_cents": 10000 } ] } ], "extras": [ { "name": "Locker", "price_in_cents": 2000 } ] }
Returns a 200 response with the plan's attributes on success, 422 if the plan could not be updated due to missing/invalid attributes (validation errors are returned as JSON).
DELETE https://:subdomain.cobot.me/api/plans/:plan_id
Deletes a plan.
URL:
DELETE https://co-up.cobot.me/api/plans/5e0cf837aad41efc609aedab319422d6
Returns an empty 200 response.