#zach_ubb-credit
1 messages ¡ Page 1 of 1 (latest)
đ 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/1281293068020219947
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Ran out of characters....
ideally this is another product (a credit product) we can attach to a meter and report credit quantity
I've looked at other options
- Coupons
coupons seem to be a fixed amount of usage/amount, each of our customers might use different amounts of product A leading to a different credit quantity/ amount of Product B
with coupons you have to set a specific amount, this would mean everytime they use more Product A we would need to remove the old coupon from the customer, create a new coupon for a differnet amount, then attach that to a customer.
- Customer Credit Balance Ledger. This puts the credit at the very end of the invoice, and doesn't really allow for you to show the offsetting quantiy of Product B (driven by your usage of Product A)
So, to summarize, you are attempting to implement some sort of credit or discount for metered billing?
Currently billing meters do not support a form of credit but it is a feature that is under development
im trying to figure any level of workaround
do you have any ideas beyond a manual invoice line item that i keep updating as pseudo usage is sent
the one issue i have with that strategy in general is that it doesnt look very good on the invoice
like its not clear what it is offsetting
Since metered billing bills at the end of the billing cycle, I would write an algorithm to calculate the discount to apply based on the usage amount when the Invoice is created in draft status.
I would use an invoice item with a negative amount to account for this and include a description to describe what the reduction is for.
https://docs.stripe.com/api/invoiceitems/create#create_invoiceitem-description
Yea, the only dowside to that is mid month the customer would not be able to look at their "next invoice" to determine how much credit they have mid month
Also right now ( i honestly havent gotten far enough in going down this route of manual negative item), but the ordering of the items seems semi arbitrary?
like when i add a manual item its sometimes putting it at the bottom of the list of invoice items and sometimes at the top, really i would want it to come after the product its creditng for (middle of the invoice item list)
is that something i can easily reorder during draft phase of the invoice?
Unfortunately there isn't an ordering mechanism for Invoice line_items. I can raise it as a feature request though.
WRT to customers tracking their credit, that would need to be something you would implement (e.g. run the discount algorithm mid-month on current usage and return result).
im suprised on the lack of ordering
is there anything with the grouping of invoice line items functionality that could be done to at least group the two lines together ( 1 being the debit entry from metered usage.
and 1 being the credit entry that im making manually)
Unfortunately that does not appear to be an existing feature either
hmm, so no way to get two lines to appear together on an invoice then
I think it's based on when you add them. So you would need to add the discount line immediately after the metered usage line.
Hmm, that would be hard to do
maybe i can play with the ordering of when i create products and get lucky with a SQL ORDER BY statement
there must be some form of pattern even if not on purpose as to how items are added
if i can get that product to be the last printed on the invoice then perhaps it can appear in order
id say the two things we discuessed above should definitley be feature requests as this seems like a feature others would use
the metered credits being in development, at what stage are they? In beta or still in development phase
Not beta yet, that I know of. Still being worked on. If you want to be kept up to date about developments I recommend signing up for the developer digest
https://docs.stripe.com/upgrades#stay-informed
I'll post a feature request for the line item ordering feature.
ok thx