Skip to main content

Overview

When calculating taxes or posting transactions to Zamp, take a look at this guide for how the math works for subtotals and totals.
Zamp’s APIs accept up to the cent (second decimal place) for financial values. Otherwise, we will return a Number must be a multiple of 0.01 error.

Transaction-Level Subtotal

At the transaction-level, the subTotal is the cost of the items and any transaction-level or line-item discounts. The difference is, the discount at the transaction-level is still passed as a discount even though it is factored into the subTotal.
  • I have a transaction for 2 of the same item.
    • They cost $10 each.
  • There is a promotion running for $10.00 off your cart.Β 
  • TheΒ subtotalΒ for this transaction is $10.
(10.00βˆ—2)βˆ’10.00=subtotal(10.00)(10.00 * 2) - 10.00 = subtotal (10.00)
  • I have a transaction where 3 different items are being sold.
    • Item A is $10, and the customer ordered 1.
    • Item B is $15, and the customer ordered 3.
    • Item C is $20, and the customer ordered 2.
  • There is an additional 20% discount for the cart.
  • TheΒ subtotalΒ for this transactions is $75.00
(10.00βˆ—1)+(15.00βˆ—3)+(20.00βˆ—2)βˆ’20.00=subtotal(75.00)(10.00 * 1) + (15.00 * 3) + (20.00 * 2) - 20.00 = subtotal (75.00)
  • I have a transaction for 3 of the same item.
    • The item costs $10.00.
  • There is a β€œBuy Two Get One Free” promotion, so the discount is $10.00.
  • The subTotal for the transaction is still $20.00, but there is no transaction-level discount value since it is factored in at the line-item.
(10.00βˆ—3βˆ’10.00)=subtotal(20.00)(10.00 * 3 - 10.00) = subtotal (20.00)

Transaction Total

At the transaction-level, the total is the aggregate of the subtotal, any shipping and/or handling, and tax.
  • I have a sale with a single line item worth $20.00.
    • It costs $1.50 to ship.
    • It costs $1.00 to handle.
    • It has $2.00 of tax calculated.
  • The total for this transaction is $24.50.
20.00+1.50+1.00+2.00βˆ’total(24.50)20.00 + 1.50 + 1.00 + 2.00 - total (24.50)
  • I have a sale with 3 line items.
    • Each cost $10.00.
    • It costs $5.00 to shipΒ ANDΒ handle.
    • The tax calculated is $3.00.
  • The total for this transaction is $38.00.
(10.00βˆ—3)+5.00+3.00=total(38.00)(10.00 * 3) + 5.00 + 3.00 = total (38.00)