#cdric-chevillard_api

1 messages ยท Page 1 of 1 (latest)

half lionBOT
#

๐Ÿ‘‹ 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.

long cape
snow orchidBOT
formal raven
#

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.

long cape
#

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.

formal raven
#

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:

  1. Create the new Product and Price, using your user details
  2. Create a new Coupon and Promotion Code for the newly created Product
  3. Create a Checkout Session using the newly created Price from step 1
long cape
formal raven
#

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.

long cape
#

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?

formal raven
#

On the Invoice object, yes, which isn't shown during the checkout process.

long cape
#

the important thing is that it is present on the invoice ๐Ÿ˜‰

#

How can I add a line break in this description?

#

'<br>' '\n' ...

formal raven
#

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.

long cape
#

Ok

#

thank

#

for assist ๐Ÿ™‚