How can I detect duplicate cards or bank accounts?

A fingerprint is a unique identifier for a given card number or bank account in a Stripe account. That is, if you keep track of all the fingerprints in your database you’ll be able to detect a returning customer. When a customer adds a new card or bank account, you could first check if you have seen that fingerprint before in your database and decide either to create a customer or return an error.

For cards, use the card.fingerprint property of the Payment Method. There are also fingerprint properties for other forms of payment, such as us_bank_account.fingerprint and sepa_debit.fingerprint.

For legacy integrations (those not using the PaymentMethod/PaymentIntent APIs), you can look at the fingerprint property on Token, Card, and Bank Account objects.

This also allows you to detect someone trying to sign up multiple times with the same card (for example, to get the same discount) and block this behavior. This can also help remove old cards added in the past if a new one with a more recent expiration date is added with the same fingerprint.

The fingerprint is unique for a given Account. If the same card is added to two different accounts, they will have different fingerprints. Cards and bank accounts created by Platforms on behalf of Connected Accounts will have a fingerprint that is universal across all Connected Accounts.

Note that the fingerprint does not take the expiration date of a card into account at all: the same card with different expiration dates (after a renewal, for example) have the same fingerprint.

Did this answer your question?