Hello! I’m currently migrating a subscription base to VTEX and, so far, the part of creating the customer account on the platform and setting up the subscription for the customer is working fine. However, I couldn’t find a reference for adding a credit card via API for the customer.
We were told this is possible — does anyone know how to do it?
Reference for the DELETE method related to what I’m looking for:
Endpoint to delete a credit card
Hi, @pedroarimura!
As far as I know, there really is no way to pre-register a credit card. They are only saved after an order is created, if the customer has chosen to save it.
Hi Pedro, hope you’re doing well!
I think the best path forward would be to open a ticket to speak with the VTEX solutions architects team to check if there’s any possibility of implementation.
However, according to the How My Account Works documentation, there are some limitations that suggest what you’re looking to do may not be possible. Here are the key points:
-
If the buyer tries to register a new card without having previously used it in your store, the message An error occurred while trying to register the card will be displayed. For more details, see our documentation Saving a new card does not work when using 3DS.
-
In Subscriptions, it is also not possible to first save the card and then activate the subscription for the desired service. In situations like this, you need to activate the subscription at the time of purchase, so the card will be saved automatically.
-
Even if the credit card saved under the Cards tab has an expired expiration date, you will need to remove it and make a new purchase to save it again, since due to 3DS authentication, it is not possible to update and confirm card details without having completed a transaction in the store.
@pedroarimura how’s it going? I worked at VTEX for many years and this was always a pain point. Luckily, in the last project I was involved in, we managed to build this feature, exclusively for card migration. It’s something the payments team built and it needs to be done for each acquirer/gateway. It’s not something that can be done via API (or a middleware external to VTEX’s PCI environment). It’s worth talking to the team there — they might have already built it for your acquirer. If you want, I can also try to find out.