#kliff_retrieve-historical-discounts

1 messages ยท Page 1 of 1 (latest)

warm perchBOT
#

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

๐Ÿ“ 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.

spare citrus
#

Hello ๐Ÿ‘‹

What do you mean by all "discounts"? We have APIs to retrieve coupons and promotion codes but not applied discounts

fallow pebble
#

There is a discounts API

spare citrus
#

Not a List API though

#

The two endpoints for Discouts only allow deleting discounts

fallow pebble
#

Right - If an event has, say 3 discounts in an array, how do make the connection to discounts to know which coupon to apply

spare citrus
#

The Discount object includes properties that ilnk it to the coupon/promo code. Can you share an event so we can discuss a concrete example?

fallow pebble
#

Yeah one sec

#

evt_1Qk4HrBvulM3DTAZkOjm8GB3

#

["di_1PK6PfBvulM3DTAZf66H8HpZ", "di_1Qk4HqBvulM3DTAZslJs4EYt"]

spare citrus
#

di_1PK6PfBvulM3DTAZf66H8HpZ has coupon: co_1OqmRTBvulM3DTAZhtwSEg6r

#

Ah but you just get the ID, don't you

#

What you would need to do is retreive the Subscription that was included in this event and pass expand=['discounts']

fallow pebble
#

Ah ok

spare citrus
#

The discounts property is expandable, meaning we only send IDs by default but you can request the full object from the API

fallow pebble
#

Thats what I needed. Thanks!

spare citrus
#

Great ๐ŸŽ‰ Happy to help ๐Ÿ™‚

fallow pebble
#

Actually - sorry we are already expanding that property, and when we do, we are missing discounts. Let me try to find an example of that

#

My question would be, does the subscription object capture every discount that has ever been applied to the subscription?

spare citrus
#

Oh, no. It only captures the current discounts

fallow pebble
#

Ok thats what I thought. So there currently is no way of know historically which discounts were applied?

#

Again, I can see the discounts in Sigma. Should we use the Sigma API at this point?

spare citrus
#

I think that is your best option here.

fallow pebble
#

Ok, thanks again!

spare citrus
#

Happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚