Package Information
Downloads: 6 weekly / 103 monthly
Latest Version: 0.5.3
Author: Max Soukhomlinov
Documentation
n8n-nodes-usage-billing
This n8n community node provides usage-based billing calculation functionality. It takes usage data and price lists as inputs, performs matching and calculation, and outputs formatted billing records.
IMPORTANT: When updating between versions, make sure to restart your n8n instance after the update. UI changes and new features are only picked up after a restart.
Installation
Features
Operations
Configuration Options
Contributing
Support
License
Features
- Flexible Usage Matching: Match usage data to price list items using multiple fields
- Customer-Specific Pricing: Support for customer-specific pricing rules
- FX Conversion: Convert calculated amounts to a target currency using a fixed exchange rate
- Minimum Sell Price Enforcement: Prevent customer-specific sell prices from falling below the standard pricelist price
- Margin/Profit Calculation: Derive margin, margin %, and markup % from cost and sell amounts
- Pass-Through Fields: Copy billing period dates and identifiers from usage records to output without prefixing
- Calculation Options: Configure rounding and decimal precision
- Output Customization: Control which fields appear in the output with automatic or manual field inclusion
- Usage Summarization: Generate summaries by grouping and totaling fields
Operations
The node provides two main operations:
Match Usage and Calculate
Match usage data with pricing records and calculate costs:
- Provide price list and usage data in specified fields (supports expressions that return arrays or objects)
- Configure match fields (productId, region, etc.)
- Configure calculation options (quantity field, price fields, rounding)
- Configure customer-specific pricing (if needed)
- Configure output field options:
- Automatic mode: Automatically include all fields from both pricelist and usage data with configurable prefixes (default:
price_andusage_) - Manual mode: Manually specify which fields to include with custom source and target field names
- Automatic mode: Automatically include all fields from both pricelist and usage data with configurable prefixes (default:
- Get calculated billing records as output, with unmatched records in a separate output
Usage Summary
Generate summaries of usage and costs:
- Provide calculated billing records as input
- Specify fields to total (cost, price, etc.)
- Specify fields to group by (date, customer, product, etc.)
- Get summarized totals as output
Configuration Options
Match Usage and Calculate Configuration
- Price List Field: Field or expression containing price list data (supports arrays, objects, JSON strings, or field paths)
- Usage Data Field: Field or expression containing usage data (supports arrays, objects, JSON strings, or field paths)
- Match Fields: Field pairs to match between price list and usage data (at least one pair required)
- Calculation Configuration: Fields and options for calculation (quantity, cost price, sell price, rounding)
- Customer-Specific Pricing: Options for customer-specific price entries with customer ID matching
- FX Conversion: Enable currency conversion with a fixed exchange rate and target currency code (e.g. USD → AUD at 1.62). Adds
calc_fxRateandcalc_currencyCodeto output. - Minimum Sell Price Enforcement: When customer-specific pricing is active, ensures the sell price is not lower than the standard pricelist price. Adds
minSellEnforced,standardSellPrice, andoriginalCustomerSellPriceto output when triggered. - Margin/Profit Calculation: Enable
Include Margin Fieldsin Calculation Settings to addcalc_margin,calc_margin_percent, andcalc_markup_percentto output. Division-by-zero cases (cost=0 or sell=0) outputnull. - Output Field Configuration: Automatic inclusion settings for match fields, calculation fields, and field prefixes
- Pass-Through Fields: In Output Field Configuration, specify a comma-separated list of usage record field names (e.g.
startDate,endDate,customerName) to copy verbatim to output without any prefix. - Output Fields: Control which additional fields to include in output:
- Automatic Mode: Automatically includes all fields from both pricelist and usage data with required prefixes
- Manual Mode: Manually specify individual fields with source and target field names
Usage Summary Configuration
- Fields to Total: Comma-separated list of fields to sum
- Group By Fields: Fields to group by when generating summaries
- Include Source Data: Option to include source records in summary
Contributing
Contributions are welcome! If you'd like to contribute to this project:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Support
If you find this node helpful and would like to support its development:
