#alalva_api

1 messages ¡ Page 1 of 1 (latest)

hoary ruinBOT
#

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

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

random quail
#

Can you show me your code for the upcoming invoice call and your code for actually updating the subscription?

#

One thing that immediately pops to mind is that the prorations may differ slightly because unless specified they assume the proration will happen now. So depending on the price and time gap, that would mean that prorating now actually would be a couple cents different from prorating a minute or two ago. The solution in that case would be to note the proration date from the upcoming invoice and pass that as proration_date in the actual update so that the time calculation is the same

tropic acorn
#

thanks for your response, i'm using a no code app called Bubble but i'll show you the call in the next message. I was also thinking that the reason might be because of the time gap but i've clicked on the button to show me the proration amount and right away i clicked to pay and the difference is still pretty significant, last case about 20 plus cents

#

To kind of break it down to you the dynamic expressions in blue, 1st is the Subscription proration date, followed by subscription items, then the new subscription amount price, Subscription id, and last the stripe customer id, I am 100% sure that all except the date are correct but just cant seem to get the correct amounts to display to the user. Any help from you will be appreciated!!

#

i will give you another customer that i'm trying to create a new proration, this customer id is cus_QV0nPGD2N1pgRb

#

and their subscription ID is sub_1Pe0m3ATCXjCgCHXDT0B2eOZ and for this i'm getting a proration amount of $49.90

random quail
#

Is that from the upcoming invoice call or the actual update call?

tropic acorn
#

actual update call

random quail
#

I am not seeing a log of a successful update on that subscription. Can you try running both of these calls again now and send me the request IDs? (req_123)

tropic acorn
#

sure

#

i'm creating a new user and starting fresh, give me 1 minute. thanks

#

here is the req_JC8DLcBt9qX88J

#

this one i was getting the proration amount of $50 and it did charge accordingly but i think its because i had just signed up the user to a $50 plan and a minute later i was upgrading the plan to a $500 therefore not much time had passed. i have to wait for 10-20 minutes to pass in order for me to see a difference in the proration amount but when i charge the user then it charges them a different amount even when i click to pay right away and don't let time pass.

random quail
#

Gotcha, that makes sense with my query and your config, I do see that you bucket your timestamps by 10 min intervals

tropic acorn
#

i've changed the intervals as well but get the same results - weird.

random quail
#

So to prevent this, you will want to save the timestamp that you used for the preview call and re-use it as proration_date in the update call. Basically lock-in the original price