#masseelch_api

1 messages ยท Page 1 of 1 (latest)

buoyant surgeBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

limpid pine
#

That expects an Id, not its value

#

the Id is something likie promo_xxx

blissful parrot
#

Makes sense. Not sure why I did not think about this myself ๐Ÿคฆโ€โ™‚๏ธ Thanks!

buoyant surgeBOT
blissful parrot
#

Is this thread still active?

humble slate
#

Yes

blissful parrot
#

I am not able to retrieve from the API if a subscription / checkout session was created withj a coupon or not.

#

Tried to exapnd both checkout-sessions and subscriptions endpoints with discount

#

req_jj62rxoiEwA5Bk
req_ZLAXpWoS65YChb
req_zc7xlqR5xYCEKF

Those are a few requests I tried

#

I can see in the dashboard the coupon was applied, but I am not able to retrieve for a checout session or subscription the applied coupons

humble slate
blissful parrot
#

The discounts field is always empty

#

I am using the Go SDK

humble slate
#

There's 2 properties on the Subscription object. It seems like you're expanding discounts but checking discount

blissful parrot
#

This is the object inside the SDK, there is not discounts, also I did expand discount as well.

blissful parrot
humble slate
#

What library version are you using?

blissful parrot
#

Which are "2023-10-16" and "2024-09-30.acacia" respectively

humble slate
#

Could you please share the full response in JSON?

blissful parrot
#

I stripped some sensitive info from it

#

req_F1ZnF4D8ocqmpa
Related request id to the above response

buoyant surgeBOT
humble slate
#

Have you tried fetching the Subscription itself and expanding discounts?

blissful parrot
#

Yes

#

Same issue ๐Ÿ˜ฆ

jade flume
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

blissful parrot
#

req_JgeyRHaML9Q9xW

This request for example

jade flume
#

you're expanding the deprecated property discount

#

you need to expand discounts instead

blissful parrot
#

req_vUJVfrUxGg0oaU

Tried that as well as you can see in this request

#

go sdk v76: req_xVeh5CyP7bpP5w
go sdk v80: req_0kJPgdohRlypkt

Both expand discounts

#

Both fields are empty in the response

jade flume
#

since the coupon applied is applicable once, you won't find the discount applied on the subscription but rather on its first invoice

#

of the subscription.latest_invoice

#

it should work

#

so you could expand on subscription.latest_invoice.discounts when retrieving the Checkout Session

blissful parrot
#

Let me check

#

Nice, works. Will the first invoice always have the coupon? Even it is a coupon than is applied 2 months or forever?

jade flume
#

yes

blissful parrot
#

Thank you very much!