You’re encountering a common multi-currency cost calculation issue that requires understanding several API-specific parameters and how they differ from UI defaults.
Cost Calculation Parameters:
The API requires explicit specification of calculation parameters that the UI infers from user context and preferences. Here’s the complete parameter set you need:
GET /Windchill/servlet/odata/v2/PTC/Parts('OR:456')/CostRollup?
includeOverhead=true&
includeBurden=true&
currencyConversionMethod=WEIGHTED_AVERAGE&
effectiveDate=2025-05-18&
costView=STANDARD
Multi-Currency Handling:
The key issue is how exchange rates are applied during BOM rollup. The UI uses a two-phase conversion approach:
- Component Level: Each component’s cost is calculated in its native currency
- Assembly Level: Components are converted to the parent assembly’s currency using weighted average rates based on quantity and cost contribution
The API defaults to simple spot-rate conversion per line item, which causes discrepancies. To match UI behavior:
// Pseudocode - Key implementation steps:
1. Query BOM structure with currency metadata for each component
2. Calculate component costs in native currencies first
3. Determine weighted exchange rates based on cost contribution
4. Apply weighted rates for currency conversion to parent currency
5. Sum converted values with overhead allocation
// See documentation: Cost Management API Section 9.2
Overhead Allocation:
Overhead is applied differently in multi-currency scenarios. The UI calculates overhead as a percentage of converted costs, while the API (by default) applies overhead before currency conversion. This creates compounding errors.
Use the overheadApplication parameter with value POST_CONVERSION to match UI behavior:
overheadApplication=POST_CONVERSION
Exchange Rate Configuration:
Verify your exchange rate table includes all required currency pairs and that you’re querying the correct rate type. Windchill supports multiple rate types (SPOT, AVERAGE, BUDGET). The UI typically uses AVERAGE rates while API defaults to SPOT.
Specify rate type explicitly:
exchangeRateType=AVERAGE
Complete Working Example:
Here’s a properly configured API call that should match UI calculations:
GET /Windchill/servlet/odata/v2/PTC/Parts('OR:456')/CostRollup?
includeOverhead=true&
includeBurden=true&
includeLaborCosts=true&
currencyConversionMethod=WEIGHTED_AVERAGE&
overheadApplication=POST_CONVERSION&
exchangeRateType=AVERAGE&
effectiveDate=2025-05-18&
costView=STANDARD&
breakdownByCurrency=true
The breakdownByCurrency=true parameter returns detailed conversion information so you can audit the calculation step-by-step.
Validation Approach:
- Query a simple single-level BOM first to verify basic calculation matches
- Add one multi-currency component and validate conversion
- Progressively test with more complex BOMs
- Compare the
breakdownByCurrency response to UI cost breakdown report
Common Gotchas:
- Phantom assemblies: Set
expandPhantoms=true to match UI behavior
- Cost element filtering: UI might filter out certain cost elements based on user preferences
- Effectivity gaps: If no valid cost exists for the effectiveDate, API returns null while UI interpolates
- Quantity breaks: API requires explicit quantity parameter for tiered pricing
Additional Considerations:
If you’re still seeing discrepancies after applying these parameters, check:
- Custom cost formulas in your cost templates (these may not be exposed via API)
- Site-specific cost adjustment factors
- User preference settings that affect UI cost display (like rounding rules)
With these corrections, your API-derived costs should match UI values within 0.5% (acceptable rounding variance). The 9% discrepancy you’re seeing will be eliminated by properly configuring overhead allocation and currency conversion methodology.