Reputation: 5520
I have 2 web products A and B, which share one same user database. We offer a paid monthly subscription for A, and a paid monthly subscription for B. Some users have none of them; some users have the subscription for A; some users have the subscription for B; some users have both.
The backend is built with Node.js and the payment is managed by Stripe. In the products, a user can open their customer portal to manage their subscriptions. With the following code, a user X who has both the subscriptions for A and B is able to see the two subscriptions in his customer portal.
const portalSession = await stripe.billingPortal.sessions.create({
customer: customer.id,
});
But what we would like to achieve is that, in the product A, the user X can only see his subscription to the product A in his customer portal; in the product B, the user X can only see his subscription to the product B in his customer portal.
Does anyone know if it's possible to achieve this?
(* a related question asked 18 months ago: Stripe Customer Portal - show specific subscription *)
Upvotes: 0
Views: 42
Reputation: 623
In your case it's best to keep those Subscriptions attached to 2 separate Customer objects. You can then map it to the same persona/user in your own database. Otherwise, it's not possible to only show a subset of Customer Subscriptions in a Customer Portal Session.
Upvotes: 0