#yagnesh-p_api

1 messages ยท Page 1 of 1 (latest)

short questBOT
#

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

azure panther
#

๐Ÿ‘‹ happy to help

short questBOT
rugged oak
#

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

wicked echo
#

Means if i have other product in line items other then mentioned in applies_to, then the discount wont be applicable, right?

rugged oak
#

Correct

wicked echo
#

Can you check this case : pi_3RYnEPEap0XQH1am1gpnZpXG

#

this is from checkout session, i tried to create same case in that

rugged oak
#

Check what about it?

wicked echo
#

I applied discount in that too, which has 2 products, that worked.

rugged oak
#

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?

wicked echo
#

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?

rugged oak
#

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.

wicked echo
rugged oak
#

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)

wicked echo
#

Okay, looks like I need to rewrite the code maybe, for line items with discount.
Thanks for the help.