#dingkai031
1 messages · Page 1 of 1 (latest)
👋 Hi there, Happy to help!
Could you please share more details about your issue ?
Yes, I inserted a link there to our previous conversation in discord.
but okay, I will start over
What I would like to achieve is create a subscription for my customer that have a "paid trials" plan for a week, after a week it will start a monthly plan (with different price) for 1 product. and the customer will be charge automatically every month until they cancel the subscription
then the final flow that we agree is,
- make a normal subscription
- listen to invoice.paid event
- then change the subscription plan
but I got an error in webhook logs.. <b>Fatal error</b>: Uncaught (Status 400) (Request req_Ldao9lkbFwGGjh) Changing plan intervals. There's no way to leave billing cycle unchanged.
if you need anymore details just let me know
Yes checking ...
The error looks explicit,
Changing plan intervals. There's no way to leave billing cycle unchanged.
You can't change the plan and keepingbilling_cycle_anchor: "unchanged"
You need to set billing_cycle_anchor: "now" or I may suggest you to use Stripe Subscription Schedule in order to achieve your scenario
https://stripe.com/docs/billing/subscriptions/subscription-schedules
but I try changing the subscription manually from dashboard, it works.
The dashboard changes the billing cycle anchor
but when calling your api you're setting the billing_anchor unchanged
ahhh, if so... what should I change it to so that it behave the same like the one from dashboard?
I'm not sure I follow -- if the interval changed the anchor must necessarily change. Are you sure you changed the interval? More complex flows would potentially need a schedule as @glad burrow noted.
the interval should be changed, because the frist subscription is weekly then it updated to monthly
Sure, so the billing cycle anchor must change too. Do you have an example you updated?
this is the one that I manually do in the dashboard
But if it's not possible. I can go with the subscription schedule api or any other route it's okay. Maybe can you walk me through the flow please
Can you share the subscription id? sub_1234 eg
sub_1M57kVBBuNcFsmgMfTisZVdt
The billing cycle anchor did change when you made the dashboard update here: https://dashboard.stripe.com/test/logs/req_ThpyGYVGfkGkVQ
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
the anchor moved from 1668690203 to 1668698218
I see, so I should use the subscription schedule API instead...
Can you show me the steps with the subscription schedule API please
Hi. have you read over https://stripe.com/docs/billing/subscriptions/subscription-schedules ?
yes, but I don't understand how the payment works for the schedule api.
is it the same like subscription API?
What don't you understand, specifically? Not sure I understand the question
sorry, I mean.. for example... the flow for subscription api is :
create stripe elements, collect the data, pass the data to confirmPayments(), if it's success then redirect to thank you page.
but for schedule api, how is the flow?
Ah. Subscription schedules create subcsription objects, so it would essentially be the same. You can even create subscription schedules from existing subscriptions