Knowledge Base

API Guide for Billing Integration

Overview

This document provides an overview of the billing integration process between the Cloudmore platform and ERP or financial systems.

Billing integration is the most common use case on Cloudmore and is generally straightforward, often requiring only a single API call to retrieve the necessary data.

While billing is generated monthly, the exact dates vary by service.

For example, Microsoft NCE data is available between the 6th and 8th of each month, while legacy Microsoft services follow different, partner-specific schedules.

For most organizations, retrieving billing data once or twice a month is sufficient.

The document outlines the available Cloudmore API endpoints for exporting billing data and refers to the Cloudmore Swagger documentation for complete technical details.

Available API Calls

API Endpoint

Data Returned

Note

…/billing/reports/BillingLineDetails

All services

Recommended API call. Detailed, paginated billing lines returned synchronously.

…/billing/reports/BillingTotalAll …/billing/reports/BillingTotalByDate …/billing/reports/BillingTotalByService …/billing/reports/BillingTotalByOrganization …/billing/reports/BillingTotalByOrganizationService …/billing/reports/BillingTotalBySubscription …/billing/reports/BillingTotalByCostCenter

All services (aggregated)

Pre-aggregated billing totals at different levels.

…/billing/azurereports/AzureOneTimeInvoice/

  • Microsoft Data

    • 365 NCE

    • Azure NCE

    • Perpetual Licenses

    • Software Subscriptions

    • Marketplace Items

    • Reserved Instances

Returns detailed Microsoft information for all services under the New Commerce Experience (NCE).

This data is based on Microsoft’s “Recurring and one-time purchases” invoice.

…/billing/cspreports/MonthlyBillingPerOrganization

Microsoft O365 Legacy

Detailed report for Microsoft Legacy services. This data is based on Microsoft’s “Recurring” invoice.

…/billing/azurereports/InvoiceOverview

Microsoft Azure Legacy billing data

Detailed report for Microsoft Legacy services. This data is based on Microsoft’s “Recurring” invoice.

…/billing/azureonetimeusage/AzureOneTimeInvoice

Microsoft Azure Usage data

Microsoft Azure usage data report. Please note that the Microsoft usage report may slightly differ from the Microsoft Azure billing report because of rounding and transformations made by Microsoft.

Legacy APIs

…/billing/reports/MonthlyBillingPerOrganizationAsync

All services

Replaced by BillingLineDetails. Retained for backward compatibility only.

…/billing/reports/MonthlyBillingPerOrganization
and
…/billing/reports/MonthlyBillingPerService

All Services

This legacy API should only be used for testing. This API returns the same data as the asynchronous call, but has a limit on the amount of data that can be returned. NOTE! Not for Production!

Recommendation

Cloudmore strongly advises using the …/billing/reports/BillingLineDetails API endpoint to access billing information. This endpoint provides comprehensive billing data across all services available in Cloudmore, is returned synchronously with pagination, and is designed to be future-proof. By using this API, you avoid having to update your billing integration when expanding from Microsoft services to other offerings within Cloudmore.

If only summarized totals are needed (per organization, service, subscription, date, or cost center), the corresponding BillingTotal* aggregated API can be used.

Pre-Generated Billing Reports

Screenshot 2026-07-02 at 11.41.12.png

Common conventions

Aspect

Detail

Swagger Heading

PreGeneratedBillingReports

Base path

/api/resellers/{resellerId}/billing/reports/{Action}

Method

GET

Produces

application/json

resellerId

Path parameter, GUID.

Date period

startDate and endDate are both inclusive. startDate is taken from the start of that day and endDate is extended to the end of that day.

Currency

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

Filtering

organizationIds, organizationGroupIds, and serviceIds are optional and repeatable (repeat the parameter per value); omitting a filter returns all.

averageMarginPercentage

Calculated as (SUM(totalSales) − SUM(totalCost)) / SUM(totalSales) × 100.

Pagination

  • Request

    • Send the optional pageToken HTTP header to fetch a specific page; omit it for the first page.

  • Response

    • When more pages exist, a nextPageToken HTTP header is returned in the response. Pass the nextPageToken value back in the next request's pageToken header. No nextPageToken header present means it’s the last page.

  • Page size is fixed at 1000 items.

  • BillingTotalAll is not paginated; it returns a single object.

Example Request with Token

PowerShell
curl -i --location \
  'https://api.cloudmore.com/api/resellers/3f9a2c14-7b6e-4d81-a5c3-1e8f90d4a72b/billing/reports/BillingLineDetails'\
'?startDate=2026-01-01'\
'&endDate=2026-01-31'\
'&organizationIds=b21d7e4a-9c05-4f3e-8a16-2d7c6e94f018'\
'&organizationIds=c84f0a92-6d13-49b7-b2e5-71a3f8c5029d'\
'&splitByCostCenter=true' \
  --header 'pageToken: d3f6a81b-4e29-4c07-9a52-6f81b0e3c7a4|2026-01-06T00:00:00.0000000Z' \
  --header 'Authorization: Bearer {token}'

Status codes

Status

Meaning

200 OK

Success. Paginated endpoints may include a nextPageToken response header.

400 Bad Request

Missing/invalid parameters; invalid convertToCurrency; startDate later than endDate.

401 Unauthorized

Missing or invalid authentication credentials.

403 Forbidden

Authenticated, but the account lacks permission for this reseller.

404 Not Found

Reseller, organization, organization group, or service not found for the reseller.

Azure Service Name Mapping

A serviceId is normally associated with a single serviceName. Azure billing is broken down by model type, so a single Azure serviceId can appear under several serviceNames for the following APIs: BillingTotalByService, BillingTotalByOrganizationService, and BillingTotalBySubscription.

Service Name

Azure Consumption

Microsoft Azure & Software

Azure Marketplace

Azure Reserved Instances

Azure Perpetual Software

Azure Software Subscriptions

Azure Savings Plan

API Details

Details

API

Documentation

Returns paged billing line details for a reseller with optional filters.

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

https://cloudmore-kb.atlassian.net/wiki/spaces/SUP/pages/253591554/Billing+Line+Details+API+Details#Billing-Line-Details-API-Details

Returns aggregated billing totals for a reseller for the given period.

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

https://cloudmore-kb.atlassian.net/wiki/spaces/SUP/pages/252608517/Aggregated+Billing+Total+API+Details#BillingTotalAll

Returns paged billing totals grouped by date for a reseller.

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

https://cloudmore-kb.atlassian.net/wiki/spaces/SUP/pages/252608517/Aggregated+Billing+Total+API+Details#BillingTotalByDate

Returns paged billing totals grouped by service for a reseller.

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

https://cloudmore-kb.atlassian.net/wiki/spaces/SUP/pages/252608517/Aggregated+Billing+Total+API+Details#BillingTotalByService

Returns paged billing totals grouped by organization for a reseller.

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

https://cloudmore-kb.atlassian.net/wiki/spaces/SUP/pages/252608517/Aggregated+Billing+Total+API+Details#BillingTotalByOrganization

Returns paged billing totals grouped by organization and service for a reseller.

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

https://cloudmore-kb.atlassian.net/wiki/spaces/SUP/pages/252608517/Aggregated+Billing+Total+API+Details#BillingTotalByOrganizationService

Returns paged billing totals grouped by subscription for a reseller.

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

https://cloudmore-kb.atlassian.net/wiki/spaces/SUP/pages/252608517/Aggregated+Billing+Total+API+Details#BillingTotalBySubscription

Returns paged billing totals grouped by cost center for a reseller.

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

https://cloudmore-kb.atlassian.net/wiki/spaces/SUP/pages/252608517/Aggregated+Billing+Total+API+Details#BillingTotalByCostCenter