Documentation

Documentation/API reference/Endpoints/

POST /v1/transactions

Submit a payment for real-time monitoring and get its decision

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

Parameters

NameInDescription
Idempotency-Keyheader

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

Request body

PaymentRequest

A JSON object, at most 64 000 characters.

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

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

Request sample

curl -X POST "$UNDERLAYER_BASE_URL/v1/transactions" \
  -H "X-API-Key: $UNDERLAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: <a unique key for this request>" \
  --data-binary @- <<'JSON'
{
  "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"
}
JSON
import os
import requests

response = requests.post(
    os.environ["UNDERLAYER_BASE_URL"] + "/v1/transactions",
    headers={"X-API-Key": os.environ["UNDERLAYER_API_KEY"], "Idempotency-Key": "<a unique key for this request>"},
    json={
      "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"
    },
)
print(response.status_code, response.json())
const response = await fetch(process.env.UNDERLAYER_BASE_URL + "/v1/transactions", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.UNDERLAYER_API_KEY,
    "Content-Type": "application/json",
    "Idempotency-Key": "<a unique key for this request>",
  },
  body: JSON.stringify({
    "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"
  }),
});
console.log(response.status, await response.json());

Written from the example on this page. UNDERLAYER_BASE_URL is https://api.underlayer.eu; UNDERLAYER_API_KEY is yours, given at onboarding.

Responses

StatusBodyDescription
200PaymentDecision or PostEventPayment

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

202PaymentDecision 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.

400ErrorBody

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:

  • institution is not active
  • transaction_timestamp must be 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 = UTC), such as 2026-09-01T14:30:00Z
  • data_classification % is not accepted by the decisioning engine
  • data_classification % is accepted only by a sandbox institution: a production institution takes PRODUCTION data only
  • external_transaction_id is required
  • references beginning EXAMPLE- come from the documentation and are refused: send your own references
  • unknown channel %
  • channel % is disabled
  • direction % is not supported on %
  • % 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
  • % must be greater than zero
  • % must be a three-letter ISO 4217 currency code such as EUR
  • % must be a two-letter ISO 3166-1 alpha-2 country code such as LT
  • % must be true or false
  • % must be one of %
  • % 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
  • % looks like an IBAN but its check digits are wrong
  • % is required for % payments
  • instant is only for SEPA payments
  • unsupported counterparty_type %
  • counterparty_sector_code % is unknown or retired
  • unknown customer_ref %
  • transaction_timestamp is required when executed_during_outage is true: send the time your system executed the payment
  • transaction_timestamp of a payment executed during an outage cannot be later than the time it is sent
  • executed_during_outage is refused: your institution has not chosen its policy for payments while Underlayer cannot be reached (Settings, Decision policies), so every payment is decided in real time
  • executed_during_outage is refused: your institution's policy is to hold payments while Underlayer cannot be reached, so send the payment without it and it is decided in real time

Correct the request; do not send it again unchanged.

401ErrorBody

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

403ErrorBody

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.

409ErrorBody

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.

413ErrorBody

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.

429ErrorBody

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.

500ErrorBody

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.

503ErrorBody

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

Examples of 200

Example: released

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

Example: 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"
    }
  ]
}

Example: duplicate

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

Examples of 202

Example: 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."
}

Example: aiTriage

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

Example: screeningDidNotFinish

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

Examples of 400

Example: notJson

{
  "error": "Body must be valid JSON",
  "error_code": "BODY_NOT_JSON"
}

Example: notObject

{
  "error": "Body must be a JSON object",
  "error_code": "BODY_NOT_OBJECT"
}

Example: The message % is required for % payments, as the caller receives it

{
  "error": "counterparty is required for SEPA payments",
  "error_code": "MISSING_CHANNEL_FIELD"
}

Example: The message % may have at most two decimals, for an amount of 10.123

{
  "error": "amount may have at most two decimals",
  "error_code": "TOO_MANY_DECIMALS"
}

Example: The message % must be a two-letter ISO 3166-1 alpha-2 country code such as LT, for origin_country XX

{
  "error": "origin_country must be a two-letter ISO 3166-1 alpha-2 country code such as LT",
  "error_code": "INVALID_COUNTRY"
}

Example: An external_transaction_id or customer_ref beginning EXAMPLE-

{
  "error": "references beginning EXAMPLE- come from the documentation and are refused: send your own references",
  "error_code": "EXAMPLE_ROW"
}

Examples of 401

Example: missing

{
  "error": "Missing or malformed API key",
  "error_code": "API_KEY_MISSING"
}

Example: invalid

{
  "error": "Invalid or revoked API key",
  "error_code": "API_KEY_INVALID"
}

Examples of 403

Example: addressNotAllowed

{
  "error": "API key not allowed from this address",
  "error_code": "API_KEY_ADDRESS_NOT_ALLOWED"
}

Example: institutionInactive

{
  "error": "Institution is not active",
  "error_code": "INSTITUTION_NOT_ACTIVE"
}

Example: classification

{
  "error": "This API key may not submit TEST payments",
  "error_code": "CLASSIFICATION_NOT_ALLOWED_FOR_KEY"
}

Examples of 409

Example: differentBody

{
  "error": "this 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-Key",
  "error_code": "IDEMPOTENCY_CONFLICT"
}

Example: twoPayments

{
  "error": "the Idempotency-Key and the external_transaction_id name two different payments: retry with the key and the reference you sent the first time",
  "error_code": "REFERENCE_KEY_MISMATCH"
}

Examples of 413

Example: tooLarge

{
  "error": "Request body too large",
  "error_code": "BODY_TOO_LARGE"
}

Examples of 429

Example: failedAuthentications

{
  "error": "Too many failed authentication attempts from this address; retry after the number of seconds in Retry-After",
  "error_code": "TOO_MANY_FAILED_AUTHENTICATIONS"
}

Example: perKey

{
  "error": "Too many requests for this API key; retry after the number of seconds in Retry-After",
  "error_code": "RATE_LIMITED_KEY"
}

Example: perAddress

{
  "error": "Too many requests from this address; retry after the number of seconds in Retry-After",
  "error_code": "RATE_LIMITED_ADDRESS"
}

Examples of 500

Example: engine

{
  "error": "Decisioning engine error",
  "error_code": "ENGINE_ERROR",
  "code": "P0001"
}

Examples of 503

Example: busy

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

Example: keyCheck

{
  "error": "Service unavailable",
  "error_code": "SERVICE_UNAVAILABLE"
}

Example: settings

{
  "error": "Service temporarily unavailable",
  "error_code": "SERVICE_SETTINGS_UNUSABLE"
}

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