#corjan-subscriptions

1 messages · Page 1 of 1 (latest)

raven crater
#

can you post the sub_sched_xxx ID you're working with? it can be easier to follow than reading the text :p

worthy river
#

Yeah sure! Let me create a new schedule through the API. Gimme a sec ❤️

#

Woops: sub_sched_1KTQhmGzhgXG0QoUkRbjJcW1

raven crater
#

thanks, will look in a little while.

raven crater
#

If I however cancel the scheduled deletion
can you show me how you do that?

#

but sorry, this is really complex and I'm answering many other questions so it's going to be a while before me or my colleagues can really dive in

worthy river
#

Sure!
No problem at all. After months of working with your API I feel pretty experienced 😉 I might miss a simple API parameter (we humans tend to miss tedious details) but I thought this might be difficult. Go ahead and answer some others. I will provide you with some more info.

#

To start off with, let me tell you how I schedule the deletion.
For an existing subscription (with billing yearly interval) I create a new schedule. This schedule will have a single phase.
The start_date of that phase is equal to the subscription current_period_start.
The end_date of the phase will be set to the date I want it to be cancelled. For the scenario above that is start_date + 1 month
One other parameter is explicitly set: the end_behavior. Passed value is "cancel"

#

Now over to cancelling a scheduled deletion.
For that same subscription I modify the current_phase to have the same start_date as before (still the subscription current_period_start).
The end_date is reset to the the initial value (current_period_start + 1 year, it was a yearly subscription afterall).
This schedule doesn't really need to do anything to the subscription as a previous action is reverted. Therefore the end_behavior is set to "release"

#

---- details ----

#

After scheduling the cancellation: the dashboard shows the following information.
It was created Feb 15th and originally the next invoice would be Feb 15 2023. However a proration is now created for Mar 15 2022 (as expected).
It bills €0,00 on Mar 15 as the invoice only contains a prorated invoice item for €36,01 (11/12 of the original amount).

#

Now when I want to revert this scheduled operation (as described above).
The original schedule phase has an end_date of 1647349466 (Tuesday 15 March 2022 13:04:26)
I updated that to end_date of 1676466266 (Wednesday 15 February 2023 13:04:26) -> current_period_start + 1 year

The schedule (sub_sched_1KTQhmGzhgXG0QoUkRbjJcW1) was completed successfully.
The subscription is not cancelled for deletion anymore (screenshot).

However.....

  • The pending invoice item to refund €36,01 still exists -> I could delete that through the API.
  • An invoice will still be created on March 15th for one month usage. Actually it is a whole year with a discount based on the existing invoice item (screenshot 2)
#

The scheduled deletion was however cancelled so why is the next invoicing moment not equal to Feb 15th 2023?

raven crater
#

we don't have the bandwidth to respond to this quantity of messages here, and I have to hand over to a colleague in 5 minutes so they'll have to rebuild all the context.

#

if you write in then we can take as much time as needed to understand your case and suggest something!

worthy river
#

Thanks for letting me know. I will do that