#jagariko_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/1361301012538720330
📝 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.
- _api, 1 hour ago, 7 messages
Which sub_xxx ID demonstrates the behaviour you reference
The following subscription IDs demonstrate the behavior:
sub_1RDkU0H9QZM8KDuiwC1mTae4: An invoice was generated.
sub_1RDjaSH9QZM8KDuiRCbkuZzG: No invoice was generated.
Which update request? This one? https://dashboard.stripe.com/test/logs/req_GRJqDlNBuqJBU8
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Yes!
Invoice was created:
- req_gDnPXtzTXImbzO (We first add a usage-based Free plan (price = ¥0).)
- req_GRJqDlNBuqJBU8 (Then we update the subscription with trial_end=now.)
No invoice created:
- req_qvlbmF2lM9Z6js (We call Subscription.update to add the usage-based Free plan and set trial_end=now in the same API call.)
Overall I'm confused, the parameters on all 3 of those requests are totally different. Why would you expect them all to behave the same?
We call Subscription.update to add the usage-based Free plan and set trial_end=now in the same API call.
You already ended the trial here: https://dashboard.stripe.com/test/logs/req_GRJqDlNBuqJBU8
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I’m not expecting all three requests to behave identically.
What I’m trying to understand is why the specific request where we update both trial_end=now and add a usage-based (metered) plan at the same time does not generate a ¥0 invoice, while doing the same operations in two separate steps does generate invoices.
That generated a new invoice: in_1RDjcpH9QZM8KDuivC2hEKdT
We wouldn't then generated another new invoice just for the addition of a usage based plan, which was the only 'difference' on req_qvlbmF2lM9Z6js
I believe the invoice in_1RDjcpH9QZM8KDuivC2hEKdT was actually generated at the time the trial started, not when the trial ended.
Nope, was created by this API call: https://dashboard.stripe.com/test/logs/req_GRJqDlNBuqJBU8
As reflected in the .updated event: https://dashboard.stripe.com/test/events/evt_1RDjcqH9QZM8KDuiOGWbi0rj
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
in_1RDjaSH9QZM8KDuiARnNaRkf is the initial trial invoice
What are you showing me? I already explained why that didn't generate an invoice
☝️
I understand why the invoice wasn’t generated in the previous case.
However, I’m trying to understand why this request, which also used trial_end=now, did result in an invoice:
https://dashboard.stripe.com/test/workbench/logs/req_PazulkrAZEVw5T
https://dashboard.stripe.com/test/invoices/in_1RDkcPH9QZM8KDuidTjLWi0s
Hey! Taking over for my colleague. Let me catch up.
Hey, thanks for jumping in! 🙏
However, I’m trying to understand why this request, which also used trial_end=now, did result in an invoice:
As you ended the trial period, so a new invoice will be generated, that's expected.
The invoice has 0$ amount because you are using a freemium price price_1QjHt6H9QZM8KDuiikGQJB4u
Thanks for the explanation!
Yes, I understand that ending a trial can generate an invoice — and that aligns with our expectations.
However, we have another request where we also used trial_end=now, but no invoice was created:
https://dashboard.stripe.com/test/workbench/logs/req_qvlbmF2lM9Z6js
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
My colleague have already answered you regarding that request I think
We wouldn't then generated another new invoice just for the addition of a usage based plan, which was the only 'difference' on req_qvlbmF2lM9Z6js
Also, the trial is already ended, why you are making another request with trial_end=now ?
It has no impact.
I think there might be some confusion — the request where we used trial_end=now was for a different subscription than the one that had already ended its trial.
We’re comparing two separate subscriptions that both used trial_end=now, but behaved differently:
#1361301012538720330 message
Ah yes true, sorry. But for this Subscription there is already an invoice genered with 0$ amount in_1RDjcpH9QZM8KDuivC2hEKdT
Ending the trial period won't generate a new invoice as there was already one freemium invoice
Why you want to have two invoices with 0$ ?
No worries, thanks for checking again!
in_1RDjcpH9QZM8KDuivC2hEKdTwas created when the trial started, not when it ended.
https://dashboard.stripe.com/test/workbench/logs/req_GRJqDlNBuqJBU8
Just to confirm — no invoice was generated when the trial was ended in the following request, correct?
https://dashboard.stripe.com/test/workbench/logs/req_qvlbmF2lM9Z6js
From what I can see, only the following events were triggered:
- evt_1RDjdLH9QZM8KDui5OE1JpUz
- evt_1RDjdLH9QZM8KDuim2sCv0OR
Just to confirm — no invoice was generated when the trial was ended in the following request, correct?
https://dashboard.stripe.com/test/workbench/logs/req_qvlbmF2lM9Z6js
No invoice generated yes
Previously, you mentioned:
As you ended the trial period, so a new invoice will be generated, that's expected.
Given that, could you please help me understand why no invoice was generated in this request, even though trial_end=now was used?
https://dashboard.stripe.com/test/workbench/logs/req_qvlbmF2lM9Z6js
Here the difference is there was a 0$ invoice already generated, so no new one will be generated
To help clarify the behavior, I’d like to walk through the flow with you in real time.
The following customer is currently still in the trial period:
http://dashboard.stripe.com/test/customers/cus_S82M2zXqCPBzBV
If you're able to take a look and confirm the current state, I’ll go ahead and end the trial so we can observe what happens with invoice generation.
You are referring to this Subscription sub_1RDmHVH9QZM8KDuiWkQUOmjZ
It's in trial period now and it should end on Apr 28
And between, there is a freemium invoice generated already for this Subscription between: in_1RDmN4H9QZM8KDuiSvwb3xpb
I’ll now update the subscription using trial_end=now to immediately end the trial.
Let’s see together whether an invoice is generated in this case.
It won't generated. I explained previously why, you have already a freemimum invoice generated.
I've now ended the trial using trial_end=now, as mentioned.
However, no invoice was generated after the trial ended.
You can see the subscription here:
https://dashboard.stripe.com/test/subscriptions/sub_1RDmHVH9QZM8KDuiWkQUOmjZ
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
👆
Why are you expecting a new invoice with 0$ ?
There is no change that requires an invoice in this use case
We're expecting a ¥0 invoice because it's a way for us to reliably detect when a trial ends in our system.
You should rely on this event in your system and not invoice generation customer.subscription.trial_will_end
Thank you, and yes — we understand that customer.subscription.trial_will_end is the recommended way to detect trial endings.
That said, in our previous implementations, we relied on invoice.created with a ¥0 invoice at the time the trial ended, which worked well for our use case.
To better understand the behavior, here is another subscription where a ¥0 invoice was created when the trial ended using trial_end=now:
https://dashboard.stripe.com/test/subscriptions/sub_1RDmbHH9QZM8KDui5MkKeJJc
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You should update your implementation to use the recommended flow.
And listen to the event customer.subscription.trial_will_end and detect when a trial is ended.
we’ll look into using customer.subscription.trial_will_end for detecting trial ends going forward.
That said, we've seen cases where a ¥0 invoice is generated when the trial ends, and we've been relying on that behavior as well.
Just to be sure, could you help confirm under what conditions a ¥0 invoice will be created when a trial ends?
The following customer is currently still in the trial period:
https://dashboard.stripe.com/test/subscriptions/sub_1RDmbHH9QZM8KDui5MkKeJJc
If you're able to take a look and confirm the current state, I’ll go ahead and end the trial so we can observe what happens with invoice generation.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Hi, taking over as my teammate needs to step away. Let me catch up.
I recommend that you test this. Are you able to make the update and look for customer.subscription.trial_will_end event?
Thanks — yes, I understand that customer.subscription.trial_will_end is the recommended event to use, and we’ll look into incorporating it.
That said, for now, I'd really appreciate it if you could help confirm under what conditions a ¥0 invoice is generated when using trial_end=now.
We've seen it happen in some cases, but not others — so we're trying to understand that behavior more clearly before finalizing our logic.
Can you test this and see what happens? Are you usign Test Clocks,https://docs.stripe.com/billing/testing/test-clocks ?
I’ll proceed to end the trial immediately using trial_end=now.
I’ve just ended the trial using trial_end=now.
You can see that two invoices were generated as a result:
https://dashboard.stripe.com/test/subscriptions/sub_1RDmbHH9QZM8KDui5MkKeJJc
Could you help explain why two invoices were created in this case?
We're trying to understand what triggered each one so we can ensure consistent behavior in our system.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
It looks like you ended the trial, https://dashboard.stripe.com/test/logs/req_yYBbL6nRrU4RTa and then updated the price, https://dashboard.stripe.com/test/logs/req_p04vqLUlTHkzEf and https://dashboard.stripe.com/test/logs/req_v2b0JEXR9iYYed
If there is that period between the trial end, and the next billing period, you'd get a ¥0 invoice
Here is the log that occurred at the beginning of the trial, not the end of the trial .
You can check the time .
https://dashboard.stripe.com/test/logs/req_yYBbL6nRrU4RTa
The following log is what ended the trial.(trial_end=now)
https://dashboard.stripe.com/test/logs/req_yYBbL6nRrU4RTa
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I'm unsure what you mean by that. Are you able to reword this?
Sorry to ask again — but could you help me understand why an invoice was generated when we ended the trial using trial_end=now in this request?
→ https://dashboard.stripe.com/test/workbench/logs/req_U4p7O0Yg8Uf9ZG
→ https://dashboard.stripe.com/test/workbench/events/evt_1RDmwSH9QZM8KDuiV9JPeoYj
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
If you look at that response, https://dashboard.stripe.com/test/logs/req_U4p7O0Yg8Uf9ZG I see
trial_settings: {
end_behavior: {
missing_payment_method: "create_invoice",
},
},
You can update that here, https://docs.stripe.com/api/subscriptions/update#update_subscription-trial_settings
Thanks for all your help so far.
I think we’ll pause the investigation here for now.
We’ve explored various cases and we may need to approach this differently on our side.
Appreciate your time and support!