Documentation

Documentation/Guides/

Customer events

POST /v1/customer-events records something your customer, or someone in the customer's session, did that is not a payment: a sign-in, a failed sign-in, a new device, a changed password or two-step sign-in, a changed e-mail, phone, address or limit, an added or changed payee, an added card, and a card payment the customer confirmed in your app. Every field is described in the API reference; every refusal in Errors, "Customer events".

Nothing is decided on an event and it raises no alert by itself. It does three things:

The rules of the endpoint

A sign-in

Send one for every successful sign-in, with the session your app or web site saw. session_id lets a later payment of the same session be tied to its sign-in (only its SHA-256 is kept).

{
  "external_event_id": "EXAMPLE-EVENT-0001",
  "source_system": "MOBILE-APP",
  "customer_ref": "EXAMPLE-CUST-0001",
  "event_type": "LOGIN_SUCCESS",
  "event_time": "2026-09-02T18:01:07Z",
  "ip_address": "203.0.113.10",
  "device_id": "EXAMPLE-DEVICE-7F3A9C21",
  "device_timezone": "Europe/Vilnius",
  "session_id": "EXAMPLE-SESSION-0001",
  "initiation_channel": "MOBILE_APP",
  "device_os": "IOS",
  "data_classification": "TEST"
}

The answer (202):

{
  "duplicate": false,
  "event_id": "00000000-0000-4000-8000-000000000041",
  "event_ref": "CEV-2026-000123",
  "event_type": "LOGIN_SUCCESS",
  "received_at": "2026-09-02T18:01:08.204719+00:00"
}

A failed sign-in is LOGIN_FAILED with the same fields: it is recorded and shown, and keeps no device in the ledger.

A changed phone number, by the customer or by your staff

Say who made the change: a change your staff made at the customer's request is not a sign of account takeover. The new value itself is not sent (your CDD file carries contact details); the event only says that it changed.

{
  "external_event_id": "EXAMPLE-EVENT-0003",
  "customer_ref": "EXAMPLE-CUST-0001",
  "event_type": "PHONE_CHANGED",
  "changed_by": "CUSTOMER",
  "event_time": "2026-09-02T18:03:40Z",
  "device_id": "EXAMPLE-DEVICE-7F3A9C21",
  "ip_address": "203.0.113.10",
  "data_classification": "TEST"
}

A payee added

Send the payee's account as the customer entered it: a later payment to that account can then be tied to the payee the customer added, and to when.

{
  "external_event_id": "EXAMPLE-EVENT-0004",
  "customer_ref": "EXAMPLE-CUST-0001",
  "event_type": "PAYEE_ADDED",
  "changed_by": "CUSTOMER",
  "payee_name": "Example Payee UAB",
  "payee_account": "LT12 1000 0111 0100 1000",
  "payee_country": "LT",
  "payee_type": "LEGAL_ENTITY",
  "device_id": "EXAMPLE-DEVICE-7F3A9C21",
  "data_classification": "TEST"
}

A card payment confirmed in your app (virtual cards, e-commerce)

A card authorisation carries no session data: the card network's message holds no customer IP address or device, so the card endpoint takes none (Card events). But an e-commerce payment by a card, a virtual card most of all, is usually confirmed by the customer in your app: a 3-D Secure challenge or an approval in the app. There your app does see the customer's IP address and device. Send that confirmation as a CARD_PAYMENT_CONFIRMATION event:

{
  "external_event_id": "EXAMPLE-EVENT-0002",
  "customer_ref": "EXAMPLE-CUST-0001",
  "event_type": "CARD_PAYMENT_CONFIRMATION",
  "outcome": "APPROVED",
  "confirmation_method": "THREE_DS_CHALLENGE",
  "card_token": "EXAMPLE-CARD-0001",
  "merchant_country": "DE",
  "event_time": "2026-09-02T18:04:02Z",
  "ip_address": "203.0.113.10",
  "device_id": "EXAMPLE-DEVICE-7F3A9C21",
  "device_timezone": "Europe/Vilnius",
  "initiation_channel": "MOBILE_APP",
  "data_classification": "TEST"
}

A card or card event the customer does not hold is not linked, and the answer says so in warnings (card_token or card_event_ref); the event is recorded all the same. With these events the rules can tie a card-not-present payment to the app session that approved it: a new device approving a card payment, or an IP country other than the merchant's or the customer's residence.

What the rules read from your events

Underlayer stamps every payment and card event, when it stores it, with facts from the customer's earlier events. Which event feeds which fact:

EventFact on a later payment or card event
LOGIN_SUCCESS with session_idsession_age_seconds: a payment with the same session_id knows how long ago the session signed in.
LOGIN_SUCCESS, DEVICE_ADDED and any event with a deviceThe device ledger: device_is_new, device_age_hours, customer_device_history_days, customer_devices_24h; with a time zone, device_region_changed_hours.
LOGIN_FAILEDfailed_logins_24h. A failed sign-in keeps no device in the ledger.
EMAIL_CHANGED, PHONE_CHANGED, ADDRESS_CHANGEDcontact_change_hours, unless changed_by is STAFF or SYSTEM.
PASSWORD_CHANGED, PASSWORD_RESET, MFA_CHANGEDcredential_change_hours, unless changed_by is STAFF or SYSTEM.
PAYEE_ADDED, PAYEE_CHANGEDpayee_added_minutes on a payment to that payee_account (else to that payee's name).
CARD_ADDED with card_tokencard_hours_since_card_added on the card's events.
CARD_PAYMENT_CONFIRMATION with card_tokenOn the card's next event within 15 minutes: confirmed_in_app, confirming_device_is_new, confirming_device_age_hours, confirming_ip_country.

Send an event before the payment it may lead to. A fact is stamped once, when the payment or card event is stored, from the events Underlayer holds then; an event that arrives later never changes it. A card payment confirmation is the case to watch: your app usually has the customer's answer before the card network's authorisation reaches you, so send the confirmation first and the card event will carry it. A confirmation sent after its card event is recorded, keeps its own facts and names the card event when you send card_event_ref, but the card event, already answered, is not changed.

A fact whose event you never sent is unknown, and a rule condition on an unknown value never matches. The rule builder warns when a rule reads customer events your institution has not sent in the last 30 days.

At go-live

  1. Send your customers' CDD records (Customer data (CDD)).
  2. Send the sign-ins of the last 400 days, oldest first or in any order (an older sighting never overwrites a newer device's last country or time zone), each with its own external_event_id.
  3. From then on, send every event as it happens, before the payment it may lead to when you can.

What happens to the data

The IP address, the device ID, the session hash, the payee's name and account are personal data of the customer's file: they are kept as long as the file and erased with it. An IP address or a device ID is shared by many people (a household, an office, a mobile carrier), so erasure takes it out of the customer's own file and never searches other records for it.

© 2026 Underlayer, Lithuania. info@underlayer.eu System status Privacy notice