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:
- it keeps the customer's device ledger: every device you report, when it was first and last seen, how often, and its last IP country and time zone (a failed sign-in does not count: a device that only failed to sign in is not the customer's);
- it is shown to your people on the customer's Digital activity tab, with the customer's IP addresses and their country;
- it feeds the facts the account-takeover rules read on later payments and card events ("a payment soon after the phone number changed", "a large payment from a device first seen today", "a payee added and paid within 30 minutes").
The rules of the endpoint
- The customer must already be yours. An event never creates a customer (a payment may open a provisional one; an event does not): an unknown
customer_refis refused (400). Send the customer's CDD record first (Customer data (CDD)). - An event is identified by
source_system+external_event_id. Sending it again answers the first answer withduplicate: true(200) and stores nothing more, so a retry is always safe and noIdempotency-Keyis needed. A repeat with anothercustomer_reforevent_typeis refused409and stores nothing. event_timemay be up to 400 days in the past and no later than the time it is sent (five minutes for your clock). At go-live, send your customers' sign-ins of the last 400 days: their devices are then known from the first day, and a "new device" rule does not see every device as new.- Session and device fields are read exactly as on a payment (Session and device data): a malformed value is not stored and named in
warnings, never a refusal; a field left out says nothing. An event has noinitiation. - A field of one kind of event only is refused on another: the payee fields on a payee event, the card payment confirmation's fields on a confirmation,
card_tokenon a card event,changed_byon a change. - The events take their own back-pressure (
503 Service busy, a pool separate from payments and card events), so a burst of sign-ins never slows a payment's decision (Rate limits and back-pressure).
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:
outcome(required):APPROVEDorDECLINED, what the customer answered;confirmation_method:THREE_DS_CHALLENGE,IN_APP_APPROVALorOTHER;card_token: the card on file (the event is linked to it; the token itself is not stored);card_event_ref: theevent_refUnderlayer answered for the card event, when the authorisation was already sent (the confirmation usually comes first; then leave it out and send the card event as usual);merchant_country, and the session fields your app saw.
{
"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:
| Event | Fact on a later payment or card event |
|---|---|
LOGIN_SUCCESS with session_id | session_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 device | The device ledger: device_is_new, device_age_hours, customer_device_history_days, customer_devices_24h; with a time zone, device_region_changed_hours. |
LOGIN_FAILED | failed_logins_24h. A failed sign-in keeps no device in the ledger. |
EMAIL_CHANGED, PHONE_CHANGED, ADDRESS_CHANGED | contact_change_hours, unless changed_by is STAFF or SYSTEM. |
PASSWORD_CHANGED, PASSWORD_RESET, MFA_CHANGED | credential_change_hours, unless changed_by is STAFF or SYSTEM. |
PAYEE_ADDED, PAYEE_CHANGED | payee_added_minutes on a payment to that payee_account (else to that payee's name). |
CARD_ADDED with card_token | card_hours_since_card_added on the card's events. |
CARD_PAYMENT_CONFIRMATION with card_token | On 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
- Send your customers' CDD records (Customer data (CDD)).
- 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. - 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