INVALID_CARD_DATA when create authorized payment

Dear Team,

in production env, we got below error while calling API to create an authorized payment,

Error [category=INVALID_REQUEST_ERROR, code=INVALID_CARD_DATA, detail=Invalid card data., field=source_id]

a few hour later, when we tried to repeat the API call with the same payment token for troubleshooting, the error became

  "errors": [
      "code": "NOT_FOUND",
      "detail": "Card nonce not found",
      "category": "INVALID_REQUEST_ERROR"

may i know what would be the case of the error INVALID_CARD_DATA and the later NOT_FOUND?


btw, i have tried inputting wrong card number / CVV / expire date through square web sdk, it looks all these cases will fail to generate payment token by square web sdk

With Square the token that’s returned from the Web Payments SDK is a one time use token which is why you got the error when trying it for a second time. :slightly_smiling_face:

may i know what would be the cause of INVALID_CARD_DATA for the first failure?

Banks don’t always share with us the reason behind the decline. Whenever you get an error like this you’ll want to have the customer contact the bank. :slightly_smiling_face:

I thought it’s GENERIC_DECLINE that the customer needs to contact with bank … :thinking:

as both GENERIC_DECLINE and INVALID_CARD_DATA are caused in bank, may i know what is the difference between the two errors?
such as, because the error is INVALID_CARD_DATA but not GENERIC_DECLINE, can we know anything more than what GENERIC_DECLINE means?

Sorry, your right. The GENERIC_DECLINE is returned from the bank for payments. If you get INVALID_CARD_DATA that means that the card information that was given to use was incorrect when trying to charge the card. If this is when your trying to save the card on file then this error is returned from the bank. When a customer gets these errors they should retry the payment and make sure they’re putting in all the information correctly. If they get this again then they should contact their bank. :slightly_smiling_face:

thanks for the details, we contacted with the customer, the error occurred when trying to save the card on file.
however we are also told that the same card can be saved in apple pay successfully, but not card on file in square, may i know what would be the cause of this difference?

At this time we currently don’t support storing Apple Pay cards on file. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slightly_smiling_face:

no… i didn’t mean storing apple pay cards on file in Square.

for example, the customer can save his card in Apple pay, but he can’t save this same card on file in square,
we would like to know what’s the cause of this difference.

Sorry if that wasn’t clear. The Apple Pay card I was referring to is the customers card stored in the digital wallet. Storing this on file isn’t currently available with our APIs. :slightly_smiling_face:

sorry i think i didn’t make it clear :sweat_smile:, let me put it in this way:

  • customer has a card, for example, the card number is VI 1234,
  • customer can add this VI 1234 to his apple pay account on his iPhone successfully, this apple pay account is not related to Square, and he can buy things from any online shop, etc. with his apple pay account, although the money comes from his card VI 1234 originally. in this case, the customer’s operation is not related to square, it’s success.
  • customer tried to add his card VI 1234 on file in square, but failed; what he tried, is not to save his digital wallets (such like apple pay or google pay) on file, but to directly save his card VI 1234 on file; which means, in this case, the customer’s operation is not related to apple pay, it’s failed.

Was the source_id that was passed to CreateCard generated through the Web Payments SDK or was it generated through Apple Pays returned response? If it was generated through the Web Payments SDK and failed we recommend having the customer retry and make sure the information they provided was correct. If it continues to fail then we recommend that the customer contacts the bank for further assistance. :slightly_smiling_face: