#mxc42_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ 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/1241108579855896758
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
I've tried create_prorations and none when changing anchor, but both charge
I've also tried the free trial, but that doesn't seem to be quite what I'm looking for
The prorations are for crediting for the current period that you are shortening by reseting the billing cycle
I imagine you're resetting to now?
yeah, now
ah gotcha
I'd like to basically skip the current period
Unless you switch to a free price or a trial, this doesn't really make sense, becuase setting the anchor to now is effectively forcing a billing cycle to reset/rollover, leading to an invoice for the current price
What are you trying to achieve as an end result?
Can you explain the situation more broadly?
So currently we charge customer when they make a reservation
Which is what we want to continue doing
but we want the next payment to occur 30 days after they physically pick up the rental
so the first cycle would basically be time between reservation and pickup plus the subscription interval
and then it gets a little more tricky because the product in question is a electric scooter that has a set time of authorization before it shuts off
which is right now dictated by the subscriptions next invoice time plus a buffer
Using trial_end + disable prorations for this might be most appropriate, because you can trigger that at "pickup" and set the next invoice time for whatever you like
You could also achieve this with a Subscription Schedule, but that feels heavy handed for the use case
so for trial_end, would the initial subscription creation / invoice need any changes?
or I just use it at pickup time without changing anything else?
i guess i'll go test a bit with it
assuming you invoice the full amount of the first period at time of booking, and pickup happens before the end of the first period, then yea thats all you need
trial_end=timestamp of next invoice to pay
proration_behavior=none
and you update the sub at pickup
That doesn't seem to change the billing cycle at all though, does it?
say they reserved on May 15, and picked up on May 17, I want the next invoice to be June 17
it does, when the trial ends it will reset the anchor
oh I see
(and will be free until then)
so timestamp of next invoice to pay should be pickup time + 30 days?
Yep! some timestmap on Jun 17 in your example
ok sweet, thanks
would it be better to do "pickup time + 30 days" or "current_period_end + (pickup time - current_period_start)"?
are monthly cycles always 30 days or is it set by day of month?
is i guess the question
It depends! If we narrow the scope of your question to single month billing cycles then yes, its the same day of the month except when thats not possible (eg, same day doesnt exist in the month).