Skip to Content
Docs

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.

Load Pay.com.js on initial page load so it has time to collect device signals before checkout submission. Submitting a charge without a valid risk_session_id (or with a stale ID from a previous page load) can increase the risk score and lead to declines.

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. 1

    Read the risk session ID

    Read window.Pay.riskIdentifier after Pay.com.js loads (using either the script tag or @pay-com/js). This property lives on the global window.Pay object, not on the instance returned by Pay.com().

    const riskSessionId = window.Pay.riskIdentifier

    To 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. 2

    Pass risk_session_id on the charge or hold

    Include risk_session_id in your POST /v1/charges or POST /v1/holds request body. The example charges €1.00 (amount is 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:

Was this page helpful?