Many businesses have customers who are invoiced outside their subscription billing system. With a custom data source, you can add these customers and their subscription billing data into ChartMogul through either our UI or via API integration. If you built your own subscription billing in-house, or want to build your own integration for any reason, then you would also use a custom data source.
This article focuses on how to add your customers and subscription billing data in your custom data source using a CSV (comma-separated values) file.
1. Formatting your CSV file(s)
In the custom data source, customers and their billing information are separated into different tabs, as shown in the image below.
A custom data source expects your CSV file data to be in a specific format. To import billing data using CSV upload prepare files for each data set - customers, plans, invoices, invoice line items, transactions, and cancellations. Please note that these should be separate CSV files with all the required fields.
A sample file for each of these tabs can be seen below.
- Customers - sample CSV file
- Plans - sample CSV file
- Invoices - sample CSV file
- Invoice line items - sample CSV file
- Transactions - sample CSV file
- Cancellations - sample CSV file
Alternatively, you can download all the files as a zip by clicking here - Sample files.
Note: The column names shown in the UI may be different from those in the CSV file. However, we recommend using the same naming as in the sample files above.
Note: The CSV file should either be in ASCII or UTF-8 Unicode file format.
2. Uploading your file(s)
To upload a CSV file, navigate to the desired tab inside the custom data source. Click on the Import CSV button and upload the file in the modal window. For example, to upload a customer file navigate to the Customers tab and click on the Import CSV button.
To upload a different type of data, navigate to a different tab. For example, to upload a transaction file navigate to the "Transactions" tab and then click on the Upload CSV button. A different modal window is shown in this case with an option to upload transactions CSV file.
After the file is uploaded and processed, the data will be reflected in the custom data source. By default, the data is filtered to the CSV file that was last uploaded. Use the dropdown shown in the image below to filter by a different CSV file or to remove the filter.
Note: CSV file processing can take some time, depending on the number of rows in your CSV file.
3. Editing uploaded data
If there is a failure in processing the information or if there are any issues with data entered, you can change the data in the UI. If you want to edit data, navigate to that tab and click on the edit icon in the row. Click on the green tick to submit your changes.
Alternatively, you can upload a new CSV file with the correct data. If there is an existing record for a row in the CSV file, then that record will be replaced with the latest data. If there are additional rows in the CSV file, then they will be added as new data.