I deleted an invoice by mistake. How do I restore it?
How to restore the deleted invoice?
You can gather the deleted invoice data by navigating to the subscription details page > events > 'invoice deleted' event > Click on event id> Show V2 content.
Once you have the data of the deleted invoice, you can restore the deleted invoice in one of the two ways:
Import Invoice API for a single invoice
Bulk operation for multiple Invoices.
Firstly, we need to gather the details of the deleted invoice
Navigate to the Events from the Subscription detail page or from to Events Index page under logs.
Once we locate and open the Invoice Deleted event, click ‘Show V2 Content’
Option 1: Import Invoice API
Note: If you have product family and charges under Product Catalog then you are in PC 2.0 version. Click here to know more.
Sample request Sample response
Importing an invoice status as ‘Paid’ status is only when you are trying to move from different billing provider to Chargebee. If we import an invoice in Paid status for deleted invoice, it would create an invoice with a new payment.
The previously deleted invoice will have payments moved to excess payments which will not be linked to the invoice created in Paid status that would cause duplicate payments for the same invoice.
Once the invoice is imported successfully, you will see the same invoice created in Chargebee.
Step 2: To link the payment that was used to the invoice that was deleted, you can use the ‘Apply Payments’ option from the invoice.
You will be prompted to link the excess payment, and click ‘Apply’
Option 2: Bulk Operation
Step 1: You can perform this action from Settings > Configure Chargebee > Import & Export Data > Choose a Bulk Operation > Invoices > Import Invoice
Step 2: Download the sample CSV file
This file contains sample records that you can replace with your own records. Note that the data needs to be added to the sheet in the same format the sample data is in.
Upon downloading the CSV ‘import_invoice_sample_data.csv’ file, update the current data from your site to in the sample CSV
Now, you can update the invoice data into the ‘import_invoice_sample_data.csv’
Step 5: Drag and drop your data file into the web interface or upload it:
Once you've added all the information and the data file is ready, upload it.
Please refer to this link Bulk operations if you have received any errors while uploading the file.