At VTEX, it is possible to integrate with ClearSaleV3 anti-fraud. Through this system, it is possible to increase the level of security in payment transactions carried out in your store using risk analyzes that identify possible fraud. Para configurar o ClearSaleV3, siga os passos abaixo:
To configure ClearSaleV3, follow the steps below:
- In the VTEX Admin, go to Store Settings > Payment > Providers, or type Providers in the search bar at the top of the page.
- On the providers screen, click the
New Provider
button. - Type the name ClearSaleV3 in the search bar and click on the name of the provider.
- If you wish to modify the identification name to be displayed for the ClearSaleV3 provider on the VTEX Admin screen, enter the information in the Name field in Basic Information.
- In Payment Control, select whether you want to activate the provider in a test environment by clicking Enable test mode.
- Fill in the information below according to your ClearSale settings:
- Login: Login.
- Password: Password.
- Custom SLA in minutes (optional): Period in which ClearSale will have to process the fraud analysis.
- Product (optional): Numeric value. Corresponds to the product ID contracted on ClearSale.
- Transaction currency: Currency in which the transaction is carried out.
- Observation (optional): Text that will be sent to ClearSale as a remark.
- Send authenticated transactions?: Indicates whether payment transactions must be authenticated with a password in the 3DSecure program.
- Click
Save
.
If you have a mobile application that uses VTEX APIs at checkout, it is necessary to implement fingerprint data collection to be sent to Clearsale, according to the platform used by the application. Find out more at [Clearsale Behavior Analytics](https://api.clearsale.com.br/docs/behavior-analytics" target="_blank).
With the SDK implementation, it is necessary to collect the sessionId value and send it in the deviceFingerprint via API when creating the payment.
Creating a Google Tag Manager tag
Configuring ClearSale v3 anti-fraud solution requires creating a tag in Google Tag Manager, as described in the following steps:
- Sign in to your Google Tag Manager account.
- Click on Tag and then on New.
- Choose the product Personalized HTML Tag.
- Enter the following script, replacing
your-app
with the identifier sent to you by ClearSale (between single quotes):
var deviceFingerprintIdCSV4 = 10000000 + Math.floor(Math.random() * 99999999); (function (a, b, c, d, e, f, g) { a['CsdpObject'] = e; a[e] = a[e] || function () { (a[e].q = a[e].q || []).push(arguments) }, a[e].l = 1 * new Date(); f = b.createElement(c), g = b.getElementsByTagName(c)[0]; f.async = 1; f.src = d; g.parentNode.insertBefore(f, g) })(window, document, 'script', '//device.clearsale.com.br/p/fp.js', 'csdp'); csdp('app', 'your-app'); csdp('sessionid', deviceFingerprintIdCSV4); window.vtex.deviceFingerprint = deviceFingerprintIdCSV4;
- Check the option Support for document.write.
- In Trigger In, select the option More and click on New.
- Allocate a name to this trigger and choose the event type Personalized Event.
- In Trigger In, define the name of the event as payment.
- Save the trigger.
- Click on the Create Tag button, enter a name for this tag and save.
- In the top right corner, click on Publish.

See the [ FingerPrint documentation](https://api.clearsale.com.br/docs/finger-print" target="_blank) on ClearSale for more information on the above script.
CustomSLA field details
The value entered in the Custom SLA in minutes field when configuring the anti-fraud solution is one of the three possible values for the customSLA
field. If the cart is empty, the customSLA
value will be the value of the shippingEstimate
field for the transaction cart. If the cart has at least one item, the customSLA
value will be the lowest value between the deliverySlaInMinutes
value of the first item in the cart and the Custom SLA in minutes value used when configuring the anti-fraud solution.
The shippingEstimate
and deliverySlaInMinutes
values correspond to the delivery time and are generated at checkout from information in the Logistics module. The calculation of the delivery time is explained in the article How is the delivery time is calculated?.
The shippingEstimate
value is obtained from a calculation made by the Logistics module. The value is followed by a letter, which represents the time unit used. The letters are:
d
for calendar days orbd
for working days if the time is zero or at least 24 hours.h
for hours if the time is less than 24 hours and at least 2 hours.m
for minutes if time is less than 2 hours.
The shippingEstimate
field can be obtained from the shippingData.logisticsInfo[]
items in the Get Order endpoint response.
The deliverySlaInMinutes
value is the conversion of shippingEstimate
into minutes. If the unit is m
(minutes), the value will be the same. If the unit is h
(hours), the value is multiplied by 60, and if the unit is d
(calendar days) or bd
(working days), the value is multiplied by 1440. For example, three calendar days or 3d
is represented as 4320
. The deliverySlaInMinutes
field is used in each item of the minicart
in the request body of the Send Antifraud Pre-Analysis Data and Send Antifraud Data endpoints.
Although the time conversion in calendar days (
d
) and working days (bd
) to minutes is the same in thedeliverySlaInMinutes
field, the delivery date may be different depending on the calendar (when there are weekends and holidays within the delivery window).