Random "Payment on file not found" errors

We have a payment flow that involves saving a card on file via Reader SDK and charging it some time later. Occasionally we see some “Payment on file not found” errors and I’m not sure why.

Upon further inspection in Square API logs, I’m seeing some strange behavior where the card on file is successfully created, but when it comes time to charge the payment on file is not found. The strange thing is that some time later we’re able to successfully call the API to disable the same card on file, so it’s almost as if something goes wrong on Square’s end where the card on file is momentarily not found.

Check out the following events in Square API logs:

Merchant ID: MLS7BGJFT27SS

2023-03-14 13:48:45 GMT-7: Card on file is successfully created with last 4 digits 7918.

2023-03-14 13:49:43 GMT-7: Payment on file not found error, but the source_id is redacted in my log so I can’t verify if it’s exactly the same above. That being said, it should be - see the next event.

2023-03-14 14:11:13 GMT-7: Card on file is successfully disabled with the same ID as created above.

Square API logs don’t provide much info beyond this, so I’m hoping someone at Square can provide some deeper insight.

The customer_id in the payment request is Z4WB4XD3EVHPVHD10PPKF3SQX0 and the customer_id for the card is AG33FZPZFX6PH11YQ67BDZHX64 which is why the card not found error was returned. :slightly_smiling_face:

That’s what I thought when I was investigating this, but when you actually search up both of those customer IDs, they seem to point to the same customer object in Square? :thinking:

In fact if you use the Retrieve Customer endpoint on both of those IDs, they point to the same object in Square - but this time with a different ID: QWHDMRTN1N4VV2FW4BRSSX1DW4. What’s up with that?

@Bryan-Square - See above. Any update on this?

We haven’t been able to find anything that would have caused this. Are you still seeing this happen? Do you have any additional examples we can look into? :slightly_smiling_face:

Haven’t had another report from the merchant, but let me ask them and follow up with you.