#sajid_schedule-update

1 messages ¡ Page 1 of 1 (latest)

thin ivyBOT
#

👋 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/1288540640937771111

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

median fulcrum
#

my code:
const updatedSubscriptionSchedule = await stripe.subscriptionSchedules.update(scheduleId, {
// start_date: startDate, // Update the start date for the subscription
end_behavior: 'release', // What happens when the schedule ends (can also be 'cancel')
phases: [
{
items: items, // Recurring items (for the subscription)
add_invoice_items: invoiceItems, // One-time invoice items (added to the next invoice)
iterations, // Number of billing cycles for this phase
billing_cycle_anchor: 'automatic', // Automatically set the billing cycle anchor
discounts: couponId ? [{ coupon: couponId }] : undefined, // Apply discount coupon if available
metadata: {
invoiceNo,
// Add any additional metadata here
},
collection_method: "charge_automatically", // Set collection method
},
],
});

barren lantern
median fulcrum
#

req_TOpkV9PUhHIned

barren lantern
#

Looking...

#

The error is accurate, you're not providing a start_date, so the Schedule doesn't know when to start.

median fulcrum
#

but when i pass startDate it says unknow parameter. that why i commneted the startdate line.

#

does i added at wrong place?

barren lantern
#

Yes, you need to add it to the first phase.

median fulcrum
#

ok but i when give dates it says gap. how can i handle that ?

barren lantern
#

What's the exact error?

median fulcrum
#

reason: StripeInvalidRequestError: There is a gap between phase 0 (1727722800, 1759258800) and phase 1 (1732548043, 1764084043).

#

i am setting though code giving one month gap.

barren lantern
#

Can you give me the request ID with that error?

median fulcrum
#

req_ECkiE1pK7O4JyS

#

give me a way so when i give two phases. i want to follow second after 1 month how can i do that?

barren lantern
#

You got the error in this request because you're setting a start date for both phases, and those are conflicting. You should only be setting a start date for the first phase.

#

If you want the first phase to last for a month, use a monthly Price and set iterations to 1. After that single iteration of one month the next phase will begin.

thin ivyBOT