#yagnesh-p_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/1382340039685701775
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- yagnesh-p_webhooks, 18 hours ago, 31 messages
๐ happy to help
Hi there ๐ the Coupon you applied isn't discounting the Invoice's line items due to restrictions you placed on the Coupon.
The Coupon was created so that it would apply to only a specific Product, and the Prices used in the Invoice's line items are associated with other Products.
The applies_to.product field in this request is what set that:
https://dashboard.stripe.com/test/logs/req_yEjZMeNhffBOC3
https://docs.stripe.com/billing/subscriptions/coupons?dashboard-or-api=api#set-eligible-products
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Means if i have other product in line items other then mentioned in applies_to, then the discount wont be applicable, right?
Correct
Can you check this case : pi_3RYnEPEap0XQH1am1gpnZpXG
this is from checkout session, i tried to create same case in that
Check what about it?
I applied discount in that too, which has 2 products, that worked.
What worked? Sorry, I need more context about your concern to understand what you're trying to ask.
It only looks like one line item was discounted, and that line item used the Product associated with the Coupon.
Is that different from what you're seeing?
Yes, from checkout session of this payment intent pi_3RYnEPEap0XQH1am1gpnZpXG, the discount is properly applied , https://dashboard.stripe.com/test/logs?method[0]=post&method[1]=delete&direction[0]=connect_in&direction[1]=self&starting_after=1749642841-req_x1h0ATgzP7gxws
in this i had 2 products then also why it was applied, i am not able to get it, but for this invoice in_1RYnMCEap0XQH1am64yXTPCJ you are telling me there is applies_to that i have to check. Am i missing something here?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
For the Checkout Session, one of the line items used the Product that the Coupon applies to, so the Coupon discounted that line item.
In the Invoice shared initially, none of the line items used the Product that the Coupon applies to, so none of hte line items were discounted.
When you apply a Coupon that uses applies_to to a Checkout Session, Subscription, or Invoice, the Coupon will discount any line item that uses the same Product that the Coupon is configured to apply to. Any other line items, which do not use that same Product (or Products), are not discounted.
invoice: in_1RYodrEap0XQH1amZpv1fuMe
in this the applies_to product is in the line item of the invoice.
product: xdso898ivj82nz3d
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Can you help me understand where you see that Product is in that Invoice?
Looking at the response our API provided to your request to create that Invoice, the values for lines.data.pricing.pricing_details.product for the two line items don't align with the Product ID you referenced. (xdso898ivj82nz3d)
Okay, looks like I need to rewrite the code maybe, for line items with discount.
Thanks for the help.