#cedaf_webhooks

1 messages ¡ Page 1 of 1 (latest)

hollow 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/1266356244378157067

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

soft tartanBOT
#

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.

hollow vineBOT
strong elm
#

You'd need to retrieve the Customer object using the cus_xxx ID from the a customer field in the event payload

rose karma
#

would there be any other way which doesn't require a second api call to retrieve the email though?

strong elm
#

Not with customer.subscription.* events no. You can't 'expand' those fields in webhook event so an additional API request is required

rose karma
#

not even if the email is on the subscription as a metadata field?

strong elm
#

Well if it's in the metadata yes it'll be there

rose karma
#

but that would be the only option- and not the email address field technically used for communication

#

if I've understood correctly that is

strong elm
#

I don't understand the question. My assumption is you create a Customer object (which is required for a Subscription) and set the email parameter there. You then want to retrieve this field in the customer.subscription.created event, yes?

rose karma
#

yes in order to entitle that customer with that email address to what they've just subscribed

#

the worry about having a second api is we'd need that email address for every other entitlement-related-management item, so would we be having to do 2x calls on every use case

strong elm
#

Are you using Checkout or a direct Billing integration?

rose karma
#

this would be a customer who is signed up via a paylink, in this scenario

strong elm
#

What is a 'paylink'?

rose karma
strong elm
#

Ah, a Payment Link

rose karma
#

ahh okay: so this looks like you can get the customer details/address/etc, but then you just get an ID for the subscription - I'm not seeing anything that says "products subscribed to"

is it fair to say that its the combo of the two events that give you the customer email + subscribed-to product?

strong elm
#

Yes, the Checkout Session event won't include the items by default (again, needs to be expanded/additional API request)

#

So yeah you probably need a combo of the two if your hesitancy is making additional API requests

rose karma
#

got it - thank you!