#steven-priced-invoice

1 messages · Page 1 of 1 (latest)

worldly kernel
#

You can't mostly, you need a separate Price since a Price has a "set amount"

cerulean oasis
#

I can create a discount code and apply it to that invoice item right?

worldly kernel
#

yeah that works

cerulean oasis
#

ok so applying a discount well coupon....I'm doing this, but I'm getting Invalid array

`$disc = bcmul($prod['price'], 100) - bcmul($amount, 100);

        $coupon = $stripe->coupons->create([
          'amount_off' => $disc / 100,
          'currency' => 'USD'
        ]);

        $invoice = $stripe->invoices->create([
          'customer' => $stripeCustomerId,
          'collection_method' => 'send_invoice',
          'due_date' => date("U", strtotime("+7 DAYS")),
          "discounts" => ["coupon" => $coupon->id]
        ]);`
worldly kernel
#

sorry missed your follow up my bad