OK, I figured it out on my test store with the following settings:
- total prices of products in cart (with taxes): 127
- shipping costs: 12
- fees (taxable): 13
- discount from a coupon: 10
With these settings, I get the following on my cart object:
"cart_contents_total":97.4998,
"total":144.6,
"subtotal":127,
"subtotal_ex_tax":105.8333,
"tax_total":22.1001,
"discount_cart":8.3334,
"discount_cart_tax":1.6667,
"fee_total":13,
"shipping_total":10,
"shipping_tax_total":2,
"fees":[{"id":"extra-fee", "name":"Extra Fee", "amount":13, "tax_class":"", "taxable":true, "tax":2.6, "tax_data":{"1":2.6}
So, the answer is:
- total = total prices of products in cart (with tax) + shipping cost + fees + tax on fees – discount
- subtotal = total prices of products in cart (with tax)