---
title: "💭 Retrieve an upcoming invoice | Stripe API Reference"
description: "!https://stripe.com/docs/api/invoices/upcoming"
date: 2023-12-07
published: true
tags:
  - webdev
  - stripe
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://stripe.com/docs/api/invoices/upcoming" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-content">
      <div class="embed-card-title">External Link</div>
      <div class="embed-card-meta">stripe.com</div>
    </div>
  </a>
</div>


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 <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
