Reporting API v1 - detailed invoice line items

Appxite

Introduction

This article explains how to retrieve detailed invoice line items using the Reporting API v1. Understanding the difference between consolidated and expanded invoice line items will help you access the level of detail you need for your reporting and analysis.
Reporting APIs can return detailed invoice line items. A comprehensive list of available Reporting API and functionalities can be found here:

APPXITE REPORTING API

In this article:

Consolidated vs expanded invoice line items

The Reporting API provides flexibility in viewing Invoice data:

Consolidated view: Features aggregated Invoice line items grouped by subscriptionId, providing an easy understanding of charges across various Subscriptions.

Expanded view: Provides a detailed breakdown of Invoice information, including specific details regarding prorated charges and individual transaction lines.

How to enable expanded invoice line items

To get Detailed Invoice Line Items in the API response, use the 'expand' parameter in the 'invoice-rows' endpoints (both 'general' and 'preview'):

'CorrectionDetails': Shows Correction Invoice line items only

'AllDetails': Shows all Invoice line items

No expand parameter: Returns aggregated entities grouped by subscriptionId

With expand parameter: Returns non-aggregated entities with separate entries for each Invoice line, including vendorInvoiceRowId (which corresponds to Microsoft or other vendor Invoice row ID)

Understanding the expand parameter

Without 'expand' enabled:

  • Entities are aggregated per subscriptionId
  • For usage fee Subscriptions (e.g., Azure usage), values are aggregated based on Usage Fees and Corrections

With 'expand' enabled:

  • Usage Fee values are aggregated per subscriptionId without vendorInvoiceRowId populated (due to potentially hundreds of thousands of lines with different vendorInvoiceRowId for each Subscription)
  • Corrections are divided into detailed Customer Credits using grouping of dates and totals
  • The vendorDetails field displays additional Invoice details directly from the vendor (such as exact account or Domain name)
NOTE! For usage fee (eg. Azure usage) subscriptions, having 'expand' disabled will result in having the values as per the subscriptionId aggregated based on Usage Fees and Corrections.

Having 'expand' enabled will result in having:
 - Usage Fee values aggregated as per the subscriptionId and without 'vendorInvoiceRowId' populated due that there could be hundreds of thousands of lines with different 'vendorInvoiceRowId' for each subscription
- Corrections divided into detailed Customer Credits using the grouping of dates and totals as explained in:
Detailed Invoice Line Items

 

Important! Expanded invoice line items for Correction lines are available for invoices generated after December 1, 2022 and for other lines - for invoices generated after May 1, 2023.

Rounding differences

Consolidated and expanded views handle rounding differently:

Consolidated Invoice line items: Aggregated totals are rounded to two decimal places

Expanded Invoice line items: Presented without rounding, preserving the precise number of digits as provided by the vendor

Example:

Expanded View Consolidated View
Invoice Line 1 5 173.23750  
Invoice Line 2 3 818.33750  
Invoice Line 3 2 463.45000  
Invoice Line 4 7 636.68950  
Total Amount 19 091.71450 19 091.71

Microsoft example

You bought 10 seats of the “Microsoft 365 Business Standard“ subscription on October 1st and added and removed seats several times until October 7th.

October has 31 days. Unit Price = 3. Number of days in the charge cycle 31; used/unused days = 27 (10/5 to 10/31), including 10/5.

Date Quantity Action
1st of Oct 10 Purchase 10 seats
2nd of Oct -3 Reduce 3 seats
3rd of Oct 5 Add 5 seats
4th of Oct -2 Reduce 2 seats
5th of Oct -3 Reduce 3 seats
6th of Oct -2 Reduce 2 seats
7th of Oct -1 Reduce 1 seats (not allowed)

Microsoft invoice lines:

Order Date Charge Type Unit Price Total Charge Start Date Charge End Date Effective Unit Price Billable Quantity
10/1/2021 new 3 30 10/1/2021 10/31/2021 3 10
10/2/2021 removeQuantity 3 -29 10/2/2021 10/31/2021 -2.9 10
10/2/2021 removeQuantity 3 20.3 10/2/2021 10/31/2021 2.9 7
10/3/2021 addQuantity 3 -19.6 10/3/2021 10/31/2021 -2.8 7
10/3/2021 addQuantity 3 33.6 10/3/2021 10/31/2021 2.8 12
10/4/2021 removeQuantity 3 -32.4 10/4/2021 10/31/2021 -2.7 12
10/4/2021 removeQuantity 3 27 10/4/2021 10/31/2021 2.7 10
10/5/2021 removeQuantity 3 -26.1 10/5/2021 10/31/2021 -2.61 10
10/5/2021 removeQuantity 3 18.27 10/5/2021 10/31/2021 2.61 7
10/6/2021 removeQuantity 3 -17.57 10/6/2021 10/31/2021 -2.51 7
10/6/2021 removeQuantity 3 12.55 10/6/2021 10/31/2021 2.51 5

Note: For change event on 6th of October Effective Unit Price = 3 / 31 * 26 = 2.51 (cut down to two decimal digits). Please note the Microsoft does not apply rounding as full Effective Unit Price = 3 / 31 * 26 = 2.516129032 and thus rounded number should be 2.52 EUR. 

Reporting API invoice lines:

Consolidated invoice line items:

Charge Type Customer Unit Price Customer Total Price Charge Start Date Charge End Date Reseller Unit Price

Customer 

Quantity

Reseller Total Price
CycleFee 3 30 10/1/2021 10/31/2021 3 10 30
Correction -12.95 -12.95 10/1/2021 10/31/2021 -12.95 1 -12.95

In consolidated invoice line-item view AppXite platform will provided all invoice line items with charge type Correction = -29 + 20.3 - 19.6 + 33.6 – 32.4 + 27 - 26.1 + 18.27 – 17.57 + 12.55 = - 12.95 EUR

Expanded invoice line items:

Charge Type Customer Unit Price Customer Total Price Charge Start Date Charge End Date Reseller Unit Price Customer Quantity Reseller Total Price
new 3 30 10/1/2021 10/31/2021 3 10 30
removeQuantity 3 -29 10/2/2021 10/31/2021 -2.9 10 -29
removeQuantity 3 20.3 10/2/2021 10/31/2021 2.9 7 20.3
addQuantity 3 -19.6 10/3/2021 10/31/2021 -2.8 7 -19.6
addQuantity 3 33.6 10/3/2021 10/31/2021 2.8 12 33.6
removeQuantity 3 -32.4 10/4/2021 10/31/2021 -2.7 12 -32.4
removeQuantity 3 27 10/4/2021 10/31/2021 2.7 10 27
removeQuantity 3 -26.1 10/5/2021 10/31/2021 -2.61 10 -26.1
removeQuantity 3 18.27 10/5/2021 10/31/2021 2.61 7 18.27
removeQuantity 3 -17.57 10/6/2021 10/31/2021 -2.51 7 -17.57
removeQuantity 3 12.55 10/6/2021 10/31/2021 2.51 5 12.55

 

Additionally, if we use 'Expand' = 'AllDetails' for either of endpoints shown below, additional invoice 
details will be displayed in the field vendorDetails. That information comes directly for a vendor, and it can be for example the exact account or domain name the charge is for, or any other details:
 

  • invoice-rows/{requesterId}
  • invoice-rows/{requesterId}/preview

Summary

The Reporting API provides both consolidated and expanded views of Invoice line items through the 'expand' parameter in invoice-rows endpoints. Use 'CorrectionDetails' to view only Corrections or 'AllDetails' to view all line items. Without the expand parameter, Invoice line items are aggregated by subscriptionId with totals rounded to two decimal places. With expand enabled, each transaction appears as a separate line item with precise vendor-provided values and vendorInvoiceRowId populated. For usage fee Subscriptions, Usage Fees remain aggregated while Corrections are divided into detailed Customer Credits. Expanded Invoice line items are available for Corrections after December 1, 2022, and for other lines after May 1, 2023. The 'AllDetails' option also populates the vendorDetails field with additional vendor-specific information.

 

 

 

 

 

Was this article helpful?

1 out of 1 found this helpful

Add comment

Please sign in to leave a comment.