#kirito
1 messages · Page 1 of 1 (latest)
Subscription Schedules can be a bit tedious to work with, so before going down that path I wanted to check if you really need to schedule these metadata changes.
If these changes don't need to be scheduled to be made in the future, then updating the Subscription and changing its metadata in that request would likely be easier:
https://stripe.com/docs/api/subscriptions/update#update_subscription-metadata
If you do need to schedule these changes so they occur at a later date/time, then you would use the metadata parameter inside of your list of phases to define what the metadata should be for each phase of the Subscription Schedule:
https://stripe.com/docs/api/subscription_schedules/object#subscription_schedule_object-phases-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I tried this but I got the error: Type '{ items: { price: string; }[]; start_date: number; iterations: number; metadata: Stripe.Metadata; }' is not assignable to type 'Phase'.
Object literal may only specify known properties, and 'metadata' does not exist in type 'Phase'
Here is the pases list : ```{
items: [{ price: subscription.items.data[0].price.id }],
start_date: subscriptionSchedule.phases[0].start_date,
iterations: 12,
metadata: currentMetadata,
},
{
items: [{ price: subscription.items.data[0].price.id }],
iterations: 12,
metadata: nextMetadata,
},````
Is that an error you're getting as a response back from the API, or is that a complication error?
compilation error
Which of our libraries are you currently using, and what version is it currently on?
"stripe": "^8.208.0",
"@stripe/react-stripe-js": "^1.7.0",
"@stripe/stripe-js": "^1.24.0",
The stripe that you referenced which is on version 8.208.0, is that our Node library that you're referring to?
yes it is my node library
Gotcha, support for metadata on phases was added in version 9.1.0 of that library, so you will need to update the library to get access to that parameter:
https://github.com/stripe/stripe-node/releases/tag/v9.1.0
Ok, thank you so much
Happy to help!