#tea-hanks_api
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/1428316237766856704
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Could you please share the two corresponding request Id: Invoice Preview and Subscription Update ?
Are you using same API version in both requests ?
Yes. We are using the same API version... Since I mentioned we are in the process of migrating from Acacia to Clover... So I am testing this on my local machine
This is the request ID of create preview req_6h9kw9N0I2w9D1
And this is the subsequent request to update subscription when user follows through the preview req_wHotI9fzlRlyrM
Thanks for sharing, checking...
And sorry, do you have a successful request with basil of this req_wHotI9fzlRlyrM?
I have tested it a bit more on the acacia version since we have that one currently
There it seems to work
req_FyH6DijFj02AE7
I also noticed something. We are using the retrieveUpcoming invoice endpoint but in logs I can see req_ShO961qKjUMIhm using create preview instead
In that create preview the billing cycle anchor param is not provided
But it does work for update subscription
What's the use for providing both b_c_a: 'now' and a proration date? My understanding is that we now disallow using both of those together as of a recent update
Ok the usecase is as following
We have a subscripton model with different tiers and billing cycles. When a user upgrades to a new tier or changes their cycle length we set a new billing cycle anchor
So a user who suscribed to let say tier 1 last week on a monthly basis, upgrades to tier 2 on a monthly basis today. We will reset the billing cycle to today and apply prorations for tier 1. For that we provide the proration date
Okay I guess I have it now. The update subscription endpoint fails for the combination of b_c_a=now and proration_date if the billing mode is flexible
It fails both in Acacia and Clover. However, preview invoice doesn't
And if billing mode is classic then it passes. But in Clover the default mode is flexible hence I came across the error
Likelihood is that you'll need to 'forgive' the time between the new anchor and the desired proration (and instead prorate based on 'now'). In reality the Invoice Preview endpoint should also reflect that behaviour so I'll flag that
You can opt into the old mode via billing_mode: 'classic' if preferred
Ok then I will have to communicate this to the team. And I'm assuming the behavior on the subscription update endpoint is correct. So when this all is fixed the create preview should also throw an error
In any case we need to either switch to classic mode or have the proration as you described. Correct?
And I'm assuming the behavior on the subscription update endpoint is correct
It is forflexiblemode, yes
So when this all is fixed the create preview should also throw an error
Yes, in an ideal world
In any case we need to either switch to classic mode or have the proration as you described. Correct?
Yes
Okay thanks for the support ๐