#dzidor - Invoice Updates

1 messages · Page 1 of 1 (latest)

final shuttle
#

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.

cosmic tiger
#

don't understand what to change

#

Invoice::update('invoice_id_xyz, [
'discounts' => ['coupon_id_xyz'],
])

like this?

final shuttle
#

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?

cosmic tiger
#

Thank you so much for your help