Skip to content

Membership

Check the status of a membership (from an email address)

Section titled “Check the status of a membership (from an email address)”
GET https://api.sheepcrm.com/api/v1/$FLOCK/user/membership/?email=james@sheepcrm.com
Authorization: Bearer $API_KEY
HTTP/1.1 200 OK
{
"active_memberships_for_display": [
"Membership Grade F"
],
"first_name": "James",
"last_name": "Webster",
"member_since": "2019-01-01T00:00:00",
"member_till": "2021-01-01T00:00:00",
"member_till_plus_grace": "2021-12-31T00:00:00",
"membership_numbers": [
"EAB54"
],
"membership_record_status": "active",
"person": "/example/person/5e3453b40b915a4c234a36ab/",
"photo": null,
"photo-avatar": null,
"primary_email": "james@sheepcrm.com"
}
ParameterDescription
memberRequired. The URI of the member (the person or organisation URI).
membership_typeRequired. The URI of the membership type to create.
start_dateOptional. When the membership should start (default = today).
amountOptional. Membership price (if not the list price).
currencyOptional. Membership currency (if not the list currency).
POST https://api.sheepcrm.com/api/v1/$FLOCK/member/
Authorization: Bearer $API_KEY
Content-Type: application/json
{
"membership_type": "/example/membership_type/1234abc/",
"member": "/example/person/5e3453b40b915a4c234a36ab/"
}
HTTP/1.1 201 CREATED

A membership URI is in the format /{FLOCK}/member/{UID}/. For convenience we use a variable $MEMBER_URI to represent that in the following examples.

POST https://api.sheepcrm.com/api/v1/$MEMBER_URI/activate/
Authorization: Bearer $API_KEY

Types of cancellation:

  • Default — Cancel immediately with no reason. The status will be cancelled and the membership ends immediately.
  • Early end — If the cancellation is for a future date earlier than the natural expiry or lapse date, provide a when value. The end date of the membership will be brought forward and auto renewal turned off. The membership will be active until the new end date, after which it will appear as lapsed.
  • Advise lapse — If the cancellation is a decision not to renew, the membership is simply allowed to lapse and not renew. This will appear as lapsed in reports.
ParameterDescription
reasonOptional. Reason for cancellation.
whenOptional. When should the cancellation occur. Default = immediate. Accepts date strings or on_expiry to allow a lapse.
POST https://api.sheepcrm.com/api/v1/$MEMBER_URI/cancel/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"reason": "too expensive", "when": "2021-12-31"}
POST https://api.sheepcrm.com/api/v1/$MEMBER_URI/renew/
Authorization: Bearer $API_KEY

Remove the payment plan from the membership after checking that no future payments exist:

POST https://api.sheepcrm.com/api/v1/$MEMBER_URI/remove_payment_plan/
Authorization: Bearer $API_KEY

Create payments based on the schedule defined in the payment plan:

POST https://api.sheepcrm.com/api/v1/$MEMBER_URI/unpack_payment_plan/
Authorization: Bearer $API_KEY

Delete any future payments that are associated with the payment plan:

POST https://api.sheepcrm.com/api/v1/$MEMBER_URI/delete_future_scheduled_payments/
Authorization: Bearer $API_KEY

If the membership supports linked members:

ParameterDescription
linked_member_uriRequired. The URI of the contact to be added as a linked member.
forceOptional. Force adding the linked member by removing a linked member to make room. true/false (defaults to false).
POST https://api.sheepcrm.com/api/v1/$MEMBER_URI/linked_members/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"linked_member_uri": "/example/person/5c407b48d4069413d21d4d0e/"}
HTTP/1.1 200 OK
{
"linked_members": [
"/example/person/5b5769f48b38805e2981d1ea/"
],
"status": "OK"
}

Storing additional data on a membership record

Section titled “Storing additional data on a membership record”

The membership record has an extra field which can be used to store JSON formatted data. This data is not readily available to users within the CRM and is not exported.

PUT https://api.sheepcrm.com/api/v1/$MEMBER_URI/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"extra": "{\"my-custom-field\":\"my value\"}"}
HTTP/1.0 200 OK
{
"errors": {},
"updates": {
"extra": "{\"my-custom-field\":\"my value\"}"
}
}

No auth required:

GET https://api.sheepcrm.com/api/v1/public/$MEMBER_URI/certificate/
ParameterDescription
templateOptional. Registered certificate template. Default is sheep-membership-certificate-a4.

No auth required:

GET https://api.sheepcrm.com/api/v1/public/$MEMBER_URI/invoice/
ParameterDescription
templateOptional. Registered invoice template. Default is sheep-invoice-a4.

If no invoice exists for the membership, a PDF with a missing invoice message will be returned.

GET https://api.sheepcrm.com/api/v1/$FLOCK/member/
GET https://api.sheepcrm.com/api/v1/$FLOCK/member/?membership_record_status=active
GET https://api.sheepcrm.com/api/v1/$FLOCK/member/?membership_record_status__ne=active
GET https://api.sheepcrm.com/api/v1/$FLOCK/member/?created__gte=yesterday
GET https://api.sheepcrm.com/api/v1/$FLOCK/member/?created__gte=2020-01-30

Read the membership number counter to see the next number. An error packet with “not configured” will be returned if the membership number has not yet been set.

GET https://api.sheepcrm.com/api/v1/$FLOCK/system/membership_number/
Authorization: Bearer $API_KEY
HTTP/1.1 200 OK
{
"auto_membership_number_next": 26
}

Reset the counter to a new number:

POST https://api.sheepcrm.com/api/v1/$FLOCK/system/membership_number/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"reset_value": 45}
HTTP/1.1 200 OK
{
"auto_membership_number_next": 46
}