New: Try Voli The Bear, Fast package manager (and not only) for Windows
JavaScript
const payload = '{"invoice":"INV-2026-0043","lines":[{"sku":"KB-101","amount":19.99},{"sku":"MS-204","amount":"25.50"},{"sku":"HD-330","amount":8.99}]}';

// Two lines arrive as JSON numbers, one arrives as a JSON string.
// This returns a total and never throws. Run it, then read what it printed.
function invoiceTotal(json) {
  const data = JSON.parse(json);
  return data.lines.reduce((sum, line) => sum + line.amount, 0);
}

console.log(`Invoice total: $${invoiceTotal(payload)}`);