Documentation
Feedback
Guides
API Reference

Guides
CheckoutFeatures
Enable the Save user data opt-in

To comply with GDPR (General Data Protection Regulation - Europe) and LGPD - Lei Geral de Proteção de Dados (General Data Protection Law - Brazil), among other solutions, VTEX offers the Save User Data opt-in functionality. Through it, users can select whether they want the store to keep their personal and payment data saved.

The Save user data opt-in feature is only available for Checkout v6.

Save user data opt-in activation

To use the Save user data opt-in functionality in your store, you must first enable it. Then, follow the settings below:

  1. Make a GET request using the endpoint Get orderForm configuration.
  2. Make a POST request using the endpoint Update orderForm configuration with the same data obtained in the GET request, just modifying the value of the savePersonalDataAsOptIn parameter from null to true.
  3. Make a new GET request using the endpoint Get orderForm configuration to confirm activation. This will be indicated by the presence of the savePaymentData and savePersonalData fields under the clientPreferencesData object in the orderForm.

{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAIAAAA7ljmRAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAMklEQVR4nAEnANj/AOno6Zucnpicne/w8AChoqQFFyMABA2ur7IA+fj5w8TIwL/B/v7+wLQX6VjLwTkAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/enable-the-save-user-data-opt-in-0.PNG","width":714,"height":508,"type":"png"}}

Under the storePreferencesData object, the saveUserData field may be indicated as true. This field is ignored, and kept in this configuration for backwards compatibility only.

{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAIAAADwyuo0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAI0lEQVR4nGNYtnaLqrE1MyPH4cNHGR4/f1Ve1RgfGfX3918AlGcNH9mt7/8AAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/enable-the-save-user-data-opt-in-1.PNG","width":928,"height":481,"type":"png"}}

Saving personal and payment data

Once the Save user data opt-in is enabled, the user will have access to checkboxes on the Checkout page to select whether their personal and payment data should be kept by the store and used in future orders.

Checkbox for saving personal data:

{"base64":"  ","img":{"width":1266,"height":854,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":69558,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/enable-the-save-user-data-opt-in-2.png"}}

Previously, it was possible to display this checkbox by modifying the display property of the .save-data element, via CSS. However, with the Save user data opt-in enabled, the method through CSS is no longer recommended.

Checkbox for saving payment data:

{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAIAAADwyuo0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAI0lEQVR4nGM4cfKkvIKiupratm3bGH7++qWqqiYiLHTu3DkAkhwLUAy/0owAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/enable-the-save-user-data-opt-in-3.PNG","width":1266,"height":638,"type":"png"}}

The checkbox for saving payment data will only be shown if the user has already selected the option to save their personal data.

Checkbox not available to save payment data if (the user has not previously selected the option to save personal data):

{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAIAAADwyuo0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAI0lEQVR4nGM4cfKkqqqauprahk2bGB49fhIaFmZqanru3DkAljAMBaVA9hUAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/enable-the-save-user-data-opt-in-4.png","width":1266,"height":627,"type":"png"}}

If the user chooses to use two cards to pay for the purchase, when selecting the option to save payment data, the data of both cards will be saved. There is no option to save only one of the cards.

Checkbox to save payment data from both cards:

{"base64":"  ","img":{"width":1266,"height":906,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":122845,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/enable-the-save-user-data-opt-in-5.png"}}

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page