#kliff_retrieve-historical-discounts
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/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.
- kliff_api, 51 minutes ago, 3 messages
Hello ๐
What do you mean by all "discounts"? We have APIs to retrieve coupons and promotion codes but not applied discounts
There is a discounts API
Right - If an event has, say 3 discounts in an array, how do make the connection to discounts to know which coupon to apply
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?
Yeah one sec
evt_1Qk4HrBvulM3DTAZkOjm8GB3
["di_1PK6PfBvulM3DTAZf66H8HpZ", "di_1Qk4HqBvulM3DTAZslJs4EYt"]
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']
Ah ok
The discounts property is expandable, meaning we only send IDs by default but you can request the full object from the API
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
By passing the expand parameter
Thats what I needed. Thanks!
Great ๐ Happy to help ๐
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?
Oh, no. It only captures the current discounts
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?
I think that is your best option here.
Ok, thanks again!
Happy to shed what ๐ก I can ๐