#skammerens-datter_api

1 messages ¡ Page 1 of 1 (latest)

rich hedgeBOT
#

👋 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/1266348569820921887

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

smoky heathBOT
#

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.

grand marten
tight mango
#

Sure; req_wdOM15YBdnSMY1

grand marten
#

You need to pass in all current and future phases when you update a subscription schedule. You also need to pass in any previously set parameters that you want to keep. Any parameters that were previously set are unset for the existing phase unless you pass those in the update request. You still receive information in the response about past phases.
https://docs.stripe.com/billing/subscriptions/subscription-schedules#updating

Learn how to use subscription schedules to automate changes to subscriptions over time.

tight mango
#

Okay, I do a lot of different API calls with the subscription. Do I need to set the parameters for any other call? Meaning, will I be good if I only add parameters again for the schedule call only?

grand marten
#

Updates to sub items, like req_wdOM15YBdnSMY1, are implicit meaning that you don't need to pass all parameters

tight mango
#

so doing this (php), won't require setting default_tax_rates, it'll just be inferred from what is already set?

$stripe->subscriptions->update($subscriptionId, [
            'items' => [[
                'id' => $subscription->items->data[0]->id,
                'price' => $planPriceId
            ]],
            'expand' => ['latest_invoice.payment_intent'],
            'proration_date' => !is_null($prorationTime) ? $prorationTime : time(),
            'proration_behavior' => 'always_invoice'
        ]);
```
grand marten
#

Yes!

tight mango
#

Okay, thank you. I changed the schedule call to the following, assuming that is what should be done:

$stripe->subscriptionSchedules->update(
  $schedule->id,
  [
    'phases' => [
      [
        'items' => [[
          'price' => $schedule->phases[0]->items[0]->price,
          'quantity' => $schedule->phases[0]->items[0]->quantity
        ]],
        'start_date' => $schedule->phases[0]->start_date,
        'end_date' => $schedule->phases[0]->end_date,
        'default_tax_rates' => ['txr_1PaG3qGppVLMkw062cvfyWAO']
      ],
      [
        'items' => [[
          'price' => $planPriceId,
          'quantity' => 1
        ]],
        'iterations' => 1,
        'default_tax_rates' => ['txr_1PaG3qGppVLMkw062cvfyWAO']
      ]
    ]
  ]
);
grand marten
#

Yep, seems good

tight mango
#

okay, great - thanks!