#sahil-invoiceitems-delete

1 messages · Page 1 of 1 (latest)

grim stumpBOT
covert ivy
#

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?

dreamy sequoia
#

This is an invoice that just created from a subscription I created now: in_1On3qHSHHDGB2RdrAnNar8bq

covert ivy
#

This invoice has already been paid

#

It was paid at the time of creation

dreamy sequoia
#

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

covert ivy
#

What are you trying to modify?

#

This Invoice has not been modified. It only has a single API request assocaited with it.

dreamy sequoia
#

Trying to delete invoice items

covert ivy
#

Can you provide the API request IDs for a request where the Deletion worked and one where it failed?

dreamy sequoia
#

I don't see logs on Dashbaord, but from my application logs:
For req which didn't work: req_OcNy07EsCPXwGq

covert ivy
#

This invoice item was generated due to a proration. I don't think you can delete those

dreamy sequoia
#

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?

covert ivy
#

So are you saying you don't want prorations and that is why you are trying to delete the items?

dreamy sequoia
#

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.

covert ivy
#

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?

dreamy sequoia
#

This is a new change where we want the billing cycle to end at end of calendar month

covert ivy
#

Okay so the proration is to charge for the period of time between when you create the invoice and billing cycle anchor

dreamy sequoia
#

yes

covert ivy
#

Okay well I don't think you can delete those invoice items.

grim stumpBOT
#

sahil-invoiceitems-delete

dreamy sequoia
#

okay, so the bottom line is invoice items under an invoice created with proration can't be deleted, right?

covert ivy
#

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.

dreamy sequoia
#

ok, the item that we have in the invoice is the default that gets added, and yes that has proration=true.

covert ivy
#

Okay so I think it is expected that this would fail when attempting to delete the item.