#SenorKarlos

1 messages ยท Page 1 of 1 (latest)

exotic stormBOT
brave cradle
#

Hello ๐Ÿ‘‹
Are these services subscription based or just one-off purchases?

cedar sierra
#

both ๐Ÿ˜…

#

I offer time based purchases for a higher fee, and subscriptions for savings

brave cradle
#

Ah okay! I don't think we have a single API endpoint which would return such information. One option would be to build a webhook endpoint and track the purchases in your own database (for new checkouts)

However for old purchases, you'd need to use the APIs to retrieve and backfill the data

cedar sierra
#

Indeed... I guess focusing on the customer object and working early is clouding my creativity ๐Ÿ˜‚

Whether it's one time or subscription, all money moves through the charges API eh?

#

And if they've tried and failed to purchase (and never came back) they'd only have payment intents?

#

Brain waking up a lil here on that 'no single api' comment bahaha

#

Would this logic check out you think?

Call the List all charges API function for each DB record I'm considering purging, if nothing is returned, good to delete? I don't really care about failed intents

brave cradle
#

Charges API is the older API. PaymentIntents API is the newer one that's mostly used for all payments (it does create a charge underneath though).

You can list all charges by PaymentIntents to see all their successful/failed charges
https://stripe.com/docs/api/charges/list

cedar sierra
#

more specifically if the data [] array is empty but yea

brave cradle
#

yup, makes sense. You can list all charges by customer too (if you only care about if there's a charge or not)

cedar sierra
#

indeed!

#

awesome ๐Ÿ˜„ just needed a brain shake and to type it out ๐Ÿ˜‚ thanks very much!

brave cradle
#

NP! ๐Ÿ™‚ Happy to help
Good luck