#cdric-chevillard_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1303751148678680679
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐ yes, it is possible to create a Product with user details while creating a Checkout Session by using price_data and product_data. But, if you have a Product-specific Promotion Code that won't be applicable to the newly created Product.
In my case, I want to create a checkout using existing products on Stripe so that I can potentially apply promo codes to them. Additionally, I would like to add a personalized description, such as the first and last name, for each line item on the invoice.
I don't think there is a way to customize what is shown in the part of the page that renders details about the Product being purchased if you use an already created Product.
I think what you would need to do here is the following for each Checkout Session:
- Create the new Product and Price, using your user details
- Create a new Coupon and Promotion Code for the newly created Product
- Create a Checkout Session using the newly created Price from step 1
hmm ok, i see this : https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-invoice_creation-invoice_data-description
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I don't think that will do what you're after, since that description would be for the Invoice object that is created when payment is completed.
Perhaps I can include personal information in the invoice description. How can I add a line break in this description?
Doesn't this add a description on the invoice?
On the Invoice object, yes, which isn't shown during the checkout process.
the important thing is that it is present on the invoice ๐
How can I add a line break in this description?
'<br>' '\n' ...
Ah I see, that's pretty different from the initial question that was asked so I didn't think that'd be beneficial.
I believe it's either an actual return character in the string you provide or \n, but would recommend testing that quickly to confirm it does what you're hoping.