#devparry - one time invoice items on first sub invoice
1 messages ยท Page 1 of 1 (latest)
Hi there
Hi
So when you create the Sub, you want to use the add_invoice_items param: https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items
That was you can add an invoice item to the first invoice for that $5 installation charge
so it will automatically deduct $15 from the user card
and in the rest of next month's invoice, $10 will deduct. Please confrim @languid jasper
okay one more question
๐ i can help with that
also, is it required to create multiple prices ( attach ) under plans too before creating a subscription?
ya sure
Multiple prices for what, exactly?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
SUre, but what are you trying to do in the end?
You can create multiple prices, and a subscription might be for multiple products/prices, but this is not required
I am confused once i see this URL : https://support.stripe.com/questions/how-to-add-one-time-items-to-invoices-and-subscriptions-in-the-dashboard
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.
let me explain till now what we did and what we want to do i hope it will let u under stand better
Oh i think i understand
we have already created a system where the admin can manage ( create | edit | remove ) plans under the admin panel and all these are sync with stripe as well using stripe API https://stripe.com/docs/api/plans/create
and based on that users can select plans on Front end and take subscriptions which is working fine with the help of Stripe subscription apis
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You mean for those one time items for the first invoice, do you need to create prices beforehand?
You can create those if you like, or if they are ad-hoc priced, you can also specify that with price_data, but you do need a product to reference in that case
https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Now we have to add additional functionality like adding one-time Payment E.g: first-time installation charges
so if we have a plan Basic plan which monthly Price is $10 and the user has to pay $5.
First time user will pay $15 and rest on months it will just $10
so what is the best way to make this workable and what additional functionality has to be implement?
Right so I'd say you need to make a product for the installation charges
if the price is usually 5 you can also make a price and use that price in add_invoice_items
If the price varies, you can use price_data in add_invoice_items to provide the amount on the fly for the product
devparry - one time invoice items on first sub invoice
$stripe->subscriptions->create( [ 'customer' => '{{CUSTOMER_ID}}', 'items' => [['price' => '{{RECURRING_PRICE_ID}}']], 'add_invoice_items' => [['price' => '{{PRICE_ID}}']], 'payment_behavior' => 'default_incomplete', ] );
this code will be use I am right ?
Yea that's right ๐
and what will be the syntax for price_data?
@winter imp any idea ?
You can see the API shape here: https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.