#kirito

1 messages · Page 1 of 1 (latest)

mighty spruceBOT
gaunt oasis
#

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

bleak tusk
#

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,
        },````
gaunt oasis
#

Is that an error you're getting as a response back from the API, or is that a complication error?

bleak tusk
#

compilation error

gaunt oasis
#

Which of our libraries are you currently using, and what version is it currently on?

bleak tusk
#

"stripe": "^8.208.0",

#

"@stripe/react-stripe-js": "^1.7.0",
"@stripe/stripe-js": "^1.24.0",

gaunt oasis
#

The stripe that you referenced which is on version 8.208.0, is that our Node library that you're referring to?

bleak tusk
#

yes it is my node library

gaunt oasis
bleak tusk
#

Ok, thank you so much

gaunt oasis
#

Happy to help!