#mink4501_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/1220314188065275934
๐ 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.
- mink4501_webhooks, 6 days ago, 17 messages
hi!
- Look at the
discountsfield on the related Invoice. - Look at the
trial_endon the related Subscription object.
For discounts, it's exposed even though the discount hasn't been applied yet.
we_1O7wcbH7t32LLKQxQZR1kbGe
evt_1OwiUKH7t32LLKQxpgQTTg1l
can you expand on what you mean/the problem you're facing?
-
i want to know when a payment is made on a subscription, if that payment is discounted. I'm not talking about the amount that will be applied in the future, but if the coupon was applied to the current payment.
-
I want to know if the amount is 0 because of a Free Trial when the payment is completed on a subscription.
I'm not talking about the amount that will be applied in the future, but if the coupon was applied to the current payment.
The presence of the discounts field on the related Invoice(of the payment) means that Invoice had a coupon applied.
so I think that answers that?
I want to know if the amount is 0 because of a Free Trial when the payment is completed on a subscription.
that doesn't really make sense since there's no payment if the "amount is 0", so what specifically are you referring to? If you mean the initial $0 that's generated when a trial starts, then as I answered โ you'd look at the related Subscription object and see if it has a trial period set. (invoice->subscription->trial_end).
If you call the checkout session API and you put in a trial period and you also put in a coupon, then inside the invoice.paid event there is a discount and the amount is $0. It's actually $0 because of the trial, not because of the discount.
then in your logic you just need to check both of the fields I mention and implement that 'priority' yourself(if there's a trial and also a coupon, then your code would decide that the trial is the 'reason' for it being $0).
i see thank you