The shopping cart is where the information on the products chosen by the customer while browsing a store is gathered. This data may include item prices, shipping value, payment, and delivery methods, among others.
This guide will describe how to remove all personal data from a shopping cart by the API.
Getting and accessing shopping cart information
The first step is to get the orderFormId
and access the shopping cart information that you want to remove personal data. For more information, access the Get cart information by ID guide.
See below an example of some personal data contained in a shopping cart:
_41..._41"clientProfileData": {_41 "email": "clark.kent@examplemail.com",_41 "firstName": "Clark",_41 "lastName": "Kent",_41 "document": "44444444444",_41 "documentType": "cpf",_41 "phone": "+5511123456789",_41 "corporateName": null,_41 "tradeName": null,_41 "corporateDocument": null,_41 "stateInscription": null,_41 "corporatePhone": null,_41 "isCorporate": false,_41 "profileCompleteOnLoading": false,_41 "profileErrorOnLoading": false,_41 "customerClass": null_41},_41…_41"availableAddresses": [_41 {_41 "addressType": "residential",_41 "receiverName": "Clark Kent",_41 "addressId": "ae3173b32bf64663a81fc42b057be211",_41 "isDisposable": true,_41 "postalCode": "70386060",_41 "city": "Brasília",_41 "state": "DF",_41 "country": "BRA",_41 "street": "Quadra SQS 116 Bloco F",_41 "number": "101",_41 "neighborhood": "Asa Sul",_41 "complement": null,_41 "reference": null,_41 "geoCoordinates": [_41 -47.925922393798828,_41 -15.832707405090332_41 ]_41 }_41]_41...
️ For more information about the meaning of each of the fields available in the shopping cart, access the orderForm overview.
Removing all personal data from the shopping cart
To remove all personal data from a shopping cart, you can use your browser to create an URL based on the orderFormId
value. See an example below:
- ordeFormId:
9620cbb7ebc34ca68a86621428816c5a
- New URL:
https://{accountname}.{environment.com.br}/checkout/changeToAnonymousUser/9620cbb7ebc34ca68a86621428816c5a
After accessing the URL created in your browser, you will be redirected to the cart page, where all personal data has been removed.
Important: The page with the cart without personal information is displayed, because when the URL is accessed, a new orderForm is generated and a new cookie is saved in the browser.
Alternatively, if you are using a backend or similar implementation, it is also possible to create a new cart (without any personal data) using the Get current or create a new Cart endpoint and adding the same items from the previous cart through the Update cart items.