#dzidor - Invoice Updates
1 messages · Page 1 of 1 (latest)
Hello! The discounts property on an Invoice update takes an array of hashes, not a single hash, so you need to modify your code to provide an array containing the discounts you want to apply.
don't understand what to change
Invoice::update('invoice_id_xyz, [
'discounts' => ['coupon_id_xyz'],
])
like this?
No, it would be something like this:
Invoice::update('invoice_id_xyz, [
'discounts' => [
['coupon' => 'coupon_id_xyz'],
],
]);
See how the value of discounts is an array that can contain several hashes above?
Thank you so much for your help