#kennyjack_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/1369255527082885141
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- kennyjack_code, 1 hour ago, 9 messages
- kennyjack_code, 21 hours ago, 97 messages
- kennyjack_api, 1 day ago, 3 messages
- kennyjack_best-practices, 3 days ago, 29 messages
- kennyjack_best-practices, 3 days ago, 54 messages
- kennyjack_best-practices, 5 days ago, 20 messages
From this request req_49XDnqRV1TwJPb, I expect will see the amount of $2700. Because i defined the start_date = 1746513610 & end_date = 1778049610 which is the whole year of the subscription sub_1RLfAkArTeYcLw6yxoGTUt5F
Please correct me if i'm wrong
looking into this
If could, also help me on understand why both request with two different payload getting the same amount
req_I9HhoFwkggzcHD, req_49XDnqRV1TwJPb,
for the line "Remaining time on Annual Captivate after 06 May 2025", it's set to $2698,94, but you expected it to be $2700?
No, I think not the question i asking about.
How about can help me understand why both request with two different payload getting the same amount
req_I9HhoFwkggzcHD, req_49XDnqRV1TwJPb,
Because although the phases payload differs between the requests you're essentially asking to a preview of the same invoice, right?
req_I9HhoFwkggzcHDhas 2 phases โ 1st one starts and ends now so there's nothing to chagre. We immediately transition to 2nd phase which starts *now * and has an end date a year in the futurereq_49XDnqRV1TwJPbhas 1 phase. It starts now and ends a year in the future
They both use the same price, so unclear what is unexpected here
req_I9HhoFwkggzcHD - The 1st phasestart_date = 1746513610 (May 6, 2025 6:40:10 AM), is based on the subscription start_date and end_date = now is when the time i send the request.
The 2nd phase ``start_date = now` is when the time i send the request. And end_date = 1778049610 ( May 6, 2026 6:40:10 AM) is based on the subscription end_date
I understand that above request will immediately enter the 2nd phase. Since 1st phase already passed.
req_49XDnqRV1TwJPb - The 1st phase start_date = 1746513610 (May 6, 2025 6:40:10 AM) and end_date = 1778049610 ( May 6, 2026 6:40:10 AM).
So when i time i send both request start_date = 1746513610 is already in past
So I would like to know this request will stripe automatically know start_date = 1746513610 is already in past then it start count when the time request is send?
What are you actually trying to do here?
I'm just confuse why both request with different payload gave me the same amount.
In req_49XDnqRV1TwJPb has 1 phase. How you know, It starts now? I have define the start_date = 1746513610
Sorry I missed that you passed a specific timestamp. Yeah honestly, I don't know. Looking at the payload responses we do seem to use 1746513610 as the period_start for both previews which makes sense why the values match
I see, based on your knowledge. I should define the phases like in req_I9HhoFwkggzcHD
- Which i define the subscription current phase end (1st phase)
- Then define to start next phase (2nd phase)
Or I just define like in req_49XDnqRV1TwJPb
- Define to start next phase (but the start & end date same as the subscription period start & end)
Well as I said, all this depends on what exactly it is you're trying to do. Our general recommendation is to not use specific start/end dates as noted, and just rely on now with iterations:
You can set these values manually, but Stripe recommends using iterations instead. Because manually setting the start and end dates is prone to errors, only use it for advanced use cases.
I'm using https://docs.stripe.com/api/invoices/create_preview preview invoice with schedule_details
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes, but what are you trying to preview? Why does it need to be in the past?
so i need to define the start_date based on the subscription start_date.
I'm trying to preview when my subscription subscribe to priceA upgrade to priceB how much does it cost
OK, but then why do you need to backdate it if the update is happening now?
I get this error if i don't backdate "You can not modify the start date of the current phase."
Why does it need to be in the past?
Here the request req_JG02at0jYGD2FW that i get the error if i put start_date now
Then are you unblocked? Your preview is returning the value according to upgrading now
Sorry, I don't understand this sentence
Your preview is returning the value according to upgrading now
My subscription have subscription schedule to PriceC.
But now I want to update to PriceB, before update I want to preview the amount for PriceB
Yes I know that. But the reason why the values are the same is because you're missing a proration date. Otherwise the preview amount is calculated accoridng to now