#eoghanobrien
1 messages · Page 1 of 1 (latest)
Hi, this typically occurs when there is no invoice items on the customer, and to correct this, you'd need to create one: https://stripe.com/docs/api/invoiceitems/create
In the customer overview it shows 2 invoices, here's the most recent one: in_1Mz5XWE3c9sWyeruAHtBKEqN
Invoice and Invoice Items are two separate objects
I'd recommend that you read through this document, https://stripe.com/docs/invoicing/overview and let me know if you have any questions on it.
I think what happened here is I updated the subscription/created the invoice from my development machine without having the stripe cli listener running locally, so the webhook went to our staging environment
Does that sound like it could have caused this?
Can you share the specific request id with me? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_iogmuzuiGbIl4J
No that's not it ☝️ (the request id is fine) it looks like we weren't using immediate invoicing before, so we would update the subscription then create an invoice using just the customer ID - my assumption is that would then create the invoice for a prorated draft invoice or something?
Can you share the correct request id with me? Without it, it's really hard to understand what the question is
I saw your 'No that's not it' so did not look further..
Looking now
If you look at https://dashboard.stripe.com/test/customers/cus_NHkx6UBLZRdR7t, there are no items to invoice under 'Pending invoice items'. You'd need to create an invoice item: you'd need to create one: https://stripe.com/docs/api/invoiceitems/create before you can create an invoice: https://dashboard.stripe.com/test/logs/req_iogmuzuiGbIl4J
What do you think would trigger this protate, 'my assumption is that would then create the invoice for a prorated draft invoice'?
I think this is a legacy code issue on our side
We use an eventing system with listeners and it looks like that specific listener wasn't disabled.
I see
I'm running a separate test now to confirm
Based on what you said, it sounds like my assumption is correct
We were expecting the pending invoice to exist because we were using the old subscription.prorate = true functionality instead of the new subscription.proration_behavior
Are you making a call to update a subscription?
Yes ... We switched to the newer proration_behavior and the invoiced processed and paid as expected but we still called the Invoice::create([customer_id: customerID]) afterward but there was no pending invoice at that point