Pricing
TimberCloud offers two powerful ways to create product pricing: the Formula Builder for an intuitive step-based experience, and the Code Editor for advanced JavaScript-based formulas.
Formula Builder

The Formula Builder provides an intuitive step-based interface for creating pricing formulas without writing code. The same builder is used for pricing, parts, and inventory calculations.
Getting Started
- Navigate to your product's pricing section
- Click "Open Formula Builder" to launch the visual editor
- Build your formula step by step
Building Blocks
The Formula Builder supports five operand types:
| Type | Description | Example |
|---|---|---|
| Field | Reference line items or product options | width, material.price |
| Number | Fixed numeric values | 144, 1.10, 50 |
| Measurement | Pre-built calculations | Square Feet, Board Feet, Perimeter |
| Group | Parentheses for order of operations | (Base + Material) × Qty |
| Conditional | If/then/else logic | IF width > 48 THEN 50 ELSE 0 |
Available Measurements
| Measurement | Formula | Use Case |
|---|---|---|
| Square Feet | (W × H) ÷ 144 | Panel pricing |
| Board Feet | (T × W × L) ÷ 144 | Lumber pricing |
| Linear Feet | Length ÷ 12 | Trim, molding |
| Cubic Feet | (W × H × D) ÷ 1728 | Large items |
| Perimeter | 2 × (W + H) | Edge banding |
| Waste Factor | Qty × (1 + %) | Material waste |
Common Formula Templates
Quick-start templates include:
- Price per Square Foot -
Square Feet × Price - Price per Board Foot -
Board Feet × Price - Base + Per-unit -
Base Price + (Qty × Unit Price) - Size-based Upcharge - Conditional pricing for oversized items
- Tiered Quantity Pricing - Different prices based on quantity
Example: Cabinet Door Pricing
Square Feet(width, height) × material.price
+ Perimeter(width, height) × edge.price
+ IF width > 48 THEN 50 ELSE 0This formula:
- Calculates square feet and multiplies by material price
- Adds edge banding based on perimeter
- Adds a $50 upcharge for oversized doors
For complete Formula Builder documentation, see Formula Builder.
Code Editor (Advanced)
For complex pricing logic, use the JavaScript-based code editor.
The pricing editor has access to all your attributes and line items.
Selectable Items
Attributes
In this example we have an attribute called Material
| Name | Price | Thickness | Weight |
|---|---|---|---|
| Cherry | $25 | 3/4 | 0.8 |
| Maple | $30 | 3/4 | 0.5 |
| Walnut | $35 | 5/4 | 1.2 |
In our editor we can select Material → Price which adds:
material.price;We can do this for any attribute or line item.
Line Items
Here's an example of what your line items table may look like during an order:
| QTY | Width | Height |
|---|---|---|
| 2 | 24 1/2 | 34 1/2 |
| 3 | 12 | 24 3/4 |
| 1 | 14 1/2 | 3 3/4 |
Code Examples
Basic Example
// Base material price on Sq FT and add design and panel prices
((width * height) / 144) * material.price + (design.price + panel.price);Custom Logic with Conditionals
// Set variables
const sqFt = (width * height) / 144;
const wood = material.price;
const design = design.price;
const edge = edge.price;
const panel = panel.price;
if (sqFt > 2) {
// Nested logic for oversized items
if (width > 48) {
const upcharge = 50;
return sqFt * wood + (design * (panelsH * panelsW) + edge + panel + upcharge);
} else {
return sqFt * wood + (design * (panelsH * panelsW) + edge + panel);
}
} else {
// Minimum 2 sq ft charge
return 2 * wood + (design * (panelsH * panelsW) + edge + panel);
}Tiered Pricing
const sqFt = (width * height) / 144;
const basePrice = material.price;
// Volume discount tiers
if (qty >= 100) {
return sqFt * basePrice * 0.85; // 15% discount
} else if (qty >= 50) {
return sqFt * basePrice * 0.90; // 10% discount
} else if (qty >= 25) {
return sqFt * basePrice * 0.95; // 5% discount
} else {
return sqFt * basePrice;
}Best Practices
- Start with the Visual Builder - It's faster for most common formulas
- Use the Code Editor for complex nested logic
- Test with sample orders to verify calculations
- Document your formulas with comments in code mode
- Use meaningful attribute names for easier formula building
Troubleshooting
Formula Not Calculating
- Ensure all referenced fields exist on your product
- Check that attribute parts have values assigned
- Verify line item field names match exactly
Unexpected Results
- Check order of operations (use parentheses)
- Verify measurement calculations use correct dimensions
- Test with known values to validate formula
Visual Builder Tips
- Use Groups to ensure correct calculation order
- Measurement blocks automatically handle unit conversions
- Conditionals can be nested for complex logic