#sahil-invoiceitems-delete
1 messages · Page 1 of 1 (latest)
Hi 👋
This would depend on how the billing cycle configuration changes the status of the invoice. Do you have an exmaple I can take a look at?
This is an invoice that just created from a subscription I created now: in_1On3qHSHHDGB2RdrAnNar8bq
Yes, as it is the first invoice with $0. But we had the same process before we started creating subscription with billing_anchor_config.
Example: in_1On0cXSHHDGB2Rdri1YIsFYu. We didn't have any problems modifying this, even after it was paid
What are you trying to modify?
This Invoice has not been modified. It only has a single API request assocaited with it.
Trying to delete invoice items
Can you provide the API request IDs for a request where the Deletion worked and one where it failed?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
I don't see logs on Dashbaord, but from my application logs:
For req which didn't work: req_OcNy07EsCPXwGq
This invoice item was generated due to a proration. I don't think you can delete those
ok. I think that is the default behavior, proration_behavior=create_prorations
But if I do proration_behavior=none, the billing cycle then starts from the date specified in billing_anchor_config right?
So are you saying you don't want prorations and that is why you are trying to delete the items?
Well, we want prorations, but it is more of the application design where we delete all items and then add items from our database. The deletion is to avoid duplication.
Unfortunately I don't think you can remove those proration items. It sounds like these are being created because your billing cycle config is creating a billing period that does not exactly match the billing interval for your prices. Is that correct?
This is a new change where we want the billing cycle to end at end of calendar month
Okay so the proration is to charge for the period of time between when you create the invoice and billing cycle anchor
yes
Okay well I don't think you can delete those invoice items.
sahil-invoiceitems-delete
okay, so the bottom line is invoice items under an invoice created with proration can't be deleted, right?
The proration items specifically, yes
But also we call out where deleting invoice items is not possible here: https://docs.stripe.com/api/invoiceitems/delete
Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.
ok, the item that we have in the invoice is the default that gets added, and yes that has proration=true.
Okay so I think it is expected that this would fail when attempting to delete the item.