I think I know the solution for this, however I just want to make sure before I go down this route as it will require a lot more work.
It appears that there is no way to retrieve all payments made by a customer, is that correct? The closest I can find would be to provide the last 4 digits and Card Brand in the List Payments call and then figure out a way to handle if you have multiple customers with the same last 4 and card brand.
Is that correct or am I missing something?
We are storing the square customer ID in our database, and the customer ID comes back for each payment in the List Payment Query, so it appears I can simply filter out those payments that are not for the current customer ID.
If there is an easier way to do this please let me know, seems like I’ll be pulling back quite a bit of unnecessary data over time if this is the solution.
That’s pretty much the best way to do this currently, as there is no way to filter payments by
customer_id at this time.
If you were using
customer_id in the Order (
SearchOrders endpoint has a query parameter and cab be used to filter be
customer_ids to find all orders belonging to a specific order. However, by default the customer id is not added to orders, so it would need to be something extra you add into the flow of your application.
Ok, thanks Stephen, we’re not using orders, so we’ll just have to filter out any payments that come back that aren’t for the current customer.