Documentation

Documentation/

API reference

Version 2026-11-17. Generated from openapi.yaml.

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

The public API an e-money or payment institution (EMI) calls to have its payments and card events monitored and to send its customer due diligence (CDD) data. Start with the Getting started page (an API key, the sandbox, the first payment end to end, and the topic guides); read this specification as the API reference page, which is generated from it, with the Errors page (every error answer and what to do). Each is checked against the code by an automated test.

A 2xx answer is never an approval. Only a payment whose status is RELEASED may be settled. Every other status (HOLD, AI_INVESTIGATION, HUMAN_REVIEW, ESCALATED, BLOCKED, ...) means: do not settle; wait for the decision webhook or poll the decision. A replayed duplicate answers 200 whatever its status.

Examples use references that begin EXAMPLE-, and every endpoint refuses them: an example sent unchanged never creates data. The payment endpoint refuses an external_transaction_id or customer_ref, and the card endpoint a card_token, that begins EXAMPLE- in any case, with a 400 (references beginning EXAMPLE- come from the documentation and are refused: send your own references); nothing is stored. The CDD intake refuses a row whose customer_ref begins EXAMPLE- (row reason EXAMPLE_ROW, nothing is stored).

Values are checked before anything is stored. On the payment and card endpoints every amount, currency, country, flag and card code is read by one set of rules: an amount is a JSON number or a decimal string with at most two decimals, a currency three letters, a country a code of the platform's country list, a card code one of the rule builder's values; codes are upper-cased. A value of the wrong type is refused with a 400 that names the field, never a 500.

Authentication. Every client endpoint takes the header X-API-Key: <key_id>.<secret> (issued once, on the API and webhooks screen, by an administrator of the institution: ak_ and 16 hexadecimal characters, a dot, 48 hexadecimal characters). The key decides the institution: nothing in a request can choose another one. Each key lists the data classifications it may send (PRODUCTION, TEST, DEMO, SCALE_TEST). To rotate a key, switch every caller to the new key first, then revoke the old one: requests with a revoked key answer 401, and 20 failed authentications from one address within 10 minutes refuse that address for 10 minutes, the good key included.

Idempotency and retries. See the Idempotency and retries guide. In short: a payment is identified by source_system + external_transaction_id (and by Idempotency-Key when you send one): sending it again returns the payment's current decision (its status may have moved on since you sent it) with duplicate: true and changes nothing. A card event is identified only by Idempotency-Key, so the card endpoint requires it (400 without it), and a repeat returns the card event's first decision. A CDD file can be sent again: unchanged customers are counted as unchanged and get no new version.

Error bodies. Every error is JSON { "error": "<words>", "error_code": "<CODE>" }: match on the status and error_code, a stable code listed on the Errors page (the words are for a person). A server-side refusal adds code, the database's error code (an SQLSTATE such as P0001, or a PostgREST code such as PGRST116), never the database's message. A 400 from the database carries the text of its VALIDATION: refusal, which names only what you sent.

Paths and methods not listed here. A path that is not listed here answers 404 {"error":"Not found","error_code":"NOT_FOUND"}, whatever the method (components.responses.NotFound). A listed path called with a method not listed for it answers 405 {"error":"Method not allowed","error_code":"METHOD_NOT_ALLOWED"} with an Allow header naming the methods it takes (components.responses.MethodNotAllowed): HEAD wherever GET is listed, OPTIONS nowhere (the API is called from servers and answers no CORS preflight). Both are JSON, read no key and name nothing from the request. A path is matched exactly, in lower case and without a trailing slash: /V1/HEALTH/ answers 404. An answer that is not application/json comes from our hosting provider (a bare 502 or 504): retry it with back-off.

Rate limiting (429, Retry-After) is in force: see the Rate limits and back-pressure guide.

Back-pressure. Each server instance decides at most a fixed number of payments and card events at once, and one institution at most its share of them. Over that, the next one answers at once 503 {"error":"Service busy","error_code":"SERVICE_BUSY"} with Retry-After: 1, before anything is stored; so does a repeat (same key and Idempotency-Key) of a request still being decided. When the API key itself cannot be checked the answer is 503 {"error":"Service unavailable","error_code":"SERVICE_UNAVAILABLE"} with Retry-After: 5, never a key error. Retry a 503 with back-off, starting from Retry-After: the payment's own reference and the Idempotency-Key make a retry safe, never a second payment or card event (a payment's repeat answers its current decision).

Servers

https://api.underlayer.eu

The client API's address, for sandbox and production keys alike. Keep it in your configuration as UNDERLAYER_BASE_URL: every path is appended to it.

Endpoints

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

Webhooks

What Underlayer sends to your address.

WebhookWhat it tells you
POST decisionStatusChangedA payment decision changed status
POST cardStatusChangedUnderlayer changed the status of one of your cards

Schemas and files

Every object the API takes or answers is on the Schemas page. The contract itself is the OpenAPI 3.1 file.

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