#clayton_best-practices

1 messages ¡ Page 1 of 1 (latest)

blazing roseBOT
#

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

📝 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.

frail laurel
#

For send_invoice invoices we do have a due date field
https://docs.stripe.com/api/invoices/object#invoice_object-due_date
finalized_at will tell you when the invoice went from draft to open, there is also the effective_at field which is initially set to the same thing as finalized at but you can override it if that helps you keep track of something like a due date
https://docs.stripe.com/api/invoices/object#invoice_object-status_transitions-finalized_at

vocal mica
#

I'm not so much looking for the due date as I'm looking for if it has not been paid when it should have been. Are you suggesting to use finalized_at instead of attempted and then look at the amount_remaining. I would be worried with using the date that if there is a delay in between finalized_at and when the payment is processed, I would be alerting the client an invoice is overdue when in fact its just processing.

frail laurel
#

I more mean that outside of the actual due_date field, our invoices don't have a concept of when they should have been paid. So the best way when only looking at an invoice would be to check when it was finalized and how long it has been since to see if that matches your definition of should have been paid

#

Oh or it may make sense to expand the invoice's subscription field and you can check if the subscription's status has changed to past_due

vocal mica
#

Ok I see. So in our logic, an invoice should be automatically attempted to be paid after its finalized. If that is the case, do you see any issue I might not be thinking of using the attempted and amount_remaining strategy?

For subscription, we also have to include invoices for charges not associated with a subscription, so that would not work in this case.

frail laurel
#

Ah gotcha, attempted and amount remaining should work in that case as far as I know. Though at that point attempted and the invoice's status may be sufficient as the invoice won't be open if there is no amount remaining

vocal mica
#

Oh right, I hadn't thought of that. The invoice will be will be moved to paid if it was successful. That is one step easier, so I will go with that.