#florian-ruen_api

1 messages ¡ Page 1 of 1 (latest)

vivid berryBOT
keen pathBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

vivid berryBOT
#

👋 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/1275446510837825608

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

narrow ore
#

Hello there,

To do a quick summary:

  • i'm trying to create a complex pricing model using Stripe (Go SDK), that cannot be achieved using billing meters and subscriptions (price depend on a max(price1, price2))
  • the first suggestion was to use invoice directly and keep the usage records on my own: GREAT solution, but where i can store the price for each consumer ?
  • another suggestion to test: create a subscription with two fixed price for each consumer and use invoice.created to edit the invoice (add/remove items) before finalization

Good solution, but it seems, I can't remove the lines created by a subscription in a invoice (API response)
There is a workaround for this ? Or the suggestion is not the good way to achieve this ?

long dome
#

hey there

#

Correct, that generated invoice line item can't be removed

#

The options would be:
1/ ignore it, give the "placeholder" product some name like "monthly subscription fee" where $0 makes sense
2/ move to a model that fits with generated non-zero invoice items
3/ if you're really not using the subscription controlled details at all, don't use the subscription and instead use one-off invoices on your own cadence

narrow ore
#

The third option can be great, but where can I store the prices (default pricing, and price per consumer) ? I don't want to store in my database to avoid business departement to ask a developer each time they want to apply another price to specific customer

I'll try the first one, if I can't delete it, maybe I can change the price to 0 (today not zero, I use the two items to store the price, because I retrieve the price on invoice.created, and business departement can apply exception on Stripe dashboard using this. And i'm using the new price when generating the invoice)

long dome
#

I don't understand how this applies if you calculate your own invoice amounts anyways

#

You can have a base price for the subscription that is $0 that wont affect the invoice totals

#

then add your own items as needed

narrow ore
#

To be more clear, my default price is 3 % on transaction amount, with a minimun of 0.25$/TiB (a transaction is a price, and a size), the minimun means if the % is under this minimum, we apply the minimum. So the price is max(percentage,minimum)

But i don't want to keep the 3% and 0.25 value in my database, I want to store in Stripe, so business departement can change to apply 0% and 0.10 for a specific customer (a big client or partner for example) ... this without access a database or ask a developer

#

So my idea is:

  • on invoice.created, get the price that will be applied (using two items created by subscription, that i want to remove)
  • add more items using this price (compute using price, size and so one)
  • remove the two items (or here set to 0 or something, becuase can't be removed)
long dome
#

in theory you could set up one of those as a metered billing model (the minimum/size is simpler), then at end of period add an item to true up to % if needed

#

but thats really up to you

#

otherwise yea use a zero item by default, then add lines as you like

#

"where to store prices" really depends on what you build, since you aren't using stripe calculations for invoices when you'd need ot build the system to manage who you store that on your customer

#

You can certainly build a UI to expose options to your business team

#

but there's no natural way to do with with stripe customers. You can shoehorn your "price ids" into customer metadata if you like, but really this should be in your system

narrow ore
#

As I understand from previous messages with your colleagues, seems very hard to apply this kind of price (both of them after explanation, says that billing meter is not the best solution)
Because even if using two billing meter (one for size, one for price) will apply both price, not a maximum between

long dome
#

I wouldn't suggestion both, i'd suggest one, then calculate an additional amount yourself if needed

#

ie, just have a meter for size, let that get calculated

#

if that exceeds the 3% then great, youre done for that motnh

#

if not, you add some amount to get it up to the 3%

#

this would be split across two items, so whether thats acceptable is up to you

#

Another option is calculating both using meters, separately, then apply a credit for the lower one

narrow ore
#

what i want on the PDF invoice, is one line per day (I record usage each day, billed each month)

because if i have only two lines, the price can't be easily re-calculated by the customer (for this he need the total size, total price that we use, and get 3% and so one). the problem with this, is we will get a lot of support tickets to explain the price to each customer, which is not possible for us

long dome
#

It sounds like you need to be generating your own line items then to control that

narrow ore
#

this is what i'm trying, but i can't remove generated subscription line item. I'll try to set the price to 0 and edit the description
if the update is not restricted can be a good workaround

long dome
#

If you don't even want that $0 line item, then you'll need to manage creating your own invoices

narrow ore
#

understood, but this means using another workaround to store price, maybe an UI for business departement which is a lot of work, just for managing prices