#sajid_schedule-update
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/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.
- sajid_api, 12 hours ago, 60 messages
- sajid_checkout-redirect, 5 days ago, 29 messages
- sajid_subscription-customprice, 6 days ago, 19 messages
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
},
],
});
Hello! Can you provide the request ID showing the error you're seeing? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_TOpkV9PUhHIned
Looking...
The error is accurate, you're not providing a start_date, so the Schedule doesn't know when to start.
but when i pass startDate it says unknow parameter. that why i commneted the startdate line.
does i added at wrong place?
Yes, you need to add it to the first phase.
ok but i when give dates it says gap. how can i handle that ?
What's the exact error?
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.
Can you give me the request ID with that error?
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?
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.