docs

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.

StepDeprecated calculatorPrice Calculator v1
1Calculate tax per product lineCalculate tax per product line
2Sum unrounded tax amountsRound each line tax to 2 decimals
3Round the final sumSum the rounded line taxes

Example: multiple quantities

This rule still applies when one product line contains several units.

Product lineQuantityUnrounded taxRounded line tax in v1
Line A30.5130.51
Line B20.4140.41
Line C10.2940.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:

  1. Calculate tax for each product line.
  2. Round each line tax to two decimals.
  3. 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

  1. SCAYLE Panel: If your setup exposes the setting in the shop configuration, enable Price Calculator v1 there.
  2. Admin API: If your team manages shop configuration through the API, apply the same change there.
  3. SCAYLE Support: If your team cannot access the setting, contact SCAYLE Support or your Account Manager.
  1. Enable the setting in a test shop first.
  2. Create test orders with multiple quantities and vouchers.
  3. Compare invoice tax summaries, order totals, and webhook payloads.
  4. Verify integrations that consume tax or net values.
  5. 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.undiscounted
  • totals.before
  • totals.after
  • totals.difference
  • totals.before.taxSummary
  • totals.bruttoDiscount
  • totals.bruttoWithServiceCosts
  • totals.netto
  • totals.nettoWithServiceCosts
  • totals.tax
  • totals.taxWithServiceCosts

GET Order API

Affected order totals and item fields

Totals

  • totals.costWithoutTaxWithoutAbsoluteVouchersWithServiceCosts
  • totals.costWithoutTaxWithVouchersWithServiceCosts
  • totals.costWithoutTaxWithVouchersWithShipping

Items

  • items.available.total.taxAmount
  • items.available.unit.costWithoutTaxWithMembershipDiscount
  • items.available.unit.costWithoutTaxWithVoucher
  • items.available.unit.costWithoutTaxWithoutVoucher
  • items.available.unit.taxWithVoucher
  • items.available.unit.taxWithoutVoucher

Webhooks and Cloud API

Affected webhook and Cloud API fields
  • cost.withoutTax
  • cost.withoutTaxwithMembershipDiscount
  • cost.vat.amount.amount

Customer Care Interface

Affected customer care fields
  • item.withoutTaxWithMembershipDiscount
  • items.cost.withoutTaxWithMembershipDiscount

Edge cases to keep in mind

  • A quantity greater than 1 does 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.