← All field notes

The cloud billing stack: 25 layers from product catalog to general ledger

AI-assisted / research-based

This field note was drafted with AI assistance and synthesizes publicly documented cloud billing concepts and general industry practice. It is not based on confidential Microsoft systems or data, describes a generalized reference architecture rather than any single provider's implementation, and is not accounting, tax, or legal advice. Public documentation is linked so you can verify each concept yourself.

A customer sees one number at the end of the month. Behind it sits a long chain of systems, each owning a narrow decision: what can be sold, what was consumed, what it costs this customer, who owns the charge, what tax applies, and how the result lands in the books.

Most billing incidents are not failures of a single layer. They happen at the seams, where one layer's assumptions quietly differ from the next one's. A useful way to reason about commerce billing is to lay the whole chain out end to end and be explicit about what the company must define at every step.

The pipeline in five phases

The 25 layers below group naturally into five phases. Each phase consumes the output of the one before it.

  • Define (layers 1–3): the catalog, the commercial offer, and the meter. Nothing can be billed that is not first described here.
  • Measure (layers 4–6): services emit usage, the platform ingests it, and heterogeneous events are normalized into one canonical record.
  • Price (layers 7–13): rating, pricing, tiers, commitments, discounts, account ownership, and eligibility combine to turn quantity into money.
  • Bill (layers 14–17): tax, credits, aggregation, and the invoice document itself.
  • Account and operate (layers 18–25): allocation, reconciliation, disputes, revenue recognition, ledger posting, audit, downstream APIs, and FinOps analytics.
Flowchart / commerce billing pipeline

From catalog to ledger in five phases

FIG 01 · MOTION
Twenty-five layer cloud billing flow Five phases carry a usage record from definition to the ledger. Catalog, offer, and meter definitions (layers 1 to 3) supply the keys. Usage is generated, ingested, and normalized (layers 4 to 6). The rating engine (layer 7) multiplies quantity by an effective unit price built from pricing, tiers, commitments, discounts, account hierarchy, and eligibility (layers 8 to 13). Tax, credits, aggregation, and invoice generation (layers 14 to 17) produce the bill. Billed data then fans out to cost allocation, reconciliation, disputes, and revenue recognition (layers 18 to 21), which feed ledger posting, audit, exports, and FinOps analytics (layers 22 to 25). Disputes loop back as credits, and FinOps insight loops back to commitments. SKU · METER · OFFER KEYS NORMALIZED USAGE EFFECTIVE UNIT PRICE RATED CHARGES DISPUTE → CREDIT RIGHT-SIZE + BUY COMMITMENTS PHASE 01Definelayers 1–3 01 / DEFINEProduct / service catalogproduct · SKU · meter · region 02 / CONTRACTOffer / commercial modelpay-as-you-go · contract · reseller 03 / MEASUREMeter definitionunit + aggregation method PHASE 02Measurelayers 4–6 04 / EMITUsage / telemetry generationresource · meter · qty · time 05 / COLLECTUsage ingestionvalidate · dedupe · late events 06 / CONFORMUsage normalizationcanonical billing schema PHASE 03Pricelayers 7–13 07 / RATERating engineqty × effective unit priceper normalized record 08 / PRICEPricing engineretail vs negotiated rate 09 / TIERTier / threshold logic0–100 TB · 100–500 TB 10 / COMMITCommitment / reservation logicreservations · savings plans 11 / DISCOUNTDiscount / benefit engineprecedence + stacking rules 12 / OWNAccount hierarchywho owns each charge 13 / QUALIFYEntitlement / eligibility enginewho qualifies for which price PHASE 04Billlayers 14–17 14 / TAXTax engineVAT · sales tax · GST 15 / ADJUSTCredits / adjustmentsSLA credit · correction 16 / GROUPInvoice aggregationbilling profile + currency 17 / ISSUEInvoice generationlegal fields · tax · total PHASE 05Account + operatelayers 18–25 18 / ALLOCATECost allocationtags → cost centers 19 / VERIFYReconciliationusage = rated = invoiced 20 / RESOLVEDispute / support workflowvalidate → adjust 21 / RECOGNIZERevenue recognitiondeferred vs recognized 22 / POSTFinancial ledger integrationrevenue · AR · tax GL 23 / TRACEAudit / complianceversion + approver 24 / EXPOSEBilling APIs / exportsusage + invoice data 25 / OPTIMIZEFinOps / analyticsbudgets · anomaly alerts REFERENCE DATADECISION / OUTPUTSYSTEM OF RECORDFEEDBACK LOOP Motion shows phase order only. Every path stays visible without animation.
Definitions set the keys, usage is measured and normalized, six pricing inputs converge on the rating engine, and the bill fans out into accounting and operations. Disputes return as credits; FinOps insight returns as commitments.

The full reference map

Scroll the table sideways on smaller screens. The first column stays pinned.

Architecture LayerWhat It DoesTypical Cloud Billing Provider ExampleWhat the Company DefinesTypical Policy / Schema Examples
1. Product / Service CatalogDefines what can be sold and billedAzure VM, Storage, Cosmos DB, OpenAI tokensProducts, SKUs, editions, regions, unitsProductId, SkuId, MeterId, Region, UnitOfMeasure
2. Offer / Commercial ModelDefines how a customer buys the servicePAYG, Enterprise Agreement, MCA, CSPContract type, eligibility, term, commitmentCustomer eligible for negotiated pricing only under a specific agreement
3. Meter DefinitionDefines the measurable consumption unitVM hours, GB-month, API calls, tokensMeter name, unit, aggregation methodComputeHours, StorageGBMonth, InputTokens
4. Usage / Telemetry GenerationService produces billable usage recordsA VM reports running hoursEvent format, timestamps, resource IDs{subscriptionId, resourceId, meterId, quantity, timestamp}
5. Usage IngestionCollects usage from Azure servicesUsage pipeline receiving events from compute/storageValidation, deduplication, late-event handlingReject missing MeterId; dedupe identical event IDs
6. Usage NormalizationConverts different service events into a common billing formatDifferent services mapped into standardized usage recordsCanonical billing schemaConvert seconds → hours; bytes → GB
7. Rating EngineConverts usage into monetary charges10 VM hours × $0.12/hourPricing rules, tiers, discountsCharge = Quantity × EffectiveUnitPrice
8. Pricing EngineDetermines applicable priceRetail price vs EA negotiated ratePrice lists, negotiated prices, currencyUS East VM = $X/hour; customer discount = 12%
9. Tier / Threshold LogicSupports volume pricingFirst 100 TB vs next 400 TBTier boundaries and rates0–100TB=$x, 100–500TB=$y
10. Commitment / Reservation LogicApplies prepaid commitmentsAzure Reservations, Savings PlanCoverage, eligibility, allocationApply reservation before PAYG pricing
11. Discount / Benefit EngineApplies contractual benefitsAzure Hybrid Benefit, dev/test ratesPrecedence and stacking rulesReservation → negotiated discount → promotional credit
12. Account HierarchyDetermines who owns the chargesBilling Account → Billing Profile → Invoice Section → SubscriptionOrganizational relationshipsSubscription belongs to department/cost center
13. Entitlement / Eligibility EngineDetermines what pricing or benefits a customer can useDev/Test subscription eligibilityCustomer/tenant/product eligibilityOnly Visual Studio subscribers qualify
14. Tax EngineCalculates tax treatmentVAT, sales tax, GSTJurisdiction and tax rulesWA sales tax based on customer billing location
15. Credits / AdjustmentsHandles credits and correctionsSLA credit, support credit, billing correctionAdjustment reason and authorizationCredit $500 against invoice
16. Invoice AggregationGroups rated chargesMonthly Azure invoiceBilling period, grouping, invoice ownershipAggregate by billing profile + currency
17. Invoice GenerationProduces invoice documentsAzure monthly invoice PDFInvoice schema and legal fieldsInvoice ID, billing period, tax, subtotal, total
18. Cost AllocationMaps spend to business unitsCost Management tagsTag policies, cost centers, departmentsCostCenter=Finance, Environment=Prod
19. ReconciliationVerifies usage → charge → invoice integrityCompare source usage against billed recordsTolerance and reconciliation rulesUsage quantity must equal rated quantity
20. Dispute / Support WorkflowHandles customer billing disputesCustomer challenges unexpected Azure chargeInvestigation and approval policyUsage validation → pricing validation → adjustment
21. Revenue RecognitionConverts billing into accounting eventsMonthly service consumption revenueAccounting rulesDeferred vs recognized revenue
22. Financial Ledger IntegrationPosts transactions into finance systemsRevenue, AR, tax ledgerGL mappingsVM revenue → Cloud Compute Revenue GL
23. Audit / ComplianceMaintains traceabilityWho changed price or issued creditAudit requirementsEvery pricing change has version + approver
24. Billing APIs / ExportsExposes billing data downstreamAzure Cost Management exports/APIsAPI schema, access policyUsageDetail API, invoice API
25. FinOps / AnalyticsHelps customers optimize spendingAzure Cost ManagementAllocation, budgets, anomaly rulesAlert if spend > 110% of monthly budget

Where the hard problems live

Identity has to survive every hop

The MeterId defined in layer 3 is the thread that ties a telemetry event to a price, a tax treatment, and eventually a GL account. If normalization rewrites it, or a service emits a meter the catalog does not know, the charge either drops silently or lands on the wrong line. Ingestion should reject unknown meters loudly rather than guess.

Ingestion must be idempotent and tolerant of lateness

Usage arrives out of order and sometimes twice. Deduplicating on a stable event ID and defining a cut-off for late events per billing period are what separate a correct invoice from one that needs a correction later.

Precedence is a contract, not an implementation detail

Reservations, savings plans, negotiated discounts, hybrid benefits, and promotional credits can all touch the same usage. The order they apply in changes the final amount, so the stacking rule belongs in versioned policy, not scattered across engine code. A typical order is commitment coverage first, then contractual discounts, then credits.

Ownership decides the invoice

The account hierarchy in layer 12 determines which invoice a charge lands on and which currency and tax jurisdiction apply. Moving a subscription between invoice sections mid-period is a common source of split or duplicated charges.

Reconciliation closes the loop

Layer 19 is the control that proves the pipeline is honest: usage quantity in equals rated quantity out, and rated charges sum to the invoice. Without it, errors surface as customer disputes in layer 20 instead of internal alerts.

A billing system earns trust when every number on the invoice can be traced back to a meter, a price version, and an approval.

Design principles that hold across layers

  • Version every price, rule, and discount, and record who approved each change.
  • Keep one canonical usage schema; translate at the edge, not in the middle.
  • Treat tax, revenue recognition, and ledger mapping as first-class consumers of the rated record, not afterthoughts.
  • Expose the same rated data customers are billed on through exports and APIs, so FinOps teams reconcile against the source of truth.
  • Build reconciliation as a continuous check, not a month-end task.

Public references

Continue readingReturn to field notes →