Device ID

Device ID - JS integration

For merchants who are using DIRECT payment flows and are not using our Smart Fields solution, we strongly recommend the integration of the Fraud Prevention Javascript library within the payment flow of the client application. This script will allow the collection of detailed device information that will enhance the fraud prevention capabilities for each processed payment.

If you are using our Smart Fields solution, or any of our REDIRECT flows, the Device ID is being automatically collected so you may ignore this section.

Fraud Prevention JS library URLs

For web applications, in order to integrate our JS library and perform the device data collection you should include the following code snippet right after the opening <body> tag:

<!-- Scripts -->
<script src=LIBRARY_URL></script>

<script text="text/javascript">
   dlocalCollector.create({ apiKey: API_KEY })
    .then((event_uuid) => console.log(event_uuid));
</script>

Within this code, you should:

  1. Replace LIBRARY_URL with the URL for the sandbox or production environment, as detailed above.
  2. Replace API_KEY with your Smart Fields API Key. This key can be obtained from the Settings > Integration section in the Merchant Dashboard.
  3. Retrieve the event_uuid returned by the call to the dlocalCollector.create() method, and submit this value in the payment request within the additional_risk_data.device.event_uuid parameter.

For Mobile applications, dLocal provides SDKs for both Android and iOS that enable collecting device information which can then be provided in the payment request, within the additional_risk_data.device.event_uuid parameter.
For full integration details, please refer to the documentation in each of the public repositories

Device ID - Mobile SDKs


Did this page help you?