paddle-subscription-cancel
Installation
SKILL.md
Cancel a Paddle subscription from Next.js
When to use this skill
Use this skill when building the "Cancel subscription" button (or equivalent) on the authenticated user's billing or account page. It covers a Next.js 15 (App Router) Server Action that calls paddle.subscriptions.cancel() with the right options, the security checks every cancel action needs, what to do after the cancel succeeds, and the relationship between Paddle's canceled status and a scheduledChange block.
This is the initiating side of subscription cancellation. Pair it with:
subscription-syncfor the receiving side — your webhook handler will get asubscription.updatedevent reflecting the schedule change, thensubscription.updatedandsubscription.canceledevents when the period actually ends.webhooksif you haven't set up the webhook endpoint yet.
Don't need your own cancel button? Two alternatives:
- Customer portal deep link. Mint a portal session with
paddle.customerPortalSessions.create(customerId, [subscriptionId])and redirect tosession.urls.subscriptions[0].cancelSubscription(seecustomer-portal). Paddle hosts the cancel UI. - Paddle Retain cancellation flows. If you've set up cancellation flows in Paddle Retain, launch one from the browser with Paddle.js:
paddle.Retain.initCancellationFlow({ subscriptionId }). It shows salvage offers first; if the customer goes ahead, Retain cancels the subscription in Paddle for you. The promise resolves with astatusofretained,aborted,chose_to_cancel, orerror. Retain isn't available in sandbox, so test this flow in live.