The significance of invoice end dates
The following information applies only to monthly invoice modes.
Different representations of invoice end dates
When viewing invoice data, you may notice that the end dates are represented differently in the API and the management portal UI on invoice page or export. Here's how the two representations may vary:
API Representation
The API shows the raw values of the end dates as they are stored in the system. For example, an invoice with an end date of 2023-08-01 will be displayed as such in the API.
Management Portal and Export Representation
In the management portal UI (invoice page) and export, the end dates may have a -1 day offset. This offset is applied to make it easier for users to understand the invoice period, especially for month-to-month charges.
Reason for discrepancy
The difference in representation arises from the way invoices are managed within our system. At the system level, an invoice is typically considered to be month-to-month. For instance, an invoice that starts on 2023-08-01 would be considered to end on 2023-09-01.
However, certain scenarios involving prorated rent and prepayments that are not month-to-month charges can lead to variations in the end dates. For example, if an invoice starts on 2023-08-31, the end date would need to be adjusted to 2023-09-30 since there is no 31st day in September.
System level advantage
At the system level, an invoice is considered month to month, starting from a specific date and ending on the corresponding day of the following month. However, to accommodate certain situations, sometimes we make end date adjustments when required for display purposes only and do not affect any calculations or the accuracy of the actual invoice period. For calculations, data processing, and system-level operations, the API remains the definitive source of truth.