#haris ishtiaq-invoice
1 messages ยท Page 1 of 1 (latest)
so how can i show estimate before a subscription
you can use this API https://stripe.com/docs/api/invoices/upcoming
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
actually it works even if you don't have any subscription
you could use it to simulate a subscription invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so i need to give price ids to this api ?
yes
let me try
if not successful will ping you again
yes sure, let me know if you need any more help
$inv=Cashier::stripe()->invoices->upcoming([
'customer' => auth()->user()->stores->find($request->store_id)->stripe_id,
'invoice_items'=> [
'price'=> [
'price_1L7dUVJOIuKIWiW6CO9hlV3a',
]
]
]);
it says invalid array
'price'=> [
'price_1L7dUVJOIuKIWiW6CO9hlV3a',
]
]]
you also need to pass in the quantity
this returns this
The price specified is set to type=recurring but this field only accepts prices with type=one_time.
sorry my bad
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
use subscription_items instead of invoice_items
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.