Memberships

get
All Memberships

https://yourcompany.sport-keeper.com/api/v1/memberships
Retrieve all memberships
Request
Response
Request
Path Parameters
page
optional
integer
Results are paginated.
Headers
Authorization
required
string
Auth token
Response
200: OK
Returns an array of memberships. Only the first 20 are returned. Passing the page param will paginate the results.
[
{
"id": 38,
"member_id": 40,
"expiration": "2019-02-25T09:46:31.000-05:00",
"status": "active",
"created_at": "2019-01-25T09:46:31.000-05:00",
"updated_at": "2019-02-03T18:22:37.590-05:00",
"member_group_id": null,
"membership_plan_id": 15,
"merchant_subscription_id": "sub_PKcpdAPK5kex8",
"payment_method": "card"
},
{
"id": 39,
"member_id": 41,
"expiration": "2019-02-05T16:52:47.000-05:00",
"status": "active",
"created_at": "2019-01-15T16:52:47.000-05:00",
"updated_at": "2019-02-03T18:22:37.611-05:00",
"member_group_id": null,
"membership_plan_id": 16,
"merchant_subscription_id": "sub_ELhEKFuhCGj4v",
"payment_method": "card"
}
]

get
Show Membership

https://yourcompany.sport-keeper.com/api/v1/memberships/:id
Retrieve a single membership
Request
Response
Request
Headers
Authorization
required
string
Auth token
Response
200: OK
{
"id": 48,
"member_id": 51,
"expiration": "2019-04-30T12:04:26.000-04:00",
"status": "active",
"created_at": "2019-04-23T12:04:20.074-04:00",
"updated_at": "2019-04-23T12:04:23.691-04:00",
"member_group_id": null,
"membership_plan_id": 16,
"merchant_subscription_id": "sub_EwJiskxQW3XrEb",
"payment_method": "card"
}
404: Not Found
null

post
Create Membership

https://yourcompany.sport-keeper.com/v1/memberships
Request
Response
Request
Headers
Authorization
required
string
Auth Token
Form Data Parameters
payment_method
required
integer
0 - card, 1 - bank, 2 - cash
member_id
required
integer
ID of the member to attach the membership to.
expiration
required
object
Expiration date in datetime format
status
required
integer
0 - active, 1 - past_due, 2 - canceled, 3 - unpaid, 4 - free, 5 - pending
membership_plan_id
required
integer
ID of the Subscription Plan to attach the membership to.
items_attributes
required
array
Array of membership items attributes.
payments_attributes
required
array
Array of payments attributes
Response
200: OK
{
"id": 48,
"member_id": 51,
"expiration": "2019-04-30T12:04:26.000-04:00",
"status": "active",
"created_at": "2019-04-23T12:04:20.074-04:00",
"updated_at": "2019-04-23T12:04:23.691-04:00",
"member_group_id": null,
"membership_plan_id": 16,
"merchant_subscription_id": "sub_EwJkskjQW3XrEb",
"payment_method": "card"
}

patch
Update Membership

https://yourcompany.sport-keeper.com/v1/memberships/:id
Update a single membership. All of the above properties in create membership are valid.
Request
Response
Request
Headers
Authorization
optional
string
Auth token
Response
200: OK
{
"id": 48,
"member_id": 51,
"expiration": "2019-04-30T12:04:26.000-04:00",
"status": "active",
"created_at": "2019-04-23T12:04:20.074-04:00",
"updated_at": "2019-04-23T12:04:23.691-04:00",
"member_group_id": null,
"membership_plan_id": 16,
"merchant_subscription_id": "sub_jwJkskxQW3XrEb",
"payment_method": "card"
}

delete
Delete a Membership

https://yourcompany.sport-keeper.com/v1/memberships/:id
Delete a member.
Request
Response
Request
Headers
Authorization
required
string
Auth token.
Response
200: OK
‚Äč