Cancel a membership for the paying member

POST /api/members/{memberId}/memberships/{membershipRef}/cancel

Success: 200 OK

Overview

Cancels a membership on the instruction of the member who pays for it — the action behind a "cancel my membership" button in a self-service account area. Call Get member memberships and payment information first: each membership there carries a cancellation object saying whether this call will succeed, what it will do, and which dates the member may choose from. Show the member that outcome and get their confirmation before you call this endpoint, because a cancellation cannot be undone through the API.

The eligibility rules are checked again when you call, using the same rules as the memberships call, so a request built from an out-of-date screen is refused rather than honoured. There are two outcomes:

A membership that covers linked members (applyToLinks is true) is cancelled for everyone it covers.

After a successful cancellation the platform sends the member a confirmation email and sends the operator's staff an internal notification, unless the operator has switched either email off. The internal notification goes to the addresses in the operator's Self-Serve Cancellation Internal Recipients setting; when that is blank, no notification is sent.

This endpoint does not refund anything. A member who cancels inside the cooling-off period may be owed money, and the operator's staff handle that from the internal notification. Do not tell the member a refund has been made.

The cooling-off period is the operator's configured cooling-off period, counted in days from the date the membership was bought, not the date it starts. An operator that has not configured one gets 14 days.

Endpoint

POST {base_url}/api/members/{memberId}/memberships/{membershipRef}/cancel

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
memberIdinteger (int32)YesThe member asking to cancel. Must be greater than 0 — 0 and negative values are rejected with 400. This must be the member who pays for the membership: if the membership is allocated to this member but paid for by someone else, such as a parent paying for a child, the request is refused with 409 and reasonID 2. Compare it with paidByMember.id from the memberships call.
membershipRefinteger (int32)YesThe membership to cancel — the membershipRef of an entry returned by Get member memberships and payment information for the same memberId. Not the membership type id. If the member holds or pays for no membership with this reference, the request fails with 404.

Request body

The body is optional. Omit it entirely, or send {}, to take the earliest offered date.

FieldTypeRequiredDescription
effectiveDatestring (date)NoThe date the cancellation takes effect, as a calendar date (YYYY-MM-DD): the last day the member keeps their membership. Only for a membership whose cancellation.reasonID is 8, and it must be one of the dates in that membership's cancellation.cancellationDates — any other date is rejected with 400. The list is worked out again when you call, so a date offered yesterday may no longer be accepted today if it has dropped off the front of the list. Sending it at all for a membership inside its cooling-off period (reasonID 7) is rejected with 400, because that cancellation takes effect immediately. When omitted, the earliest offered date is used.

Sample request

cURL
curl -X POST '{base_url}/api/members/{memberId}/memberships/{membershipRef}/cancel' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "effectiveDate": "2026-11-16"
}'

Response fields

FieldTypeDescription
membershipRefinteger (int32)The membership that was cancelled, as sent in the path.
reasonstringThe outcome the cancellation was carried out under, in English — the same text as cancellation.reason on the memberships call. Not translated: use reasonID to choose your own copy and treat this as a fallback.
reasonIDinteger (int32)7 when the membership was ended immediately inside its cooling-off period, 8 when it was set to stop renewing on effectiveDate. If this differs from what your screen showed, the member's situation changed between the two calls — for example, the cooling-off period ended.
effectiveDatestring (date)For reasonID 8, the last day the member keeps the membership, as a calendar date (YYYY-MM-DD). null for reasonID 7, because the membership has already ended.

Sample response

200 OK
{
  "membershipRef": 3014,
  "reason": "This membership will stop renewing and remain active until its cancellation takes effect",
  "reasonID": 8,
  "effectiveDate": "2026-11-16"
}
409 Conflict
{
  "allowed": false,
  "reason": "Only the member who pays for this membership can cancel it",
  "reasonID": 2,
  "cancellationDates": []
}

Errors

StatusMeaningWhen
400Bad requestmemberId is 0 or negative. The body is {memberId} is an invalid member ID.
400Bad requesteffectiveDate was sent for a membership that is cancelled immediately — Membership {membershipRef} cancels immediately, so it cannot be asked to take effect on a later date.
400Bad requesteffectiveDate is not one of the membership's current cancellationDates — {dd/MM/yyyy} is not one of the dates membership {membershipRef} can be cancelled on.
400Bad requesteffectiveDate is not a valid date. The body is a validation problem document (application/problem+json) with an errors map keyed by field name.
404Not foundThe member holds or pays for no membership with this reference — Membership {membershipRef} was not found for member {memberId}. Expired memberships are still found, and refused with 409 instead.
409ConflictThe member may not cancel this membership. The body is the same cancellation object the memberships call returns, with allowed false; branch on reasonID (2 to 6, listed below). Nothing is changed.
501Not implementedThe member may cancel, but the membership's own terms do not produce a date for the cancellation to take effect on — Membership {membershipRef} can be cancelled but its contract terms do not yield a date for it to take effect. This is the same situation as an empty cancellationDates list on a reasonID 8 membership. Nothing is changed; the member needs to contact the operator.
501Not implementedThe membership is in a cancellable state this endpoint cannot carry out — Cancelling membership {membershipRef} is allowed but the outcome is not one this endpoint can action. Nothing is changed.
500Internal server errorAny other unexpected failure. No detail is returned.

The reasonID values a 409 can carry:

reasonIDreasonWhen
2Only the member who pays for this membership can cancel itmemberId is not the paying member — typically a linked family member whose membership someone else pays for.
3This membership can only be cancelled during the cooling-off periodA membership that does not auto-renew, past its cooling-off period. It will simply end on its expiry date.
4This membership cannot be cancelled because all of its uses have been takenA usage membership (a bundle of visits) inside its cooling-off period with no uses left.
5This membership has already been cancelledThe membership already has a renewalStopDate, whether set by the member or by the operator's staff.
6This membership has already expiredNothing is left to cancel.

reasonID 1 (Self-service cancellations are not enabled) is also defined. The numbering will only ever be added to, never changed, so it is safe to switch on.

Notes

This page as markdown · All pages · llms.txt