#dragonlord_api

1 messages · Page 1 of 1 (latest)

hard flameBOT
#

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

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

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.

drowsy stone
#

Hello! Can you provide more details? What specifically are you confused about? What have you tried that hasn't worked?

rich iron
#

I do not know what endpoint to call to update the billing credits

drowsy stone
#

What do you mean by "update"? Do you mean grant them the credits in the first place?

rich iron
#

I am able to create the credit grant how do you decrease it as the person uses it

#

I was trying to use

             `   $stripe->billing->meterEvents->create([` to update the credits 

but then I get the error

No active meter found for event name

drowsy stone
rich iron
#

yes I get you but I want apply the credits, but for example I want to decrease the credits as the user uses a certain feature

drowsy stone
#

You do that by Invoicing them for that usage.

#

You don't manually decrement the credits, that's what the invoicing process is for.

rich iron
#

I want to charge them in the beginning but as they use the credits I can say they used x amount of credits I do not think the current process makes sense.

Like I want them to prefill their account and as they use the service they get charged

drowsy stone
#

Yeah, that's what this does.

#

They buy credits, you add those credits, then you record usage, then you Invoice for the usage, then the credits are applies to the Invoice.

rich iron
#

I do not want to record their usuage I want them to pay initially and they decrease from their credits as they use it and stop when credits as they use it

#

I do not want to keep track of their usuage

drowsy stone
#

That's not how this works.

rich iron
#

This is what I want to do exactly what it says

#

In this model, you can get prepayment for usage-based products and services. Using Billing Credits, users can pay an initial amount and “burn down” on their billing credits as they use the product.

drowsy stone
#

Yes, and I'm trying to explain how that works.

#

You still need to record usage and Invoice for it.

#

The Invoice will be paid using their credits.

rich iron
#

What you are saying and the text I sent do not align.

The user is supposed to pay initially and they lose credits as they use a product and they pay again if they want more credits.

I do not want to invoice after usuage

drowsy stone
#

I understand what you're saying, but I'm trying to explain to you that's not how it works and you have to Invoice.

#

If you don't want to do that you need to keep track of usage on your end and not use our system

rich iron
#

interesting

drowsy stone
#

I would encourage you to give this a try in test mode, though, because I think it might work better than you think.

rich iron
#

I have tested it out

#

I just want to a way to say for example I got 10 dollars worth of credits

After x times the 10 dollars is now worth only 5 dollars

#

and so one

#

I can refill my balance again later now my credits are 15 dollars

drowsy stone
#

Yeah, that's how this works. When your Customer pays you for credits, you create a Credit Grant to assign to those credits to that Customer. Then you record their usage. Then you Invoice for their usage. Then the Invoice is paid for by their credits, reducing them by the amount used that's being Invoiced.

#

You seem to want to only record credits, increasing and decreasing them arbitrarily without recording usage or invoicing for usage.

#

That is now how our system works.

#

If you want to do that you need to not use our system and keep track of credits on your end.

rich iron
#

How do I record usage

drowsy stone
#

To put it another way, our credits system is not designed to be arbitrarally decremented manually.

rich iron
#

like how do i know the user used x credits

drowsy stone
rich iron
#

Why is their not one endpoint where I can decrease the credits easily

drowsy stone
#

Yes.

#

Because the system is not designed to work that way.

#

The balance is decremented by Invoicing the Customer.

rich iron
#

this is what I do not understand can this be requested

#

like it's such a nice feature to have

drowsy stone
rich iron
#

Okay how do I invoice the user to decrease the credit

drowsy stone
#

That's explained in the docs linked to above.

rich iron
#

but does the user need to pay again

#

or the invoice uses the available credits

drowsy stone
#

Only if they don't have enough credits to cover the Invoice.

rich iron
#

okay this is basically what I want

drowsy stone
#

If the Invoice is for $10 and they have $15 worth of credits they don't need to pay, for example.

#

Yeah, I know, that's what I've been trying to explain the entire time. 🙂

rich iron
#

sorry

#

my bad if I was difficult

drowsy stone
#

No worries, this stuff is fairly complicated.

#

Can be hard to wrap your head around.

rich iron
#

but question do these credits affect other biling for the user

#

for other products

#

like if they pay for a product to use just want to be sure