Last active
October 6, 2015 14:12
-
-
Save adamjstevenson/250cc4aed818acec2978 to your computer and use it in GitHub Desktop.
Iterate through Stripe charges in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import stripe | |
# Be sure to use your API key - https://dashboard.stripe.com/account/apikeys | |
stripe.api_key = "sk_your_secret_key" | |
charges = stripe.Charge.all(limit=100) | |
for charge in charges.data: | |
print(charge.id) | |
while charges.has_more: | |
charges = stripe.Charge.all(limit=100, starting_after=charges.data[-1]) | |
for charge in charges.data: | |
print(charge.id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment