#kiel_subscription-schedule-metadata-copy
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/1394360199531335730
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
We do not copy metadata between objects, with a few expections that we document here: https://docs.stripe.com/metadata
You are looking for the metadata in the Subscription items to be copied to the phase.items.metadata property? https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-phases-items-metadata
You would need to update the Subscription Schedule after you created it, to accomplish this.
I recommend testing this out in Test mode first to be certain everything works as you expect it.
Hi! Yes that's exactly what I'm trying to do. I thought the items would be copied as they are, metadata included.
I could update the subscription schedule to add the metadata afterwards, but reconciling the subscription's items with the phase.items might be a bit tricky: the phase.items don't have an id
I guess I could just delete the phase.items automatically created in the schedule and just convert manually the ones from the subscription object?
I guess I could just delete the phase.items automatically created in the schedule and just convert manually the ones from the subscription object?
I would avoid that if you can. When you first create a Schedule directly from a Subscription, it will only have one phase that corresponds with the current state of the Subscription at the time you created the Schedule. I think making an update request based on the Price IDs/quantities in the phase.items and the subscription.items is likely your best bet.
Sounds good, I wanted to avoid doing that if I could but I'll try it that way. Thanks!
Out of curiosity, do you know why the metadata is not copied in that case? It looks to me like it would be a good exception to add (it would certainly help me ๐ )
It's not something we generally do. I can request it but we try to keep the phases logically separate from the Subscription Items themselves.
Fair enough. If a request is not too much bother it would be appreciated, otherwise I'll manage without it ๐
I'll request it but you should plan/assume that nothing will change and update your integration accordingly
If that feature does wind up getting implemented, you can simplify your approach later.
Thanks a lot!
Feature requested. We're happy to help ๐
Is there a place where I could follow its progression? Or is it internal only?
Sorry, internal only.
But if that behavior changes, we'll announce it here: https://docs.stripe.com/changelog
Cool! Thanks a lot for your help, I hope you have a great day ๐
You too!