#frallain_api

1 messages ¡ Page 1 of 1 (latest)

rough vineBOT
#

👋 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/1414912623899574322

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

nocturne lake
rough vineBOT
upper sluice
nocturne lake
#

OK cool! One more question : for "once" coupon, how can I know API-wise that it has been already applied or not?

upper sluice
#

What do you mean by 'once' coupons? As in duration: 'once'?

nocturne lake
#

yes

upper sluice
#

What exactly are you trying to do?

nocturne lake
#

we sometimes see some once coupons that have already been used and stay on the subscription after use, dangling

#

We'd like to detect those

upper sluice
#

You'd probably need to check the invoice(s) for the subscription and check to see if discounts is set on them. If for example it's only set on the Jan invoice and not on Feb invoice then you can infer that is has been 'applied'

#

Not great I know

nocturne lake
#

OK, yes that would be great to have a dedicated field on the discount entity for this

#

or fill in start and end for those once coupons

upper sluice
nocturne lake
#

just found one

upper sluice
#

To confirm, you're creating these subscriptions directly via the API and not via Checkout etc?

nocturne lake
#

yes via the API

upper sluice
#

OK, one moment

nocturne lake
#

then our Support adds some coupons via the dashboard

rough vineBOT
nocturne lake
#

No in fact previous example was unclear

upper sluice
#

Looks like that subscription just had a new discount applied?

nocturne lake
upper sluice
upper sluice
#

Before that call discount/discounts were null, which is not what you described

nocturne lake
#

MMmh allright

upper sluice
#

So it doesn't seem like the coupons/discounts are hanging, but that they're being re-applied again