#damenz_api

1 messages ¡ Page 1 of 1 (latest)

opaque islandBOT
#

👋 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.

worldly lion
#

Hello, no there isn't an endpoint like that that exists. You would have to track/check that yourself.

fleet nest
#

Ah ... thats too bad

#

This should totally be a thing

worldly lion
#

You could always do something like set metadata on the Customer when you apply the coupon

fleet nest
#

That counter-intuitive not to have that endpoint

worldly lion
#

Then check that metadata

fleet nest
#

since you have quite a efty configuration flexibility for coupons

worldly lion
#

Happy to submit a feature request for that internally

#

But yeah that's not possible today

fleet nest
#

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.)

worldly lion
#

You are using Subs/Invoices here?

fleet nest
#

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

worldly lion
#

What was the error you saw here?

fleet nest
#

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

worldly lion
#

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.

#

That is probably the cleanest way without having to build out a large tracking mechanism on your end.