#cedaf_webhooks
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/1266356244378157067
đ 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.
- cedaf_best-practices, 1 day ago, 8 messages
You'd need to retrieve the Customer object using the cus_xxx ID from the a customer field in the event payload
would there be any other way which doesn't require a second api call to retrieve the email though?
Not with customer.subscription.* events no. You can't 'expand' those fields in webhook event so an additional API request is required
not even if the email is on the subscription as a metadata field?
Well if it's in the metadata yes it'll be there
but that would be the only option- and not the email address field technically used for communication
if I've understood correctly that is
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?
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
Are you using Checkout or a direct Billing integration?
this would be a customer who is signed up via a paylink, in this scenario
What is a 'paylink'?
a stripe paylink? https://stripe.com/gb/payments/payment-links
Ah, a Payment Link
Then in that case I'd recommend listening for checkout.session.completed events which will include the email collected on the payment page: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-customer_details
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
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
got it - thank you!