#alalva_invoice-timestamps

1 messages ¡ Page 1 of 1 (latest)

frosty totemBOT
#

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

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

rustic ravenBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

slow meteor
#

Hello

#

Taking a look

#

Can you share the request ID for your upcoming Invoice request?

fiery star
#

let me create a new user subscription and then i'll get a new req. THANK YOU!

slow meteor
#

The proration date indicates the specific time when the update would actually be made

#

So if you are setting it to "now" in the preview then yeah that would be different than the time in the future when the update is made and the proration is calculated

fiery star
#

let me see if i can find the last one i had an issue with instead.

#

i believe it was this req_Xn1v22SctmJ1pt

slow meteor
#

Hmm no that is just a Subscription retrieval request

#

Not a preview

#

But regardless the above is almost certainly the reasoining you are seeing a mismatch

fiery star
#

lets try this one req_AWsWjZEX4ES8Xd

slow meteor
#

That is likely what you are missing

#

See the explanation there:

If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with upcoming invoice endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.

fiery star
#

to be more specific if i sign up for a subscription that costs $50 and a half hour later i sign up for a differernt subscription that costs $500, the preview will show that the cost is $49.99 so basically it will only apply 1 cent to the new subscription but when it charges the card the amount is about .26 cents difference.

slow meteor
#

Are you creating a new Subscription here or updating one?

fiery star
#

i'm updating a subscription

#

i'm also using the proration date

slow meteor
#

Can you share your Subscription update request?

fiery star
#

i have to create a new one, give me one minute.

slow meteor
#

In that request do you set proration_date to the same timestamp as you use in the preview?

fiery star
#

the recent calls i have been using current date and time plus 5 minutes

slow meteor
#

Right so that is why you have a misalignment

#

For the preview and actual update to be for the same amount you have to pass the same timestamp to proration_date

fiery star
#

but previously i was using current date and time and the amounts were way off therefore i started to use the plus 5 minutes but that didn't make a difference either.

slow meteor
#

Current date doesn't stay the same, right?

#

Like you can't just pass the current date each time

fiery star
#

let me ask you, when it comes to dates do you recommend using current date and time? and then do you use Unix? i guess the part i'm confused about is the 10 characters that Stripe is looking for and how i can get those 10 characters. I've tried 2 different ways in trying to get this the 1st one is current date and time extract Unix/1000 in order to get the 10 characters and the next one is current date and time extract unix converting to number extracting 10 characters

#

i think its the date and i say this because i just created a request 10:31;43 AM and i just saw the date says Error insight Invalid integer 1721662600.229 req_Hlt9ardwehLX1W

slow meteor
#

Correct our API accepts UNIX dates

#

So you convert whatever date you want into a UNIX timestamp and then pass that to our API

fiery star
#

yes

frosty totemBOT
slow meteor
#

Sorry to be clear @fiery star you don't pass any decimals with your unix -- we accept a UNIX date in seconds

fiery star
#

got it.