#Shx-checkout
1 messages · Page 1 of 1 (latest)
basically it generates multiple invoices with amount $0
Do you have an example? And can you clarify what behavior you're expecting to happen instead?
I have Screen shot can I share here?
As long as there's no PII it's fine
Basically I am using stripe checkout session for subscription, I am simply redirecting users to stripe checkout portal
This is the issue I am facing
Can you give me one of the invoice IDs so I can take a closer look?
Those $0 invoices are being created as a result of requests that set billing_cycle_anchor: now. This is happening somewhere in your own code, so if you don't want these Invoices you need to pinpoint where those requests are coming from
Ok this is what I got from stripe support but I am not using billing_cycle_anchor any where in my code
Basically, I am using stripe example which is in the documentation
These server-side requests have to be coming from somewhere, and they are not coming from our internal processes or the dashboard. Are there maybe other places in your code you haven't looked? Do you have any test scripts that could possibly be causing this?
I need to head out, but one of my teammates will be hopping in to help
can I share the code that I am using? and there is only one server-side request "create checkout session" which I am using
Sure you can share that here
This is what I am uisng
I am just redirecting users to check out URL
Maybe something I am missing
You can see your integration making the subscription update request like this one for the example invoice you sent: https://dashboard.stripe.com/test/logs/req_1jiPIyZAZrKHyy
are you calling subscriptions.update() somewhere?
No this is test code I am using just this one I shared
There must be other code running somewhere
Oh 🧐
Take a look at your request logs here: https://dashboard.stripe.com/test/logs
see the pattern of 9 subscription update requests following each checkout session?
I wonder if you have a webhook endpoint doing something you dont expect?
I first realize that may this be because of webhooks but in my webhooks, I am not using stripe again I am just calling my database
will see it again without webhooks in separate test server locally
you can try disabling your test webhook endpoint to see if the behavior stops
which would be in indication that it would be a rogue webhook handler you have running somewhere
I want to know another thing, How can I charge Immediately using the stripe billing portal, without proration, I see the document If I use proration_behavior = "none" It will charge after the billing period, and for an immediate charge I need to use "always_invoice" but it will charge a prorated amount
yeah sure I will
Thank BTW
what are you trying to charge for, whats the scenario?
for that scenario it sounds like you might wish to be resetting the billing anchor to reset the billing period (which is what happens in these requests we cant find the source of)
Ok for upgrading I want to charge immediately and for downgrading I want to charge at the end of billing cycle
yes want to reset the billing cycle but and want to charge full amount
It's not possible to configure that set of preferences via the billing portal, you would need to build the upgrade/downgrade logic yourself
and handle the two scenarios differently with subscription update requests
Oh ok ok Thank you, means billing portal will always charge prorated amount
Thank you for your help and guidence
You can choose to prorate or not, but its not possible to make that different for upgrade vs downgrade: https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-proration_behavior