Membership
Admin Membership Calls
Section titled “Admin Membership Calls”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.comAuthorization: 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"}Create a membership record
Section titled “Create a membership record”| Parameter | Description |
|---|---|
member | Required. The URI of the member (the person or organisation URI). |
membership_type | Required. The URI of the membership type to create. |
start_date | Optional. When the membership should start (default = today). |
amount | Optional. Membership price (if not the list price). |
currency | Optional. Membership currency (if not the list currency). |
POST https://api.sheepcrm.com/api/v1/$FLOCK/member/Authorization: Bearer $API_KEYContent-Type: application/json
{ "membership_type": "/example/membership_type/1234abc/", "member": "/example/person/5e3453b40b915a4c234a36ab/"}
HTTP/1.1 201 CREATEDA membership URI is in the format /{FLOCK}/member/{UID}/. For convenience we use a variable $MEMBER_URI to represent that in the following examples.
Activate a pending membership
Section titled “Activate a pending membership”POST https://api.sheepcrm.com/api/v1/$MEMBER_URI/activate/Authorization: Bearer $API_KEYCancel a membership
Section titled “Cancel a membership”Types of cancellation:
- Default — Cancel immediately with no reason. The status will be
cancelledand the membership ends immediately. - Early end — If the cancellation is for a future date earlier than the natural expiry or lapse date, provide a
whenvalue. 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 aslapsed. - 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
lapsedin reports.
| Parameter | Description |
|---|---|
reason | Optional. Reason for cancellation. |
when | Optional. 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_KEYContent-Type: application/json
{"reason": "too expensive", "when": "2021-12-31"}Renew a membership
Section titled “Renew a membership”POST https://api.sheepcrm.com/api/v1/$MEMBER_URI/renew/Authorization: Bearer $API_KEYRemove payment plan from membership
Section titled “Remove payment plan from membership”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_KEYUnpack payment plan from membership
Section titled “Unpack payment plan from membership”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_KEYDelete future scheduled payments
Section titled “Delete future scheduled payments”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_KEYAdd a linked member
Section titled “Add a linked member”If the membership supports linked members:
| Parameter | Description |
|---|---|
linked_member_uri | Required. The URI of the contact to be added as a linked member. |
force | Optional. 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_KEYContent-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_KEYContent-Type: application/json
{"extra": "{\"my-custom-field\":\"my value\"}"}
HTTP/1.0 200 OK{ "errors": {}, "updates": { "extra": "{\"my-custom-field\":\"my value\"}" }}Membership certificate
Section titled “Membership certificate”No auth required:
GET https://api.sheepcrm.com/api/v1/public/$MEMBER_URI/certificate/| Parameter | Description |
|---|---|
template | Optional. Registered certificate template. Default is sheep-membership-certificate-a4. |
Membership invoice
Section titled “Membership invoice”No auth required:
GET https://api.sheepcrm.com/api/v1/public/$MEMBER_URI/invoice/| Parameter | Description |
|---|---|
template | Optional. 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.
Bulk Admin Membership Calls
Section titled “Bulk Admin Membership Calls”Get all members
Section titled “Get all members”GET https://api.sheepcrm.com/api/v1/$FLOCK/member/Get all active members
Section titled “Get all active members”GET https://api.sheepcrm.com/api/v1/$FLOCK/member/?membership_record_status=activeGet all non-active members
Section titled “Get all non-active members”GET https://api.sheepcrm.com/api/v1/$FLOCK/member/?membership_record_status__ne=activeGet all recently added members
Section titled “Get all recently added members”GET https://api.sheepcrm.com/api/v1/$FLOCK/member/?created__gte=yesterdayGET https://api.sheepcrm.com/api/v1/$FLOCK/member/?created__gte=2020-01-30Automatic Membership Numbers
Section titled “Automatic Membership Numbers”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_KEYContent-Type: application/json
{"reset_value": 45}
HTTP/1.1 200 OK{ "auto_membership_number_next": 46}