#dingkai031

1 messages · Page 1 of 1 (latest)

opal streamBOT
glad burrow
#

👋 Hi there, Happy to help!
Could you please share more details about your issue ?

unreal holly
#

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,

  1. make a normal subscription
  2. listen to invoice.paid event
  3. 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

glad burrow
#

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 keeping billing_cycle_anchor: "unchanged"

unreal holly
#

but I try changing the subscription manually from dashboard, it works.

glad burrow
#

The dashboard changes the billing cycle anchor

#

but when calling your api you're setting the billing_anchor unchanged

unreal holly
#

ahhh, if so... what should I change it to so that it behave the same like the one from dashboard?

violet surge
#

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.

unreal holly
#

the interval should be changed, because the frist subscription is weekly then it updated to monthly

violet surge
#

Sure, so the billing cycle anchor must change too. Do you have an example you updated?

unreal holly
#

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

violet surge
#

Can you share the subscription id? sub_1234 eg

unreal holly
#

sub_1M57kVBBuNcFsmgMfTisZVdt

violet surge
#

the anchor moved from 1668690203 to 1668698218

unreal holly
#

I see, so I should use the subscription schedule API instead...

#

Can you show me the steps with the subscription schedule API please

elfin harbor
unreal holly
#

yes, but I don't understand how the payment works for the schedule api.

#

is it the same like subscription API?

elfin harbor
#

What don't you understand, specifically? Not sure I understand the question

unreal holly
#

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?

elfin harbor
#

Ah. Subscription schedules create subcsription objects, so it would essentially be the same. You can even create subscription schedules from existing subscriptions