#dzidor-draft-invoice
1 messages ยท Page 1 of 1 (latest)
hey there sorry i missed this one
whats the actual error you're encountering?
Can you share a request ID?
like req_123 https://stripe.com/docs/api/request_ids
or https://support.stripe.com/questions/finding-the-id-for-an-api-request
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
what i need is that apply discount on subscription invoice for a customer
let's say the customer have 5 coupons of 30 USD. and he as a subscription plan in my website for 100 USD by month
Sure and you've shared a snippet of code. Does it work?
i need to catch the webhook [invoice.created] while it is a draft invoice each of the 5 following months
and i soon i get the webhook, i want to create an invoice item (with 1 of the 5 coupon)
to apply discount to his 5 next months
do you see what i want to achieve?
i try when received the webhook invoice.created to achieve that but maybe it is not the right way of doing that
InvoiceItem::create([
'customer' => 'cus_XYZ',
'invoice' => 'in_XYZ,
'discounts' => ['coupon' => 'XYZ'],
]);
You must specify a currency, or specify a price or price_data Stripe\Exception\InvalidRequestException
this is my error
my request id:
req_KrO8eoxP2H0T9v
allo ?
hey there, just a sec looking again ๐
Oh, yes, you need to include a price or amount¤cy for the item
https://stripe.com/docs/api/invoiceitems/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Then the discount will be applied to it
If you want to discount the entire invoice, you should update the invoice instead:
https://stripe.com/docs/api/invoices/update#update_invoice-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.