Add a description to a stripe product at checkout

Viewed 608

I am working on a C# application where the app users will purchase a subscription for their clients. Since they will buy multiple subscriptions, I need to add a description (client name) to a product so it shows up in the billing portal along with the price. My current checkout code works fine and the relevant part is here:

            var options = new Stripe.Checkout.SessionCreateOptions
        {
            LineItems = new List<SessionLineItemOptions>
            {
                new SessionLineItemOptions
                {
                    Price = priceId,
                    Quantity = 1
                },
            },
            PaymentMethodTypes = new List<string> 
            {
                "card",
            },

            Mode = "subscription",
            SuccessUrl = string.Concat("https://", domain, "/success/", hhid, "?session_id={CHECKOUT_SESSION_ID}"),
            CancelUrl = string.Concat("https://", domain),
            Customer = customerId,
            SubscriptionData = new SessionSubscriptionDataOptions()
            {
                Metadata = new Dictionary<string, string>()
                {
                    { "userId", userId.ToString() }
                }
            }
        };

        if (!string.IsNullOrEmpty(user.PaymentCustomerId))
            options.Customer = user.PaymentCustomerId;

        var service = new Stripe.Checkout.SessionService();
        Stripe.Checkout.Session session = await service.CreateAsync(options);

        Response.Headers.Add("Location", session.Url);

I contacted Stripe support and their response was

In this particular case we do not have an option that allow you to add a description, but you are able to add the name with price_data parameter into the Checkout, Invoice Items, and Subscription Schedule APIs.
https://stripe.com/docs/api/subscription_items/create
https://stripe.com/docs/billing/prices-guide

They provided links to the two articles which I have read and re-read and don't understand how to implement it. If anyone can help it would be greatly appreciated.

1 Answers

Unfortunately, the Billing Portal does not show a description for the Product.

If you want to use the Billing Portal, then you would need to specify the client name in the name for the Product e.g. [client name] Product #1, and this would require you to create a new Product and Price for every client.

You can do it in the Checkout Session creation :

Or, create the Product and Price separately :

Related