#Hackerman
1 messages · Page 1 of 1 (latest)
Could you share the code on how the subscription schedule is created?
I see that you created two subscription schedules in your code. For creating subscription schedule on the existing schedule, the flow should be:
- Create subscription schedule with
from_subscription: https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#existing-subscription - Update the subscription schedule created in Step 1 with new phase that will change the price in the future date: https://stripe.com/docs/api/subscription_schedules/update
In the second subscription schedule creation of your code, you're actually creating a new subscription with subscription schedule. This is not necessary.
In the example code of the official website .update is never used
The example code here is to create a new subscription with subscription schedule. I understand it's a bit confusing, but this example is not to have a subscription schedule with existing subscription
One question, if I have a subscription running on a 6-month cycle. When updating the phases should I subtract that month that is currently running?
I need to charge 6 months and I already charged the first therefore the phases should be 5 iterations instead of 6, right?
When you create a subscription schedule, the first phase will be current phase and has no visibility of the number of cycles that have been processed in the past.
And yes, if the subscription has been charged 1 month, then the iterations will be 5. I'd recommend testing out in test env with test clock: https://stripe.com/docs/billing/testing/test-clocks
Ok thanks, i go to test
The start_date should be the end date of the current phase?
Can you share the request ID (req_xxx) where you saw this error, so that I could have a check? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Ok wait
Is it working now? Or do you still have questions for req_3YREQLOt79XLp8?
Add the missing parameter and it worked perfect
Woohoo! Happy to hear that 😄