#jacques_code
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/1315621644034899988
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! you can't. you'd create a Price first with stripe.prices.create(), and pass the ID of the returned object to phase.items.[i].price
although maybe I'm wrong, since https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-phases-items-price_data exists? are you saying it doesn't work when you try it?
yes I try with this code (screen 1) but a have this error in typescript
No overload corresponds to this call.
The 2 of 2 overload, ‘(options?: RequestOptions | undefined): Promise<Response<SubscriptionSchedule>>', generated the following error.
An object literal can only specify known properties, and ‘customer’ does not exist in the ‘RequestOptions’ type.ts(2769)
what version of stripe-node is your project using?
I don't immediately think that code would give that error, because RequestOptions is the second parameter(if you call stripe.subscriptionSchedules.create({...}, {...}) , the second option is RequestOptions and takes things like a per-request API key; the first argument is the object with all the actual parameters like customer/phases etc)
should just work since the types do allow this, assuming you're using the types in our library and not some third party. https://github.com/stripe/stripe-node?tab=readme-ov-file#usage-with-typescript
https://github.com/stripe/stripe-node/blob/master/types/SubscriptionSchedulesResource.d.ts#L5-L9
https://github.com/stripe/stripe-node/blob/master/types/SubscriptionSchedulesResource.d.ts#L1322
we'd need to see a more complete reproduction if you're having an issue and are using the official types from the SDK
for example if I add price_data , I get an error directly for the create sub schedule (screen 1)
But if a comment this code (screen 2) it work
and in this doc api https://docs.stripe.com/api/subscription_schedules/create?lang=node I can't find the part items for the sub schedule, but on your Api doc it's there.
I think I'll go through your first proposal and create first by price.creates and then I'll pass it on to my subscription schedule.