#ghost_dev
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ghost_dev, 13 hours ago, 31 messages
👋 happy to help
hello
would you mind elaborating?
so i show the docs
unsubscribe for what?
yeah i want user to use like a form of yours to unsibscribe example
const subscription = await stripe.subscriptions.cancel(
'sub_1MlPf9LkdIwHu7ixB6VIYRyX'
);
is there a form like the one we use to pay but to cancel?
you can use the Customer Portal for that https://docs.stripe.com/customer-management
so
i saw this
const session = await stripe.billingPortal.sessions.create({
customer: '{{CUSTOMER_ID}}',
return_url: 'https://example.com/account/overview',
flow_data: {
type: 'subscription_cancel',
subscription_cancel: {
subscription: '{{SUBSCRIPTION_ID}}',
},
after_completion: {
type: 'redirect',
redirect: {
return_url: 'https://example.com/account/subscription_canceled',
},
},
},
});
so basically the same customer id can have multiple subscriptions i can use {{SUBSCRIPTION_ID}} to show the one i want right?
yes
but how can i embed it on client code ?
you just redirect to the session.url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
trying to figure it out i will need help soon