#cj_best-practices
1 messages ยท Page 1 of 1 (latest)
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.
- cj_subscription-fees, 6 days ago, 50 messages
๐ 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/1276549494703525990
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, what specifically are you looking for on the invoice that is not showing?
I wanna the item lines to show something like
Room rental: $100
Service fee: $5
or somehow indicate that $5 portion is the service fee in the invoice
I tried updating the invoiceItems description but doesn't work
I see, when you create the CheckoutSession, are toy passing two price ids? One for the room rental, and the other for the service fee?
just one at the moment
Do you recommend passing 2 - one for the room fee and one for the service fee?
untimately my goal is to just indicate in the invoice that $5 is service fee
Yes, with the above set up of having two separate prices, I would.
Or, maybe you culd test passing custom fields in the invoice: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-invoice_creation-invoice_data-custom_fields
Can you try this?
oh let me try one min
ah it says Generate a post-purchase Invoice for one-time payments. mine is subscription
will it still work?
i.e. I'm using subscription_data when creating the session
nah doesn't allow me You can only enable invoice creation when modeis set topayment. Invoices are created automatically when modeis set tosubscription, and are unsupported when set to setup. To learn more visit https://stripe.com/docs/payments/checkout/post-payment-invoice
I did not realize that you were using subscription mode. Have you tried setting the description: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-subscription_data-description ?
let me try
After testing the custom fields on the invoice, that is not what you'd want anyways. Also, it is not applicable since you're using subscriptions mode.
are you referring to the Have you tried setting the description?
Nope, the custom fields - I just tested this for one time payment.
I see
I tried setting the description. It doesn't seem to change anything on the generated invoice
I can see the description from the portal but nothing changed on the invoice
yes, same on my end. Let me test one more thing
thannk you
After testing, if you want to show 2 line items, you would need to pass two price ids. One for the service fee, and the other for the rental fee.
However, if you're looking for manage prices with one line item, you could include the service fee in the description of the product id when you create it as shown on my test:
I see hmm...
So for your breakdown, I think the best option is to pass two prices
ok so this is what I'm thinking
- Create a product called
Service Fee - Add price on that product of $5
- Add both prices to the session.create
Yes!
The question I have with this approah is
is with step 2
Whenever I generate a invoice, they all have different service fee
which means I'll need to create another price everytime
is this a bad pratice?
In long term, this Service Fee product is going to have many many prices attached to it (i.e. $1 fee, $2 fee... etc)
I see, in this pace, you can just pass the price data: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data
So you do not need to make an extra call to create a product each time.
I think I'm ok with making an extra call, I'm just worried about the Service Fee product (from step 1) having many many prices
If that is what your business requires, that is fine.
even if I use https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data its ganna create a prices right?
is there a way to avoid duping same price?
i.e. if there is already a prices of value $5, is there way to find this one instead of creating another $5
Yes, it would create a price object. No, there is not a way.
I think the best approach is to create the Service Fee product, add the specific prices so you can reuse them
It's % of whatever price the host sets so will be a very wide range :S
is there stripe limit on how many prices can exist on a product?
Yeah, on your code you can look through your database and match the amount for the prices, then pull in that price id to charge for the service fee.
No, there is not
ok - just to triple triple check before I commit to the route
there is no way to put some custom text on the generated invoice created via session.create?
There is not I'm afraid.
thank you ๐ - if I use mode of payment, is this possible?
or same story as subscription
It would be similar to the Subscriptions. However, the customer fields I was referring to can be passed but it would now show a breakdown like you imagined. Here is my test with custom fields. You can see that information is on top left side of the invoice.
I see... thank you so much ๐ I'll take your advice and create a seperate item
is there a way to make the Rent fee be the first line item?
There is not a way to change the ordering of the line items I'm afraid.