#haris ishtiaq-invoice

1 messages ยท Page 1 of 1 (latest)

wise steeple
#

๐Ÿ‘‹ happy to help

regal apex
#

so how can i show estimate before a subscription

wise steeple
regal apex
#

its for the upcoming invoices e.g if customer has a subscription which renews every month so upcoming api will show the next invoice which is yet to come at the end of month

#

this isn't helpful

#

@wise steeple there?

wise steeple
#

actually it works even if you don't have any subscription

#

you could use it to simulate a subscription invoice

regal apex
#

so i need to give price ids to this api ?

wise steeple
#

yes

regal apex
#

let me try
if not successful will ping you again

wise steeple
#

yes sure, let me know if you need any more help

regal apex
#

$inv=Cashier::stripe()->invoices->upcoming([
'customer' => auth()->user()->stores->find($request->store_id)->stripe_id,
'invoice_items'=> [
'price'=> [
'price_1L7dUVJOIuKIWiW6CO9hlV3a',
]
]
]);

#

it says invalid array

wise steeple
#
                'price'=> [
                    'price_1L7dUVJOIuKIWiW6CO9hlV3a',
                    ]
            ]]
#

you also need to pass in the quantity

regal apex
#

this returns this
The price specified is set to type=recurring but this field only accepts prices with type=one_time.

wise steeple
#

sorry my bad

#

use subscription_items instead of invoice_items

regal apex
#

ok

#

thank you
one more question
does it support promocodes or coupon codes as well ???

#

ok thank you so much
i got the answer
it support discounts

wise steeple