Menu
Feedback
Start here
Tutorials
Developer portal

Known Issues
Support Rules
Troubleshooting

Frequently Asked Questions
Announcements
Tutorials
Tutorials
Explore in-depth tutorials for operating your VTEX store.
Tutorials
Payments
Payment Settings
Configuring ClearSale v3 antifraud
Configuring ClearSale v3 antifraud
5 min read

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:

  1. In the VTEX Admin, go to Store Settings > Payment > Providers, or type Providers in the search bar at the top of the page.
  2. On the providers screen, click the New Provider button.
  3. Type the name ClearSaleV3 in the search bar and click on the name of the provider.
  4. 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.
  5. In Payment Control, select whether you want to activate the provider in a test environment by clicking Enable test mode.
  6. 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.
  1. 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:

  1. Sign in to your Google Tag Manager account.
  2. Click on Tag and then on New.
  3. Choose the product Personalized HTML Tag.
  4. 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;

  1. Check the option Support for document.write.
  2. In Trigger In, select the option More and click on New.
  3. Allocate a name to this trigger and choose the event type Personalized Event.
  4. In Trigger In, define the name of the event as payment.
  5. Save the trigger.
  6. Click on the Create Tag button, enter a name for this tag and save.
  7. In the top right corner, click on Publish.

{"base64":"  ","img":{"width":1714,"height":1161,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":178273,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/configuring-clearsale-v3-antifraud_1.png"}}

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 or bd 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 the deliverySlaInMinutes field, the delivery date may be different depending on the calendar (when there are weekends and holidays within the delivery window).

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
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX community.
Join our community
Request support from VTEX
For personalized assistance, contact our experts.
Open a support ticket
GithubDeveloper portalCommunityFeedback