#damenz_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/1306649684915388518
đ 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.
- damenz_api, 21 hours ago, 30 messages
- damenz_tax-setup, 5 days ago, 19 messages
Hello, no there isn't an endpoint like that that exists. You would have to track/check that yourself.
You could always do something like set metadata on the Customer when you apply the coupon
That counter-intuitive not to have that endpoint
Then check that metadata
since you have quite a efty configuration flexibility for coupons
Happy to submit a feature request for that internally
But yeah that's not possible today
Yeah that would be nice on the long term
a coupon endpoint where you could provide the cus_ as a parameter
and it would let you know if this coupon is redeemable for that customer based on all the coupon configuration (expiration, max redeem per customer, etc.)
You are using Subs/Invoices here?
Checkout session
i tried creating a checkout session with a 1 time coupon (per customer) on the same customer and I got an error back
instead of not applying the coupon, the createCheckout crash in this scenario
I was trying not to have to handle coupons logic / usage internally but seems like I can't do otherwise
Checkout session -> pay invoice immediatly -> subscription
What was the error you saw here?
Coupon lancement-worksplace is expired and cannot be applied.
return Session::create($sessionData);
it is not "expired" but it does have a 1 usage per customer limit
I tried to use it twice on purpose to test this scenario
Gotcha, yeah you do have to track that yourself. Or you could just try to apply it first and have fallback logic if it is expired.
Or you can retrieve the coupon first.
And check for times_redeemed: https://docs.stripe.com/api/coupons/object#coupon_object-times_redeemed
That is probably the cleanest way without having to build out a large tracking mechanism on your end.