# Get List of a Customer's Payments through API

**URL:** <https://developer.squareup.com/forums/t/get-list-of-a-customers-payments-through-api/1530>\
**Category:** Questions\
**Tags:** payments-api\
**Created:** [January 2, 2021, 12:35am UTC](https://developer.squareup.com/forums/t/get-list-of-a-customers-payments-through-api/1530 "2021-01-02T00:35:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmilleriec](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@jmilleriec](https://developer.squareup.com/forums/u/jmilleriec)\
**Post date:** [January 2, 2021, 12:35am UTC](https://developer.squareup.com/forums/t/get-list-of-a-customers-payments-through-api/1530/1 "2021-01-02T00:35:15Z")

</div>

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?

Thanks,  
Jim

---

<div class="post-metadata">

**Author:** ![jmilleriec](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@jmilleriec](https://developer.squareup.com/forums/u/jmilleriec)\
**Post date:** [January 2, 2021, 1:04am UTC](https://developer.squareup.com/forums/t/get-list-of-a-customers-payments-through-api/1530/2 "2021-01-02T01:04:03Z")

</div>

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.

Thanks,  
Jim

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [January 4, 2021, 6:16pm UTC](https://developer.squareup.com/forums/t/get-list-of-a-customers-payments-through-api/1530/3 "2021-01-04T18:16:37Z")

</div>

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 (`CreateOrder`), the `SearchOrders` endpoint has a query parameter and cab be used to filter be `customer_id`s 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.

---

<div class="post-metadata">

**Author:** ![jmilleriec](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@jmilleriec](https://developer.squareup.com/forums/u/jmilleriec)\
**Post date:** [January 4, 2021, 6:50pm UTC](https://developer.squareup.com/forums/t/get-list-of-a-customers-payments-through-api/1530/4 "2021-01-04T18:50:15Z")

</div>

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.

Thanks,  
Jim
