#jeff-sexton_invoice-preview-updates

1 messages ยท Page 1 of 1 (latest)

craggy siloBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1306020879867838534

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

spark plover
#

Hi ๐Ÿ‘‹

This is a preview invoice. You cannot make any direct changes to it because it's a read only object

#

In order to make any changes you would need to change the Subscription

#

or wait until the generated Invoice is in draft state and make changes then

#

What is the specific flow you are trying to enable?

hearty geode
#

The main issue is that we need to preview proposed changes to a subscription but we also need to update that preview to include some additional lines. e.g. we have a third party tax integration outside of stripe so we need to add the taxation lines to the invoice preview as well.

#

This means we need to:

#
  1. generate a preview with the changed subscription items
#
  1. use that preview to generate taxation amounts
#
  1. re-generate a new preview with both the changed subscription items AND the tax lines
spark plover
#

Okay so none of that is possible since the Preview Invoice doesn't actually exist as an object in Stripe

hearty geode
#

currently we're using Stripe::Invoice.upcoming and we were hoping that we could reduce the number of calls by persisting the preview

#

Obviously our use cases doesn't match with the Stripe functionality here.

spark plover
#

So I'm assuming you are not using Stripe Tax to automatically compute and collect taxes here

hearty geode
#

Exactly

spark plover
#

Would I be correct to assume these are specific tax lines and not something you could just include on the Subscription itself?

hearty geode
#

That's correct. We need the first preview response in order to calculate the tax with the third party integration

#

and then feed that back into a new preview with all the lines

spark plover
#

You can't skip more API calls this way but it will work

hearty geode
#

That's what we

#

we're* doing now

spark plover
hearty geode
#

Ok. Thanks for the clarification

spark plover
#

Happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚

hearty geode