# Cancel membership/subscription contract Cancels a membership/subscription contract and sends cancellation confirmation emails. This endpoint terminates the recurring subscription and processes all cancellation workflows. Cancellation Process: - Contract Termination: Marks subscription as cancelled in Shopify - Billing Stop: Prevents future billing attempts - Email Notification: Sends cancellation confirmation to customer - Activity Logging: Records cancellation event with source and feedback - Feedback Capture: Optional cancellation reason for analytics Key Features: - Immediate Cancellation: Stops subscription processing immediately - Feedback Collection: Capture customer cancellation reasons - Automated Emails: Customer receives cancellation confirmation - Activity Tracking: Logs cancellation to activity history - Source Attribution: Tracks whether cancellation came from customer portal or API Validation Checks: - Contract Ownership: Verifies contract belongs to authenticated shop - Minimum Cycles: Checks if minimum billing cycles requirement is met (if configured) - Freeze Status: Validates subscription is not frozen - Existing Status: Ensures contract is not already cancelled Email Notifications: - Sends cancellation confirmation to customer email - Includes subscription details and cancellation date - Uses customizable email templates from shop settings Use Cases: - Allow customers to cancel from custom portals or mobile apps - Bulk cancellation workflows via external systems - Integration with customer service platforms - Automated cancellation based on business rules - Churn management and retention workflows Authentication: Requires API key authentication via X-API-Key header or api_key parameter Endpoint: DELETE /api/external/v2/subscription-contracts/{id} Version: 0.0.1 ## Path parameters: - `id` (integer, required) Membership contract ID to cancel Example: 123456789 ## Query parameters: - `api_key` (string) API Key (Deprecated - Use Header X-API-Key instead) - `cancellationFeedback` (string) Optional cancellation reason/feedback from customer Example: "Too expensive" ## Header parameters: - `X-API-Key` (string) ## Response 204 fields ## Response 400 fields ## Response 401 fields ## Response 404 fields ## Response 500 fields