Skip to content
FreeTicketDocs
Esc
↑↓navigate↵open⌘Jpreview

Cancel the buyer's own membership

Requires the X-Customer-Session header. The enterprise service API key is OPTIONAL: with a key, the workspace is the one pinned to it (any workspaceId in the body is ignored); without a key, workspaceId is REQUIRED in the body (422 if missing). The membership is ALWAYS resolved from the buyer session (a CustomerMembership id is never accepted). It first cancels the recurring charge at the provider and then marks the membership as CANCELLED. Idempotent.

POST/customer/subscriptions/cancel
Authorization
AuthorizationAPI key · headerrequired

API key prefixed with Bearer . Alternative: the x-api-key header with the raw key. Available scopes: read and write (see /.well-known/oauth-protected-resource).

or
x-api-keyAPI key · headerrequired

Raw API key (without Bearer ), alternative to Authorization.

Header parameters
X-Workspace-Idstring

Active workspace to operate on. Optional: when omitted, the default workspace of the user who owns the key is used (pickActiveOrg).

Request body
requiredapplication/json
workspaceIdstring

Required only without an enterprise service API key: which membership (by workspace) to cancel. Ignored with a key — the workspace is the one pinned to it.

min length 1
Responses
200

OK

dataCustomerSubscriptionCancelResultrequired
Show properties
idstringrequired
statusstringrequired
Allowed:PENDINGACTIVEEXPIREDCANCELLEDPAUSED
cancelledAtstring | nullrequired
Show properties
Any of:
string
string
null
null
401

Missing or invalid credential.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
403

Insufficient role or resource not accessible.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
404

Operation error.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
422

Operation error.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
502

The external provider failed to complete the operation.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://admin.appfreeticket.com/api/v1/customer/subscriptions/cancel' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "workspaceId": "string"
}'
Response
{
  "data": {
    "id": "string",
    "status": "PENDING",
    "cancelledAt": "string"
  }
}