efficiently locate customer with unpaid invoices

324 views
Skip to first unread message

Jonathon Fillmore

unread,
Oct 27, 2014, 3:47:21 PM10/27/14
to api-d...@lists.stripe.com
Hi,

The API doesn't seem to provide a way to locate customers with unpaid invoices. When listing invoices we could filter based on invoice status and/or filter customer lists based on whether the customer has a current balance or not? Otherwise it seems like we have to fetch and iterate over the Stripe invoices?

Please NOTE: This electronic message, including any attachments, may include privileged, confidential and/or inside information owned by Rightside Group, Ltd. Any distribution or use of this communication by anyone other than the intended recipient(s) is strictly prohibited and may be unlawful.  If you are not the intended recipient, please notify the sender by replying to this message and then delete it from your system. Thank you.

Michaël Gallego

unread,
Oct 27, 2014, 5:06:27 PM10/27/14
to api-d...@lists.stripe.com
Hi,

Stripe API is actually full of hidden features. While I'm not sure you can get unpaid invoices, you can easily retrieve unpaid charges by using the "paid" boolean filter (not documented, but it works): GET /charges?paid=false

If you expand the invoice, you will get the unpaid charges with the associated invoice. Note that when a charge fails for an invoice, the invoice then recreate a NEW charge for subsequence retries. This means that although you retrieve the unpaid charges from the API, it does not mean that the invoice is still unpaid.

Alternatively, you can also retrieve all the customers that are delinquent (this means that they have at least one unpaid invoice) by using the undocumented "delinquent" boolean filter: GET /customers?delinquent=false

There are A LOT of other filters across various Stripe resources that are not documented (and could therefore by removed anytime soon), but as they are used in the dashboard, I hope Stripe team will not remove them ;)
Reply all
Reply to author
Forward
0 new messages