I need to get the amount of a discount from orders to write that data into a json file (on EVENT_AFTER_COMPLETE_ORDER) which then will be consumed by an inventory management system and now am stuck with discount amounts. Currently I have:
"price": ' . $order->adjustment->one->type('discount')->amount . ',
which does not work. Could anyone help on how to do this and maybe point me to the documentation where I could read up on it?