#Nadiya - discount
1 messages ยท Page 1 of 1 (latest)
api
You set duration to once: https://stripe.com/docs/api/coupons/create#create_coupon-duration
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
this discount amount can be dynamic (which is coming from user (admin) input), so, shouldn't we need to create coupon for each subscription?
How dynamic? Is there a set few possibilities, or is it highly variable?
no, discount is just a number input, where admin can enter any value for a product while creating..
something like this ๐
Ok so you would create a coupon for each amount you need a discount for then
i would like to know about the possiblity of changing the invoice directly
Oh ok. You could always create an invoice item as a credit/discount: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can we create this invoice as the latest ?
currently, i'm using this
this one already creates an invoice
Invoice item isn't an invoice
It's an item added to an invoice
So you could create a credit that would apply to that first invoice
$subscription->latest_invoice
what about latest_invoice?
ah ok, let me check
See the link i sent last
yes, but i can't add to the latest one (which is active initially)?
You would add the invoice item to the customer prior to creating the subscription. Then the first invoice would automatically pick that item up
All done, Thank you so much ๐
No problem!