简体   繁体   中英

Get records of all new customers for each day from stripe and store in MYSQL database

I am required to get the records of all the customers in a day from Stripe and store the records in the MySQL database table. I am able to fetch the records from Stripe and can store them in the table too. However, I want the task to be automatic and get the task done at a specific time in a day. Any suggestions?

Are you open to the idea of implementing a simple application that Stripe can send webhook events to? If so, you can listen to the customer.created event. This way you can add a new record in your database as soon as a Customer is created.

If not, use the List all Customers API and supply the created parameter: https://stripe.com/docs/api/customers/list#list_customers-created but this will be slightly more tedious as you'll need to paginate, since you can only retrieve 100 Customers per API call. To paginate, supply the starting_after and ending_before parameters. You'll also need to configure your cronjob to run at the timing that you desire.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM