#veesh_api
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/1328371966142582807
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
We're talking about billing credits, yes? https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits
Grant billing credits to your customers so they can use them to pay for usage-based products or services, memberships, pay-as-you-go plans, or subscriptions. Learn about approved and prohibited use cases for billing credits, how to apply credit grants, and what information displays in the credit balance summary and in credit balance transactions.
Yes indeed
Really I would wanna express this as a tiered price, but we have arbitrary amounts
Yeah I think invoice application is limited to Dashboard only currently
ah, but it can be done manually? i wasn't able to see how to do so
I've not tried this myself, but: https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits/implementation-guide?dashboard-or-api=api#apply-billing-credits-to-invoices
Learn how to implement a prepaid billing solution with billing credits.
it says there that it's automatic
Oh wait, maybe the application is doen at the customer level and then it passes down to open invoices
So yeah I don't think you can do the credit application to a specific invoice it's just handled automatically via the customer application
mmhmmm
(sorry this is new to me too)
is there a webhook that's fired when a usage based subscription is about to be billed?
or only after the invoice goes out
There will be an invoice.created event when the invoice is initially created in a draft state. That lasts for an hour before the invoice is automatically finalized and sent off, but you can finalize yourself via the API before then.
is it possible to make that time period longer? just worried that maybe somehow we'll miss the window
Not as far as I am aware, double checking if there is a workaround
There is a way to control this! You can set auto_advance to false on the Invoice just after it is created. That will keep the invoice in a draft state indefinitely. There isn't a way to set this on the subscription, so the way to do it would be to listen to invoice.created events and make the invoice update call on each new invoice that you want to pause this on https://docs.stripe.com/api/invoices/update#update_invoice-auto_advance
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
similar issue in terms of missing the window, tho
I more meant having an automated system listen for the events and make that call. The events are sent out immediately when the invoice is created
ya, got it
are credits applied to draft invoices, or only finalized?
ah, docs say only finalized
Ah yep, so you would need to retrieve the credit for the customer if you aren't already tracking that to see what would apply.
https://docs.stripe.com/invoicing/integration/workflow-transitions#finalized this here says that the 1 hour is after receiving a response to invoice.created - does this apply to subscriptions also, or just manually created invoices?
Subscription invoices as well
oh wonderful, so then i don't have concerns anymore; thanks a mil!