Skip to content

Delete a paid membership

DELETE /program/memberships/{membership_id}
Scopeprogram:write
Customer session tokenNot accepted: call from your server with an API key
Rate limit classwrite_shopify (limits)
Idempotency keyRequired (idempotency)
MCP toolcharm_delete_membership

Deletes a membership that is off sale and never had a member. The Shopify product stays. Call with dry_run: true first.

NameInTypeDescription
membership_idpathstringThe membership’s id.
FieldTypeDescription
dry_runbooleanPreview only: validate, resolve references and return the diff and summary, but write nothing. Costs no idempotency key and is limited as a read. Call with this first, show the merchant, then repeat without it. (optional)
if_revisionintegerThe program revision you last read (from GET /program or a previous write). When the program changed since, the write is refused with 409 revision_conflict instead of overwriting a concurrent admin edit. (optional)

Returns MembershipWriteResult.

FieldTypeDescription
dry_runboolean
revisioninteger
operationstring: create, update, delete, none
diffarray of FieldChange
summarystring or null(nullable)
membershipMembership
product_createdbooleanA new draft (unpublished) product was created in Shopify for this membership. (optional)
would_create_productobjectDry run: the draft product a real call would create. (optional)
product_statusstringThe product’s Shopify status when it is not ACTIVE (a DRAFT product cannot be bought until published). (optional)
gating_republish_failedbooleanSaved, but the members-only content rules did not republish; save again to retry. (optional)
{
"dry_run": false,
"revision": 1,
"operation": "create",
"diff": [
{
"path": "path",
"before": null,
"after": null
}
],
"summary": "summary",
"membership": {
"id": "id",
"name": "Gold",
"name_translations": {},
"enabled": true,
"billing_type": "term",
"term": {
"unit": "DAY",
"count": 1
},
"billing_interval": {
"unit": "DAY",
"count": 1
},
"grace_days": 1,
"points_multiplier": 120,
"activity_window_months": 1,
"inactive_points_multiplier": 120,
"highlight": false,
"show_payoff": false,
"product": {
"id": "id",
"title": "title",
"variant_id": "44123456789",
"variant_title": "variant title",
"price": "price",
"currency": "EUR"
},
"benefits": [
{}
]
},
"product_created": false,
"would_create_product": {
"title": "title",
"price": 1,
"status": "active"
},
"product_status": "product status",
"gating_republish_failed": false
}
Terminal window
curl -X DELETE "https://charm.appfleece.app/api/v1/program/memberships/<membership_id>" \
-H "Authorization: Bearer chrm_live_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"dry_run":false,"if_revision":1}'

unauthorized · invalid_token · insufficient_scope · access_required · not_found · validation_error · rate_limited · idempotency_conflict · shopify_unavailable

Every error body carries code, message, request_id and a doc_url pointing at the matching entry in the error catalog.