#Rohit89
1 messages · Page 1 of 1 (latest)
Hello! You want the specific tax calculated for a payment you mean?
I have subscription ID in test mode - sub_1Me0FmLv5rdhLZWUFKPMvT4P
When I retrieve not able to see the tax being deducted
Tax is calculated already
I want to see that info in subscription object
When I try to fetch like this Stripe::Subscription.retrieve( sub_id)
The tax details you're looking for are on the Subscription's Invoices, not the Subscription itself. For example, look at total_tax_amounts on the Subscription's latest_invoice: https://stripe.com/docs/api/invoices/object#invoice_object-total_tax_amounts
So subscription won't have tax information?
How I can get to know how much tax is being applied to the subscription? As I want to show subscription to the user -- so I need to break down it
No. The Subscription generates Invoices for each period, the Invoices deal with the actual payments for each period, including tax.
You need to retrieve the Invoice and get the data from there.
The tax may change from one period to the next, so you can't just show a static value for the whole Subscription.
ok, So i need to get the invoice id from subscription
And then reterive the latest invoice
Subscription can have multiple items. Our user is subscribed with Plan A. Later they can add seats in the same subscription. So we are going to create item with quantity in same subscription.
Stripe::SubscriptionItem.create({
subscription: subscription_id,
price: seat_price,
quantity: 4,
proration_behavior: 'always_invoice'
})
How I can make sure this subscription item charges same tax that is being charged for subscription?
Do I need to pass the tax information while creating the subscription item?
Hi there 👋 taking over, as my colleague needs to step away
Give me a few minutes to get caught up.
ok
Is there parameter that can be passed while creating subscription item, that calculate the tax according to the address being saved for customer in stripe/?
Or tax being applied on subscription
I believe you just need to update the Price and Product to include tax: https://stripe.com/docs/tax/subscriptions#product-and-price-setup
This can be done when creating the Subscription as well, by creating a new Product and Price in-line with the Subscription. You can set tax_behavior and tax–rates on the line_items during creation: https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data-tax_behavior
https://stripe.com/docs/api/subscriptions/create#create_subscription-items-tax_rates
Right now on checkout we have this
automatic_tax: { enabled: true }
We dont have tax save for product/price
we are calculating when user type address while checkout due to this
automatic_tax: { enabled: true }
We have registered locations https://dashboard.stripe.com/test/settings/tax
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
that calculate the tax
as we are passing
automatic_tax: { enabled: true }
on checkout
Ah, I didn't realize you were using Checkout. Can you elaborate on what your question is?
So on checkout we are calculating tax as soon as user enter zip/address. Subscription is created /user is being charged including tax.
Later user can add more seats in the plan. So we are creating another subscription item with x quantity... There we also want the same tax to be charged that is charged on checkput when subscription is created
Do you have that system up and running right now? If so, is it not working?
I thought that tax carried over to the new Subscription items automatically if they were created with an automatically taxed Subscription
Stripe::SubscriptionItem.create({
subscription: subscription_id,
price: seat_price,
quantity: 4,
proration_behavior: 'always_invoice'
})
Creating a subscription item like this... will only charge the price passing in price attribute. I guess....
Or will it charge the tax too that is charged while creating sub via checkout
I need to implement. So I am testing the stripe API calls
Yeah, the Subscription should still calculate tax on the new quantity if you're using the same taxable Price when you create the Subscription Item
Subscription is already created with tax being paid.
But when I am creating subscription item, It will charge immediately including tax ? Or it will charge tax on next cycle when sub renew?
You choose when the Subscription payment is accepted for the new Subscription Item based on proration_behavior: https://stripe.com/docs/api/subscription_items/create#create_subscription_item-proration_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok. Is there way to calculate prorated amount that we are going to charge user?
Example. Subscription is created on Feb, 1.
But subscription item is going to be created on Feb 20 with quantity 4. So there will be prorated amount from 20 feb to 28 feb. And then new cycle will start on March 1.
On March 1, User will be charged for subscription that include the item.
But we want to show the user when they add the item. How much amount being charged to them -- let's say they buy seats on 20 of feb and subscription is created on feb 1
You would need to use the Upcoming Invoice API to create a mock-up of what the Invoice would be with the new items on it 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.
will it provide the prorate amount value that will be charged at the time of item creation?
No, that will just tell you what the amount would be on the next billing cycle. You can't get the proration amount before updating the Subscription unfortunately
So there is no way to find the prorated amount. If I creating subscription item today and subscription is created on Feb1.
I just want to know the amount that stripe will charge today for that item from FEB 1 to today
Correct
what about this - subscription_proration_date
That's the date of the proration, so I'm not sure how you would use that to do what you want to do