Cookies help us deliver our services. By using our services, you agree to our use of cookies.

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

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.

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

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.

As admin:

URL:

PUT https://:subdomain.cobot.me/api/memberships/:membership_id/plan

Body:

{
  "name": "new name"
}

Customizes the current plan of a member.

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

URL:

PUT https://co-up.cobot.me/api/memberships/9f663e11ef7383e82cca0dd07a751d78/plan

Body:

{
  "name": "new name"
}

Response:

{
  "name": "new name",
  "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": []
}

As admin:

URL:

PUT https://:subdomain.cobot.me/api/memberships/:membership_id/upcoming_plan

Body:

{
  "name": "new name"
}

Customizes the upcoming plan of a member.

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

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": []
}

back to index