# Large number of declines & invalid card number

**URL:** <https://developer.squareup.com/forums/t/large-number-of-declines-invalid-card-number/14806>\
**Category:** Questions\
**Tags:** payments-api, cards-api\
**Created:** [April 19, 2024, 10:59pm UTC](https://developer.squareup.com/forums/t/large-number-of-declines-invalid-card-number/14806 "2024-04-19T22:59:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaigeNZ](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@SaigeNZ](https://developer.squareup.com/forums/u/SaigeNZ)\
**Post date:** [April 19, 2024, 10:59pm UTC](https://developer.squareup.com/forums/t/large-number-of-declines-invalid-card-number/14806/1 "2024-04-19T22:59:07Z")

</div>

We’ve just rolled our product out to production, we have 80 successful transactions yesterday which show’s it is working in some case but we also received 105 declines.

We’ve correctly setup createVerificationDetails using STORE, countryCode, familyName, givenName & email. The tokenization works fine on all test cards, and a variety of live cards.

On the back-end we trigger two API’s createCard and createPayment, majority seem to be failing on the initial createCard.

These are the error codes & number of occurences. Why are we seeing such a large number of invalid\_card\_data, these have been pulled from our API logs. The front-end is built using the react web SDK.

- `INVALID_CARD_DATA`: 61 occurrences
- `GENERIC_DECLINE`: 36 occurrences

How can we lower the decline rate / invalid card, on our previous payment processor Stripe this was a non-existent issue.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [April 19, 2024, 10:59pm UTC](https://developer.squareup.com/forums/t/large-number-of-declines-invalid-card-number/14806/2 "2024-04-19T22:59:30Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Troubleshoot the Payments API](https://developer.squareup.com/docs/payments-api/error-codes)**
>
> Learn about the error codes returned by the Payments API.

> **[Troubleshoot In-App Payments SDK Problems](https://developer.squareup.com/docs/in-app-payments-sdk/troubleshooting)**
>
> Troubleshoot problems with the Square In-App Payments SDK.

> **Additional Documentation**
>
> [Cards API Overview](https://developer.squareup.com/docs/cards-api)  
> [Handling Errors](https://developer.squareup.com/docs/build-basics/general-considerations/handling-errors)  
> [Cards API Overview](https://developer.squareup.com/docs/cards-api/overview)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [April 19, 2024, 11:02pm UTC](https://developer.squareup.com/forums/t/large-number-of-declines-invalid-card-number/14806/3 "2024-04-19T23:02:52Z")

</div>

The error codes you’re encountering, `INVALID_CARD_DATA` and `GENERIC_DECLINE`, are typically related to the card information provided by the customer.

`INVALID_CARD_DATA` error occurs when the card information provided by the customer is incorrect. This could be due to an incorrect card number, CVV, or expiration date. It’s important to ensure that your application’s card input fields are correctly capturing and transmitting this data.

`GENERIC_DECLINE` error is usually returned when the card issuing bank declines the payment. The reasons for this can vary and might include insufficient funds, a closed account, or other reasons determined by the bank. In this case, the customer should contact their bank for more information.

To lower the decline rate, you could implement additional user prompts or error messages in your application to guide customers in entering their card information correctly. For example, you could add real-time validation for card input fields to check that the card number and CVV are the correct length, and that the expiration date is in the future.

Remember, the error codes are there to help protect both you and the customer from fraudulent transactions or mistakes. While it can be frustrating to see declines, these safeguards are important for maintaining the integrity of the payment process.

_This answer was reviewed by @Bryan-Square._
