# Delay retrieving saved customer cards

**URL:** <https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011>\
**Category:** Questions\
**Tags:** customers-api\
**Created:** [October 1, 2020, 9:47pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011 "2020-10-01T21:47:38Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [October 1, 2020, 9:47pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/1 "2020-10-01T21:47:38Z")

</div>

I’m seeing some delays with customers being able to use a card they have just saved. The workflow in our app is:

1. Customer adds items to their cart on our end
2. Customer is prompted to create an account to check out (if they haven’t registered before.)
3. Customer registers and saves a card using the Square card form.
4. Checkout is completed using the card they have saved.

Most of the time this seems to work, but on a few occasions I’m seeing “NOT\_FOUND: Card on file not found” errors when trying to check out with a card that was recently saved.

The latest error has this timeline (PDT timezone):  
10:45am: user registers on our app  
1:51pm: they try to place an order  
3:47pm: user info was updated on Square.

The order they tried to place was unsuccessful due to the “card not found” error. Looking at their info from the customers API, they have 2 of the same card saved, which confirms what they saved on our end. It looks to me like there was a 2 hour delay actually saving the cards to their Square account though?

Customer ID is AMJGCMYEPH1J91TTDN5PN0BYH4 if that helps.

This is one example, but we’re seeing these sporadically every day or so. Should we expect a delay between a customer saving the card and actually being able to use it?

---

<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:** [October 5, 2020, 11:18pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/2 "2020-10-05T23:18:04Z")

</div>

Could you provide any other customer\_ids this is happening with? There definitely shouldn’t be a 2 hour delay between being able to use it. I do not see any “card not found” errors with the customer id provided. Is this with the `CreatePayment` request?

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [October 6, 2020, 4:21pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/3 "2020-10-06T16:21:32Z")

</div>

If any more pop up I’ll add the ID’s here. Thanks for looking into this.

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [October 6, 2020, 5:14pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/4 "2020-10-06T17:14:53Z")

</div>

And yes, it was the CreatePayment request that threw the error.

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [October 6, 2020, 5:22pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/5 "2020-10-06T17:22:32Z")

</div>

The order ID was GrNwATZczanYpfvPJuuIeBNtib6YY for this instance.

---

<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:** [October 6, 2020, 5:42pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/6 "2020-10-06T17:42:55Z")

</div>

Thanks, I found that order and payment, but it’s for a different customer (`WQ9RGAG9SCVZ93V1FGSH52V294`). I can confirm that the card id passed does _not_ match the card id that is on file for this customer, though.

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [October 6, 2020, 6:36pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/7 "2020-10-06T18:36:41Z")

</div>

Hmm…that’s odd. Fetching the user from Customers API:  
`https://connect.squareup.com/v2/customers/WQ9RGAG9SCVZ93V1FGSH52V294/`

Returns user with ID `AMJGCMYEPH1J91TTDN5PN0BYH4`.

---

<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:** [October 6, 2020, 6:48pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/8 "2020-10-06T18:48:02Z")

</div>

Ahhh probably a merged customer then. That’s probably their old id 🙂. Regardless in the request I found, it was passing the wrong `card_id` though which is where the error is coming from.

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [October 6, 2020, 6:52pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/9 "2020-10-06T18:52:32Z")

</div>

I can’t tell which card ID was used for the payment request from my end, but the only 2 cards I have on record for this customer match the two in the customer returned from the API:

`ccof:M68JDfWrC2JLZBuh3GB`  
`ccof:GLMgdVAeewK1tLMu3GB`

Would using the old customer ID cause the error?

---

<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:** [October 7, 2020, 2:01am UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/10 "2020-10-07T02:01:07Z")

</div>

Talking to the payments team about this to make sure I don’t miss anything, but from what I see so far:

`WQ9RGAG9SCVZ93V1FGSH52V294` owns `ccof:GLMgdVAeewK1tLMu3GB`  
`6FS7196TMMX1X8QPYA4JMP17PR` owns `ccof:M68JDfWrC2JLZBuh3GB`  
and it looks like the two of these were merged to make `AMJGCMYEPH1J91TTDN5PN0BYH4`.

However in the `CreatePayment` request, at least in the logs we received, `WQ9RGAG9SCVZ93V1FGSH52V294` and `ccof:M68JDfWrC2JLZBuh3GB` were passed (and not `AMJGCMYEPH1J91TTDN5PN0BYH4`) which do not belong together. So if `WQ9RGAG9SCVZ93V1FGSH52V294` (the old id) is used, then yes it would return this error.

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [October 7, 2020, 4:27pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/11 "2020-10-07T16:27:56Z")

</div>

Ah, ok. So we were sending old ID #1 with old ID #2’s card. I didn’t see any webhooks for customers api - is there any way for us to be notified if they have been merged aside from seeing an error when they try to pay? If that happens after someone creates an account through our app, we wouldn’t be aware of it, and would have the old customer ID, which seems to be what happened here.

---

<div class="post-metadata">

**Author:** ![szisman](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@szisman](https://developer.squareup.com/forums/u/szisman)\
**Post date:** [October 7, 2020, 7:53pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/12 "2020-10-07T19:53:45Z")

</div>

Hi @shannonf. I’m the Product Manager for Customers API. We don’t have Webhooks publicly available quite yet for providing notifications for customer-related changes (including merges), but this is something we’re actively working on. I will DM you!

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [January 5, 2021, 9:26pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/13 "2021-01-05T21:26:48Z")

</div>

I’m still seeing this behavior intermittently. Here is an example of a customer that wasn’t merged. ID `ZWZFZ6M0355FNDT8SBE3EXAP4C`, created at `2021-01-05T19:30:24.124Z`, at which point they would have also added a card (adding a card on our end is what prompts creating the customer on Square.)

They tried to place an order at `2021-01-05T19:34:07.476Z`, paying for the order was not successful as it returned a `Card on file not found` error. The order ID is `G98fyDktwsnoFiDCCpCQM7DYphPZY`.

Looking at the customer now, I see 2 cards saved to them both in Square and on our end, both are the same card (same last 4 and exp date). The card that was used for the order is `ccof:mLWng7qur51nfT6d3GB`, which I see listed under their cards on their Square info.

What would be causing the `Card on file not found` error here?

---

<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 5, 2021, 10:38pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/14 "2021-01-05T22:38:09Z")

</div>

The `customer_id` used to pay for order `G98fyDktwsnoFiDCCpCQM7DYphPZY` was `XRHJ9NAQX0RK757ZWPSVJDKNZW`, which is different than what you supplied above.

Furthermore, `ZWZFZ6M0355FNDT8SBE3EXAP4C` was created as a result of a merge (I see that as the source in the customer directory). It looks like the original two customer\_ids were `GYK1QVA9CWY239DBZRMCYF4AHM` and `XRHJ9NAQX0RK757ZWPSVJDKNZW`. In this case, `XRHJ9NAQX0RK757ZWPSVJDKNZW` was passed in the `CreatePayment` request, but `ZWZFZ6M0355FNDT8SBE3EXAP4C` is the owner of the card on file, thus the error was thrown.

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [January 5, 2021, 11:10pm UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/15 "2021-01-05T23:10:44Z")

</div>

Can you tell if there was a webhook event sent for the merge? I don’t see any requests posted to our callback for the time when the customer data says it was created or updated.

---

<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 6, 2021, 12:43am UTC](https://developer.squareup.com/forums/t/delay-retrieving-saved-customer-cards/1011/16 "2021-01-06T00:43:16Z")

</div>

I see a `customer.created` webhook was sent at 11:54 AM PST today (1/05) when the customer was merged. The `created_at` is from the oldest customer’s `created_at`, I believe.
