Request and Response Models

Last updated: 2026-05-19

Request and Response Models

This page summarises the most important models across the wrappers and what they are used for.

Connection and Session Models

TerminalNetworkConnection

Defines how the wrapper connects to the terminal.

FieldPurpose
Terminal endpointTerminal IP address and port.
UseKeepAlive / useKeepAliveControls socket keepalive behaviour.

TerminalEnvironment

Defines the login context for the terminal session.

FieldPurpose
Terminal IDThe primary terminal identifier.
Store IDStore or merchant-side logical store identifier.
Workstation IDIdentifies the ECR workstation and is required in many EPAS flows.
Secondary terminal IDsAdditional terminal IDs where the solution uses them.
Configuration serverBackend endpoint for configuration.
Authorisation serverBackend endpoint for host or authorisation traffic.
Operator IDCashier or operator identity.
LanguageECR or terminal language code.

Transaction Request Models

PurchaseTransactionAmounts

Used for the normal purchase call and for pre-amount completion.

FieldPurpose
Purchase amountBase purchase amount.
Cashback amountCashback requested as part of the transaction.
Merchant category codeMCC when the solution populates it explicitly.

PurchaseRequest

Full purchase request model used when a simple amount is not enough.

FieldPurpose
AmountBase amount.
Cashback amountOptional cashback.
Payment methodAlternative payment method such as Swish when supported.
Terminal IDOptional terminal override for multi-terminal scenarios.
Merchant category codeMCC override where needed.

RefundRequest

Used when refund logic needs more than a plain amount.

FieldPurpose
AmountRefund amount.
Payment methodAlternative payment method for non-card refund flows.
ReferenceOriginal transaction reference, especially important for alternative methods.
Terminal IDOptional source terminal override.
Merchant category codeMCC override where needed.

EnableCardReaderOptions

Used with enable or disable reader operations.

FieldPurpose
NotifyOnCancel / notifyOnCancelWhether a cancellation should surface reader-state notification back to the ECR.
TransactionType / transactionTypeWhether the reader is opened for payment, refund, or default behaviour.

Response Models

LoginResponse

Returned by login and indicates whether the terminal session is ready.

FieldPurpose
Logged in flagWhether login succeeded.
Error conditionTerminal-side failure category when login failed.
Additional informationFree-text explanation from the terminal or wrapper.
Feature versionsFeature-version map where the wrapper exposes it.

LogoutResponse

Returned when the session is explicitly logged out.

FieldPurpose
Logged out flagWhether logout succeeded.
Error conditionTerminal-side failure category.
Additional informationDiagnostic text when available.

TransactionResponse

The standard result model for purchase, refund, reversal, and cash advance.

FieldPurpose
ApprovedWhether the transaction was approved.
Transaction referenceReference used for reporting, matching, and reversals.
Final amountFinal approved amount including tip, cashback, or add-ons.
Error conditionFailure category when not approved.
Additional informationHuman-readable terminal information.

LastTransactionResponse

Returned by last-transaction lookups and recovery workflows.

AreaTypical contents
ResultApproved flag, final amount, error condition, additional info.
TransactionType, timestamp, reference, currency, alternative method, base amount, cashback, VAT, tip, and charges.
MerchantMerchant name, address, city, zip, phone, organisation number.
CardMerchant PAN, customer PAN, card name, and related card summary data.
ReceiptsMerchant and customer receipt text where exposed.

The Swift wrapper currently exposes a partial but useful last-transaction model and can be expanded further toward .NET and Java parity.

EnableReadersResponse

Returned when card readers are opened or closed.

FieldPurpose
SuccessfulWhether the command succeeded.
Open card readersWhether the request represented opening rather than closing.
Error conditionTerminal-side failure category.
Additional informationDiagnostic text if present.

AdminResponse

Returned by administrative flows such as host login, print configuration, or parameter update.

FieldPurpose
SuccessfulWhether the administrative command succeeded.
Error conditionFailure category when it did not.
Additional informationDiagnostic or terminal text.

Receipt Models

ReceiptData

Receipt callbacks deliver structured data rather than a plain text block.

FieldPurpose
VersionMerchant or cardholder copy.
OutcomeApproved, declined, or cancelled transaction outcome.
Reference numberReceipt-side reference number.
Terminal IDTerminal that produced the receipt.
Operator IDOperator or cashier context.
TimestampReceipt timestamp.
Raw XMLOriginal print request XML where exposed.
Structured fieldsLabel, value, and explanation tuples for formatting or UI display.

ReceiptField

Used in the Swift wrapper's receipt presentation model.

FieldPurpose
LabelField label or heading.
ValueReceipt value.
ExplanationHuman-oriented explanation of what the field means.

Callback Support Models

CardAcceptedEventArgs

Used when the terminal notifies the ECR that a payment card has been accepted.

FieldPurpose
Masked card numberPAN masked to a safe display format.
Card number aliasAlias or token-like card identifier where supported.
Card number alias 2Optional second alias when supplied by the terminal.

Swift callback result wrappers

TypePurpose
BooleanCallbackResultBoolean answer plus handled flag.
TextCallbackResultString answer plus handled flag.
DecimalCallbackResultDecimal answer plus handled flag.