# Cancel a membership contract Permanently cancels an active membership contract in Shopify. This operation stops all future billing and marks the membership as CANCELLED. Important Notes: - Permanent Action: Cancellation cannot be undone. A new membership must be created to re-subscribe. - Email Notification: Cancellation email is automatically sent to the customer - Activity Logging: Cancellation is logged with reason/feedback for analytics - Immediate Effect: No future billing attempts will be made Customer Portal Restrictions: When called from customer portal, additional validations apply: - Minimum Cycles: Cannot cancel if membership hasn't completed minimum required billing cycles - Frozen Memberships: Cannot cancel memberships that are frozen until min cycle completion - Attribute-Based Limits: Respects any custom attribute-based cancellation restrictions Cancellation Feedback: - Optional cancellationFeedback parameter to capture why customer is cancelling - Common values: 'TOO_EXPENSIVE', 'NO_LONGER_NEEDED', 'SWITCHING_TO_COMPETITOR', 'OTHER' - Helps merchants understand churn reasons Use Cases: - Customer requests to cancel their membership - Merchant manually cancels membership (e.g., payment issues, customer request) - Automated cancellation after max cycles reached Authentication: Requires authenticated shop user or customer portal token Endpoint: DELETE /memberships/cp/api/subscription-contracts/{id} Version: 0.0.1 ## Path parameters: - `id` (integer, required) Membership contract ID to cancel Example: 123456789 ## Query parameters: - `cancellationFeedback` (string) Optional cancellation reason/feedback from customer Example: "TOO_EXPENSIVE" - `cancellationNote` (string) Optional cancellation note with additional details Example: "Customer found a cheaper alternative" ## Response 204 fields ## Response 400 fields ## Response 401 fields ## Response 500 fields