curl --request POST \
--url https://api.letsdothis.com/v0/membership-policies/{policyId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"cancelWhen": "<string>"
}
'const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({cancelWhen: '<string>'})
};
fetch('https://api.letsdothis.com/v0/membership-policies/{policyId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.letsdothis.com/v0/membership-policies/{policyId}/cancel"
payload = { "cancelWhen": "<string>" }
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"policyId": "<string>",
"pendingChange": {
"id": "<string>",
"kind": "OFFERING",
"timing": "NOW",
"effectiveAt": "2023-11-07T05:31:56Z",
"requestedAt": "2023-11-07T05:31:56Z",
"requestedByKind": "<string>",
"requestedVia": "<string>",
"cancellationCause": "<string>",
"toOfferingId": "<string>",
"direction": "<string>",
"amountDueNow": {
"value": 123,
"currencyCode": "<string>"
},
"payBy": "2023-11-07T05:31:56Z",
"releaseSeatIds": [
"<string>"
]
},
"coolingOffRefund": {
"outcome": "<string>",
"amount": {
"value": 123,
"currencyCode": "<string>"
}
},
"outstandingInvoicesVoidIncomplete": true
}{
"code": "MEMBERSHIP_INVALID_REQUEST",
"statusCode": 400,
"message": "<string>"
}{
"code": "MEMBERSHIP_CANCELLATION_INVOICE_CHOICE_NOT_PERMITTED",
"statusCode": 403,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 404,
"message": "<string>"
}{
"code": "MEMBERSHIP_CANCELLATION_IN_PROGRESS",
"statusCode": 409,
"message": "<string>"
}{
"code": "MEMBERSHIP_IDEMPOTENCY_KEY_REUSED",
"statusCode": 422,
"message": "<string>"
}Cancel a membership policy
Cancels immediately or at the end of the billing period. A member token acts as the primary member, under the scheme’s cancellation rules and notice period. An organizer key acts as the organizer, with no notice period, and may cancel immediately. With an organizer key, invoices the membership still owes stay owed unless the request sends outstandingInvoices VOID; the cancellation quote says what is owed. A member’s own cancellation voids an unpaid invoice in two cases: cancelling immediately inside a cooling-off window, and an unpaid member cancelling on a scheme with no notice period, whose membership ends at once. Organizer keys may also send an optional reason code and a private note of up to 2000 characters; this audit context does not change billing. Send an Idempotency-Key unique to each cancellation and reuse it when retrying. Additional cancelWhen values may be introduced.
curl --request POST \
--url https://api.letsdothis.com/v0/membership-policies/{policyId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"cancelWhen": "<string>"
}
'const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({cancelWhen: '<string>'})
};
fetch('https://api.letsdothis.com/v0/membership-policies/{policyId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.letsdothis.com/v0/membership-policies/{policyId}/cancel"
payload = { "cancelWhen": "<string>" }
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"policyId": "<string>",
"pendingChange": {
"id": "<string>",
"kind": "OFFERING",
"timing": "NOW",
"effectiveAt": "2023-11-07T05:31:56Z",
"requestedAt": "2023-11-07T05:31:56Z",
"requestedByKind": "<string>",
"requestedVia": "<string>",
"cancellationCause": "<string>",
"toOfferingId": "<string>",
"direction": "<string>",
"amountDueNow": {
"value": 123,
"currencyCode": "<string>"
},
"payBy": "2023-11-07T05:31:56Z",
"releaseSeatIds": [
"<string>"
]
},
"coolingOffRefund": {
"outcome": "<string>",
"amount": {
"value": 123,
"currencyCode": "<string>"
}
},
"outstandingInvoicesVoidIncomplete": true
}{
"code": "MEMBERSHIP_INVALID_REQUEST",
"statusCode": 400,
"message": "<string>"
}{
"code": "MEMBERSHIP_CANCELLATION_INVOICE_CHOICE_NOT_PERMITTED",
"statusCode": 403,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 404,
"message": "<string>"
}{
"code": "MEMBERSHIP_CANCELLATION_IN_PROGRESS",
"statusCode": 409,
"message": "<string>"
}{
"code": "MEMBERSHIP_IDEMPOTENCY_KEY_REUSED",
"statusCode": 422,
"message": "<string>"
}Authorizations
Headers
Path Parameters
Body
Organizer keys only: what becomes of invoices the membership still owes. KEEP, the default, leaves them owed. VOID voids them, so the member owes nothing. A member token that sends this is refused; a member's own cancellation follows the scheme's rules.
KEEP, VOID Response
The policy id, its pending cancellation if any, the cooling-off refund outcome when returned, and whether a requested void is still being finished.
Was this page helpful?

