💭 Retrieve an upcoming invoice | Stripe API Reference ===================================================== !https://stripe.com/docs/api/invoices/upcoming Date: December 7, 2023 External Link stripe.com [1] You can find your customers next billing date through the stripe api by using `Invoice`. and passing in customer, customer_details, subscription, or schedule. ``` python import stripe stripe.api_key = "sk_test_51ODvHtB26msLKqCAPBAo1qkBBuIfT5tQBX6YFWCLMsPixIExxITCRVa9tNCIqkdQS8olhR79NYXsFWBPKsM3LbGO00zEcNQfNI" invoice = stripe.Invoice.upcoming(customer="cus_NeZwdNtLEOXuvB") ``` Within the invoice, you can find the next_payment_attempt as a epoch. ``` python date = datetime.fromtimestamp(invoice.next_payment_attempt) amount = invoice.amount_due currency = invoice.currency ``` !!! note This post is a thought [2]. It's a short note that I make about someone else's content online #thoughts [3] References: [1]: https://stripe.com/docs/api/invoices/upcoming [2]: /thoughts/ [3]: /tags/thoughts/