Documentation

Documentation/

Underlayer client API: the integration file for AI coding tools

To hand this to an AI coding tool, give it the plain file: integrate-with-ai.md. A tool that looks for an index finds one in llms.txt.

Real-time payment and card decisioning, decision look-up and CDD intake for e-money and payment institutions.

This one file is written for an AI coding tool (Claude Code, Cursor, Codex and the like) that a developer asks to build or change a client system's integration with the Underlayer client API. It holds everything an integration needs: the address, headers and keys, every operation with its fields, values and examples, the answers, idempotency and retries, the webhook signature check, the strict rules and the steps that check an integration in the sandbox. It is generated from openapi.yaml (version 2026-11-17) and the guides; where the two seem to differ, openapi.yaml is the contract.

0. How to work from this file

  1. Read sections 1 and 2 before you write any code.
  2. Build and test against the developer's sandbox institution only, with TEST data (section 6).
  3. Take the base address, the API key, the webhook secret and the data classification from configuration: UNDERLAYER_BASE_URL, UNDERLAYER_API_KEY, UNDERLAYER_WEBHOOK_SECRET and UNDERLAYER_DATA_CLASSIFICATION. If one is not configured, ask the developer; never invent one.
  4. Copy field names and values from section 3 exactly. Where the developer's request needs something section 3 does not have, say so.
  5. Finish with the sandbox check steps (section 6) and report each result.

1. Strict rules

2. Address, headers and keys

The base address

Every path below is appended to $UNDERLAYER_BASE_URL, for example $UNDERLAYER_BASE_URL/v1/transactions. Every request and answer is JSON over HTTPS.

The base address is the server of openapi.yaml, the same for sandbox and production keys: this file names it only by its placeholder. The API key, not the address, decides which institution a request is for; during integration it is the key of the developer's sandbox institution:

As in the test and live modes of payment APIs, your test data and your real data live apart:

InstitutionTakesFigures count
ProductionPRODUCTION data only. A TEST, SCALE_TEST or DEMO payment, card event or CDD file is refused (400).Its production records.
SandboxAny data classification its keys allow.Everything it holds: it is all test data.

Each institution has its own keys. Build and test your integration against your sandbox institution; switch to the production institution's key when you go live. An institution never goes from production to sandbox. A platform administrator of Underlayer can empty a sandbox's test data before a new round of tests (its settings, people and keys stay).

Headers

HeaderSent withValue
X-API-KeyEvery request but GET /v1/health.$UNDERLAYER_API_KEY: <key_id>.<secret>, for example ak_0123456789abcdef.<48 hexadecimal characters>. Only a hash of the secret is stored; a lost key cannot be shown again, issue a new one. A key may be limited to allowed IP addresses and ranges: from any other address it answers 403 (API key not allowed from this address).
Content-TypeEvery POST.application/json. Every body is a JSON object, UTF-8.
Idempotency-KeyPOST /v1/card-authorizations: required.Required for card events: a card event is recognised only by this key. Send a unique key for each event (for example a UUID), at most 255 characters, and the same key when you retry it. Without it, or with a blank one, the event is refused (400) before anything else is read. A repeated key with the same card_token, event_type, amount and currency answers the card event's first decision with duplicate: true; with another of them it is refused 409. Requests with the same key wait for each other, so a concurrent repeat answers the card event's first decision too.
Idempotency-KeyPOST /v1/transactions: optional, recommended.Your unique key for this payment, unique within your institution (for example a UUID). Optional: a payment is also recognised by source_system + external_transaction_id without it. A repeated key creates nothing new and answers duplicate: true with the payment's current decision, which may have moved on since you sent it (from AI_INVESTIGATION to RELEASED or BLOCKED, for example). A repeat must be the same payment: one whose compared fields differ from the earlier one's is refused 409 and nothing is stored. Requests with the same key wait for each other, so a concurrent repeat answers the first request's decision. (A card event's Idempotency-Key is required, and a repeat there answers the card event's first decision: see POST /v1/card-authorizations.)

Every answer carries X-Request-Id, an identifier our server makes for that request: log it with the request and quote it when you contact Underlayer.

Keys and secrets

PlaceholderWhat it holdsWhere it comes from
UNDERLAYER_BASE_URLThe base address of the API: the server of openapi.yaml.The same for sandbox and production keys; the key decides the institution.
UNDERLAYER_API_KEYThe API key, <key_id>.<secret>.Issued by an administrator of the institution on the API and webhooks screen and shown once.
UNDERLAYER_WEBHOOK_SECRETThe webhook signing secret.Set on the API and webhooks screen and shown once.
UNDERLAYER_DATA_CLASSIFICATIONThe data classification every request sends: TEST in the sandbox, PRODUCTION live.The developer's configuration; the key must allow the value (403 otherwise).

The API key

Every client endpoint takes one header:

X-API-Key: <key_id>.<secret>

The key is ak_ and 16 hexadecimal characters, a dot, and 48 hexadecimal characters. The health route (GET /v1/health) is the only endpoint that needs no key.

The key decides your institution. Nothing in a request can choose another one: every payment, card event, customer and decision look-up is your institution's own, and a payment of another institution answers 404 and is never read.

Rotating a key

  1. Issue the new key.
  2. Switch every caller to it.
  3. Revoke the old key. A request with a revoked key answers 401 (Invalid or revoked API key).

Revoke a key at once if it may have leaked. 20 failed authentications from one address within 10 minutes refuse that address for 10 minutes, a right key included (Rate limits and back-pressure).

3. Operations

OperationWhat it does
3.1POST /v1/transactionsSubmit a payment for real-time monitoring and get its decision
3.2GET /v1/transactions/{id}/decisionRead the current decision for one of your payments
3.3POST /v1/cardsRegister one of your cards, or update it
3.4POST /v1/card-authorizationsDecide a card or ATM authorisation in real time
3.5POST /v1/customer-eventsRecord something the customer did that is not a payment
3.6POST /v1/cdd-ingestSend customer due diligence (CDD / KYC) records
3.7GET /v1/healthLiveness

Send a customer's CDD record (3.6) before the customer's payments, card registrations and customer events, and a card registration (3.3) before the card's events.

3.1. POST /v1/transactions: Submit a payment for real-time monitoring and get its decision

Operation submitPayment. Header X-API-Key. Header Idempotency-Key: optional.

Records the payment and its decision, then evaluates it with the institution's own monitoring rules and screens it against the sanctions lists in real time, within a budget of 12 seconds. A customer's PEP status is your own KYC determination, sent with the customer's record (pep_determination). If screening does not finish in time or fails, the payment is held for a person (HUMAN_REVIEW, screening_timeout: true): it is never released unscreened. When the server has no capacity left to hold it at once, the answer is 202 with status: SCREENING and screening_timeout: true, and the scheduled sweep holds it within minutes; poll the decision. A payment held this way is screened again in the background within minutes of its arrival: if that screening finds nothing it is released (decision.released to the webhook), otherwise it stays held with its alerts. A payment no person has acted on and that arrived less than an hour ago is the only one screened this way; any other stays with a person.

Fields not listed in the schema are ignored. Which fields are required depends on the channel (see PaymentRequest).

Request body: PaymentRequest.

PaymentRequest

Required for every payment: external_transaction_id, customer_ref, channel, direction, amount, currency. Required by channel: SEPA also counterparty; SWIFT also origin_country and destination_country. Every amount, currency, country and card_present is checked before anything is stored, and a value of the wrong type is refused with a 400 naming the field. Codes are upper-cased: a currency must be three letters (Currency), a country a code of the platform's country list (Country). An external_transaction_id or customer_ref beginning EXAMPLE- (in any case) is refused. The session and device fields (ip_address, ip_country, device_id, device_timezone, device_utc_offset, session_id, initiation_channel, initiation, device_os, vpn_or_proxy, remote_access_detected) are optional and never refuse the payment: a malformed one is stored as nothing and named in the answer's warnings, a field left out says nothing. The payee fields (counterparty_account, counterparty_relationship, payee_verification, available_balance, balance_currency) are optional and refused (400) when malformed, like every other field.

FieldRequiredTypeValuesMeaning
external_transaction_idyesstringat least 1 charactersYour unique id for this payment within source_system. Sending it again returns the payment's current decision (duplicate). One beginning EXAMPLE- is refused (400).
source_systemstringdefault APIWhich of your systems sent the payment. Part of the payment's identity together with external_transaction_id.
customer_refyesstringYour customer reference, as in the CDD intake. An unknown one opens a provisional customer (KYC incomplete, risk High) unless your decision policy forbids it or today's limit is reached; then the answer is 400 unknown customer_ref. One beginning EXAMPLE- is refused (400).
customer_namestringUsed only when the payment opens a provisional customer.
customer_typestringone of Business, IndividualUsed only when the payment opens a provisional customer (default Individual; another value counts as Individual).
customer_countryCountrysee Country in "Value formats"Used only when the payment opens a provisional customer (default XX, unknown). A code you send must be on the platform's country list, so XX itself is refused.
account_numberstringThe customer's account the payment was booked on; linked when it belongs to that customer, otherwise ignored.
channelyesstringone of SEPA, SWIFT, CARD, ATMThe payment rail (case-insensitive). Decides which fields are required.
directionyesstringone of INCOMING, OUTGOINGIncoming or outgoing for your customer (case-insensitive).
amountyesAmountsee Amount in "Value formats"Greater than zero, in currency, at most two decimals. Missing: 400 amount is required. Zero or negative: 400 amount must be greater than zero. Not a decimal number: 400 amount must be a decimal number such as 125.50 (no exponent, NaN or Infinity).
currencyyesCurrencysee Currency in "Value formats"ISO 4217 code, for example EUR. Missing or not three letters - 400 currency must be a three-letter ISO 4217 currency code such as EUR.
transaction_timestampIsoDateTimesee IsoDateTime in "Value formats"When the payment happened. Default the time of receipt.
payment_typestringYour own payment type label. Default "<CHANNEL> <Direction>", for example "SEPA Outgoing".
origin_countryCountrysee Country in "Value formats"The country the money comes from. Required for SWIFT.
destination_countryCountrysee Country in "Value formats"The country the money goes to. Required for SWIFT.
counterpartystringName of the other party. Required for SEPA. Screened against the sanctions lists.
counterparty_countryCountrysee Country in "Value formats"The other party's country.
counterparty_typestringone of INDIVIDUAL, LEGAL_ENTITY, FINANCIAL_INSTITUTION, GOVERNMENT, MERCHANT, OTHERCase-insensitive.
counterparty_sector_codestringA sector code from the platform's list (active codes only). Leave it out unless you were given the list.
payment_referencestringFree text of the payment (purpose). Rules can compare and group by it.
originatorstringSender's name (wires). Screened.
originator_bicstring
beneficiarystringRecipient's name (wires). Screened.
beneficiary_bicstring
intermediary_bankstring
card_referencestringYour card reference for a card payment.
card_presentboolean or stringtrue or false (or the strings "true" / "false" in any case); anything else, yes, no, 1 and 0 included, answers 400 card_present must be true or false.
instantboolean or stringtrue for a SEPA Instant credit transfer (SCT Inst), which must be executed within ten seconds of the order; default false. Read like card_present (anything else answers 400 instant must be true or false). Only a SEPA payment can be one: true with another channel answers 400 instant is only for SEPA payments.
merchant_namestring
merchant_countryCountrysee Country in "Value formats"
mccstringFour-digit merchant category code.
atm_idstring
atm_locationstring
correlation_idstringYour own trace id, echoed in answers and webhooks. Default a random UUID.
data_classificationDataClassificationone of PRODUCTION, TEST, SCALE_TEST, DEMO; default PRODUCTION; see DataClassification in "Value formats"
executed_during_outageboolean or stringtrue for a payment your system already executed while Underlayer could not be reached and sends afterwards; read like card_present (true, false, "true", "false"; anything else 400 executed_during_outage must be true or false). It then needs transaction_timestamp, the time it was executed (not later than five minutes after it is sent), and your institution's policy SKIP_AND_CHECK_LATER; the answer is 202 POST_EVENT, with no decision. Leave it out, or false, for every payment you send before it moves.
counterparty_accountstringat most 64 charactersThe other party's account: the payee's on an outgoing payment, the payer's on an incoming one. Spaces are taken out and letters upper-cased; 1 to 34 letters and digits. A value shaped as an IBAN must begin with a known country code and pass the IBAN check (ISO 13616, mod 97). Anything else is refused (400 "% must be 1 to 34 letters and digits (spaces are taken out)", "% looks like an IBAN but does not begin with a known country code" or "% looks like an IBAN but its check digits are wrong").
counterparty_relationshipstringone of SELF, RELATED_PARTY, UNRELATEDThe other party's relationship to your customer, as you know it (SELF, the customer's own account elsewhere). Upper-cased on arrival; another value is refused (400 "% must be one of %").
payee_verificationstringone of MATCH, CLOSE_MATCH, NO_MATCH, NOT_POSSIBLEThe Verification of Payee result your system got for this payment (Regulation (EU) 2024/886). Upper-cased on arrival; another value is refused (400 "% must be one of %").
available_balanceAmountsee Amount in "Value formats"The customer's available balance before this payment, in balance_currency. May be zero or negative. Stamped in EUR at the reference rate.
balance_currencyCurrencysee Currency in "Value formats"The currency of available_balance (default the payment's currency); not stored without available_balance.
ip_addressstringThe IP address the customer used, one IPv4 or IPv6 host address (203.0.113.10, 2001:db8::10; no prefix). Never refuses the payment: a malformed one is a warning. Our own IP-to-country lookup (DB-IP Lite) checks ip_country and fills it in when you send none.
ip_countrystringThe IP's country as your own geolocation found it, a code of the platform's country list. Yours wins; when ours disagrees the payment is marked ("IP country sent differs from our lookup"). Never refuses the payment.
device_idstringYour stable identifier of the customer's device (your device SDK's): 8 to 128 letters, digits or . _ : + / = -. Never refuses the payment.
device_timezonestringThe device's IANA time zone, such as Europe/Vilnius. Its UTC offset at the payment's time is stored with it. Never refuses the payment.
device_utc_offsetstringThe device's UTC offset, +hh:mm or -hh:mm, -12:00 to +14:00 in quarter hours. With device_timezone, the zone's own offset is stored and a different one is a warning. Never refuses the payment.
session_idstringYour session id, 1 to 128 printable characters without spaces. Only its SHA-256 (with your institution) is stored, so rules can tell payments of one session apart from others. Never refuses the payment.
initiation_channelstringone of MOBILE_APP, WEB_BROWSER, API, BRANCH, PHONE, OTHERHow the customer initiated the payment. Upper-cased on arrival. Never refuses the payment.
initiationstringone of CUSTOMER_INITIATED, STANDING_ORDER, SCHEDULED, DIRECT_DEBIT, MERCHANT_INITIATED, BULK_UPLOAD, STAFF_INITIATED, OTHERWho or what started the payment. Upper-cased on arrival. Never refuses the payment.
device_osstringone of ANDROID, IOS, WINDOWS, MACOS, LINUX, OTHERThe device's operating system. No user agent is taken. Never refuses the payment.
vpn_or_proxyboolean or stringtrue when your tools saw a VPN, proxy or anonymiser (true, false, "true", "false"). Never refuses the payment.
remote_access_detectedboolean or stringtrue when your tools saw remote-access software on the device during the session. Never refuses the payment.

Example requests (the EXAMPLE- references are refused: put your own in their place):

An outgoing SEPA transfer (example references; never send them with a production key):

{
  "external_transaction_id": "EXAMPLE-TX-0001",
  "source_system": "CORE-BANKING",
  "customer_ref": "EXAMPLE-C-0001",
  "account_number": "EXAMPLE-ACC-0001",
  "channel": "SEPA",
  "direction": "OUTGOING",
  "amount": 1250,
  "currency": "EUR",
  "transaction_timestamp": "2026-09-01T09:15:00Z",
  "counterparty": "Example Supplier GmbH",
  "counterparty_country": "DE",
  "counterparty_type": "LEGAL_ENTITY",
  "origin_country": "LT",
  "destination_country": "DE",
  "payment_reference": "Invoice 2026-118",
  "data_classification": "TEST"
}

The same transfer with the optional session, device and payee fields (see the Session and device data guide):

{
  "external_transaction_id": "EXAMPLE-TX-0002",
  "source_system": "CORE-BANKING",
  "customer_ref": "EXAMPLE-C-0001",
  "channel": "SEPA",
  "direction": "OUTGOING",
  "amount": 1250,
  "currency": "EUR",
  "transaction_timestamp": "2026-09-01T09:15:00Z",
  "counterparty": "Example Supplier GmbH",
  "counterparty_country": "DE",
  "counterparty_account": "DE89370400440532013000",
  "counterparty_relationship": "UNRELATED",
  "payee_verification": "MATCH",
  "available_balance": 4800,
  "balance_currency": "EUR",
  "ip_address": "203.0.113.10",
  "ip_country": "LT",
  "device_id": "dev-7f3a9c21",
  "device_timezone": "Europe/Vilnius",
  "session_id": "sess-5d1e0b",
  "initiation_channel": "MOBILE_APP",
  "initiation": "CUSTOMER_INITIATED",
  "device_os": "IOS",
  "vpn_or_proxy": false,
  "remote_access_detected": false,
  "data_classification": "TEST"
}

Answers:

200 (body PaymentDecision or PostEventPayment). Released (status: RELEASED), or a replayed duplicate (duplicate: true, any status; status: POST_EVENT for a payment sent after an outage).

202 (body PaymentDecision or PostEventPayment). Accepted for screening only. The payment must not be settled: status is not RELEASED. With status: BLOCKED the payment is rejected and the decision is final: act on rejection_action. Or, with status: POST_EVENT, a payment your system already executed during an outage: checked after the event, never decided.

400 (body ErrorBody). The body is not a JSON object, or the database refused the payment with a VALIDATION: message, answered without its prefix. A value of the wrong type is refused this way, with the field's name. The messages are listed on the Errors page, "Payment refusals (400)"; % stands for the field or the value you sent:

Correct the request; do not send it again unchanged.

401: Unauthorized, as 3.8 "Answers several endpoints share" says.

403 (body ErrorBody). The key is limited to allowed addresses and the request came from another one, the institution is not active, or this key may not send this data classification.

409 (body ErrorBody). The request repeats an earlier payment's reference or key but is not the same payment; nothing was stored. this external_transaction_id or Idempotency-Key was already used for a payment with a different %: retry with the same body, or send a new payment with a new external_transaction_id and a new Idempotency-Key (% names the fields that differ: customer_ref, amount, currency, direction, channel; never a value), or the Idempotency-Key and the external_transaction_id name two different payments: retry with the key and the reference you sent the first time.

413: PayloadTooLarge, as 3.8 "Answers several endpoints share" says.

429: TooManyRequests, as 3.8 "Answers several endpoints share" says.

500 (body ErrorBody). The database refused the payment with something other than a validation message. code is the database's error code: for example P0001, no decision policy is in force for your institution. A value of the wrong type is never answered here: it is a 400, and a concurrent repeat waits for the first request and answers its decision. Retry the same request once (it is idempotent); if it fails again with the same code, contact Underlayer.

503: DecisionServiceUnavailable, as 3.8 "Answers several endpoints share" says.

Example answers:

200:

{
  "duplicate": false,
  "transaction_id": "00000000-0000-4000-8000-000000000001",
  "decision_id": "00000000-0000-4000-8000-000000000002",
  "decision_ref": "DEC-2026-000123",
  "status": "RELEASED",
  "rejection_action": null,
  "decision_reason": "No monitoring rule triggered and no restriction requires review",
  "correlation_id": "6f1c2f9e-0000-4000-8000-000000000003",
  "received_at": "2026-09-01T09:15:01.102345+00:00",
  "policy_version": "decision-policy-v1.6",
  "alert_id": null,
  "triggered_rules": [],
  "rules_evaluated": 9,
  "rules_deferred": 0,
  "tm_latency_ms": 41,
  "total_latency_ms": 63,
  "estimated_next_state": "final"
}

200, Released; one session field was malformed and not stored (the payment is never refused for it):

{
  "duplicate": false,
  "transaction_id": "00000000-0000-4000-8000-000000000041",
  "decision_id": "00000000-0000-4000-8000-000000000042",
  "decision_ref": "DEC-2026-000126",
  "status": "RELEASED",
  "rejection_action": null,
  "decision_reason": "No monitoring rule triggered and no restriction requires review",
  "correlation_id": "6f1c2f9e-0000-4000-8000-000000000043",
  "received_at": "2026-09-01T09:30:01.102345+00:00",
  "policy_version": "decision-policy-v1.6",
  "alert_id": null,
  "triggered_rules": [],
  "rules_evaluated": 9,
  "rules_deferred": 0,
  "tm_latency_ms": 40,
  "total_latency_ms": 61,
  "estimated_next_state": "final",
  "warnings": [
    {
      "field": "device_timezone",
      "message": "device_timezone is not an IANA time zone name such as Europe/Vilnius: not stored"
    }
  ]
}

200:

{
  "duplicate": true,
  "transaction_id": "00000000-0000-4000-8000-000000000001",
  "decision_id": "00000000-0000-4000-8000-000000000002",
  "decision_ref": "DEC-2026-000123",
  "status": "HUMAN_REVIEW",
  "rejection_action": null,
  "correlation_id": "6f1c2f9e-0000-4000-8000-000000000003",
  "received_at": "2026-09-01T09:15:01.102345+00:00",
  "policy_version": "decision-policy-v1.6"
}

202, A payment sent with executed_during_outage true:

{
  "duplicate": false,
  "post_event": true,
  "status": "POST_EVENT",
  "transaction_id": "00000000-0000-4000-8000-000000000031",
  "transaction_ref": "RTX-2026-000321",
  "correlation_id": "6f1c2f9e-0000-4000-8000-000000000033",
  "received_at": "2026-09-01T11:40:00.000000+00:00",
  "executed_at": "2026-09-01T09:15:00+00:00",
  "outage_payment_policy": "SKIP_AND_CHECK_LATER",
  "checks": {
    "sanctions_screening": "QUEUED",
    "monitoring_rules_queued": 9
  },
  "message": "Executed by your system before Underlayer checked it: Underlayer does not hold, release or reject it. It is screened and evaluated by your monitoring rules after the event, and any alert goes to your team."
}

202:

{
  "duplicate": false,
  "transaction_id": "00000000-0000-4000-8000-000000000011",
  "decision_id": "00000000-0000-4000-8000-000000000012",
  "decision_ref": "DEC-2026-000124",
  "status": "AI_INVESTIGATION",
  "rejection_action": null,
  "decision_reason": "AI triage AIJ-2026-000045 queued",
  "correlation_id": "6f1c2f9e-0000-4000-8000-000000000013",
  "received_at": "2026-09-01T09:20:00.000000+00:00",
  "policy_version": "decision-policy-v1.6",
  "alert_id": "00000000-0000-4000-8000-000000000014",
  "triggered_rules": [
    "TM-003 v4"
  ],
  "rules_evaluated": 9,
  "rules_deferred": 0,
  "tm_latency_ms": 55,
  "total_latency_ms": null,
  "estimated_next_state": "RELEASED, HUMAN_REVIEW, HOLD or ESCALATED once the AI triage completes"
}

202:

{
  "duplicate": false,
  "transaction_id": "00000000-0000-4000-8000-000000000021",
  "decision_id": "00000000-0000-4000-8000-000000000022",
  "decision_ref": "DEC-2026-000125",
  "status": "HUMAN_REVIEW",
  "rejection_action": null,
  "decision_reason": "Real-time screening could not complete - human review required",
  "correlation_id": "6f1c2f9e-0000-4000-8000-000000000023",
  "received_at": "2026-09-01T09:25:00.000000+00:00",
  "policy_version": "decision-policy-v1.6",
  "alert_id": null,
  "triggered_rules": [],
  "rules_evaluated": 0,
  "rules_deferred": 0,
  "tm_latency_ms": null,
  "total_latency_ms": null,
  "estimated_next_state": "HUMAN_REVIEW",
  "screening_timeout": true
}

Error answers (the body is {"error": ..., "error_code": ...}, with code on a server-side refusal; match the status and error_code, never the words):

Statuserrorerror_codecodeWhen
400Body must be valid JSONBODY_NOT_JSON
400Body must be a JSON objectBODY_NOT_OBJECT
400counterparty is required for SEPA paymentsMISSING_CHANNEL_FIELDThe message % is required for % payments, as the caller receives it
400amount may have at most two decimalsTOO_MANY_DECIMALSThe message % may have at most two decimals, for an amount of 10.123
400origin_country must be a two-letter ISO 3166-1 alpha-2 country code such as LTINVALID_COUNTRYThe message % must be a two-letter ISO 3166-1 alpha-2 country code such as LT, for origin_country XX
400references beginning EXAMPLE- come from the documentation and are refused: send your own referencesEXAMPLE_ROWAn external_transaction_id or customer_ref beginning EXAMPLE-
403API key not allowed from this addressAPI_KEY_ADDRESS_NOT_ALLOWED
403Institution is not activeINSTITUTION_NOT_ACTIVE
403This API key may not submit TEST paymentsCLASSIFICATION_NOT_ALLOWED_FOR_KEY
409this external_transaction_id or Idempotency-Key was already used for a payment with a different amount: retry with the same body, or send a new payment with a new external_transaction_id and a new Idempotency-KeyIDEMPOTENCY_CONFLICT
409the Idempotency-Key and the external_transaction_id name two different payments: retry with the key and the reference you sent the first timeREFERENCE_KEY_MISMATCH
500Decisioning engine errorENGINE_ERRORP0001

3.2. GET /v1/transactions/{id}/decision: Read the current decision for one of your payments

Operation readDecision. Header X-API-Key. Path parameter {id}: The transaction_id or decision_id (a UUID) from the payment's answer, the decision_ref (DEC-<year>-<number>), or your own external_transaction_id. Your own reference is looked up only when it is not a UUID; when two of your payments from different source systems share it, the answer is 409: use the transaction id or the decision reference.

The authoritative, server-held decision. Poll it after a 202 if you do not use the decision webhook (every few seconds at first, then less often; a person may take hours). Every look-up is your institution's own: a payment of another institution answers 404 and is never read. The answer is never cached (Cache-Control: no-store).

Answers:

200 (body DecisionView or PostEventView; header Cache-Control). The decision, or, for a payment sent after an outage, what it is (status: POST_EVENT, no decision).

401: Unauthorized, as 3.8 "Answers several endpoints share" says.

403 (body ErrorBody). The key is limited to allowed addresses and the request came from another one (or from no address the platform recorded), or the key belongs to an institution that is not active.

404 (body ErrorBody). No decision of your institution has this id or reference.

409 (body ErrorBody). More than one of your payments has this reference (from different source systems).

429: TooManyRequests, as 3.8 "Answers several endpoints share" says.

500 (body ErrorBody). The look-up failed on the server. Retry once; if it fails again, contact Underlayer with the code.

503: ServiceUnavailable, as 3.8 "Answers several endpoints share" says.

Error answers (the body is {"error": ..., "error_code": ...}, with code on a server-side refusal; match the status and error_code, never the words):

Statuserrorerror_codecodeWhen
403API key not allowed from this addressAPI_KEY_ADDRESS_NOT_ALLOWED
403Institution is not activeINSTITUTION_NOT_ACTIVE
404Decision not foundDECISION_NOT_FOUND
409More than one of your payments has this reference: use the transaction id or the decision referenceAMBIGUOUS_REFERENCE
500Lookup failedLOOKUP_FAILED

3.3. POST /v1/cards: Register one of your cards, or update it

Operation registerCard. Header X-API-Key.

Registers a card your institution issued, or updates it, by its card_token (your card processor's token for the card). A card event (POST /v1/card-authorizations) is accepted only for a registered card, so register each card when it is issued, and send its status when you change it (see the Cards guide).

A card belongs to one of your customers (customer_ref, required for a new card): a card never creates a customer, and a card keeps its customer and its data_classification for good. Never send a full card number: a card_token or masked_pan that holds one (13 to 19 digits that pass the Luhn check, with or without spaces or hyphens) is refused and nothing is stored. masked_pan carries at most the first six or eight digits and the last four, the rest masked with *, • or X.

status is ACTIVE, SUSPENDED or TERMINATED; a terminated card stays terminated. A status you set is yours: it is recorded and audited, and Underlayer sends you no webhook for it. A status Underlayer sets (a rule suspends or terminates the card; a person or an AI closure reinstates it) is sent to your webhook (cardStatusChanged). Making active a card that a monitoring alert still open suspended is your decision: it is done, and the answer warns you (OPEN_ALERT_SUSPENDED_CARD).

The same card_token with the same values changes nothing and answers changed: false, so no Idempotency-Key is needed. A card_token or customer_ref beginning EXAMPLE- is refused. Card registrations share the customer events' back-pressure, never the decisions' capacity.

Request body: CardRequest.

CardRequest

One of your cards. Only these six fields are taken; any other is refused.

FieldRequiredTypeValuesMeaning
card_tokenyesstringpattern ^[A-Za-z0-9._:+/=-]+$; at least 1 characters; at most 128 charactersYour card processor's token for the card; never the card number. The same token updates the same card.
customer_refstringRequired for a new card: your reference of the customer it belongs to. A card keeps its customer.
masked_panstringat most 32 charactersAt most the first six or eight digits and the last four, the rest masked with *, • or X, for example 411111******1111. A full card number is refused.
card_typestringone of PHYSICAL_CARD, VIRTUAL_CARDA new card without it is PHYSICAL_CARD.
statusstringone of ACTIVE, SUSPENDED, TERMINATEDA new card without it is ACTIVE. A terminated card stays terminated.
data_classificationstringone of PRODUCTION, TEST, SCALE_TEST, DEMO; default PRODUCTIONYour key must allow it (403); a production institution takes PRODUCTION only. A card keeps the label it was registered with.

Example requests (the EXAMPLE- references are refused: put your own in their place):

A new virtual card (example references are refused):

{
  "card_token": "EXAMPLE-CARD-0001",
  "customer_ref": "EXAMPLE-CUST-0001",
  "masked_pan": "411111******1111",
  "card_type": "VIRTUAL_CARD",
  "status": "ACTIVE",
  "data_classification": "TEST"
}

You suspended the card in your own system:

{
  "card_token": "EXAMPLE-CARD-0001",
  "status": "SUSPENDED",
  "data_classification": "TEST"
}

Answers:

200 (body CardResult). The card existed: it was updated (changed: true), or nothing differed (changed: false).

201 (body CardResult). The card was registered (created: true).

400 (body ErrorBody). The body is not a JSON object, or the database refused the card with a VALIDATION: message, answered without its prefix. The messages are listed on the Errors page, "Card registration refusals (400)"; % stands for the field or its value:

Correct the request; do not send it again unchanged.

401: Unauthorized, as 3.8 "Answers several endpoints share" says.

403 (body ErrorBody). The key is limited to allowed addresses and the request came from another one, the institution is not active, or this key may not send this data classification.

413: PayloadTooLarge, as 3.8 "Answers several endpoints share" says.

429: TooManyRequests, as 3.8 "Answers several endpoints share" says.

500 (body ErrorBody). The database refused the card with something other than a validation message, a fault on our side; code is its error code. Retry once with the same body: the same card_token never makes a second card. Contact Underlayer with the code if it comes back.

503: EventServiceUnavailable, as 3.8 "Answers several endpoints share" says.

Example answers:

201:

{
  "created": true,
  "changed": true,
  "warnings": [],
  "card": {
    "card_id": "00000000-0000-4000-8000-000000000051",
    "card_token": "tok_7Hf2kQ9",
    "customer_ref": "C-1001",
    "masked_pan": "411111******1111",
    "card_type": "VIRTUAL_CARD",
    "status": "ACTIVE",
    "data_classification": "TEST",
    "updated_at": "2026-10-29T12:40:25.118402+00:00"
  }
}

Error answers (the body is {"error": ..., "error_code": ...}, with code on a server-side refusal; match the status and error_code, never the words):

Statuserrorerror_codecodeWhen
400Body must be valid JSONBODY_NOT_JSON
400Body must be a JSON objectBODY_NOT_OBJECT
400masked_pan holds a full card number: send at most the first six or eight digits and the last four, the rest maskedFULL_PAN
400customer_ref names no customer of this institution: register the customer firstUNKNOWN_CUSTOMER
400references beginning EXAMPLE- come from the documentation and are refused: send your own referencesEXAMPLE_ROWAn EXAMPLE- reference, as in the request examples above
403API key not allowed from this addressAPI_KEY_ADDRESS_NOT_ALLOWED
403Institution is not activeINSTITUTION_NOT_ACTIVE
403This API key may not submit TEST cardsCLASSIFICATION_NOT_ALLOWED_FOR_KEY
500Card registration errorENGINE_ERRORP0001

3.4. POST /v1/card-authorizations: Decide a card or ATM authorisation in real time

Operation authorizeCard. Header X-API-Key. Header Idempotency-Key: required.

Records the card event, evaluates the institution's active real-time card rules and answers APPROVED or DECLINED at once; alerts, card actions (suspend, terminate) and the AI triage follow in the background and the answer never waits for them.

A refund (CARD_REFUND) or a reversal (CARD_REVERSAL) is recorded and evaluated by the same rules, and answered REFUNDED or REVERSED: it is never declined. A reversal names the approved authorisation or withdrawal of the same card it undoes (original_event_ref, the event_ref answered for it); a refund may. What is refunded and reversed against one event never exceeds its amount.

The card must already be registered for your institution under the same data classification (POST /v1/cards, or the card file on the Data imports screen); otherwise the event is refused with unknown card_token. A card a rule suspends or terminates on this event is reported to your webhook (card.suspended, card.terminated; the cardStatusChanged webhook), seconds after the answer.

The Idempotency-Key header is required: a card event is recognised only by it. Without it the event is refused (400) before anything else is read. Send a unique key for each event and the same key when you retry: a repeated key answers the card event's first decision with duplicate: true, and two requests with the same key wait for each other, so a concurrent repeat answers the card event's first decision too. A repeat must be the same event: one whose card_token, event_type, amount or currency differs from the first is refused 409 and nothing is stored.

Currencies, merchant_country and the card codes are upper-cased on arrival and checked before anything is stored (see CardAuthorizationRequest): a value of the wrong type or outside its values is a 400 naming the field. event_type and data_classification are compared exactly as sent. cvv_result or pin_result NO_MATCH declines the event. A card_token beginning EXAMPLE- is refused.

Request body: CardAuthorizationRequest.

CardAuthorizationRequest

Checked before anything is stored. The currencies (currency, billing_currency, card_currency, balance_currency), merchant_country and the card codes (entry_mode, card_presence, card_txn_type, authorization_mode, terminal_capability, three_ds_result, cvv_result, pin_result) are upper-cased on arrival and stored upper-cased: a currency must be three letters (Currency), merchant_country a code of the platform's country list (Country), and a card code one of the values of its enum, the rule builder's values for the field (otherwise 400 "% must be one of %", naming the field and its values). event_type and data_classification are compared exactly as sent: send them in upper case. A card_token beginning EXAMPLE- (in any case) is refused. Fields not listed are ignored.

FieldRequiredTypeValuesMeaning
event_typeyesstringone of CARD_AUTHORIZATION, ATM_WITHDRAWAL, CARD_REFUND, CARD_REVERSALCompared exactly as sent, so card_authorization is refused. A CARD_REFUND is answered REFUNDED and a CARD_REVERSAL REVERSED; neither is ever declined, and the institution's real-time card rules are evaluated on both.
card_tokenyesstringat least 1 charactersThe card's token as Underlayer holds it for your institution and this data classification. Missing or blank - 400 card_token is required. One beginning EXAMPLE- is refused (400).
amountyesAmountsee Amount in "Value formats"The transaction amount in currency, greater than zero, at most two decimals. Missing: 400 amount is required. Zero or negative: 400 amount must be greater than zero. Not a decimal number: 400 amount must be a decimal number such as 125.50 (no exponent, NaN or Infinity).
currencyCurrencysee Currency in "Value formats"ISO 4217 code of the transaction; upper-cased. Left out or empty - EUR.
event_timeIsoDateTimesee IsoDateTime in "Value formats"When the event happened. Default the time of receipt.
billing_amountAmountsee Amount in "Value formats"The amount in the billing currency (what the card is charged), greater than zero. Default amount when the billing currency is the transaction currency, else amount converted at the euro reference rates of the event date (none without a rate). Stored with its EUR value at the reference rate, which the card rule templates compare.
billing_currencyCurrencysee Currency in "Value formats"Upper-cased. Default card_currency, else EUR. A transaction currency other than the billing currency is a foreign-currency transaction.
card_currencyCurrencysee Currency in "Value formats"The card's own currency; upper-cased.
merchant_namestring
merchant_idstring
mccstringFour-digit merchant category code. Default 6011 for an ATM withdrawal; what you send is kept.
merchant_countryCountrysee Country in "Value formats"Upper-cased; must be on the platform's country list.
terminal_idstring
atm_idstring
entry_modestringone of CHIP, MAGSTRIPE, CONTACTLESS, ECOMMERCE, MANUAL, TOKEN, MOTO, UNKNOWNUpper-cased on arrival. CHIP, MAGSTRIPE or CONTACTLESS make the card present; ECOMMERCE, MANUAL, TOKEN or MOTO not present.
card_presencestringone of CARD_PRESENT, CARD_NOT_PRESENT, UNKNOWNUpper-cased on arrival. Default derived from entry_mode; with no entry_mode that says otherwise an ATM withdrawal is CARD_PRESENT, anything else UNKNOWN. What you send is kept.
card_txn_typestringone of POS, ATM, REFUND, CREDIT, ECOMMERCE, QUASI_CASHUpper-cased on arrival. Default REFUND for a refund (any other value is refused for a refund), the original's for a reversal, ATM for an ATM withdrawal, ECOMMERCE for entry_mode ECOMMERCE, else POS. A CREDIT event is money in (stored Incoming, as a refund); a reversal takes the opposite direction of the event it reverses.
authorization_modestringone of ONLINE, OFFLINE; default ONLINEUpper-cased on arrival.
terminal_capabilitystringone of CHIP_AND_PIN, MAGSTRIPE_ONLY, CONTACTLESS, UNKNOWN; default UNKNOWNUpper-cased on arrival.
cvv_resultstringone of MATCH, NO_MATCH, NOT_PROVIDEDUpper-cased on arrival. NO_MATCH declines the event (INVALID_CVV); MATCH and NOT_PROVIDED do not. Any other value, FAIL included, is refused (400 cvv_result must be one of MATCH, NO_MATCH, NOT_PROVIDED).
pin_resultstringone of MATCH, NO_MATCH, NOT_PROVIDEDUpper-cased on arrival. NO_MATCH declines the event (INVALID_PIN); MATCH and NOT_PROVIDED do not. Any other value, FAIL included, is refused (400 pin_result must be one of MATCH, NO_MATCH, NOT_PROVIDED).
three_ds_resultstringone of AUTHENTICATED, NOT_AUTHENTICATED, ATTEMPTED, NOT_APPLICABLEUpper-cased on arrival.
acquirerstring
issuer_responsestring
available_balanceAmountsee Amount in "Value formats"The card's available balance at authorisation, in balance_currency. May be zero or negative (-12.50). The balance rule templates compare it in EUR at the reference rate of the event's date.
balance_currencyCurrencysee Currency in "Value formats"The currency of available_balance (ISO 4217); upper-cased. Default card_currency. Not stored without available_balance.
correlation_idstringDefault a random UUID.
original_event_refstringThe event_ref answered for an approved authorisation or withdrawal of the same card that this refund or reversal undoes. Required for a CARD_REVERSAL, optional for a CARD_REFUND. Same currency, not dated before it; what is refunded and reversed against one event never exceeds its amount. Fields left out (merchant, terminal, entry_mode, card_presence, authorization_mode, terminal_capability, card_currency, billing_currency; for a reversal card_txn_type) are taken from it. Without billing_amount the billing amount is the original's in proportion to the amount, when the billing currency is the original's.
data_classificationstringdefault PRODUCTIONPRODUCTION, TEST, SCALE_TEST or DEMO, allowed by your key; compared exactly as sent. The card must have the same classification.

Example requests (the EXAMPLE- references are refused: put your own in their place):

An e-commerce card payment (example references; an EXAMPLE- card token is refused):

{
  "event_type": "CARD_AUTHORIZATION",
  "card_token": "EXAMPLE-CARD-0001",
  "amount": 49.9,
  "currency": "EUR",
  "event_time": "2026-09-02T18:04:11Z",
  "merchant_name": "Example Shop UAB",
  "merchant_id": "EXAMPLE-MERCHANT-01",
  "mcc": "5732",
  "merchant_country": "LT",
  "entry_mode": "ECOMMERCE",
  "three_ds_result": "AUTHENTICATED",
  "data_classification": "TEST"
}

A reversal of an approved authorisation (original_event_ref is the event_ref answered for it):

{
  "event_type": "CARD_REVERSAL",
  "card_token": "EXAMPLE-CARD-0001",
  "amount": 49.9,
  "currency": "EUR",
  "original_event_ref": "CAE-2026-000321",
  "data_classification": "TEST"
}

Answers:

200 (body CardAuthorizationResult). The decision (APPROVED or DECLINED; REFUNDED or REVERSED for a refund or reversal), or a replayed duplicate (duplicate: true).

400 (body ErrorBody). The body is not a JSON object, or the database refused the event with a VALIDATION: message, answered without its prefix. A missing Idempotency-Key and a value of the wrong type are refused this way. The messages are listed on the Errors page, "Card refusals (400)"; % stands for the field or its values:

Correct the request; do not send it again unchanged.

401: Unauthorized, as 3.8 "Answers several endpoints share" says.

403 (body ErrorBody). The key is limited to allowed addresses and the request came from another one, the institution is not active, or this key may not send this data classification.

409 (body ErrorBody). The request repeats an earlier card event's Idempotency-Key but is not the same event; nothing was stored. this Idempotency-Key was already used for a card event with a different %: retry with the same body, or send a new event with a new Idempotency-Key (% names the fields that differ: card_token, event_type, amount, currency; never a value).

413: PayloadTooLarge, as 3.8 "Answers several endpoints share" says.

429: TooManyRequests, as 3.8 "Answers several endpoints share" says.

500 (body ErrorBody). The database refused the event with something other than a validation message, a fault on our side; code is its error code. A value of the wrong type is never answered here (it is a 400), and neither is a concurrent request with the same Idempotency-Key (it waits for the first). Retry once with the same Idempotency-Key; contact Underlayer with the code if it comes back.

503: DecisionServiceUnavailable, as 3.8 "Answers several endpoints share" says.

Example answers:

200:

{
  "duplicate": false,
  "event_id": "00000000-0000-4000-8000-000000000031",
  "event_ref": "CAE-2026-000321",
  "authorization_result": "APPROVED",
  "decline_reason": null,
  "flagged": false,
  "rules_fired": [],
  "alerts_generated": 0,
  "correlation_id": "6f1c2f9e-0000-4000-8000-000000000033",
  "latency_ms": 18
}

Error answers (the body is {"error": ..., "error_code": ...}, with code on a server-side refusal; match the status and error_code, never the words):

Statuserrorerror_codecodeWhen
400Body must be valid JSONBODY_NOT_JSON
400Body must be a JSON objectBODY_NOT_OBJECT
400unknown card_tokenUNKNOWN_CARD
400the Idempotency-Key header is required for card events: send a unique key for each event and the same key when you retry itMISSING_IDEMPOTENCY_KEYNo Idempotency-Key header
400cvv_result must be one of MATCH, NO_MATCH, NOT_PROVIDEDINVALID_OPTIONcvv_result FAIL is refused with the message % must be one of %
400references beginning EXAMPLE- come from the documentation and are refused: send your own referencesEXAMPLE_ROWA card_token beginning EXAMPLE-, as in the request example above
403API key not allowed from this addressAPI_KEY_ADDRESS_NOT_ALLOWED
403Institution is not activeINSTITUTION_NOT_ACTIVE
403This API key may not submit TEST eventsCLASSIFICATION_NOT_ALLOWED_FOR_KEY
409this Idempotency-Key was already used for a card event with a different amount: retry with the same body, or send a new event with a new Idempotency-KeyIDEMPOTENCY_CONFLICT
500Authorization engine errorENGINE_ERRORP0001

3.5. POST /v1/customer-events: Record something the customer did that is not a payment

Operation submitCustomerEvent. Header X-API-Key.

Records one customer event: a sign-in, a failed sign-in, a new device, a changed password, two-step sign-in, e-mail, phone, address or limit, an added or changed payee, an added card, or a card payment the customer confirmed in your app (CARD_PAYMENT_CONFIRMATION: a 3-D Secure challenge or an approval in the app, with the session and device data your app saw; a card event itself carries none). Nothing is decided and no rule runs on an event: it keeps the customer's device ledger and is shown on the customer's Digital activity tab (see the Customer events guide).

The customer must already be yours (customer_ref): an event never creates a customer. An event is identified by source_system + external_event_id: sending it again answers the first answer with duplicate: true and stores nothing more, so no Idempotency-Key is needed. A repeat must be the same event: one whose customer_ref or event_type differs from the first is refused 409 and nothing is stored. event_time may be up to 400 days in the past, so you can send your customers' past sign-ins at go-live; it may not be later than the time it is sent.

The session and device fields are read as on a payment: a malformed one is not stored and the answer carries warnings (it never refuses the event), a field left out says nothing. An external_event_id or customer_ref beginning EXAMPLE- is refused. The events take their own back-pressure, separate from payments and card events: a burst of sign-ins never takes the decisions' capacity.

Request body: CustomerEventRequest.

CustomerEventRequest

One customer event. Codes are upper-cased on arrival. A field that belongs to one kind of event only (the payee fields, the card confirmation's fields, card_token, changed_by) is refused on another (400). The session and device fields are those of a payment, read the same way: a malformed one is not stored and named in warnings, never a refusal.

FieldRequiredTypeValuesMeaning
external_event_idyesstringat most 128 charactersYour reference of the event, unique with source_system: a repeat answers the first answer. Not blank; one beginning EXAMPLE- (in any case) is refused.
source_systemstringat most 64 charactersYour system that recorded the event. Default API.
customer_refyesstringYour customer's reference, a customer of your institution already on file (an event never creates one). One beginning EXAMPLE- is refused.
event_typeyesstringone of LOGIN_SUCCESS, LOGIN_FAILED, DEVICE_ADDED, PASSWORD_CHANGED, PASSWORD_RESET, MFA_CHANGED, EMAIL_CHANGED, PHONE_CHANGED, ADDRESS_CHANGED, PAYEE_ADDED, PAYEE_CHANGED, CARD_ADDED, LIMIT_CHANGED, CARD_PAYMENT_CONFIRMATIONWhat happened. Upper-cased on arrival.
event_timeIsoDateTimesee IsoDateTime in "Value formats"When the customer did it. Default the time of receipt. Not later than five minutes after it is sent, and not more than 400 days before.
changed_bystringone of CUSTOMER, STAFF, SYSTEMWho made a change (a change event only: not a sign-in or a card payment confirmation). A change your staff made is not a sign of account takeover.
outcomestringone of APPROVED, DECLINEDCARD_PAYMENT_CONFIRMATION only, and required there: what the customer answered in your app.
confirmation_methodstringone of THREE_DS_CHALLENGE, IN_APP_APPROVAL, OTHERCARD_PAYMENT_CONFIRMATION only. How the customer confirmed the card payment.
merchant_countrystringCARD_PAYMENT_CONFIRMATION only. The merchant's country, a code of the platform's country list.
card_event_refstringCARD_PAYMENT_CONFIRMATION only. The event_ref Underlayer answered for the card event this confirmation belongs to, when it was already sent. One the customer does not hold is not linked (a warning).
card_tokenstringCARD_ADDED and CARD_PAYMENT_CONFIRMATION only. The card on file the event is about. A token of no card of this customer is not linked (a warning); the token itself is not stored.
payee_namestringat most 200 charactersPAYEE_ADDED and PAYEE_CHANGED only. The payee's name as the customer entered it.
payee_accountstringat most 64 charactersPAYEE_ADDED and PAYEE_CHANGED only. The payee's account, read as a payment's counterparty_account (an IBAN must pass its check; anything else is refused, 400).
payee_countrystringPAYEE_ADDED and PAYEE_CHANGED only. The payee's country, a code of the platform's country list.
payee_typestringone of INDIVIDUAL, LEGAL_ENTITY, FINANCIAL_INSTITUTION, GOVERNMENT, MERCHANT, OTHERPAYEE_ADDED and PAYEE_CHANGED only.
ip_addressstringThe IP address of the customer's session, one IPv4 or IPv6 host address. Our own IP-to-country lookup fills ip_country in when you send none. Never refuses the event.
ip_countrystringThe IP's country as your own geolocation found it. Yours wins. Never refuses the event.
device_idstringYour stable identifier of the customer's device: 8 to 128 letters, digits or . _ : + / = -. Keeps the customer's device ledger. Never refuses the event.
device_timezonestringThe device's IANA time zone, such as Europe/Vilnius. Never refuses the event.
device_utc_offsetstringThe device's UTC offset, +hh:mm or -hh:mm, -12:00 to +14:00 in quarter hours (with a time zone they must agree). Never refuses the event.
session_idstringYour session id; only its SHA-256 (with your institution) is stored, so a later payment can be tied to its sign-in. Never refuses the event.
initiation_channelstringone of MOBILE_APP, WEB_BROWSER, API, BRANCH, PHONE, OTHERWhere the event happened. Never refuses the event.
device_osstringone of ANDROID, IOS, WINDOWS, MACOS, LINUX, OTHERThe device's operating system. Never refuses the event.
vpn_or_proxyboolean or stringtrue when your tools saw a VPN, proxy or anonymiser. Never refuses the event.
remote_access_detectedboolean or stringtrue when your tools saw remote-access software on the device. Never refuses the event.
correlation_idstringat most 128 charactersYour own trace id.
data_classificationDataClassificationone of PRODUCTION, TEST, SCALE_TEST, DEMO; default PRODUCTION; see DataClassification in "Value formats"

Example requests (the EXAMPLE- references are refused: put your own in their place):

A sign-in from the customer's phone (example references are refused):

{
  "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"
}

A card payment the customer approved in the app (3-D Secure challenge):

{
  "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",
  "ip_address": "203.0.113.10",
  "device_id": "EXAMPLE-DEVICE-7F3A9C21",
  "data_classification": "TEST"
}

Answers:

200 (body CustomerEventResult). A repeat of a recorded event (duplicate: true): the first answer's references and warnings; nothing more is stored.

202 (body CustomerEventResult). The event was recorded. Nothing is decided; warnings is present only when a session, device or card field was not used.

400 (body ErrorBody). The body is not a JSON object, or the database refused the event with a VALIDATION: message, answered without its prefix. The messages are listed on the Errors page, "Customer event refusals (400)"; % stands for the field or its values:

Correct the request; do not send it again unchanged.

401: Unauthorized, as 3.8 "Answers several endpoints share" says.

403 (body ErrorBody). The key is limited to allowed addresses and the request came from another one, the institution is not active, or this key may not send this data classification.

409 (body ErrorBody). The request repeats an earlier event's source_system and external_event_id but is not the same event; nothing was stored. this source_system and external_event_id were already used for a customer event with a different %: retry with the same body, or send a new event with a new external_event_id (% names the fields that differ: customer_ref, event_type; never a value).

413: PayloadTooLarge, as 3.8 "Answers several endpoints share" says.

429: TooManyRequests, as 3.8 "Answers several endpoints share" says.

500 (body ErrorBody). The database refused the event with something other than a validation message, a fault on our side; code is its error code. Retry once with the same source_system and external_event_id: a repeat never stores a second event. Contact Underlayer with the code if it comes back.

503: EventServiceUnavailable, as 3.8 "Answers several endpoints share" says.

Example answers:

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"
}

Error answers (the body is {"error": ..., "error_code": ...}, with code on a server-side refusal; match the status and error_code, never the words):

Statuserrorerror_codecodeWhen
400Body must be valid JSONBODY_NOT_JSON
400Body must be a JSON objectBODY_NOT_OBJECT
400unknown customer_ref C-0042UNKNOWN_CUSTOMER
400references beginning EXAMPLE- come from the documentation and are refused: send your own referencesEXAMPLE_ROWAn EXAMPLE- reference, as in the request examples above
403API key not allowed from this addressAPI_KEY_ADDRESS_NOT_ALLOWED
403Institution is not activeINSTITUTION_NOT_ACTIVE
403This API key may not submit TEST eventsCLASSIFICATION_NOT_ALLOWED_FOR_KEY
409this source_system and external_event_id were already used for a customer event with a different event_type: retry with the same body, or send a new event with a new external_event_idIDEMPOTENCY_CONFLICT
500Customer event engine errorENGINE_ERRORP0001

3.6. POST /v1/cdd-ingest: Send customer due diligence (CDD / KYC) records

Operation ingestCdd. Header X-API-Key.

Creates or updates customers, their related parties and accounts, one row per customer. Each row is accepted or refused on its own: a refused row never stops the rest (its reason is in errors). An accepted row that changes the customer's CDD record creates a new CDD version; a row that changes nothing is counted as unchanged.

The rows are processed in chunks of 500, each committed on its own. If the import fails half-way (500), the rows of the chunks before are already stored: send the whole file again, the stored rows come back as unchanged.

In a row, a field you leave out keeps the stored value; a field you send empty or null clears it, except full_name, customer_type and risk_rating, which keep the stored value, and country_of_residence, account_opening_date, expected_monthly_turnover, actual_monthly_turnover, pep_determination, pep_status and sanctions_status, which cannot be cleared (the row is refused, ROW_REFUSED, database error 23502).

A row whose customer_ref begins EXAMPLE- is refused (EXAMPLE_ROW): the examples here can never create a customer.

Request body: CddIngestRequest.

CddIngestRequest

FieldRequiredTypeValuesMeaning
source_systemyesstringat least 1 charactersWhich of your systems the data comes from; recorded on every version.
source_filestring or nullA file name to show with the import.
classificationstringone of PRODUCTION, TEST, DEMO; default PRODUCTIONNote the name (not data_classification). Your key must allow it (403); SCALE_TEST is allowed on keys but refused by the CDD intake (400 classification must be PRODUCTION, TEST or DEMO).
rowsyesarray of CddRowat least 1 items; at most 50000 items

CddRow

One customer. A field outside this list (at any depth) refuses the row (UNKNOWN_FIELD). Required for a new customer: full_name, country_of_residence, account_opening_date.

FieldRequiredTypeValuesMeaning
customer_refyesstringYour unique customer reference. One beginning EXAMPLE- is refused (EXAMPLE_ROW).
full_namestring
customer_typestringone of Business, IndividualCase-insensitive. A new customer without it is Business.
country_of_residencestringpattern ^[A-Za-z]{2}$A code of the platform's country list (every ISO 3166-1 alpha-2 code and XK; XX is not), any case, upper-cased on arrival. Any other value rejects the row (INVALID_COUNTRY).
account_opening_dateIsoDatesee IsoDate in "Value formats"
risk_ratingstringone of Low, Medium, High, CriticalCase-insensitive. Any other value rejects the row (INVALID_RISK_RATING). A new customer without it is Not assessed, never Medium; a later row without it keeps the rating in force; a customer the payment feed created (High until its CDD record) becomes Not assessed when that record names none. Every monitoring alert of a Critical customer goes to an L2 case; your institution may send every AI result of a High customer to a person (its own review gate).
pep_determinationstringone of NOT_PEP, PEP, PEP_FAMILY_OR_CLOSE_ASSOCIATE, FORMER_PEP, NOT_ASSESSEDYour own KYC determination of whether the customer is a politically exposed person. Case-insensitive; spaces or hyphens may stand for the underscores. Any other value rejects the row (INVALID_PEP_STATUS). A new customer without it is NOT_ASSESSED, never NOT_PEP. PEP, PEP_FAMILY_OR_CLOSE_ASSOCIATE and FORMER_PEP are treated as a PEP: an EDD signal (your PEP review gate sends the AI's closure of the customer's alerts to a person); it never holds a payment. Each change is a CDD version.
pep_categorystringone of HEAD_OF_STATE_OR_GOVERNMENT, MINISTER, PARLIAMENT, POLITICAL_PARTY, SUPREME_COURT, AUDIT_OR_CENTRAL_BANK, AMBASSADOR, ARMED_FORCES, STATE_OWNED_ENTERPRISE, INTERNATIONAL_ORGANISATION, REGIONAL_OR_LOCAL_GOVERNMENT, OTHEROnly with PEP, PEP_FAMILY_OR_CLOSE_ASSOCIATE or FORMER_PEP: the public function. Case-insensitive. Otherwise, or another value, rejects the row (INVALID_PEP_DETAILS).
pep_countrystringpattern ^[A-Za-z]{2}$Only with PEP, PEP_FAMILY_OR_CLOSE_ASSOCIATE or FORMER_PEP (else INVALID_PEP_DETAILS): the country of the public function, a code of the platform's country list, any case. Any other value rejects the row (INVALID_COUNTRY).
pep_sinceIsoDatesee IsoDate in "Value formats"
pep_untilIsoDatesee IsoDate in "Value formats"
pep_sourcestringat most 100 charactersWhere the determination came from (INVALID_PEP_DETAILS over 100 characters or with NOT_ASSESSED). Left out, the import's source_system is recorded whenever the row states a determination.
pep_statusboolean or stringOlder form of pep_determination: true is PEP, false is NOT_PEP. Sent with pep_determination, the two must agree (else INVALID_PEP_STATUS).
sanctions_statusstringone of CLEAR, POTENTIAL_MATCH, CONFIRMED_MATCH, NOT_SCREENEDThe result of your own sanctions screening. Case-insensitive; spaces or hyphens may stand for the underscores. Any other value rejects the row (INVALID_SANCTIONS_STATUS). A new customer without it is NOT_SCREENED. Only CLEAR clears the customer: the other three are a sanctions concern for the AI review gates and QC sampling.
legal_formstring
registration_numberstring
registration_countrystringpattern ^[A-Za-z]{2}$A code of the platform's country list (every ISO 3166-1 alpha-2 code and XK; XX is not), any case, upper-cased on arrival. Any other value rejects the row (INVALID_COUNTRY).
registration_dateIsoDatesee IsoDate in "Value formats"
tax_numberstring
national_idstring
date_of_birthIsoDatesee IsoDate in "Value formats"
place_of_birthstring
nationalitystringpattern ^[A-Za-z]{2}$A code of the platform's country list (every ISO 3166-1 alpha-2 code and XK; XX is not), any case, upper-cased on arrival. Any other value rejects the row (INVALID_COUNTRY).
id_document_typestring
id_document_numberstring
id_document_countrystringpattern ^[A-Za-z]{2}$A code of the platform's country list (every ISO 3166-1 alpha-2 code and XK; XX is not), any case, upper-cased on arrival. Any other value rejects the row (INVALID_COUNTRY).
id_document_expiryIsoDatesee IsoDate in "Value formats"
addressstring or CddAddress
emailstring
phonestring
websitestring
business_sectorstring
industry_categorystring
industry_subcategorystring
nace_codestringpattern ^[A-Ua-u]([0-9]{2}([.][0-9]{1,2})?)?$
sic_codestring
occupationstring
employerstring
purpose_of_accountstring
source_of_fundsstring
source_of_wealthstring
countries_of_operationarray of stringeach item: pattern ^[A-Za-z]{2}$Codes of the platform's country list, any case; stored once each, upper-cased. Any other code rejects the row (INVALID_COUNTRIES_OF_OPERATION).
number_of_employeesinteger or stringat least 0
annual_turnovernumber or stringat least 0
annual_incomenumber or stringat least 0
expected_monthly_turnovernumber or string
actual_monthly_turnovernumber or string
expected_monthly_tx_countinteger or stringat least 0
max_single_paymentnumber or stringat least 0
relationship_statusstring
relationship_end_dateIsoDatesee IsoDate in "Value formats"
effective_fromIsoDateTimesee IsoDateTime in "Value formats"
notestring
related_partiesarray of CddRelatedPartyWhen present, the complete set of the customer's related parties (the earlier set is replaced).
accountsarray of CddAccountAccounts added or updated (by account_number); an account left out is kept.

CddAddress

FieldRequiredTypeValuesMeaning
linestring
line1string
line2string
streetstring
citystring
postal_codestring
postcodestring
regionstring
statestring
countrystring

CddRelatedParty

FieldRequiredTypeValuesMeaning
full_nameyesstring
roleyesstringone of UBO, SHAREHOLDER, DIRECTOR, REPRESENTATIVE, AUTHORISED_SIGNATORY, OTHER
typestringone of NATURAL, LEGAL; default NATURAL
ownership_pctnumber or stringat least 0; at most 100
date_of_birthIsoDatesee IsoDate in "Value formats"
nationalitystringpattern ^[A-Za-z]{2}$A code of the platform's country list, any case; upper-cased. Any other value rejects the row (INVALID_RELATED_PARTIES).
countrystringpattern ^[A-Za-z]{2}$A code of the platform's country list, any case; upper-cased. Any other value rejects the row (INVALID_RELATED_PARTIES).
national_idstring
registration_numberstring
emailstring
phonestring
addressstring or CddAddress
verified_atIsoDateTimesee IsoDateTime in "Value formats"
sourcestringDefault the import's source_system.

CddAccount

A new account needs currency and opened_date. An account held by another of your customers refuses the row.

FieldRequiredTypeValuesMeaning
account_numberyesstring
currencystringpattern ^[A-Za-z]{3}$An ISO 4217 code, any case; upper-cased. A value that is not a code of the platform's ISO 4217 list (QZQ included) rejects the row (INVALID_ACCOUNTS).
opened_dateIsoDatesee IsoDate in "Value formats"
account_typestringdefault Current
statusstringdefault Active
balancenumber or string

Example requests (the EXAMPLE- references are refused: put your own in their place):

One business customer with its owners and account (example references, refused as EXAMPLE_ROW):

{
  "source_system": "CRM",
  "source_file": "onboarding-2026-09-01.json",
  "classification": "TEST",
  "rows": [
    {
      "customer_ref": "EXAMPLE-C-0003",
      "full_name": "Example Logistics UAB",
      "customer_type": "Business",
      "country_of_residence": "LT",
      "account_opening_date": "2024-03-01",
      "risk_rating": "Medium",
      "pep_determination": "NOT_PEP",
      "registration_number": "304999999",
      "nace_code": "H49.41",
      "countries_of_operation": [
        "LT",
        "LV",
        "PL"
      ],
      "expected_monthly_turnover": 250000,
      "related_parties": [
        {
          "full_name": "Example Owner",
          "role": "UBO",
          "type": "NATURAL",
          "ownership_pct": 60,
          "nationality": "LT"
        }
      ],
      "accounts": [
        {
          "account_number": "EXAMPLE-ACC-0003",
          "currency": "EUR",
          "opened_date": "2024-03-01"
        }
      ]
    }
  ]
}

Answers:

200 (body CddIngestResult). The import ran. Check rejected and errors; an import whose every row was refused still answers 200.

400 (body ErrorBody). The body is not a JSON object, the envelope is incomplete, or the database refused the import before any row was read with a VALIDATION: message, answered without its prefix:

The first answers a classification your key allows but the CDD intake does not take (SCALE_TEST); the second a TEST or DEMO classification sent to a production institution, which takes production data only.

401: Unauthorized, as 3.8 "Answers several endpoints share" says.

403 (body ErrorBody). The key is limited to allowed addresses and the request came from another one, the institution is not active, or this key may not send this classification.

413: PayloadTooLarge, as 3.8 "Answers several endpoints share" says.

429: TooManyRequests, as 3.8 "Answers several endpoints share" says.

500 (body ErrorBody). The import could not start, failed part-way or could not finish; code is the database's error code (at the start, for example 42501: the institution cannot receive a CDD import). After a failure part-way, send the whole file again (rows already stored come back unchanged).

503: ServiceUnavailable, as 3.8 "Answers several endpoints share" says.

Example answers:

200:

{
  "ok": true,
  "batch_ref": "CDD-2026-000042",
  "inserted": 0,
  "updated": 0,
  "unchanged": 0,
  "rejected": 1,
  "errors": [
    {
      "row": 1,
      "customer_ref": "EXAMPLE-C-0003",
      "reason": "EXAMPLE_ROW",
      "detail": "this row comes from the sample file: replace it with your own data"
    }
  ]
}

Error answers (the body is {"error": ..., "error_code": ...}, with code on a server-side refusal; match the status and error_code, never the words):

Statuserrorerror_codecodeWhen
400Body must be valid JSONBODY_NOT_JSON
400Body must be a JSON objectBODY_NOT_OBJECT
400source_system is requiredMISSING_SOURCE_SYSTEM
400rows must be a non-empty arrayMISSING_ROWS
400rows may not exceed 50000 per requestTOO_MANY_ROWS
400classification must be PRODUCTION, TEST or DEMOINVALID_DATA_CLASSIFICATIONclassification SCALE_TEST, which the key allows
403API key not allowed from this addressAPI_KEY_ADDRESS_NOT_ALLOWED
403Institution is not activeINSTITUTION_NOT_ACTIVE
403This API key may not submit TEST customer dataCLASSIFICATION_NOT_ALLOWED_FOR_KEY
500Could not start the CDD importIMPORT_START_FAILED42501
500The CDD import failedIMPORT_FAILED57014
500Could not finish the CDD importIMPORT_FINISH_FAILED

3.7. GET /v1/health: Liveness

Operation health. No API key.

Answers 200 {"status":"ok"} when the application server is up and serving its API routes. It needs no key, reads nothing from the request, makes no database call and is not rate limited. It does not say whether the database is reachable: a payment can still fail while this answers ok.

Answers:

200 (body Health; header Cache-Control). The application server is up.

Example answers:

200:

{
  "status": "ok"
}

3.8. Answers several endpoints share

The answers below are the same on every endpoint that gives them; each endpoint above names the ones it gives.

Unauthorized

Given by POST /v1/transactions, GET /v1/transactions/{id}/decision, POST /v1/cards, POST /v1/card-authorizations, POST /v1/customer-events, POST /v1/cdd-ingest.

401 (body ErrorBody). The key is missing, malformed (not <key_id>.<secret>), unknown, revoked or wrong. Check the key; do not retry the same request.

Statuserrorerror_codecodeWhen
401Missing or malformed API keyAPI_KEY_MISSING
401Invalid or revoked API keyAPI_KEY_INVALID

PayloadTooLarge

Given by POST /v1/transactions, POST /v1/cards, POST /v1/card-authorizations, POST /v1/customer-events, POST /v1/cdd-ingest.

413 (body ErrorBody). The body is larger than the limit (64 000 bytes for payments, card events and customer events, 2 000 000 for a CDD import); a larger Content-Length is refused before the body is read and before the key is checked. Split it.

Statuserrorerror_codecodeWhen
413Request body too largeBODY_TOO_LARGE

TooManyRequests

Given by POST /v1/transactions, GET /v1/transactions/{id}/decision, POST /v1/cards, POST /v1/card-authorizations, POST /v1/customer-events, POST /v1/cdd-ingest.

429 (body ErrorBody; header Retry-After). Rate limited. Wait the seconds in Retry-After, then retry the same request. Limits are per server instance: 3 000 requests a minute per key (bursts of 1 000), 120 a minute per address for keys not yet seen, and 20 failed authentications per address within 10 minutes, after which the address is refused for 10 minutes, the right key included.

Statuserrorerror_codecodeWhen
429Too many failed authentication attempts from this address; retry after the number of seconds in Retry-AfterTOO_MANY_FAILED_AUTHENTICATIONS
429Too many requests for this API key; retry after the number of seconds in Retry-AfterRATE_LIMITED_KEY
429Too many requests from this address; retry after the number of seconds in Retry-AfterRATE_LIMITED_ADDRESS

DecisionServiceUnavailable

Given by POST /v1/transactions, POST /v1/card-authorizations.

503 (body ErrorBody; header Retry-After). The service cannot take the payment or card event now; nothing was stored and your key was not judged. Service busy: every decision this server instance runs at once is taken, your institution already holds its share of them (known once the key is checked), or a request with the same API key and Idempotency-Key is still being decided here. It is answered at once, before anything is stored; wait the seconds in Retry-After (1). Service unavailable: the key could not be checked (the database did not answer three tries); wait Retry-After (5). Service temporarily unavailable: a setting of the service is unusable (no Retry-After). Retry the same request with back-off (for example 1 s, 2 s, 4 s ... up to a minute): a payment's source_system + external_transaction_id (and Idempotency-Key), and a card event's Idempotency-Key, make the retry safe: it never creates a second payment or card event (what a repeat answers is in the Idempotency and retries guide).

Statuserrorerror_codecodeWhen
503Service busySERVICE_BUSY
503Service unavailableSERVICE_UNAVAILABLE
503Service temporarily unavailableSERVICE_SETTINGS_UNUSABLE

ServiceUnavailable

Given by GET /v1/transactions/{id}/decision, POST /v1/cdd-ingest.

503 (body ErrorBody; header Retry-After). The service cannot take the request now; your key was not judged. Service unavailable: the key could not be checked (the database did not answer three tries); wait the seconds in Retry-After (5). Service temporarily unavailable: the service's rate-limit settings are unusable (no Retry-After). Retry with back-off (for example 1 s, 2 s, 4 s ... up to a minute); a retry with the same request is safe.

Statuserrorerror_codecodeWhen
503Service unavailableSERVICE_UNAVAILABLE
503Service temporarily unavailableSERVICE_SETTINGS_UNUSABLE

EventServiceUnavailable

Given by POST /v1/cards, POST /v1/customer-events.

503 (body ErrorBody; header Retry-After). The service cannot take the customer event or the card registration now; nothing was stored and your key was not judged. Service busy: every customer event and card registration this server instance records at once is taken (a pool of their own, never a payment's or a card event's), or your institution already holds its share of them (known once the key is checked). It is answered at once, before anything is stored; wait the seconds in Retry-After (1). Service unavailable: the key could not be checked (the database did not answer three tries); wait Retry-After (5). Service temporarily unavailable: a setting of the service is unusable (no Retry-After). Retry the same request with back-off: a customer event's source_system + external_event_id never make a second event, and a card's card_token never makes a second card.

Statuserrorerror_codecodeWhen
503Service busySERVICE_BUSY
503Service unavailableSERVICE_UNAVAILABLE
503Service temporarily unavailableSERVICE_SETTINGS_UNUSABLE

3.9. The answer objects

The fields of the success answers above. Ignore a field you do not know: new ones are added within v1.

PaymentDecision

The answer to a payment. A duplicate replay carries only duplicate, transaction_id, decision_id, decision_ref, status, rejection_action, correlation_id, received_at, policy_version and, when the first request had any, warnings.

FieldRequiredTypeValuesMeaning
duplicateyesbooleantrue when this payment had already been received.
transaction_idstringformat uuid
decision_idyesstringformat uuid
decision_refyesstringDEC-<year>-<number>; quote it to the institution's analysts.
statusyesDecisionStatusone of RECEIVED, SCREENING, RELEASED, HOLD, AI_INVESTIGATION, HUMAN_REVIEW, BLOCKED, ESCALATED, FAILED, EXPIRED; see DecisionStatus in "Value formats"
rejection_actionRejectionActionone of REJECT, FREEZE; see RejectionAction in "Value formats"
decision_reasonstring or nullWhy the decision is in this status, in fixed words of the engine.
correlation_idstring
received_atstringformat date-time
policy_versionstringThe label of your institution's decision policy that applies to this payment, as the policy was named when it was put in force (for example decision-policy-v1.6; a policy changed later may carry a note after its label). Free text: show or log it, never parse it.
alert_idstring or nullformat uuidThe alert a rule hit raised, if any.
triggered_rulesarray of stringThe monitoring rule versions that fired.
rules_evaluatedinteger
rules_deferredintegerRules evaluated later by batch monitoring, not in real time: rules that need a longer history than the real-time check reads. On a payment already RELEASED (or otherwise final) what they find is an alert for your team; it never changes the payment's decision.
tm_latency_msinteger or null
total_latency_msinteger or nullSet once the decision is final.
estimated_next_statestringWhat can happen next, in words.
screening_timeoutbooleanPresent and true when screening did not finish within its budget or failed; the payment is held for a person (with status SCREENING when the server had no capacity left to hold it at once: the scheduled sweep holds it within minutes). Never settle it until its decision is RELEASED: it is screened again in the background and released if nothing is found.
warningsarray of ContextWarningPresent only when a session or device field was malformed and not stored: which field and why, in fixed words that never quote your value. The payment is decided as if the field had not been sent.

ContextWarning

FieldRequiredTypeValuesMeaning
fieldyesstringone of ip_address, ip_country, device_id, device_timezone, device_utc_offset, session_id, initiation_channel, initiation, device_os, vpn_or_proxy, remote_access_detected
messageyesstringOur own words, ending ': not stored' (or, for an offset that disagrees with the time zone, saying the zone's own offset is stored). Listed on the Errors page, 'Session and device warnings'.

PostEventPayment

The answer to a payment sent with executed_during_outage true, and to its repeat. It has no decision: nothing holds, releases or rejects it. It is screened and evaluated by your monitoring rules after the event; any alert goes to your team. A repeat carries duplicate, post_event, status, transaction_id, transaction_ref, correlation_id, received_at, executed_at and, when the first request had any, warnings.

FieldRequiredTypeValuesMeaning
duplicateyesboolean
post_eventyesbooleanalways true
statusyesstringalways POST_EVENTNot a decision status: the payment is checked after the event, never decided.
transaction_idyesstringformat uuid
transaction_refstringRTX-<year>-<number>.
correlation_idstring
received_atstringformat date-time
executed_atstringformat date-timeThe time your system executed it (transaction_timestamp).
outage_payment_policystringone of SKIP_AND_CHECK_LATERYour institution's policy it was accepted under.
checksobjectWhat was queued: sanctions_screening QUEUED, and monitoring_rules_queued, the number of your rules it is evaluated by after the event (batch-only rules read it in their nightly run).
messagestringThe same in words.
warningsarray of ContextWarningPresent only when a session or device field was malformed and not stored: which field and why, in fixed words that never quote your value. The payment is decided as if the field had not been sent.

DecisionView

FieldRequiredTypeValuesMeaning
decision_idstringformat uuid
decision_refstring
transaction_idstringformat uuid
statusDecisionStatusone of RECEIVED, SCREENING, RELEASED, HOLD, AI_INVESTIGATION, HUMAN_REVIEW, BLOCKED, ESCALATED, FAILED, EXPIRED; see DecisionStatus in "Value formats"
rejection_actionRejectionActionone of REJECT, FREEZE; see RejectionAction in "Value formats"
freeze_lifted_atstring or nullformat date-timeWhen the freeze of a payment rejected with FREEZE was lifted (every sanctions alert of the payment cleared as a false positive; rejection_action is then REJECT and decision.freeze_lifted was sent). null otherwise.
decision_reasonstring or null
channelstring or nullSEPA, SWIFT, CARD or ATM, as received.
directionstring or nullINCOMING or OUTGOING, as received.
instantbooleantrue when the payment was sent as an instant transfer (instant true).
correlation_idstring
triggered_rulesarray of string
ai_decisionstring or nullone of LOW_RISK, UNCERTAIN, HIGH_RISK, AI_FAILURE, AI_TIMEOUT, AI_CANCELLED, AI_INVALID_RESULT, AI_MAX_RETRIES_EXCEEDEDThe AI triage's recommendation, as a risk view. Never a decision by itself.
ai_confidenceinteger or null0..100.
mandatory_reviewbooleantrue when a person must decide; such a payment is never released automatically.
mandatory_review_reasonsarray of string
policy_versionstringThe label of your institution's decision policy that applies to this payment (see PaymentDecision). Free text: never parse it.
decision_engine_versionstring
received_atstringformat date-time
held_atstring or nullformat date-time
ai_started_atstring or nullformat date-time
ai_completed_atstring or nullformat date-time
decided_atstring or nullformat date-time
released_atstring or nullformat date-time
expires_atstring or nullformat date-timeWhen a hold expires under your decision policy (the payment then goes to a person, EXPIRED then HUMAN_REVIEW). It is set from the policy's hold period when the payment is received, whatever its status, and acts only while the payment is HOLD or HUMAN_REVIEW and no open case holds it: on any other status ignore it.
tm_latency_msinteger or null
total_latency_msinteger or null

PostEventView

The look-up of a payment sent after an outage; it has no decision.

FieldRequiredTypeValuesMeaning
post_eventbooleanalways true
statusstringalways POST_EVENT
transaction_idstringformat uuid
transaction_refstring
executed_atstringformat date-time
received_atstringformat date-time

CardResult

FieldRequiredTypeValuesMeaning
createdyesbooleantrue when this call registered the card.
changedyesbooleantrue when this call created or changed the card; false for a repeat.
cardyesCard
warningsyesarray of CardWarning

Card

FieldRequiredTypeValuesMeaning
card_idyesstringformat uuidUnderlayer's id of the card.
card_tokenyesstring
customer_refyesstring
masked_panstring or null
card_typeyesstringone of PHYSICAL_CARD, VIRTUAL_CARD
statusyesstringone of ACTIVE, SUSPENDED, TERMINATED
data_classificationyesstringone of PRODUCTION, TEST, SCALE_TEST, DEMO
updated_atyesstringformat date-time

CardWarning

FieldRequiredTypeValuesMeaning
codeyesstringone of OPEN_ALERT_SUSPENDED_CARD
messageyesstringOur own words. Listed on the Errors page, 'Card registration warnings'.

CardAuthorizationResult

A duplicate replay carries only duplicate, event_id, event_ref, authorization_result, decline_reason and correlation_id.

FieldRequiredTypeValuesMeaning
duplicateyesboolean
event_idyesstringformat uuid
event_refyesstringCAE-<year>-<number>.
authorization_resultyesstringone of APPROVED, DECLINED, REFUNDED, REVERSEDREFUNDED for a refund and REVERSED for a reversal; neither is ever declined.
decline_reasonstring or nullone of CARD_TERMINATED, CARD_SUSPENDED, INVALID_CVV, INVALID_PIN, RULE_DECLINE, RULE_EVALUATION_ERRORRULE_EVALUATION_ERROR: a real-time card rule could not be evaluated and your decision policy declines the event for it (card_rule_error_action DECLINE, or no decision policy in force). The order: a refund or a reversal is never declined; then the card's status, cvv_result, pin_result, a REJECT rule; then a rule error.
flaggedbooleanAlways false: no card rule approves an event and flags it. Read rules_fired and alerts_generated.
rules_firedarray of RuleFired
alerts_generatedintegerThe alerts the rules that fired raised for the event. The alert raised for a rule that could not be evaluated is not counted here; rule_errors names that rule.
rule_errorsarray of objectEvery real-time card rule that could not be evaluated for the event, or that fired but whose alert could not be recorded. Empty when every rule ran. The event is answered all the same, and an alert for a person is raised on it.
rule_error_handlingstring or nullone of APPROVE_AND_ALERT, DECLINE, ALERT_ONLYWhat a rule error did to the event; null when rule_errors is empty. APPROVE_AND_ALERT: your decision policy does not decline the event for it (the platform's default). DECLINE: your decision policy declines an approved authorisation or withdrawal for it (RULE_EVALUATION_ERROR), or no decision policy is in force. ALERT_ONLY: a refund or a reversal, never declined. A person reviews the event in every case.
correlation_idstring
latency_msinteger

RuleFired

FieldRequiredTypeValuesMeaning
rule_codestring
version_idstringformat uuid
transaction_actionstringALERT_ONLY or REJECT. REJECT declines the event (RULE_DECLINE).
card_actionstring or nullNONE, SUSPEND_CARD or TERMINATE_CARD; carried out in the background.

CustomerEventResult

FieldRequiredTypeValuesMeaning
duplicateyesbooleantrue for a repeat of a recorded event: the first answer, nothing more stored.
event_idyesstringformat uuid
event_refyesstringCEV-<year>-<number>.
event_typeyesstring
received_atyesstringformat date-timeWhen Underlayer recorded the event (the first time, for a repeat).
warningsarray of CustomerEventWarningPresent only when a session, device or card field was not used; a field left out says nothing.

CustomerEventWarning

FieldRequiredTypeValuesMeaning
fieldyesstringone of ip_address, ip_country, device_id, device_timezone, device_utc_offset, session_id, initiation_channel, device_os, vpn_or_proxy, remote_access_detected, card_token, card_event_ref
messageyesstringOur own words. Listed on the Errors page, 'Customer event warnings'.

CddIngestResult

FieldRequiredTypeValuesMeaning
okyesbooleanalways true
batch_refyesstring or nullCDD-<year>-<number>; the import as shown on the CDD import screen.
insertedyesintegerNew customers.
updatedyesintegerExisting customers whose CDD record changed (a new CDD version).
unchangedyesintegerRows that changed nothing.
rejectedyesintegerRows refused.
errorsyesarray of CddRowErrorat most 100 itemsThe first 100 refused rows (rejected counts them all).

CddRowError

FieldRequiredTypeValuesMeaning
rowinteger1-based position of the row in the request.
customer_refstring or null
reasonstringone of UNKNOWN_FIELD, MISSING_CUSTOMER_REF, EXAMPLE_ROW, MISSING_NAME, MISSING_COUNTRY_OF_RESIDENCE, MISSING_ACCOUNT_OPENING_DATE, INVALID_CUSTOMER_TYPE, INVALID_RISK_RATING, INVALID_SANCTIONS_STATUS, INVALID_PEP_STATUS, INVALID_PEP_DETAILS, INVALID_COUNTRY, INVALID_VALUE, INVALID_NACE_CODE, INVALID_COUNTRIES_OF_OPERATION, INVALID_RELATED_PARTIES, INVALID_ACCOUNTS, ACCOUNT_BELONGS_TO_ANOTHER_CUSTOMER, NEW_ACCOUNT_NEEDS_OPENED_DATE, NEW_ACCOUNT_NEEDS_CURRENCY, ROW_REFUSEDSee the Errors page, "CDD row reasons".
detailstring or nullWhich field and what is wrong, in fixed words; never the value you sent (except an account number you sent).

Health

FieldRequiredTypeValuesMeaning
statusyesstringalways ok

3.10. Value formats

FormatTypeValuesRule
IsoDatestringpattern ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$A calendar date written YYYY-MM-DD. Other shapes are refused (01.09.2026 would otherwise be read as 9 January).
IsoDateTimestringpattern ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(T([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9]([.][0-9]{1,6})?)?(Z|[+-](0[0-9]|1[0-4]):[0-5][0-9])?)?$A date YYYY-MM-DD or a date-time YYYY-MM-DDThh:mm[:ss[.ffffff]] with an optional zone Z, +hh:mm or -hh:mm. No zone means UTC. Refused: a space instead of T, a lower-case t or z, 24:00, second 60, +0300 or +03, an impossible day.
Amountnumber or stringA JSON number (1250.00), or a string of digits with a dot as the decimal separator ("1250.00"), at most 40 characters. At most two decimals (more are refused, never rounded); below 1000000000000 (the largest is 999999999999.99). In a string: no exponent, comma, NaN or Infinity. Greater than zero, except where the field may be zero or negative (available_balance). Anything else is refused with a 400 naming the field: "% is required", "% must be a number", "% must be a decimal number such as 125.50 (no exponent, NaN or Infinity)", "% may have at most two decimals", "% exceeds the largest supported amount, 999999999999.99" or "% must be greater than zero".
Currencystringpattern ^[A-Za-z]{3}$An ISO 4217 code such as EUR: three letters, upper-cased on arrival, that name a currency on the platform's ISO 4217 list. Anything else, three letters that name no currency (QZQ) included, is refused with a 400, "% must be a three-letter ISO 4217 currency code such as EUR".
Countrystringpattern ^[A-Za-z]{2}$An ISO 3166-1 alpha-2 code such as LT, upper-cased on arrival. It must be on the platform's country list (every ISO 3166-1 alpha-2 code and XK; XX is not), otherwise the answer is a 400, "% must be a two-letter ISO 3166-1 alpha-2 country code such as LT". An empty value counts as absent.
DataClassificationstringone of PRODUCTION, TEST, SCALE_TEST, DEMO; default PRODUCTIONWhat kind of data this is. Your key must allow it (403 otherwise), and a production institution takes PRODUCTION only (400 CLASSIFICATION_NOT_ACCEPTED). Only PRODUCTION data is triaged by the AI. TEST and DEMO, which only a sandbox takes, call no AI model, so a held payment goes to a person (HUMAN_REVIEW) and never waits in AI_INVESTIGATION; SCALE_TEST has no AI triage.
DecisionStatusstringone of RECEIVED, SCREENING, RELEASED, HOLD, AI_INVESTIGATION, HUMAN_REVIEW, BLOCKED, ESCALATED, FAILED, EXPIREDOnly RELEASED means the payment may settle. RELEASED and BLOCKED are final; every other status changes later. A BLOCKED payment always carries rejection_action, which says what to do with its funds (a rejected payment is never stored without one). RECEIVED: recorded, not yet screened; it normally changes within the same request. SCREENING: being screened; it normally changes within the same request, and when screening did not finish (screening_timeout) the sweep holds it within minutes. HOLD: held until what stopped it (a rule, a screening match, a country restriction) is decided. AI_INVESTIGATION: the AI triage is queued; your decision policy acts on its recommendation, or a person decides. HUMAN_REVIEW: with a person. ESCALATED: taken into a case; a person decides it there. EXPIRED: the hold period of your decision policy ran out while a person had the payment; it stays with a person. FAILED: no path sets it today; treat it as not released and quote the decision_ref to Underlayer.
RejectionActionstring or nullone of REJECT, FREEZEWhat to do with the funds of a rejected payment, set when status is BLOCKED and only then (null otherwise): a BLOCKED payment always has one. REJECT: do not execute it; money that came in goes back under your own procedure. FREEZE: the payment had a sanctions match that was confirmed, or not yet cleared as a false positive, when it was rejected; do not execute it and do not return the money: keep the funds where they are and handle them under your sanctions procedure, which reports a confirmed match. A FREEZE becomes REJECT once every sanctions alert of the payment is cleared as a false positive: the payment stays BLOCKED, decision.freeze_lifted is sent once and the decision's freeze_lifted_at says when.

4. Statuses, idempotency, retries, 429 and 503

What a payment's answer means

Within a budget of 12 seconds the payment is evaluated by your institution's own monitoring rules and screened against the sanctions lists. A customer's PEP status is your own KYC determination, sent with the customer's record (Customer data). Then:

AnswerMeaningWhat your system does
200, status: RELEASEDNothing found.Settle.
202, status: BLOCKEDRejected, and final (a monitoring rule that rejects payments, or a country restriction). rejection_action says what to do with the funds.Do not settle. REJECT: reject the payment, and return money that came in under your own procedure. FREEZE: a sanctions match was confirmed or not yet cleared; keep the funds where they are, return nothing and handle them under your sanctions procedure.
202, any other statusYour institution's monitoring is still deciding: a person, or your decision policy on the AI triage's recommendation.Do not settle. Wait for the decision webhook or poll the decision: it ends RELEASED or BLOCKED.
200, duplicate: trueA repeat of a payment already received: its current decision.Read status.
409The reference or the key of an earlier payment with another customer, amount, currency, direction or channel, or a key and a reference of two different payments. Nothing was stored.Retry with the first body; a new payment needs a new reference and key (Idempotency and retries).
202, status: POST_EVENTA payment sent after an outage (Payments sent after an outage).Nothing: it is checked after the event.
4xxRefused; nothing stored.Correct the request (Errors, section 2).

If screening does not finish in time the payment is held for a person (HUMAN_REVIEW, screening_timeout: true): it is never released unscreened. It is screened again in the background within minutes, and released if nothing is found.

Every status a decision can have, and what it means for the money:

StatusMeaningThe money
RELEASEDNothing stops it. Final.Settle.
BLOCKEDRejected. Final. It always carries rejection_action (REJECT or FREEZE).As rejection_action says.
RECEIVEDRecorded, not yet screened; it normally changes within the same request.Hold.
SCREENINGBeing screened; it normally changes within the same request. When screening did not finish (screening_timeout), the scheduled sweep holds it within minutes.Hold.
HOLDHeld until what stopped it (a rule, a screening match, a country restriction) is decided.Hold.
AI_INVESTIGATIONThe AI triage is queued; your decision policy acts on its recommendation, or a person decides.Hold.
HUMAN_REVIEWWith a person.Hold.
ESCALATEDTaken into a case; a person decides it there.Hold.
EXPIREDThe hold period of your decision policy ran out while a person had it; it stays with a person.Hold.
FAILEDNo path sets it today.Hold, and quote the decision_ref to Underlayer.

A status this table does not list is treated the same way: not released, hold the money (Versioning and changelog).

What a card event's answer means

event_typeAnswerCan be declined?
CARD_AUTHORIZATIONAPPROVED or DECLINEDYes: the card's status, cvv_result or pin_result NO_MATCH, a rule that rejects, or a rule error under your decision policy.
ATM_WITHDRAWALAPPROVED or DECLINEDYes, as an authorisation. Without card_presence it is card-present; without mcc it is 6011.
CARD_REFUNDREFUNDEDNever. original_event_ref optional.
CARD_REVERSALREVERSEDNever. original_event_ref required.

A decline is a 200 answer, not an error: its reason is in decline_reason (Errors, "Card declines").

Idempotency

A network can fail after the request reached us and before the answer reached you. Every write of this API can be sent again safely, as long as you send it the same way.

EndpointWhat makes two requests the sameA repeat answers
POST /v1/transactionsThe same source_system and external_transaction_id, or the same Idempotency-Key, within your institution. The key is optional.200, duplicate: true, the payment's current decision (its status may have moved on). Nothing new is stored. A repeat must carry the first request's customer_ref, amount, currency, direction, channel and instant (left out is false), or it is refused 409.
POST /v1/card-authorizationsThe same Idempotency-Key within your institution, only. The key is required (400 without it), at most 255 characters.200, duplicate: true, the card event's first decision. A repeat must carry the first request's card_token, event_type, amount and currency, or it is refused 409.
POST /v1/customer-eventsThe same source_system and external_event_id within your institution. No key is needed.200, duplicate: true, the first answer. A repeat must carry the first request's customer_ref and event_type, or it is refused 409.
POST /v1/cdd-ingestRows are matched by customer_ref, accounts by account_number.A row that changes nothing counts as unchanged and makes no new CDD version.
GET /v1/transactions/{id}/decisionRead only.The current decision.

A repeat is the same request sent again. Amounts are compared as numbers (140 and 140.00 are one amount) and codes as we store them (outgoing and OUTGOING are one direction). A request that reuses a key or a reference with another body is refused 409 with error_code IDEMPOTENCY_CONFLICT, and its error names the fields that differ, never a value; nothing is stored. A payment whose Idempotency-Key belongs to one of your payments and whose external_transaction_id to another is refused 409 with REFERENCE_KEY_MISMATCH. A 409 is never retried unchanged: a retry sends the first body; a new payment or event needs a new reference and a new key.

Two requests that are the same and arrive at the same moment wait for each other: the second answers like a repeat. When both reach the same server instance while the first is still being decided, the second is answered at once 503 Service busy with Retry-After: 1; its retry is then answered like any repeat.

When to retry

AnswerRetry?
200, 202No: it is the answer.
400, 401, 403, 404, 405, 409, 413Never unchanged: correct the request.
429Yes, after the seconds in Retry-After.
500Once, the same request. If the same code comes back, contact Underlayer.
503Yes, after Retry-After (1 s for Service busy, 5 s for Service unavailable), with back-off. A 503 without Retry-After (SERVICE_SETTINGS_UNUSABLE): with back-off from 1 s.
A bare 502 or 504, or a 5xx answer that is not JSONYes, with back-off: it comes from our hosting provider.

The status decides first: a 4xx of the rows above is never retried unchanged, even when its body is not JSON. Back off by doubling the wait (1 s, 2 s, 4 s ... up to a minute), never less than Retry-After. Always retry with the same body, the same external_transaction_id and the same Idempotency-Key: a retry with a new reference is a new payment.

When the first answer never arrived (a timeout, a dropped connection), the retry can be the request's first answer you see: 200 with duplicate: true for a payment, a card event or a customer event, 200 with changed: false for a card. That is the result of your request, not a failure: read it as the first answer.

Rate limits (429)

LimitWhen it appliesAnswer
Failed authentications20 failed authentications from one address within 10 minutes. The address is refused for 10 minutes on every client endpoint, a right key included.429 Too many failed authentication attempts from this address; retry after the number of seconds in Retry-After
Per API keyMore than 3 000 requests a minute on one key, with bursts of 1 000, per server instance.429 Too many requests for this API key; retry after the number of seconds in Retry-After
Per address, unknown keyMore than 120 requests a minute from one address with a key the server instance has not yet seen authenticate.429 Too many requests from this address; retry after the number of seconds in Retry-After

The client address is the one our hosting provider saw. An IPv6 client is counted by its /64 network. Each server instance keeps its own counters: plan your traffic within the limits above, never above them.

Back-pressure (503) and Retry-After

Each server instance decides a fixed number of payments and card events at once, and one institution at most its share of them. Over that, the next request answers at once:

HTTP/1.1 503 Service Unavailable
Retry-After: 1
Content-Type: application/json

{"error":"Service busy","error_code":"SERVICE_BUSY"}

Nothing was stored. A repeat (the same key and Idempotency-Key) of a request still being decided answers the same. Retry the same request after Retry-After, with back-off: the payment's own reference and the Idempotency-Key make the retry safe (Idempotency and retries).

Customer events (Customer events) have a pool of their own (one institution at most its share of it), so a burst of sign-ins never takes the payments' decisions; over it they answer the same 503 Service busy, and their source_system + external_event_id make the retry safe.

When the API key itself cannot be checked the answer is 503 {"error":"Service unavailable","error_code":"SERVICE_UNAVAILABLE"} with Retry-After: 5; it is not a key error and does not count as a failed authentication.

Body size (413)

A body larger than 64 000 bytes (payments, card events, customer events) or 2 000 000 bytes (CDD) is refused with 413 before it is read and before the key is checked. Split a large CDD file into several requests.

5. Webhooks

A payment that is not released at once is decided later: by a person, or by your decision policy on the AI triage's recommendation. Set your webhook address and its secret on the API and webhooks screen, and every status change of a payment decision is posted to it. A change Underlayer makes to one of your cards is posted to the same address, signed the same way (card.suspended, card.terminated, card.reinstated; Cards). A delivery leaves within seconds of the change, whoever made it: our API's answer, a person on the screens, your decision policy on an AI triage, or a scheduled check. A retry follows the schedule below.

The changes the API's own answer makes are posted too, so a delivery can repeat what the answer already told you. A payment sent in real time is first set to SCREENING, so it gets decision.screening, then one delivery per status the answer reaches: a payment released at once gets decision.screening and decision.released; one held gets decision.hold, followed by decision.human_review when the same answer passes it to a person or decision.blocked when a rule rejects it. Act on each change once, whichever reaches you first, the answer or the delivery: key what you do by the payment's decision_id and the delivery's event type (X-Underlayer-Event), never by its status alone: a decision.freeze_lifted is a new instruction for a payment that stays BLOCKED (below). A repeated delivery is recognised by X-Underlayer-Idempotency-Key. A delivery is queued only while a webhook address is set: a change made while none is set is never sent, so poll the decision for those.

decisionStatusChanged: A payment decision changed status

POST to your webhook address.

Sent to the institution's webhook URL (set on the API and webhooks screen) on every status change of a payment decision after it was received: decision.screening, decision.released, decision.hold, decision.ai_investigation, decision.human_review, decision.blocked, decision.escalated, decision.expired, decision.failed; and decision.freeze_lifted when a rejected payment's freeze is lifted (below). A card's status change has a webhook of its own (cardStatusChanged).

A freeze lifted. A payment rejected with rejection_action FREEZE stays rejected. When every sanctions alert of the payment is later cleared as a false positive, its rejection_action becomes REJECT and decision.freeze_lifted is sent once, with status BLOCKED and rejection_action REJECT: the funds may now be handled as for any rejected payment (money that came in goes back under your own procedure). It is sent only for a payment that was rejected with FREEZE, never twice, and never while another of its sanctions alerts is confirmed or still awaiting a decision. The decision's freeze_lifted_at says when.

Verify every delivery. X-Underlayer-Signature is sha256= and the hexadecimal HMAC-SHA256, keyed with the webhook secret, of <X-Underlayer-Timestamp>.<raw body> (the timestamp in Unix seconds, a dot, the body exactly as received). Refuse a delivery whose signature does not match or whose timestamp is too old. Nothing is sent unsigned: without a secret the delivery is skipped.

Delivery. The webhook URL's host name must resolve to public internet addresses only: a delivery is not sent to a name that resolves to a private, loopback, link-local or other reserved address, and the connection goes to the address that was checked. A redirect is not followed. Answer any 2xx within 10 seconds. Otherwise (a 3xx included) the delivery is retried after 1 minute, 5 minutes, 15 minutes, 1 hour, 4 hours, 12 hours and 24 hours, and marked failed after 8 attempts. A delivery can arrive more than once and out of order: de-duplicate by X-Underlayer-Idempotency-Key and order by occurred_at; when in doubt, read the decision.

HeaderValue
X-Underlayer-Eventdecision.<status in lower case>, or decision.freeze_lifted
X-Underlayer-DeliveryThe delivery's id (the same on every attempt). (format uuid)
X-Underlayer-Idempotency-Key<decision_ref>:<sequence of the status change>, the same on every attempt.
X-Underlayer-TimestampUnix seconds when this attempt was signed.
X-Underlayer-Signaturesha256=<hex HMAC-SHA256(secret, timestamp + '.' + raw body)>

DecisionWebhookEvent

FieldRequiredTypeValuesMeaning
event_typeyesstringdecision.<status in lower case>, or decision.freeze_lifted (a rejected payment's freeze lifted: status BLOCKED, rejection_action REJECT)
delivery_idyesstringformat uuid
attemptyesintegerat least 1
decision_idyesstringformat uuid
decision_refyesstring
transaction_idyesstringformat uuid
statusyesDecisionStatusone of RECEIVED, SCREENING, RELEASED, HOLD, AI_INVESTIGATION, HUMAN_REVIEW, BLOCKED, ESCALATED, FAILED, EXPIRED; see DecisionStatus in "Value formats"
rejection_actionRejectionActionone of REJECT, FREEZE; see RejectionAction in "Value formats"
reasonstring or null
correlation_idstring
occurred_atyesstringformat date-time

Example payload:

{
  "event_type": "decision.released",
  "delivery_id": "00000000-0000-4000-8000-000000000051",
  "attempt": 1,
  "decision_id": "00000000-0000-4000-8000-000000000012",
  "decision_ref": "DEC-2026-000124",
  "transaction_id": "00000000-0000-4000-8000-000000000011",
  "status": "RELEASED",
  "rejection_action": null,
  "reason": "Released by analyst after review",
  "correlation_id": "6f1c2f9e-0000-4000-8000-000000000013",
  "occurred_at": "2026-09-01T10:02:17+00:00"
}

cardStatusChanged: Underlayer changed the status of one of your cards

POST to your webhook address.

Sent to the institution's webhook URL, signed and delivered exactly as decisionStatusChanged (the same secret, headers, retries and verification), each time Underlayer changes the status of one of your cards: card.suspended and card.terminated (a monitoring rule acted on a card event; reason_code RULE) and card.reinstated (the card is active again: PERSON, a person reinstated it; PERSON_CLEARING, a person cleared the last alert that suspended it; AI_CLOSURE, the AI triage closed that alert and your decision policy lets such a closure reinstate a card). Apply the status in your card processor; when in doubt, keep the card suspended and ask your team. A change that changes nothing, and a status you set yourself (POST /v1/cards), send nothing. The payload never carries a card number: the card is named by your card_token.

X-Underlayer-Idempotency-Key is card:<id of the card action>, the same on every attempt. De-duplicate by it and order by occurred_at.

HeaderValue
X-Underlayer-EventThe event type. (one of card.suspended, card.terminated, card.reinstated)
X-Underlayer-DeliveryThe delivery's id (the same on every attempt). (format uuid)
X-Underlayer-Idempotency-Keycard:<id of the card action>, the same on every attempt.
X-Underlayer-TimestampUnix seconds when this attempt was signed.
X-Underlayer-Signaturesha256=<hex HMAC-SHA256(secret, timestamp + '.' + raw body)>

CardWebhookEvent

FieldRequiredTypeValuesMeaning
event_typeyesstringone of card.suspended, card.terminated, card.reinstated
delivery_idyesstringformat uuid
attemptyesintegerat least 1
card_idyesstringformat uuid
card_tokenyesstringYour token of the card.
statusyesstringone of ACTIVE, SUSPENDED, TERMINATEDThe card's new status.
previous_statusyesstringone of ACTIVE, SUSPENDED
actionyesstringone of SUSPEND_CARD, TERMINATE_CARD, UNSUSPEND_CARD
reason_codeyesstringone of RULE, PERSON, PERSON_CLEARING, AI_CLOSURE
rule_codestringThe rule that acted, when a rule did.
alert_refstringThe alert that suspended the card, or whose clearing reinstated it.
card_event_refstringThe card event the rule acted on (the event_ref answered for it).
correlation_idstring
occurred_atyesstringformat date-time

Example payload:

{
  "event_type": "card.suspended",
  "delivery_id": "00000000-0000-4000-8000-000000000061",
  "attempt": 1,
  "card_id": "00000000-0000-4000-8000-000000000051",
  "card_token": "tok_7Hf2kQ9",
  "status": "SUSPENDED",
  "previous_status": "ACTIVE",
  "action": "SUSPEND_CARD",
  "reason_code": "RULE",
  "rule_code": "RR-12",
  "card_event_ref": "CAE-2026-000311",
  "correlation_id": "6f1c2f9e-0000-4000-8000-000000000071",
  "occurred_at": "2026-10-29T12:41:02.530917+00:00"
}

Check the signature of every delivery

  1. Take the raw body exactly as received, before parsing it.
  2. Compute the HMAC-SHA256, keyed with your webhook secret, of <X-Underlayer-Timestamp>.<raw body>.
  3. Compare it, in constant time, with the hexadecimal value after sha256= in X-Underlayer-Signature.
  4. Refuse a delivery whose signature does not match, or whose timestamp is more than five minutes from your clock (older, or later: clocks drift both ways). Each attempt is signed afresh, so a retry is never older than that.

Nothing is sent unsigned: without a secret the delivery is skipped.

Keep the secret in UNDERLAYER_WEBHOOK_SECRET (it is shown once, on the API and webhooks screen, and begins whsec_). Read the raw body before any JSON parser runs: a body parsed and serialised again no longer matches its signature. The two functions below do exactly this, with five minutes either way as the limit.

Node.js:

import { createHmac, timingSafeEqual } from "node:crypto";

/**
 * True only for a delivery Underlayer signed with your webhook secret in the last five minutes.
 * rawBody: the body exactly as received (a Buffer), before any JSON parsing.
 * headers: the request headers with lower-case names (Node's req.headers).
 */
export function verifyUnderlayerWebhook(rawBody, headers, secret, nowSeconds = Math.floor(Date.now() / 1000)) {
  const timestamp = headers["x-underlayer-timestamp"];
  const signature = headers["x-underlayer-signature"];
  if (typeof timestamp !== "string" || !/^[0-9]{1,12}$/.test(timestamp)) return false;
  if (Math.abs(nowSeconds - Number(timestamp)) > 300) return false;
  if (typeof signature !== "string" || !/^sha256=[0-9a-f]{64}$/.test(signature)) return false;
  const expected = createHmac("sha256", Buffer.from(secret, "utf8"))
    .update(timestamp + ".", "utf8")
    .update(rawBody)
    .digest();
  const given = Buffer.from(signature.slice("sha256=".length), "hex");
  return given.length === expected.length && timingSafeEqual(given, expected);
}

Python:

import hashlib
import hmac
import re
import time

def verify_underlayer_webhook(raw_body: bytes, headers, secret: str, now=None) -> bool:
    """True only for a delivery Underlayer signed with your webhook secret in the last five minutes.

    raw_body: the body exactly as received (bytes), before any JSON parsing.
    headers: a case-insensitive mapping of the request headers (Flask's request.headers, Django's request.headers).
    """
    timestamp = headers.get("X-Underlayer-Timestamp") or ""
    signature = headers.get("X-Underlayer-Signature") or ""
    if not re.fullmatch(r"[0-9]{1,12}", timestamp):
        return False
    now = int(time.time()) if now is None else now
    if abs(now - int(timestamp)) > 300:
        return False
    if not re.fullmatch(r"sha256=[0-9a-f]{64}", signature):
        return False
    expected = hmac.new(secret.encode("utf-8"), timestamp.encode("ascii") + b"." + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature[len("sha256="):])

Answer 401 to a delivery that fails the check and do nothing else with it.

Answer it

Answer any 2xx within 10 seconds, then do your work. Otherwise (a redirect included) the delivery is retried after 1 minute, 5 minutes, 15 minutes, 1 hour, 4 hours, 12 hours and 24 hours, and marked failed after 8 attempts. A delivery can come twice or out of order: de-duplicate by X-Underlayer-Idempotency-Key, order by occurred_at, and when in doubt read the decision (GET /v1/transactions/{id}/decision).

Your webhook address

An https address of a public host name: no IP address, port, user name or fragment, and no internal or local name. A name that resolves to a private, loopback or other reserved address is not delivered to, and a redirect is not followed.

6. Sandbox check steps

Run these against the sandbox institution, with its key, TEST data and references of the client's own (a test prefix of its system). Each step says what a correct integration sees. They create test data in the sandbox only; a platform administrator of Underlayer can empty a sandbox before a new round.

Only with TEST. Refuse to run these steps unless UNDERLAYER_DATA_CLASSIFICATION is TEST, and send TEST on every write (the classification field of each POST; the two GETs carry none). The base address is the same for both institutions and no answer names the environment: what tells them apart is that a production institution refuses TEST data (400, error_code CLASSIFICATION_NOT_ACCEPTED). Step 2's example may be refused for its EXAMPLE- references before its classification is read; from step 3 on, on that answer stop and tell the developer that the key is a production key. A TEST record that is accepted proves the key belongs to a sandbox.

No test values for a held or rejected payment. No amount, name or reference makes the sandbox hold, reject or freeze a payment on purpose: a payment is held when the institution's own rules or screening stop it. Test the branches for HOLD, HUMAN_REVIEW, BLOCKED with REJECT and FREEZE, screening_timeout, a declined card and the webhooks against stubbed answers taken from section 3, and leave a live hold to step 9.

What they need. UNDERLAYER_BASE_URL, UNDERLAYER_API_KEY and UNDERLAYER_DATA_CLASSIFICATION. UNDERLAYER_WEBHOOK_SECRET is needed only for the live part of step 9; the other steps test the signature check with a secret made up for the test.

Who runs them. Steps 1 to 8 send requests: the AI tool runs them and reports each answer. Steps 9 to 12 test the code; the part of step 9 marked for the developer needs a public address, a secret set on a screen and a person.

Your own values. Where a step sends an example of section 3, replace every value that begins EXAMPLE- with one of your own (not only the references, which are refused: account_number, merchant_id, device_id, session_id too), give account_number the account of step 3, and send the time of the run instead of the example's event and payment times (a CDD row's dates, such as when the account was opened, may stay as they are).

Running them again. Keep the customer and the account of step 3 for every run. Give the payment, the card, the card event and the customer events a new part in their references each run (for example the run's date and time, kept apart by a letter, as in 20261118T2046: a card_token with 13 or more digits in a row can be refused as a card number): sent again with the same references, step 4 answers duplicate: true, step 7's card changed: false and step 8's event duplicate: true, which is right for a repeat but not what a first run expects.

Step 1. The service answers. No key is needed:

curl -sS "$UNDERLAYER_BASE_URL/v1/health"

Expect 200 and {"status":"ok"}.

Step 2. The key works, and an example creates nothing. Save the first example request of 3.1 unchanged as example-payment.json and send it:

curl -sS -i -X POST "$UNDERLAYER_BASE_URL/v1/transactions" -H "X-API-Key: $UNDERLAYER_API_KEY" -H "Content-Type: application/json" --data @example-payment.json

Expect 400 with error_code EXAMPLE_ROW (its words: references beginning EXAMPLE- come from the documentation and are refused: send your own references): nothing is stored. Match the code, not the words. A 401 means the key is not the one issued. A 403 says why in its error_code: CLASSIFICATION_NOT_ALLOWED_FOR_KEY (the key may not send TEST data), API_KEY_ADDRESS_NOT_ALLOWED (the key is limited to addresses, and this one is not among them) or INSTITUTION_NOT_ACTIVE. After a 401 or a 403, stop and ask the developer: 20 failed authentications from one address within 10 minutes refuse that address for 10 minutes.

Step 3. A customer. Send a CDD file (3.6's example with your own customer_ref and account_number, classification: TEST). Expect 200 with inserted: 1 (updated or unchanged on a later run) and rejected: 0; read errors when it is not 0.

Step 4. A payment. Send 3.1's example with your own external_transaction_id and the customer of step 3, data_classification: TEST. Expect 200 with status: RELEASED, or 202 with another status. Check that your code settles only RELEASED, acts on rejection_action for BLOCKED (final) and holds every other status. Then check on the Customers screen, or ask the developer to, that no provisional customer was opened: the answer does not say so.

Step 5. The same payment again. Send exactly the same request. Expect 200, duplicate: true, the same decision_id and no second payment.

Step 6. The decision look-up. Ask for the payment of step 4 by your own reference, URL-encoded:

curl -sS -i "$UNDERLAYER_BASE_URL/v1/transactions/<your external_transaction_id>/decision" -H "X-API-Key: $UNDERLAYER_API_KEY"

Expect 200 with the payment's current status. A reference that is a UUID is read as Underlayer's own id, so when your references are UUIDs ask by the decision_ref or transaction_id of step 4's answer instead.

Step 7. Cards (if the client issues them). Register a card (3.3's example with your own card_token and the customer of step 3): expect 201, then 200 with changed: false when it is sent again. Send a card authorisation (3.4) with a new Idempotency-Key: expect 200 with APPROVED or DECLINED; the same key again answers duplicate: true; the same request without the header answers 400.

Step 8. Customer events (if the client sends them). Send a LOGIN_SUCCESS (3.5) with your own external_event_id: expect 202; the same event again answers 200 with duplicate: true. Then send a second sign-in with its own external_event_id and device_timezone: "GMT+3": expect 202 and a warnings entry whose field is device_timezone. A malformed session field is never refused.

Step 9. Webhooks. Unit-test the signature check first, with a secret made up for the test: a body signed as section 5 says passes; the same body with one character changed, a signature under another secret and a timestamp ten minutes old all fail. The rest of this step is for the developer: they set the sandbox webhook address (a public HTTPS address) and secret on the API and webhooks screen; when a sandbox payment is held (a 202 answer whose status is neither BLOCKED nor POST_EVENT), a person of the client's team decides it on the screens, and they check that the endpoint receives the delivery, verifies it, answers 2xx within 10 seconds and acts once on a repeat of the same X-Underlayer-Idempotency-Key. Report this part as left for the developer.

Step 10. Retries. Unit-test the client with stubbed answers: a 429, or a 503 with Retry-After: 1, is retried with the same body and the same Idempotency-Key, no sooner than Retry-After; a 400, 401, 403, 404, 409 or 413 is never retried unchanged.

Step 11. No unknown fields. Compare the field names the code sends with the tables of section 3: a name that is not there is a bug (a payment would ignore it without a word).

Step 12. No secrets in the code or the logs. Search the change for the key, the secret and the base address: they come from configuration only, and no log line prints them.

Going live is the developer's decision, not the AI tool's: it is a change of configuration (the production institution's key and UNDERLAYER_DATA_CLASSIFICATION=PRODUCTION), never of code.

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