#gary_api

1 messages ยท Page 1 of 1 (latest)

exotic vaultBOT
#

๐Ÿ‘‹ 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/1357478001989648424

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

quiet lily
exotic vaultBOT
quiet lily
quiet ferry
#

Oh thank you! So changing monetary values or deleting existing invoice item is possible

#

for recurring invoice

quiet lily
#

Yep!

#

Or, you mean a Subscription Invoice?

quiet ferry
#

yes

quiet lily
#

Could you explain a little more fully what your use case is?

quiet ferry
#

My team has investigated this earlier last year and found that we were not able to modify line items even in draft invoice. Maybe things have changed since then.

#

One sec

#

We are building a system that upgrades user to a higher plan if their actual profile count is larger than what their plan allows. For example, if this user is on a $100 plan (recurring), but ended up having # of profiles of a $120 plan, in the next invoice cycle, they should be on the $120 plan.

#

My team has investigated this earlier last year and found that we were not able to modify line items even in draft invoice.

#

So last year it wasn't possible. We built a less optimized system that creates two invoices: $100 for recurring invoice, and $20 invoice for the upgrade

#

Ideally, we want a $120 invoice (all in one invoice)

#

We can only check for # of profiles right before the next invoice cycle - that's why I think listening to invoice.created event is a good idea.

#

When invoice.updated happens, we will check # of profiles, and update the plan value (i.e. invoice item) to $120

#

Does this make sense?

ivory agate
#

๐Ÿ‘‹ Stepping in for my teammate. Thanks for the explanation. Give me a few minutes to test this out but I think this limitation still applies

quiet ferry
#

Thanks for looking into it! Really appreciate it!

ivory agate
#

Okay, that's correct. It's not possible to update the Price in this case.

quiet ferry
#

Oh that's a bummer. I believe it is not specifically stated on Stripe docs

ivory agate
#

The draft Invoice has an InvoiceLineItem that has a type of subscription. This means the InvoiceLineItem was added to the Invoice as part of normal Subscription cycling (not as part of an InvoiceItem that was added manually). InvoiceLineItems of type: 'subscription' can only be partially updated: only tax_rates and discounts can be updated for these InvoiceLineItems

#

Do you use usage based billing?

quiet ferry
#

I see. Is there a way to add an invoice item (e.g. $20) on the same invoice so this also increases the price to $120?

#

We haven't used usage based billing yet because our usage system is not straightforward to be migrated yet

ivory agate
quiet ferry
#

Sounds good! Let me try this out