Usage Billing icon

Usage Billing

Process pricing and usage data to generate billing records

Overview

This node operation matches usage records with corresponding price list entries based on specified matching fields and calculates cost and sell amounts. It supports customer-specific pricing, foreign exchange conversion, minimum sell price enforcement, and configurable rounding and margin calculations. The node is useful for billing and invoicing scenarios where usage data needs to be priced according to a dynamic or static price list, such as telecom usage billing, utility consumption billing, or subscription service usage.

Use Case Examples

  1. Matching product usage records with a price list to calculate billing amounts.
  2. Applying customer-specific pricing rules when price list contains duplicate entries for different customers.
  3. Converting calculated amounts to a target currency using a fixed exchange rate.
  4. Enforcing minimum sell price to avoid undercharging customers.

Properties

Name Meaning
Price List Data Field name or expression that resolves to the price list array, evaluated once and reused for all matches.
Usage Data Field name or expression that resolves to usage records, accepts arrays or single objects.
Match Fields Field pairs that uniquely identify matching records between price list and usage data to ensure a single unique match.
Customer-Specific Pricing Configuration for handling duplicate price list items where some entries are customer-specific and others are general, requiring customer ID matching.
FX Conversion Settings to convert calculated amounts from source currency to target currency using a fixed exchange rate.
Minimum Sell Price Enforcement Prevents customer sell price from being lower than standard price list sell price when customer-specific pricing is active.
Calculation Settings Settings for quantity, cost price, sell price fields, rounding direction, decimal places, and margin field inclusion in calculations.
Output Field Configuration Settings to control automatic inclusion and naming of matched price list fields, usage fields, calculation fields, and pass-through fields in output.
Output Fields Configuration for automatic or manual inclusion of additional fields from price list and usage data in output.

Output

JSON

  • calculatedCostAmountField - Calculated cost amount based on matched usage and price list data.
  • calculatedSellAmountField - Calculated sell amount based on matched usage and price list data.
  • calc_margin - Margin amount (sell price minus cost price), included if margin fields enabled.
  • calc_margin_percent - Margin percentage ((sell - cost) / sell * 100), included if margin fields enabled.
  • calc_markup_percent - Markup percentage ((sell - cost) / cost * 100), included if margin fields enabled.
    price_ - Fields from price list data used for matching and calculations, prefixed as configured.usage_ - Fields from usage data used for matching and calculations, prefixed as configured.calc_ - Calculation-related fields such as quantity, cost price, sell price, and totals, prefixed as configured. - Pass-through fields copied verbatim from usage data to output without prefix.

Dependencies

  • An API key credential may be required if external FX rate services are integrated (not shown in provided code).

Troubleshooting

  • Ensure that the price list and usage data fields specified exist and contain valid data arrays or objects.
  • If FX conversion is enabled, verify that the FX rate is a positive number and the target currency code is provided.
  • When customer-specific pricing is enabled, ensure customer ID fields are correctly specified and present in both price list and usage data.
  • If no matches are found, check that the match fields correctly identify unique records between price list and usage data.
  • Common error: 'FX Conversion is enabled but FX Rate is missing or invalid' indicates a configuration issue with FX settings.

Discussion