#testanib
1 messages · Page 1 of 1 (latest)
Hi, are you creating the subscription by using the Create Subscription endpoint? Or are you using a checkout? I want to make sure that I have all of the information to give you an accurate response.
create subscription endpoint
Typically, metadata won't be copied over to different objects. But, there are ways you could set the metadata for the payments depending on how you're integrated
is it possible to do it via the create subscription endpoint or only with a checkout?
I know you can do this when you create a subscription via the Checkout. However, looking if you can with create subscription endpoint. Give me a few mins. please
alright thanks
I was able to confirm that this is not possible I'm afraid
is there a best alternative approach to do this? I know we can listen to subscription events, aswell as the charge object references an invoice id which references the subscription, but not sure if there are any other/better ways to go about this
The only way is as you've said to listen to the events and update the object with the metadata.
update the charge object based on the subscription event data?
Can you reword this last question please?
what object are you referring to when you said "update the object with the metadata"
The Payment Intent object, you can learn more about the events that a subscription triggers: https://stripe.com/docs/billing/subscriptions/webhooks
if we set the metadata in the payment intent object it will be inherited by the charge object? or just accessible to query based on information in the charge object (ex. query payment intent based on the payment intent id in the charge object)
You can listen to invoice.payment_succeeded event and look at the charge object and update the charge object's metadata: https://stripe.com/docs/api/charges/update . I was under the impression that we were talking about Payment Intent when you said subscription charges. But I think this is what you're looking for