#r.soares

1 messages ยท Page 1 of 1 (latest)

deep fernBOT
fleet flame
humble crag
#

So if im understanding correctly, if i only pass the item i want to keep it will remove the rest ?

fleet flame
#

Correct

deep fernBOT
humble crag
#

And it will trigger on start_date ?

fleet flame
#

Yes, I'd recommend trying it out in test mode as it will help clarify the process

humble crag
#

You cannot set start_date if from_subscription is set.
So how would i go about that ?

#
            [
                'from_subscription' => $subscription->id, 
                'start_date' => 'now',
                'phases' => [
                    [
                        'items' => [
                            [
                                'price' => 'price_1J7gawK9PS1qRjzz2L6IYsAo',
                                'quantity' => $current_quantity,
                            ],
                        ]
                    ]
                ]
            ],
        );```
prisma kayak
#

Start date is the date at which the subscription starts. If you're creating the schedule from an existing sub, then it would have already started

humble crag
#

So how do i make this trigger before the next invoice ?

#

You cannot set phases if from_subscription is set.
Now im confused

prisma kayak
#

You'd just need to add a phase to the existing one (your current subscription) and set the end_date of the current phase to when you want your second phase with the changes to begin

humble crag
#

So i need to simulate the current phase ??

#
            $subscriptionSchedules->id,
            [
              'phases' => [
                [
                  'items' => [
                    [
                      'price' => 'price_1J7gawK9PS1qRjzz2L6IYsAo',
                      'quantity' => 2,
                    ],
                  ],
                  'start_date' => 'now'
                ],
              ],
            ]
          );```

-> You can not modify the start date of the current phase.
prisma kayak
humble crag
#

Stripe used to be the best API to work with, now is becoming just like the others... ๐Ÿ˜ฆ

#

So for the first phase what start and end dates do i pass, "current_period_end": 1693747119,
"current_period_start": 1691068719, ???

prisma kayak
#

That'll show the current start date

#

Subscription schedules, specifically, are complicated

#

That's because they support so many niche/advanced usescases

#

Most users won't need them and can just use regular subscriptions, but schedules were designed to support a ton of functionality

humble crag
#

Find it hard to think a use case where you pass your current phase that cant be done with subscription::update and leave the schedules endpoints for scheduling xD

humble crag
#

Is there anyway to trigger the scheduled in the dashboard for testing ??

prisma kayak
#

What do you mean by trigger the schedule?

#

The schedule is triggered by the dates you set in the phases

humble crag
#

yeah, now i have to wait 1 month to see if it works ๐Ÿ˜›
Is there any button to apply the schedule changes before end date ?

prisma kayak
humble crag
#

Uhh, i need to manually create a customer for this ?

deep fernBOT
prisma kayak
#

Yeah

humble crag
#

Kk, ill say nothing ๐Ÿ˜