Price Calculator v1
The Price Calculator is the central pricing service for SCAYLE orders. It calculates taxes, discounts, totals, and unit prices for invoices, APIs, webhooks, and later order steps.
Why this matters
Price Calculator v1 makes pricing easier to reconcile across finance, customer care, and integrations.
- More predictable invoices: Taxes are rounded per product line before they are summed.
- Better consistency: The same calculator stays with the order from creation to refund.
- Clearer discount handling: Item-level and line-level values are easier to trace.
Compared with the deprecated calculator, net and tax amounts can differ by 1–2 cents. Gross prices stay the same.
Key terms
- Product line: One order line. The quantity can be greater than
1. - Tax summary: The total tax shown on an invoice. It is the sum of rounded tax amounts from each product line.
- Absolute voucher: A fixed discount amount, such as
€10 off. - Shop configuration: The shop-level setting that decides whether new orders use Price Calculator v1.
What changes in v1
Rounding at a glance
The main change is the point at which tax is rounded.
| Step | Deprecated calculator | Price Calculator v1 |
|---|---|---|
| 1 | Calculate tax per product line | Calculate tax per product line |
| 2 | Sum unrounded tax amounts | Round each line tax to 2 decimals |
| 3 | Round the final sum | Sum the rounded line taxes |
Example: multiple quantities
This rule still applies when one product line contains several units.
| Product line | Quantity | Unrounded tax | Rounded line tax in v1 |
|---|---|---|---|
| Line A | 3 | 0.513 | 0.51 |
| Line B | 2 | 0.414 | 0.41 |
| Line C | 1 | 0.294 | 0.29 |
Deprecated calculator
- Sum unrounded taxes:
0.513 + 0.414 + 0.294 = 1.221 - Round once at the end:
1.22
Price Calculator v1
- Round each line first:
0.51 + 0.41 + 0.29 - Sum rounded taxes:
1.21
Result: the tax summary differs by 0.01.
Core behavior
Product-line tax calculation
Tax is calculated per product line. It is not calculated separately for each unit.
Example:
- 3 shirts
- €10.00 per shirt
- 20% tax
- Product-line total: €30.00
- Tax for the line: €6.00
Tax summary on invoices
Invoices use this order:
- Calculate tax for each product line.
- Round each line tax to two decimals.
- Sum the rounded values.
This keeps the tax summary aligned with the line items shown on the invoice.
Unit prices for promotions
v1 also exposes unit-level prices. This helps with promotions such as buy 5, get 1 free.
Tax is still calculated from the full product line. Unit prices are only the display and allocation layer.
Example:
- Product price: €20.00
- Quantity: 6
- Promotion: buy 5, get 1 free
- Product-line total: €100.00
- Unit display price: €16.67
Rounded unit values and rounded line totals may differ by 1–2 cents. This is expected.
Absolute voucher handling
Absolute vouchers are handled differently before and after order confirmation.
Before order confirmation
- The voucher is shown as an order-level discount.
After order confirmation
- The same voucher is assigned to one eligible item.
- In most cases, this is the highest-priced eligible item.
- Invoices and refunds then use that item-level allocation.
Example:
- Jacket: €120.00
- T-shirt: €30.00
- Absolute voucher:
€20 off
In checkout, the voucher reduces the order total. After confirmation, the invoice assigns the €20 discount to one eligible item so refunds stay traceable.
How to enable and roll it out
Price Calculator v1 is controlled through shop configuration. The change applies to new orders for that shop.
Enablement options
- SCAYLE Panel: If your setup exposes the setting in the shop configuration, enable Price Calculator v1 there.
- Admin API: If your team manages shop configuration through the API, apply the same change there.
- SCAYLE Support: If your team cannot access the setting, contact SCAYLE Support or your Account Manager.
Recommended rollout steps
- Enable the setting in a test shop first.
- Create test orders with multiple quantities and vouchers.
- Compare invoice tax summaries, order totals, and webhook payloads.
- Verify integrations that consume tax or net values.
- Roll out to production once the expected differences are confirmed.
If you switch the setting, existing orders keep their original calculator. Only new orders use the new one.
Migration from the deprecated calculator
What changes
- Tax is rounded per product line before the total tax is summed.
- Some net and tax fields can differ by
1–2 cents. - Unit-level prices are exposed more clearly for promotions and refunds.
- Absolute vouchers are represented as item-level allocations after confirmation.
What stays the same
- Gross prices do not change.
- The calculator stays consistent throughout the full lifecycle of one order.
- Orders created with the deprecated calculator keep using it.
Backward compatibility is preserved at order level. Old orders stay on the old calculator. New orders can use v1.
Where differences can appear
The following outputs can show small net or tax differences after the switch.
Invoices
Affected invoice fields
totals.undiscountedtotals.beforetotals.aftertotals.differencetotals.before.taxSummarytotals.bruttoDiscounttotals.bruttoWithServiceCoststotals.nettototals.nettoWithServiceCoststotals.taxtotals.taxWithServiceCosts
GET Order API
Affected order totals and item fields
Totals
totals.costWithoutTaxWithoutAbsoluteVouchersWithServiceCoststotals.costWithoutTaxWithVouchersWithServiceCoststotals.costWithoutTaxWithVouchersWithShipping
Items
items.available.total.taxAmountitems.available.unit.costWithoutTaxWithMembershipDiscountitems.available.unit.costWithoutTaxWithVoucheritems.available.unit.costWithoutTaxWithoutVoucheritems.available.unit.taxWithVoucheritems.available.unit.taxWithoutVoucher
Webhooks and Cloud API
Affected webhook and Cloud API fields
cost.withoutTaxcost.withoutTaxwithMembershipDiscountcost.vat.amount.amount
Customer Care Interface
Affected customer care fields
item.withoutTaxWithMembershipDiscountitems.cost.withoutTaxWithMembershipDiscount
Edge cases to keep in mind
- A quantity greater than
1does not change the tax rule. Tax is still calculated on the full product line. - Rounded unit values can differ slightly from rounded totals.
- Absolute vouchers can appear at order level before confirmation and at item level after confirmation.