Knowledge Base

Aggregated Billing Total API Details (5.0)

Aggregated Billing Reports APIs

Request Details

All aggregated billing APIs share the same request parameters and return aggregated totals.

Parameter

In

Type

Required

Description

resellerId

path

GUID

Yes

Reseller identifier.

startDate

query

date

Yes

Start of billing period (inclusive). YYYY-MM-DD

endDate

query

date

Yes

End of billing period (inclusive). YYYY-MM-DD

organizationIds

query

GUID[]

No

Filter by organization. Repeatable.

organizationGroupIds

query

GUID[]

No

Filter by organization group. Repeatable.

serviceIds

query

GUID[]

No

Filter by service. Repeatable.

convertToCurrency

query

string

No

If omitted, amounts are in the default sales/cost currency. If supplied, must be a valid 3-letter ISO 4217 code.

pageToken

header

string

No

Page token from a previous response's nextPageToken header.

Common Response Fields

The following fields appear on the responses of all aggregated billing APIs.

Field

Definition

totalCost

Sum of cost for the group.

totalSales

Sum of sales for the group.

totalRecommendedPrice

Sum of the recommended price for the group.

totalDifferenceFromRecommended

Sum of the difference from recommended for the group (totalSales minus totalRecommendedPrice).

totalMarginAmount

Sum of margin (totalSales minus totalCost) for the group.

averageMarginPercentage

The average margin percentage: (SUM(totalSales) minus SUM(totalCost)) / SUM(totalSales) x 100.

costCurrencyCode

Currency of the cost amounts.

salesCurrencyCode

Currency of the sales amounts.

Additional Response Fields

Field

Definition

Appears on

billingDate

The billing date the totals are grouped by.

BillingTotalByDate

organizationId

Identifier of the organization.

BillingTotalByOrganization, BillingTotalByOrganizationService, BillingTotalBySubscription, BillingTotalByCostCenter

organizationName

Display name of the organization.

BillingTotalByOrganization, BillingTotalByOrganizationService, BillingTotalBySubscription, BillingTotalByCostCenter

customerNumber

Reseller assigned customer number.

BillingTotalByOrganization, BillingTotalByOrganizationService, BillingTotalBySubscription

organizationGroups

Names of the organization groups.

BillingTotalByOrganization

serviceId

Identifier of the service.

BillingTotalByService, BillingTotalByOrganizationService, BillingTotalBySubscription

serviceName

For Azure, reflects the Azure model type.

BillingTotalByService, BillingTotalByOrganizationService, BillingTotalBySubscription

subscriptionId

Identifier of the subscription.

BillingTotalBySubscription

subscriptionName

Friendly name of the subscription.

BillingTotalBySubscription

productId

The unique product identifier. Null for consumption based subscriptions.

BillingTotalBySubscription

productName

Name of the product. Null for consumption based subscriptions.

BillingTotalBySubscription

itemCode

Vendor item/SKU code. Null for consumption-based subscriptions.

BillingTotalBySubscription

paymentFrequency

How often the subscription is billed.

BillingTotalBySubscription

subscriptionPeriod

Term/commitment length of the subscription.

BillingTotalBySubscription

purchaseOrderNumber

Optional purchase order number.

BillingTotalBySubscription

costCenter

Name of the cost center the totals are grouped by.

BillingTotalByCostCenter

API Details

BillingTotalAll

API

Details

GET /api/resellers/{resellerId}/billing/reports/BillingTotalAll

Aggregates the entire billing for the period into one object. Not paginated (the pageToken header is ignored).

Example Response

{
  "totalCost": 9327.50,
  "totalSales": 11289.00,
  "totalRecommendedPrice": 10560.00,
  "totalDifferenceFromRecommended": 729.00,
  "totalMarginAmount": 1961.50,
  "averageMarginPercentage": 17.38,
  "costCurrencyCode": "SEK",
  "salesCurrencyCode": "SEK"
}

BillingTotalByDate

API

Details

GET /api/resellers/{resellerId}/billing/reports/BillingTotalByDate

Totals grouped by billing date. Paginated array.

Example Response

[
  {
    "billingDate": "2026-01-06",
    "totalCost": 6207.50,
    "totalSales": 7545.00,
    "totalRecommendedPrice": 7050.00,
    "totalDifferenceFromRecommended": 495.00,
    "totalMarginAmount": 1337.50,
    "averageMarginPercentage": 17.73,
    "costCurrencyCode": "SEK",
    "salesCurrencyCode": "SEK"
  }
]

BillingTotalByService

API

Details

GET /api/resellers/{resellerId}/billing/reports/BillingTotalByService

Totals grouped by service. Paginated array.

BillingTotalByOrganization

API

Details

GET /api/resellers/{resellerId}/billing/reports/BillingTotalByOrganization

Totals grouped by organization. Paginated array.

BillingTotalByOrganizationService

API

Details

GET /api/resellers/{resellerId}/billing/reports/BillingTotalByOrganizationService

Totals grouped by organization and service.

BillingTotalBySubscription

API

Details

GET /api/resellers/{resellerId}/billing/reports/BillingTotalBySubscription

Totals grouped by subscription, with parent organization, service, and product context.

Additional Info

  • A subscription can have multiple products; these are normally separate line items.

  • CSP 365 Direct: lines with the same subscriptionId, itemCode and productId are grouped together.

  • Consumption-based (Azure Consumption, Custom Service Consumption): grouped as a single subscription, with product related fields left empty/null.

  • Custom Service add-on totals are aggregated under the parent subscription record.

BillingTotalByCostCenter

API

Details

GET /api/resellers/{resellerId}/billing/reports/BillingTotalByCostCenter

Entire billing aggregated to cost center level.