Efficient way to connect user to Stripe payment?

When a stripe payment is completed and the webhook pings my app, the next step is to find the user that the payment was made from. Currently I receive the user’s unique ID in metadata from the Stripe webhook and I have to “do a search for user’s” and filter the users to the user with that unique ID.

However, with 1000s of users potentially making lots of payments, this seems like a workload unit-heavy approach to “search for users” every time.

What is a more efficient way to connect Stripe payments to the correct user?

I guess you could use a server script that outputs a User based on its unique ID (thus using an individual data-request instead of a ‘search’, which is significantly less costly in WU).

1 Like