Question about managing Cards

Hello! I had a question about managing Cards using Cards API

I managed to pass a card nonce using the Web Payments SDK and successfully created a Card on my sandbox project. I also have a feature in my app that calls the Disable Card API if the user wants to disable it.

However, when I want to re-create the Card with the same card (it generates the same nonce), I get the SOURCE_USED error, which states that the nonce has been already used to create a Card.

However, there is no endpoint to re-enable the disabled card, so I am a bit stuck in limbo: I can’t create a new Card, nor I can re-enable a disabled card. The card is stuck in the account, with no way to re-use it.

Is there anything i’m missing? Thanks!

:wave: This is the expected behavior. A nonce is a one time use token. Once a card is disabled you’ll have to generate a new nonce to tokenize the card again. There isn’t currently a function to disable and re-enable a card with the Cards API. :slightly_smiling_face:

1 Like

Thanks for the quick answer!

I’ve investigated my code after your response and I found out I was using the nonce to create the Payment and then tried to save the Card with the same nonce. That’s what triggered the error code.

I managed to get it to work by first saving the card with the nonce, and using the newly created saved card nonce to proceed with the payment.

Thanks again!