# Validate Cards on File

**URL:** <https://developer.squareup.com/forums/t/validate-cards-on-file/84>\
**Category:** Questions\
**Tags:** customers-api, payments-api\
**Created:** [April 21, 2020, 7:37pm UTC](https://developer.squareup.com/forums/t/validate-cards-on-file/84 "2020-04-21T19:37:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![RussPete](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/russpete/32/44_2.png) [@RussPete](https://developer.squareup.com/forums/u/RussPete)\
**Post date:** [April 21, 2020, 7:37pm UTC](https://developer.squareup.com/forums/t/validate-cards-on-file/84/1 "2020-04-21T19:37:08Z")

</div>

I’m just starting my development with Square and I have a few questions with how Cards on File work.

Once a month I need to charge a customer’s card, is there a way to verify the card on file has not expired before using it for payment? Ideally I’d like to verify cards a few days ahead to give the customer a heads up if their card has expired, give them a chance to update their card.

I guess I could perform a small authorization only transaction a day or two ahead, would that be a good idea or a poor idea? Does that incur a charge for the transaction from Square, or does that only happen when a payment is captured?

I don’t suppose there is a portal for the customer to maintain their cards on file?

Well, that’s it for my first question in the new forums.

Thanks,  
Russ

---

<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:** [April 21, 2020, 7:48pm UTC](https://developer.squareup.com/forums/t/validate-cards-on-file/84/2 "2020-04-21T19:48:16Z")

</div>

Hey Russ, thanks for checking out our new forums 🙂

There’s no authorization endpoint, however you could do a [Delayed Capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-capture) a few days before and complete the payment on the day of. This will basically get payment approval, but not charge the card, so you’ll know if it will succeed or not. Then, if it fails, you could alert the customer that their card on file seems to be invalid and they should update it to continue making payments.

---

<div class="post-metadata">

**Author:** ![dpapastrat](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/dpapastrat/32/2_2.png) [@dpapastrat](https://developer.squareup.com/forums/u/dpapastrat)\
**Post date:** [April 21, 2020, 7:58pm UTC](https://developer.squareup.com/forums/t/validate-cards-on-file/84/3 "2020-04-21T19:58:25Z")

</div>

Just curious @RussPete, are you just asking to know if the card’s expiration date? If so, the [Create Customer Card](https://developer.squareup.com/reference/square/customers-api/create-customer-card) endpoint returns expiration month and year for cards (and it does validate the card number when storing a card on file).

---

<div class="post-metadata">

**Author:** ![RussPete](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/russpete/32/44_2.png) [@RussPete](https://developer.squareup.com/forums/u/RussPete)\
**Post date:** [April 21, 2020, 8:18pm UTC](https://developer.squareup.com/forums/t/validate-cards-on-file/84/4 "2020-04-21T20:18:03Z")

</div>

Thanks @dpapastrat, I hadn’t seen those fields returned yet, I was thinking only the card id would be returned. I can keep the additional information that is returned and make use of it, keep track of the expiration date on my own.

---

<div class="post-metadata">

**Author:** ![jibegreenwater](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jibegreenwater](https://developer.squareup.com/forums/u/jibegreenwater)\
**Post date:** [May 3, 2020, 10:47pm UTC](https://developer.squareup.com/forums/t/validate-cards-on-file/84/5 "2020-05-03T22:47:54Z")

</div>

Believing that this questions add’s to original posters question, is it possible that a customer has more than one card on file?  
If so, what is best practice for choosing a saved card to charge?  
Assuming using the API for search and charge.

---

<div class="post-metadata">

**Author:** ![dpapastrat](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/dpapastrat/32/2_2.png) [@dpapastrat](https://developer.squareup.com/forums/u/dpapastrat)\
**Post date:** [May 4, 2020, 12:05am UTC](https://developer.squareup.com/forums/t/validate-cards-on-file/84/6 "2020-05-04T00:05:44Z")

</div>

Yes, it is possible for a customer to have more than one card on file; however, from an API point of view, you can only charge cards on file that your app has created. You’ll need to store a reference to that card in your own database - there’s no ability to list / search for cards on file today.

---

<div class="post-metadata">

**Author:** ![jibegreenwater](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jibegreenwater](https://developer.squareup.com/forums/u/jibegreenwater)\
**Post date:** [May 4, 2020, 1:07am UTC](https://developer.squareup.com/forums/t/validate-cards-on-file/84/7 "2020-05-04T01:07:19Z")

</div>

Thanks for the clarification, we have to store “reference\_id”: “YOUR\_REFERENCE\_ID” for the card that the API created in our system to be able to charge it for recurring payments.

Since we can only get the cards that the API created, is it possible for the API to save more than one card for the customer? If so, I assume we check which one of the referenced cards is valid for the next payment.

EDIT  
The reference\_id mentioned above is the customer reference, I presume the saved card ID would have to be stored at the merchant Database.

---

<div class="post-metadata">

**Author:** ![dpapastrat](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/dpapastrat/32/2_2.png) [@dpapastrat](https://developer.squareup.com/forums/u/dpapastrat)\
**Post date:** [May 4, 2020, 5:56am UTC](https://developer.squareup.com/forums/t/validate-cards-on-file/84/8 "2020-05-04T05:56:07Z")

</div>

It is possible for the API to save more than one card, yes. You’ll need to the ID of those cards in your own database, though - there’s no way to list / retrieve them from the API after they’ve been created.
