Invoices
Overview
An invoice in CloudBilling is a collection of Pricing Rule Results (PRRs) generated from a customer’s purchases in a specific time period. In simple words, an invoice is a collection of all the calculations results and the data attached to them.
Since PRRs are synced to the dataset as LineItems, all LineItems belong to an invoice indicated by the foreign key field InvoiceKey in the LineItems table. This field links to the Invoices table, which contains information associated with all CloudBilling invoices, including the customer for each invoice. This table provides invoice-specific insights such as the value generated by Ad-Hoc invoices in any specific time period.
Fields
| Name | Type | Description |
|---|---|---|
Key | Integer | Primary Key - Invoices Table. |
SourceId | String | A unique id for each invoice in CloudBilling’s internal system. |
CustomerCode | Integer | A unique customer identifier in CloudBilling - Indicates the customer an invoice belongs to. |
CustomerKey | Integer | Foreign Key - Customers Table. |
Number | String | Invoice Number. Approved Invoices will have an invoice number and all other invoices will have the value -1 |
Start | Integer | Foreign Key - DateDimension Table. The start fo the invoice period (yyyymmdd). |
End | Integer | Foreign Key - DateDimension Table. The end of the invoice period (yyyymmdd). |
StatusKey | Integer | Foreign Key - Invoice Status Table. Indicates the current status of an invoice. |
Approved | Integer | The invoice approval date (yyyymmdd). It is -1 if invoice is not approved. |
Type | Integer | 0 = Period; 1 = AdHoc; 2 = Credit. |
Amount | Decimal | The last calculated total of the invoice. |
Cost | Decimal | The last calculated cost of the invoice. |
LastCalculatedDate | Datetimeoffset | The most recent date and time of invoice recalculation in UTC (yyyy-mm-dd hh:mm:ss +00:00). |
LockedUntilDate | Datetimeoffset | Until when an invoice remains locked during data sync in UTC (yyyy-mm-dd hh:mm:ss +00:00). |