List members
GET https://:subdomain.cobot.me/api/memberships
Returns the current members of a space.
- Authentication required:
- yes, additionally user must be a space admin
- Scope required:
- read_memberships
- Rate limit
- 6 rpm
Example
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
}
]
- next_invoice_at
-
The date when the next invoice is going to be sent. Can be null (membership not confirmed, membership canceled). If the member is on a free plan no invoice might be sent.
- upcoming_plan
- If the member has selected a new plan that is not effective yet it is returned here. The upcoming plan will become the membership's plan after the canceled_to date of the old plan has been reached.
- user
- This is the user account that owns this membership. If the membership has been created by an admin and was not claimed this is *null*.
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
Cancel current membership
DELETE https://:subdomain.cobot.me/api/membership
Cancel the current user's membership at the next possible date.
- Authentication required:
- yes, additionally user must be a member of the space
- Scope required:
- write_memberships
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
- Authentication required:
- yes, additionally user must be an admin of the space
- Scope required:
- write_memberships
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
Undo a cancellation as Admin
DELETE https://:subdomain.cobot.me/api/memberships/:id/cancellation
Undoes a cancellation.
- Authentication required:
- yes, additionally user must be an admin of the space
- Scope required:
- write_memberships
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 a membership
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.
- Authentication required:
- yes, additionally user must be a space admin
- Scope required:
- write_memberships
Returns a 204 status code and an empty body.
Example
DELETE https://co-up.cobot.me/api/memberships/0c4f75fa14924423810d6f12aeb56fbb
List canceled memberships
GET https://:subdomain.cobot.me/api/memberships/cancellations
Returns all members that canceled in the given timespan.
- Authentication required:
- yes, additionally user must be a space admin
- Scope required:
- read_memberships
Example
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
}
]
Get membership details
Ad admin:
GET https://:subdomain.cobot.me/api/memberships/:membership_id
As user:
GET https://:subdomain.cobot.me/api/membership/
Returns a single membership.
- Authentication required:
- yes, additionally user must be a space admin or the owner of the membership
- Scope required:
- read_memberships
Example
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
}
- next_invoice_at
-
The date when the next invoice is going to be sent. Can be null (membership not confirmed, membership canceled). If the member is on a free plan no invoice might be sent.
- upcoming_plan
- If the member has selected a new plan that is not effective yet it is returned here. The upcoming plan will become the membership's plan after the canceled_to date of the old plan has been reached.
- user
- This is the user account that owns this membership. If the membership has been created by an admin and was not claimed this is *null*.
Get membership picture
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).
- Authentication required:
- no
- Rate limit
- 6000 rpm
Update membership picture
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>" }
- Authentication required:
- yes, additionally user must be admin or member of the space
- Scope required:
- write_membership_picture
Example
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.
Confirm membership
POST https://:subdomain.cobot.me/api/memberships/:membership_id/confirmation
Confirms a member at a space.
- Authentication required:
- yes, additionally user must be a space admin
- Scope required:
- write_memberships
Example
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.
Create Membership
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.
- Authentication required:
- yes, additionally user must be a space admin or user
- Scope required:
- write_memberships
Example
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.
- address
- Must contain company or name and country
- pre_approved
- For admins only. If passed in with true, it will confirm the membership if no user[id] is set or the plan does not require approval.
- prorate_first_invoice
- For admins only. If passes in with true, a prorated invoice will be generated.
- first_invoice_at
- For admins only - date of the first regular invoice (not prorated).
- plan[id]
- The id of one of the plans of the space. Instead of passing a plan id you can also pass a custom plan as plan.
- plan[extras]
- The ids of the desired extras of the chosen plan.
- requested_starts_at
- If passed in the membership will be requested to start at that date instead of the current day. This will become the starts_at attribute upon confirmation unless its the current day. Then it will be the same as not setting it at all.
- canceled_to
- Optional date the membership should be canceled to.
- user[id]
- Id of the user is optional for admins and no effect for users
Update 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.
- Authentication required:
- yes, additionally user must be a space admin or user
- Scope required:
- write_memberships
Example
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.
- address
- Must contain company or name and country
- email
- Can only be changed by admin if no user is connected.
Connect User to Membership
Adds a existing user to a membership.
POST https://co-up.cobot.me/api/memberships/:membership_id/user
- Authentication required:
- yes, additionally user must be a space admin
- Scope required:
- write_memberships
Example
URL:
POST https://co-up.cobot.me/api/memberships/0c4f75fa14924423810d6f12aeb56fbb/user
Body:
{
"user_token": "0c4f75fa14924423810d6f12aeb56fbb"
}
Returns 200 on success.
- user_token
- To ensure that the user has either authorized the app or was created by the admin via api.
Newsletter Approval
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
.
Internal Memo
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"
}