Device fingerprinting
Collect browser device signals with Pay.com.js and pass risk_session_id on server-to-server charges and holds.
For server-to-server API integrations, load Pay.com.js on your page to collect
device signals for Pay.com's risk engine, then pass the generated
risk_session_id on each charge or hold.
Requirements
Before you start, make sure you have installed or loaded Pay.com.js on your checkout page.
Collect and send the risk session ID
When Pay.com.js loads, it generates a session UUID on window.Pay.riskIdentifier.
Because a new UUID is generated on every page load, read the current value
right before submitting a transaction.
- 1
Read the risk session ID
Read
window.Pay.riskIdentifierafter Pay.com.js loads (using either the script tag or@pay-com/js). This property lives on the globalwindow.Payobject, not on the instance returned byPay.com().const riskSessionId = window.Pay.riskIdentifierTo supply your own UUID, append
?riskIdentifier=<uuid>to the script URL (for example,https://js.pay.com/v1?riskIdentifier=4bc38635-d941-463e-a331-376705d0b840). - 2
Pass
risk_session_idon the charge or holdInclude
risk_session_idin yourPOST /v1/chargesorPOST /v1/holdsrequest body. The example charges €1.00 (amountis in minor units) with raw card details, which need an API key enabled for raw card data. See PCI compliant keys.POST https://api.sandbox.pay.com/v1/charges{ "currency": "eur", "risk_session_id": "4bc38635-d941-463e-a331-376705d0b840", "amount": 100, "source_data": { "type": "card", "card": { "number": "4242424242424242", "expiry_month": "12", "expiry_year": "2028", "cvv": "123", "name": "Jane Smith" }, "billing_details": { "email": "jane.smith@example.com", "address": { "line1": "Georgiou Griva Digeni 43", "city": "Limassol", "postal_code": "3106", "country": "CY" }, "phone": "+35797123456" } } }
How the risk engine uses device signals
Pay.com links the collected device signals to your transaction through
risk_session_id. Depending on the signals and your risk configuration, the
risk engine can take one of these actions:
- Decline: If the engine detects high-risk signals (such as known fraudulent device fingerprints, suspicious browser configurations, or bot-like behavior), it declines the transaction automatically.
- Flag for review: The engine can flag a potentially fraudulent transaction for review. A review doesn't hold the payment. The charge succeeds, and you resolve the risk review afterward. Depending on your risk configuration, the transaction can be declined outright instead.
- Step-up authentication: When the risk score is elevated but not conclusive, the engine can trigger extra verification, such as 3D Secure.
Next steps
Related risk and SDK guides:
- Risk assessments: Score transactions via API before creating a charge.
- Test risk events: Simulate disputes, collaborations, and fraud warnings in the sandbox.
- Pay.com.js: Install and initialize Pay.com.js.