GET https://:subdomain.cobot.me/api/plans

Returns all plans for a space.

Authentication required:
no

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"
      }
    ]
  }
]
minimum_commitment
Time a member has to stay on the plan in momths before they can change or cancel it.
price_per_cycle/cycle_duration
Cycle refers to the billing cycle. Cycles are counted in months, i.e. a cycle_duration of 2 means the plan is invoiced every 2 months.
time_passes
describes the time passes the member can buy. You need the id in here to assign time passes via the _time_passes_ api.
photo
To get a different photo size, add a photo_size query parameter. Available sizes are default (300x200), xlarge (1200x900), large (900x600), small (120x120) and xsmall (120x80).
GET https://:subdomain.cobot.me/api/plans/:plan_id

Returns the details for a single plan.

Authentication required:
no
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.

Authentication required:
yes, additionally user must be a space admin
Scope required:
write

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).

minimum_commitment
Time a member has to stay on the plan in momths before they can change or cancel it.
included_timespan
Can be either blank, week or month. In combination with included_per_timespan allows you to give members a number of time passes per week/month included in the plan. (optional)
cancellation_period
Cancellation period in days (optional)
hidden
Determines whether a plan is visible publicly or can only be assigned by admins. (default: false)
PUT https://:subdomain.cobot.me/api/plans/:plan_id

Updates a plan.

Authentication required:
yes, additionally user must be a space admin
Scope required:
write

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.

Authentication required:
yes, additionally user must be a space admin
Scope required:
write

URL:

DELETE https://co-up.cobot.me/api/plans/5e0cf837aad41efc609aedab319422d6

Returns an empty 200 response.

back to index