#itaied-checkout-pi-metadata
1 messages ยท Page 1 of 1 (latest)
Hey!
Indeed, payment_intent_data is unavailable for mode: 'subscription' sessions. You'd instead use subscription_data: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
However there's no parameter available that will set metadata on the underlying PI
What is it you're trying to do exactly?
I'm trying to listen for completion of both payment and subscription.
When I receive payment_intent.succeeded then I read the metadata field and execute my business process.
How can I send metadata then to a subscription completion event? Is there a better event for subscriptions other than payment_intent.succeeded?
It depends what your 'business process' involves and what data you need and when
You could set metadata on the subscription and listen for customer.subscription.created events
I need the metadata when the payment has succeeded
customer.subscription.updated will fire to reflect payment status (i.e. status: 'active'): https://stripe.com/docs/billing/subscriptions/overview#subscription-events
Otherwise there's no way to automatically set metadata on the initial invoice PI
By listening to invoice.paid I can reach the subscription and get the metadata.
Is there any difference between invoice.paid and payment_intent.succeeded or they both indicate a successful payment?
And can I get the subscription field expanded somehow on the webhook for invoice.paid?
Is there any difference between invoice.paid and payment_intent.succeeded or they both indicate a successful payment?
invoice.paidwill fire for out-of-band payments too (i.e. if you just marked it as paid in the Dashboard).invoice.payment_succeededdoes not
And can I get the subscription field expanded somehow on the webhook for invoice.paid?
You can't expand event payload fields, so you'd need to make an additional API request
ok I understand it. Thank you very much for your support ๐
np!