#jacobjensen
1 messages ยท Page 1 of 1 (latest)
Hi Soma! So I have a subscription schedule where I would like to change the collection method from "send_invoice" to "charge_automatically". I can easily do this using the dashboard, but when I attempt to do it via the API, it is not quite working.
it is not quite working
What does that mean? Do you get an error message? Can you share the request ID (req_xxx)?
give me 1 minute - i just need to recreate the scenario
But I do not get an error. It simply removes any future invoices from the subscription and states that: you can only specify 'days_until_due' if invoice collection method is 'send_invoice'
the subscription I would like to update the collection method for is "sub_sched_1NNtliE5RkzLDNUxlXBoE8WA"
and I can do this via the dashboard by clicking "Update Subscription" and change the payment method
I would need a request ID (req_xxx) to investigate this.
You can find it here https://dashboard.stripe.com/test/logs
It simply removes any future invoices from the subscription and states that: you can only specify 'days_until_due' if invoice collection method is 'send_invoice'
Where do you see this?
Got it. Give me a few minutes to look into this.
Still looking into this, give me a couple more minutes
of course
okay I found the issue, and I think I have a solution for you.
that sounds amazing ๐
the issue is that when you created the schedule, you set invoice_settings.days_until_due: "14" in the phases themselves.
And later when you update the schedule to charge_automatically you don't update the phases. So they sill have invoice_settings.days_until_due: "14". But for charge_automatically subscription that doesn't make sense.
So you have two options:
- When you create the schedule in the first place, don't set
invoice_settings.days_until_duefor each phase. Instead just set it once in thedefault_settings. - Or if you have to set
days_until_duein the phases themselves, then when you update the schedule you need to update every phase to removedays_until_due
it doesn't look as if it possible to set the days until due parameter in default settings?
ah under invoice settings ๐
Soma, you have just saved my entire week!
thank you so much - your solution works like a charm ๐
That's great to hear ๐