Skip to main content

Terminal Payment API (1.0.0)

Download OpenAPI specification:Download

REST interface for in-store account payments. The current API supports purchases, purchases with cashback and pre-authorisations through POST /v1/payments. Capture, cancellation, refund and account-verification operations are not available yet.

Identity and authorization

Calls require a PSP bearer access token in Authorization: Bearer <token> and the PSP's subscription key in Ocp-Apim-Subscription-Key. The authenticated application and subscription must identify an active PSP caller. Missing or invalid credentials return 401; an authenticated caller without PSP access receives 403.

vendorId is a separate, required transaction identifier passed unchanged to the payment engine. The API does not yet verify which vendor IDs belong to the authenticated PSP. There are no MAC fields in this REST contract.

Identifying a payment

The API builds the engine's externalPaymentId from the request:

terminalId.cardAcceptorId.vendorId.stan.yyMMddHHmmss

These are the five values, joined by dots. Before joining, escape % as %25, then . as %2E in terminal ID, card acceptor ID and vendor ID. Their separate fields sent to the engine retain their original values. STAN and the formatted local timestamp remain unchanged. Terminal and card acceptor IDs come from terminal; STAN and the local timestamp come from transaction. For example: POS12000.4471002.000123.000123.261126120000. Payment identity is derived from these fields; there is no separate externalPaymentId or idempotency-key input.

The response's orderId is a different, engine-generated identifier, padded with leading zeros to 13 digits. Preserve it as a string.

Idempotency and repeats

Repeat the original request unchanged, preserving the five identifying values above. The engine reuses a stored approval or decline. Changing the identifying values addresses a different payment. Changing the amount, currency or cashback amount for the same identity returns 409; this is not a comparison of every request field. Authorisation after capture has been scheduled or cancellation registered also returns 409.

Identifiers without . or % keep their previous engine identity. Previously submitted identifiers containing either character get a new identity; the API does not fall back to the old format on repeats.

Timeouts and the unknown-outcome protocol

The API's call to the payment engine has a ten-second timeout and is not retried automatically. A 500 response, timeout or lost connection can leave the payment outcome unknown; it does not confirm that the payment was declined or that no money was reserved. Preserve the original request and its payment identity when repeating it.

The technical-cancellation and late-authorisation recovery flows described in the historical specification's "Failure Scenarios" are not implemented in this API yet.

Declines

A mapped payment decline returns HTTP 200 with result.outcome: DECLINED, an orderId, an ISO response code and a mapped reason. An approval returns APPROVED with response code 00 and an authorisation code. Inspect the result, not just the HTTP status.

Field-validation failures return 400 Problem Details with extraDetails, an array of {name, reason} entries identifying each field and its validation failure. Malformed or incomplete JSON also returns 400 and may omit extraDetails. Problem Details responses include the request path as instance and a traceId for troubleshooting. State and changed-repeat conflicts return 409 Problem Details with reason: INVALID_TRANSACTION and responseCode: 12. Technical failures and engine codes without an agreed mapping return 500 Problem Details; they are not reported as payment declines.

Money

Amounts are integers in minor units: 7500 means DKK 75.00 or EUR 75.00. The payment amount must be positive. Cashback is non-negative, uses the same currency and cannot exceed the payment amount. See the operation for processing/function-code combinations.

Terminal and payment data

Only contactless PAN entry is supported. Supply a payment token with its matching expiry date, PAN sequence number and transaction-generated EMV data. Request examples use synthetic payment data and cannot be used as working test payments. Merchant countries use the three-letter codes DNK and FIN. localDateTime is terminal-local time without an offset; transmissionDateTime is UTC.

Payments

Authorise a payment

Create a purchase, purchase with cashback or pre-authorisation. An HTTP 200 response contains either an approval or a processed decline; inspect result.outcome.

Type Processing code Function code Cashback
PURCHASE 000000 100 Omitted or zero
PURCHASE 090000 100 Required, including when zero
PRE_AUTHORISATION 000000 101 Omitted or zero

Cashback must use the payment currency and cannot exceed the payment amount. Invalid requests return 400; payment-state or changed-repeat conflicts return 409. A 500 response leaves the payment outcome unknown.

Authorizations:
(bearerAuthsubscriptionKey)
header Parameters
Vipps-System-Name
string <= 30 characters

Name of the terminal software / vendor host (lowercase).

Vipps-System-Version
string <= 30 characters

Version of the terminal software.

Request Body schema: application/json
required
type
required
string
Enum: "PURCHASE" "PRE_AUTHORISATION"

Purchase or pre-authorisation; determines the required function code.

required
object

Positive payment amount in minor units, including any cashback.

required
object

Terminal and merchant details, including the terminal and card acceptor IDs used in payment identity.

required
object

Terminal transaction data, including the STAN and local timestamp used in payment identity.

required
object

Payment token and matching card/EMV details from the terminal transaction.

vendorId
required
string

Vendor identifier used in payment identity and passed unchanged to the engine. Ownership by the authenticated PSP is not yet checked.

object or null

Optional cashback portion of the payment. Required for processing code 090000, including when zero; same currency as amount and no greater than it.

Responses

Request samples

Content type
application/json
Example

Illustrative data only. The token and EMV data are synthetic, not working UAT payment data. Use a valid test token with matching expiry, PAN sequence number and transaction-generated EMV data.

{
  • "type": "PURCHASE",
  • "amount": {
    },
  • "terminal": {
    },
  • "transaction": {
    },
  • "paymentInstrument": {
    },
  • "vendorId": "000123"
}

Response samples

Content type
application/json
Example
{
  • "orderId": "0081000000000",
  • "type": "PURCHASE",
  • "amount": {
    },
  • "result": {
    },
  • "terminal": {
    },
  • "transaction": {
    }
}