GET https://:subdomain.cobot.me/api/memberships
Returns the current members of a space.
GET https://co-up.cobot.me/api/memberships
Response:
[ { "id": "0c4f75fa14924423810d6f12aeb56fbb", "name": "johnny doe", "email": "johnny@example.com", "phone": "12345", "user": { "id": "1d4d33ea2501579s146a6f12aeb56fbb", "email": "johnny@example.com" }, "picture": "http://cobot.me/example.jpg", "address": { "company": "ACME corp", "name": "johnny doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "billing_emails": ["john@example.com"], "charge_taxes": true, "customer_number": "10000", "plan": { "booking_credits": [ { "resources": [ { "id": "21234", "name": "Room" }, { "id": "12334", "name": "Room 2" } ], "hours": "3.0", "price_per_hour": "5.0" } ], "name": "basic plan", "description": "cheapest plan", "parent_plan": { "id": "1234" }, "price_per_cycle_in_cents": 10000, "price_per_cycle": "100.0", "tax_rate": "19.0", "cycle_duration": 1, "currency": "EUR", "cancellation_period": 14, "canceled_to": "2010/11/15", "total_price_per_cycle": "105.00", "extras": [ { "name": "locker", "price_in_cents": 500, "price": "5.0", "tax_rate": "19.0", "currency": "EUR" } ], "time_passes": [ { "id": "0", "name": "Day Pass", "price_in_cents": 1000, "price": "10.0", "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.0", "tax_rate": "19.0", "currency": "EUR" } ] } ] }, "upcoming_plan": null, "payment_method": { "name": "cash", "automated": false }, "confirmed_at": "2010/01/01 12:00:00 +0000", "starts_at": "2010/01/01", "canceled_to": "2010/02/01", "next_invoice_at": "2010/03/01", "newsletter_approval": true } ]
You can pass an optional parameter as_of with a date. If you do, the returned list will include members that have been active at the given date (confirmed, not yet canceled).
When passing a parameter all=true, all memberships past, present and future are returned.
When passing a parameter ids=<comma separated ids>, only the memberships with the given ids are returned.
Additionally you can pass a parameter attributes with a comma separated list of attributes to return. Only request the attributes you need to speed up the request.
In the response the parent_plan will reference the original plan of the space that was used to setup this members plan
DELETE https://:subdomain.cobot.me/api/membership
Cancel the current user's membership at the next possible date.
DELETE https://cobot.cobot.me/api/membership
Request:
Response:
{ "id": "0c4f75fa14924423810d6f12aeb56fbb", "name": "johnny doe", "phone": "12345", "user": null, "address": { "company": "ACME corp", "name": "johnny doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "charge_taxes": true, "customer_number": "10000", "billing_emails": ["john@example.com"], "plan": { "booking_credits": [], "name": "basic plan", "description": "-", "parent_plan": { "id": "1234" }, "price_per_cycle_in_cents": 10000, "cycle_duration": 1, "currency": "EUR", "cancellation_period": 14, "canceled_to": null, "total_price_per_cycle": "100.00", "tax_rate": "19.0", "extras": [], "time_passes": [] }, "upcoming_plan": null, "payment_method": { "name": "cash", "automated": false }, "confirmed_at": "2010/01/01 12:00:00 +0000", "starts_at": "2010/01/01", "canceled_to": "2018/01/01", "next_invoice_at": null, "newsletter_approval": true }
POST https://:subdomain.cobot.me/api/memberships/:id/cancellation
Cancel a membership as Admin at a given date
Example:
POST https://cobot.cobot.me/api/memberships/0c4f75fa14924423810d6f12aeb56fbb/cancellation
Body:
{ "date": 2018 / 01 / 01, "delete_all_bookings_on_cancellation": true }
Required attributes: _ date _ delete_all_bookings_on_cancellation, the last determining if all bookings for that member shall be deleted following their cancellation.
Response:
{ "id": "0c4f75fa14924423810d6f12aeb56fbb", "name": "johnny doe", "phone": "12345", "user": null, "address": { "company": "ACME corp", "name": "johnny doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "charge_taxes": true, "customer_number": "10000", "billing_emails": ["john@example.com"], "plan": { "booking_credits": [], "name": "basic plan", "description": "-", "parent_plan": { "id": "1234" }, "price_per_cycle_in_cents": 10000, "cycle_duration": 1, "currency": "EUR", "cancellation_period": 14, "canceled_to": null, "total_price_per_cycle": "100.00", "tax_rate": "19.0", "extras": [], "time_passes": [] }, "upcoming_plan": null, "payment_method": { "name": "cash", "automated": false }, "confirmed_at": "2010/01/01 12:00:00 +0000", "starts_at": "2010/01/01", "canceled_to": "2018/01/01", "next_invoice_at": null, "newsletter_approval": null }
The cancellation date is set in the canceled_to attribute of the membership if cancellation was possible
DELETE https://:subdomain.cobot.me/api/memberships/:id/cancellation
Undoes a cancellation.
Example:
DELETE https://cobot.cobot.me/api/memberships/0c4f75fa14924423810d6f12aeb56fbb/cancellation
Request:
Response:
{ "id": "0c4f75fa14924423810d6f12aeb56fbb", "name": "johnny doe", "phone": "12345", "user": null, "address": { "company": "ACME corp", "name": "johnny doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "charge_taxes": true, "customer_number": "10000", "billing_emails": ["john@example.com"], "plan": { "booking_credits": [], "name": "basic plan", "description": "-", "parent_plan": {"id": "1234"}, "price_per_cycle_in_cents": 10000, "cycle_duration": 1, "currency": "EUR", "cancellation_period": 14, "canceled_to": null, "total_price_per_cycle": "100.00", "tax_rate": "19.0", "extras": [], "time_passes": [] }, "upcoming_plan": null, "payment_method": { "name": "cash", "automated": false }, "confirmed_at": "2010/01/01 12:00:00 +0000",, "starts_at": "2010/01/01", "canceled_to": "2018/01/01", "next_invoice_at": null, "newsletter_approval": true }
DELETE https://:subdomain.cobot.me/api/memberships/:id
Deletes a membership. In most cases, you want to cancel a membership instead, keeping all the data.
Returns a 204 status code and an empty body.
DELETE https://co-up.cobot.me/api/memberships/0c4f75fa14924423810d6f12aeb56fbb
GET https://:subdomain.cobot.me/api/memberships/cancellations
Returns all members that canceled in the given timespan.
GET https://co-up.cobot.me/api/memberships/cancellations?from=2013/01/12&to=2013/02/28</code>
Response:
[ { "id": "0c4f75fa14924423810d6f12aeb56fbb", "name": "johnny doe", "phone": "12345", "user": null, "address": { "company": "ACME corp", "name": "johnny doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "charge_taxes": true, "customer_number": "10000", "billing_emails": ["john@example.com"], "plan": { "booking_credits": [], "name": "basic plan", "description": "-", "parent_plan": { "id": "1234" }, "price_per_cycle_in_cents": 10000, "price_per_cycle": "100.0", "cycle_duration": 1, "currency": "EUR", "cancellation_period": 14, "canceled_to": null, "total_price_per_cycle": "100.0", "tax_rate": "19.0", "extras": [], "time_passes": [] }, "upcoming_plan": null, "payment_method": { "name": "cash", "automated": false }, "confirmed_at": "2010/01/01 12:00:00 +0000", "starts_at": "2010/01/01", "canceled_to": "2013/01/15", "next_invoice_at": null, "newsletter_approval": true } ]
Ad admin:
GET https://:subdomain.cobot.me/api/memberships/:membership_id
As user:
GET https://:subdomain.cobot.me/api/membership/
Returns a single membership.
Ad admin:
GET https://co-up.cobot.me/api/memberships/0c4f75fa14924423810d6f12aeb56fbb
As user:
GET https://:subdomain.cobot.me/api/membership
Response:
{ "id": "0c4f75fa14924423810d6f12aeb56fbb", "name": "johnny doe", "email": "johnny@example.com", "phone": "12345", "user": { "id": "1d4d33ea2501579s146a6f12aeb56fbb", "email": "johnny@example.com" }, "picture": "http://cobot.me/example.jpg", "address": { "company": "ACME corp", "name": "johnny doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "charge_taxes": true, "customer_number": "10000", "billing_emails": ["john@example.com"], "plan": { "booking_credits": [ { "resources": [ { "id": "21234", "name": "Room" }, { "id": "12334", "name": "Room 2" } ], "hours": "3.0", "price_per_hour": "5.0" } ], "name": "basic plan", "description": "cheapest plan", "price_per_cycle_in_cents": 10000, "price_per_cycle": "100.0", "parent_plan": { "id": "1234" }, "tax_rate": "19.0", "cycle_duration": 1, "currency": "EUR", "cancellation_period": 14, "canceled_to": "2010/11/15", "total_price_per_cycle": "105.00", "extras": [ { "name": "locker", "price_in_cents": 500, "price": "5.0", "tax_rate": "19.0", "currency": "EUR" } ], "time_passes": [ { "id": "0", "name": "Day Pass", "price_in_cents": 1000, "price": "10.0", "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.0", "tax_rate": "19.0", "currency": "EUR" } ] } ] }, "upcoming_plan": null, "payment_method": { "instructions": "pay at the counter", "name": "cash", "automated": false }, "confirmed_at": "2010/01/01 12:00:00 +0000", "starts_at": "2010/01/01", "canceled_to": "2010/02/01", "next_invoice_at": "2010/03/01", "newsletter_approval": true }
GET https://:subdomain.cobot.me/api/memberships/:membership_id/picture
Redirects to the member's picture so can be used within an <img/>
tag.
You can get different sizes by appending ?picture_size=<size>
, where size can be one of thumb (50x50), small (120x120), large (285x285), xlarge (600x600), hd (1200x1200).
As admin:
PUT https://:subdomain.cobot.me/api/memberships/:membership_id/picture
As member:
PUT https://:subdomain.cobot.me/api/membership/picture
Stores the given picture and assigns it to the membership. Pictures can either be passed as URL or Base64 encoded data using a data URI.
Body:
{ "url": "<url to png/gif/jpg>" }
Or:
{ "data": "data:<content type>;base64,<base64 encoded image data>" }
As member:
URL:
PUT https://www.cobot.me/api/membership/picture
Body when passing URL:
{ "url": "http://example.com/example.jpg" }
When passing Base64 encoded data:
{ "data": "data:image/png;base64,iVBORw0KGgoAAAA…ggg==" }
Response:
{ "id": "0c4f75fa14924423810d6f12aeb56fbb", "name": "joe doe", "picture": "http://cobot.me/assets/example.jpg", "...": "..." }
Pictures should be png, jpg or gif and at least 600x600px. Non-square pictures will be cropped.
POST https://:subdomain.cobot.me/api/memberships/:membership_id/confirmation
Confirms a member at a space.
POST https://co-up.cobot.me/api/memberships/fdc00612c086d003fab5d99539153f68/confirmation
Body:
{ "confirmation_date": "2018/05/20", "first_invoice_date": "2018/06/01", "prorate": true }
Both dates are optional. The default confirmation_date
is today. The default first_invoice_date
is today if default_invoice_date
in invoice settings is not set, otherwise the next date matching that day. first_invoice_date
must be the same or after confirmation_date
. confirmation_date
must be today or in the future. prorate
determines whether to send a prorated invoice for the time between the confirmation date and the first invoice date. Default is false.
Returns the membership and staus 201.
Creating a new membership as admin
POST https://:subdomain.cobot.me/api/memberships
Creating a new membership as user
POST https://:subdomain.cobot.me/api/membership
Creates a new membership. Depending on the pre_approved
parameter and wether a user was assigned, the membership will be confirmed automatically.
URL:
As admin
POST https://co-up.cobot.me/api/memberships
As user
POST https://co-up.cobot.me/api/membership
Body:
As admin
{ "address": { "name": "joe doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "plan": { "id": "134986", "extras": ["58375"] }, "email": "adam@example.com", "billing_email": "lisa@example.com", "phone": "12345", "pre_approved": false, "requested_starts_at": "2016/07/01", "canceled_to": "2016/11/15" "user": { "id": "2376ffh976a290873b98h" }, "paying_membership_id": "9a761fh976a200874b9dd" }
As user
{ "address": { "name": "joe doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "phone": "12345", "requested_starts_at": "2016/07/01", "plan": { "id": "134986", "extras": ["58375"] } }
Response:
{ "id": "0c4f75fa14924423810d6f12aeb56fbb", "name": "joe doe", "email": "joe@doe.com", "phone": "12345", "user": { "id": "2376ffh976a290873b98h", "email": "joe@doe.com" }, "address": { "company": null, "name": "joe doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "charge_taxes": true, "customer_number": "10000", "billing_emails": ["john@example.com"], "plan": { "booking_credits": [ { "resources": [ { "id": "21234", "name": "Room" }, { "id": "12334", "name": "Room 2" } ], "hours": "3.0", "price_per_hour": "5.0" } ], "name": "basic plan", "description": "cheapest plan", "parent_plan": { "id": "134986" }, "price_per_cycle_in_cents": 10000, "price_per_cycle": "100.0", "tax_rate": "19.0", "cycle_duration": 1, "currency": "EUR", "cancellation_period": 14, "canceled_to": "2010/11/15", "total_price_per_cycle": "105.00", "extras": [ { "name": "locker", "price_in_cents": 500, "price": "5.0", "tax_rate": "19.0", "currency": "EUR" } ], "time_passes": [ { "id": "0", "name": "Day Pass", "price_in_cents": 1000, "price": "10.0", "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.0", "tax_rate": "19.0", "currency": "EUR" } ] } ] }, "requested_starts_at": "2016/07/01", "upcoming_plan": null, "starts_at": null, "confirmed_at": null, "canceled_to": null, "first_invoice_at": null, "next_invoice_at": null, "newsletter_approval": null }
Returns 201 on success. A 409 means that the user already has a membership.
Update membership details as admin
PUT https://co-up.cobot.me/api/memberships/:membership_id
Update membership details as user
POST https://:subdomain.cobot.me/api/membership
Allows to update the address, tax_id and billing email for a membership. Admins can also update the email if not connected to a user.
URL:
As admin
PUT https://co-up.cobot.me/api/memberships/0c4f75fa14924423810d6f12aeb56fbb
As user
PUT https://co-up.cobot.me/api/membership
Body:
As admin
{ "address": { "name": "joe doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "billing_email": "billing1@email.de @billing2@email.de", "tax_id": "DE123456566", "email": "joe@doe.com", "phone": "12345" }
As user
{ "address": { "name": "joe doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "billing_email": "billing1@email.de @billing2@email.de", "tax_id": "DE123456566", "phone": "12345" }
Response:
{ "id": "0c4f75fa14924423810d6f12aeb56fbb", "name": "joe doe", "email": "joe@doe.com", "phone": "12345", "user": { "id": "2376ffh976a290873b98h", "email": "joe@doe.com" }, "address": { "company": null, "name": "joe doe", "full_address": "broadway\n12345 Berlin", "country": "Germany" }, "charge_taxes": true, "customer_number": "10000", "billing_emails": ["billing1@email.de", "@billing2@email.de"], "plan": { "booking_credits": [], "name": "basic plan", "description": "cheapest plan", "parent_plan": { "id": "1234" }, "price_per_cycle_in_cents": 10000, "price_per_cycle": "100.0", "tax_rate": "19.0", "cycle_duration": 1, "currency": "EUR", "cancellation_period": 14, "canceled_to": "2010/11/15", "total_price_per_cycle": "105.00", "extras": [ { "name": "locker", "price_in_cents": 500, "price": "5.0", "tax_rate": "19.0", "currency": "EUR" } ], "time_passes": [] }, "requested_start_date": "2010/01/01", "starts_at": null, "upcoming_plan": null, "confirmed_at": null, "canceled_to": null, "next_invoice_at": null, "tax_id": "DE123456566", "newsletter_approval": true }
Returns 200 on success.
Adds a existing user to a membership.
POST https://co-up.cobot.me/api/memberships/:membership_id/user
URL:
POST https://co-up.cobot.me/api/memberships/0c4f75fa14924423810d6f12aeb56fbb/user
Body:
{ "user_token": "0c4f75fa14924423810d6f12aeb56fbb" }
Returns 200 on success.
This section applies only to spaces in the European Union.
As a part of General Data Protection Regulation, your members need to double opt-in for any newsletters you might send. As the first opt-in step, there is a checkbox on signup where user can choose if they agree to receive such e-mails in the future.
Without this approval, it's not possible to add a member to a list on MailChimp using our official add-on, and you shouldn't do it using any other tools.
This information is stored and displayed on every membership as boolean value:
{ "newsletter_approval": true }
The default value is false
.
Membership attribute deprecated and replaced by [membership notes](membership-notes).
This information is stored and displayed on every membership via API (only accessible to admins), but it's not visible anywhere in the UI.
{ "internal_memo": "A private note" }