openapi: 3.0.3
info:
  title: PayTec EFT/POS Terminal Interface
  description: This is a web service that allows interfacing the PayTec EFT/POS terminals
    via HTTPS.
  contact:
    email: support@paytec.ch
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.0.0
externalDocs:
  description: Find out more about the PayTec terminals
  url: https://paytec.ch
servers:
  - url: https://kitrest.paytec.ch/
  - url: https://kitrest.azure.paytec.ch/
  - url: https://kitrest-test.azure.paytec.ch/
paths:
  /api/v1/pair:
    post:
      summary: Add a new pairing
      description: |
        Add a new pairing with an EFT/POS terminal

        Before a web application can communicate with a remote POS terminal, it establishes
        a trusted connection providing a temporary pairing code. This code is generated
        on the POS terminal via the attendant menu...

        ![Screenshot start pairing](/start_pairing.png) **click 'Go' =>** ![Screenshot pairing code](/pairing_code.png)

        ... and used in the /pair method.

        => After successful pairing, the following message will be shown for a few seconds on the terminal:

        ![Screenshot pairing successful](/pairing_successful.png)

      operationId: pair
      requestBody:
        description: Add new pairing
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PairRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PairResponse'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/connect:
    post:
      summary: Connect to a terminal
      description: Connect to a terminal using the access token
      operationId: connect
      requestBody:
        description: Connect to a terminal
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalStatus'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/disconnect:
    post:
      summary: Disconnect from a terminal
      description: Disconnect from a terminal using the access token
      operationId: disconnect
      requestBody:
        description: Disconnect from a terminal
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimpleRequest'
        required: true
      responses:
        '200':
          description: Successful operation
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/activate:
    post:
      summary: Activate a terminal
      description: Activate a terminal. If the terminal was deactivated, a new shift is opened. If the terminal was already active, the operation is idempotent.
      operationId: activate
      requestBody:
        description: Activate a terminal
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimpleRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalStatus'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/deactivate:
    post:
      summary: Deactivate a terminal
      description: Deactivate a terminal. If the terminal was active, the shift is closed. If the terminal was already deactivated, the operation is idempotent.
      operationId: deactivate
      requestBody:
        description: Deactivate a terminal
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimpleRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalStatus'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/transact:
    post:
      summary: Perform a transaction
      description: Perform a transaction on a terminal
      operationId: transact
      requestBody:
        description: Perform a transaction
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionRequest'
      responses:
        '200':
          description: Successfully received a transaction response; please consider the content of the response for further information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponse'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/abort:
    post:
      summary: Abort a transaction
      description: Abort a transaction that has been started.
      operationId: abort
      requestBody:
        description: Abort a transaction
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AbortTransactionRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                description: Successfully aborted the transaction.
                required:
                  - TrmID
                properties:
                  TrmID:
                    $ref: '#/components/schemas/TrmID'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/confirm:
    post:
      summary: Confirm a transaction
      description: Confirm a transaction that has been approved. This is necessary if AutoConfirm was not set to 1 in /transact.
      operationId: confirm
      requestBody:
        description: Confirm a transaction
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionConfirmationRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionConfirmationResponse'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/rollback:
    post:
      summary: Rollback a transaction
      description: Rollback a transaction that has been approved. This is necessary if e.g. the goods can't be delivered.
      operationId: rollback
      requestBody:
        description: Rollback a transaction
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimpleRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalStatus'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/configure:
    post:
      summary: Configure the terminal
      description: Advise the terminal to download its configuration parameters from the Terminal Management System/Service Center.
      operationId: configure
      requestBody:
        description: Configure the terminal
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimpleRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalStatus'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/initialize:
    post:
      summary: Initialize the terminal
      description: Advise the terminal to download its initialization data from the acquirer(s).
      operationId: initialize
      requestBody:
        description: Initialize the terminal
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitializationRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalStatus'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/balance:
    post:
      summary: Perform the daily closure
      description: |
        Submits/transmits all transactions to the acquirer resp. the POS Management System and closes the current booking period.
        If the period is already closed, the operation is idempotent.
      operationId: balance
      requestBody:
        description: Perform the daily closure
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimpleRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalStatus'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/report:
    post:
      summary: Generate a report
      description: Generate a financial report from the terminal
      operationId: report
      requestBody:
        description: Generate a report
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportResponse'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/status:
    post:
      summary: Get the terminal status
      description: Get the status of the terminal
      operationId: status
      requestBody:
        description: Get the terminal status
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimpleRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalStatus'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/receipt:
    post:
      summary: Get a receipt
      description: Get a receipt from the terminal
      operationId: receipt
      requestBody:
        description: Get a receipt
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReceiptRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReceiptResponse'
        '400':
          description: Invalid input
        '404':
          description: Receipt not found
        '500':
          description: Something else went wrong
  /api/v1/print:
    post:
      summary: Print a receipt
      description: Print a receipt on the terminal
      operationId: print
      requestBody:
        description: Print a receipt
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrintReceiptRequest'
        required: true
      responses:
        '200':
          description: Successfully received PrintReceiptReponse; please consider the content of the response for further information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrintReceiptResponse'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
  /api/v1/device-command:
    post:
      summary: Send a device command
      description: Send a device command to the terminal
      operationId: deviceCommand
      requestBody:
        description: Send a device command
        content:
          application/json:
            schema:
              type: object
              properties:
                AccessToken:
                  $ref: '#/components/schemas/AccessToken'
                DeviceCommandCode:
                  $ref: '#/components/schemas/DeviceCommandCode'
                Timeout:
                  type: integer
                  description: |
                    Timeout in milliseconds for the command to be executed. Default is 120000 (2 minutes), but may time out earlier due to shorter timeouts on the terminal.
                  example: 10000
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCommandResponse'
        '400':
          description: Invalid input
        '500':
          description: Something else went wrong
components:
  schemas:
    PairRequest:
      type: object
      required:
        - Code
      properties:
        Code:
          type: string
          description: 7 digit pairing code as displayed on the terminal
          example: 1234567
        PeerName:
          type: string
          description: Name of the peer, e.g. a POS identifier
          example: Awesome POS 1234
    PairResponse:
      type: object
      properties:
        AccessToken:
          $ref: '#/components/schemas/AccessToken'
        TrmID:
          $ref: '#/components/schemas/TrmID'
        IFDSerialNum:
          $ref: '#/components/schemas/IFDSerialNum'
    ConnectRequest:
      type: object
      required:
        - AccessToken
      properties:
        AccessToken:
          $ref: '#/components/schemas/AccessToken'
        PrinterWidth:
          type: integer
          description: Width in characters to format the receipt for.
          example: 40
        TrmLng:
          $ref: '#/components/schemas/LanguageCode'
    SimpleRequest:
      type: object
      required:
        - AccessToken
      properties:
        AccessToken:
          $ref: '#/components/schemas/AccessToken'
    TerminalStatus:
      type: object
      required:
        - TrmID
        - IFDSerialNum
        - TrmStatus
      properties:
        TrmID:
          $ref: '#/components/schemas/TrmID'
        TrmLng:
          type: string
          description: Language code for the terminal, e.g. 'de' for German.
          example: de
        IFDSerialNum:
          $ref: '#/components/schemas/IFDSerialNum'
        SoftwareVersion:
          type: integer
          description: Software version of the terminal.
          example: 240106
        PeSeqCnt:
          type: integer
          description: Booking period sequence counter.
          example: 1
        ActSeqCnt:
          type: integer
          description: Activation sequence counter / shift counter.
          example: 1
        TrmStatus:
          $ref: '#/components/schemas/TrmStatus'
        CardholderLng:
          $ref: '#/components/schemas/LanguageCode'
        ESigInd:
          type: integer
          description: Electronic signature indicator; 1 means e-signature supported.
          example: 0
        NextScheduledTask:
          type: object
          properties:
            TaskName:
              type: string
              description: Name of the next scheduled task.
              example: CONFIG
            LastRun:
              type: string
              description: Date and time of the last run of the task.
              example: "2021-01-01 12:00:00"
            NextRun:
              type: string
              description: Date and time of the next run of the task.
              example: "2021-01-02 12:00:00"
        SetAcqInfo:
          type: array
          items:
            type: object
            properties:
              AcqID:
                type: integer
                description: Acquirer identifier.
                example: 25
        MctID:
          type: string
          description: Merchant identification, 15 alphanumeric characters.
          example: PAYTEST00000001
        MctNameLoc:
          type: string
          description: Merchant name and location.
          example: "PayTec AG\\nVogelsangstrasse 15\\n8307 Effretikon"
        TrmCntryC:
          type: integer
          description: Country code of the terminal.
          example: 756
        TrmType:
          type: integer
          description: Terminal type.
          example: 22
        TrxFunctions:
          type: integer
          description: Supported transaction functions; bitwise combination of the following flags, returned as a JSON decimal integer
          $ref: '#/components/schemas/TrxFunctions'
          example: 182433
        Brands:
          type: array
          items:
            type: string
          description: Supported card brands.
          example:
            - MasterCard
            - Maestro
            - Visa
            - Amex
        Currencies:
          type: array
          items:
            type: integer
          description: Supported currencies.
          example:
            - 756
            - 978
            - 840
        TrxSeqCnt:
          type: integer
          description: Transaction sequence counter.
          example: 1234
        UID:
          type: string
          description: UID of non-ISO14443 NFC card, see TransactionRequestFlags.
          example: "04A224B67C5280"
    TransactionRequest:
      type: object
      required:
        - AccessToken
        - TrxFunction
      properties:
        AccessToken:
          $ref: '#/components/schemas/AccessToken'
        AcqID:
          type: integer
          description: The registered acquirer identifier, for reference-based transactions.
            - CANCEL_RESERVATION
            - PURCHASE_RESERVATION
            - RESERVATION_ADJUSTMENT
            - CONFIRM_PHONE_AUTH_RESERVATION
          example: 25
        AmtAuth:
          type: integer
          description: The amount to be authorized, in the currency's minor unit
          minimum: 0
          example: 5000
        AmtOther:
          type: integer
          description: Cashback amount, in the currency's minor unit
          minimum: 0
          example: 2000
        AuthC:
          type: string
          description: The Authorisation Code received by phone
          example: "123ABC"
        TrxCurrC:
          type: integer
          description: Transaction Currency Code (ISO-4217)
          example: 840
        TrxFunction:
          $ref: '#/components/schemas/TrxFunction'
        TrxRefNum:
          type: string
          description: Original Transaction Reference Number for reference-based transactions.
            - CANCEL_RESERVATION
            - PURCHASE_RESERVATION
            - RESERVATION_ADJUSTMENT
            - CONFIRM_PHONE_AUTH_RESERVATION
          example: 'REF12345678'
        TrxReasonC:
          type: string
          description: Transaction Reason Code
          example: "2"
        TrxReqFlags:
          $ref: '#/components/schemas/TransactionRequestFlags'
        PartialApprovalCap:
          type: number
          description: When set to 1 and initialized by the acquirer, the terminal accepts partial approval of a transaction
          example: 1
        TextOnUnknownNFC:
          type: string
          description: |
            When set, the terminal displays the text when an unknown NFC card is tapped on the terminal;
            works only in combination with the [TrxReqFlags](#/components/schemas/TransactionRequestFlags) value 0x00000008.
          example: "Please follow instructions on vending machine screen"
        AutoConfirm:
          type: integer
          description: When set to 1, the terminal automatically confirms a transaction
          example: 1
        RecOrderRef:
          type: object
          description: The product record for the merchant's order reference - supported from software version >= 24.04.06
          properties:
            OrderID:
              type: string
              description: |
                The merchant's order identifier to reference the transaction.
                Note: This field is limited to 18 (ep2 7.x) resp. 48 (ep2 >= 8.x) characters and will be truncated if necessary.
              example: "Order1234"
      example:
        AccessToken: "CxOr9ssjChB/sjJ9JD0XVfrwUSjFOu/0l2FZCjSiTsCU6IX/I0Mc7RyF/qR/IPS4wpIjjTNYpCLh9wonMF3VUw=="
        TrxFunction: 32768
        TrxCurrC: 756
        AmtAuth: 1500
        AutoConfirm: 1
        RecOrderRef:
          OrderID: "Order1234"
    TransactionResponse:
      type: object
      description: |
        Please refer to the PayTec ECR Interface Specification for further information about the content of the transaction response.

        **Warning:** Additional fields may be introduced in future versions without prior notification. Clients should be prepared to handle unknown fields gracefully.
      required:
        - TrmID
        - TrxResult
      properties:
        TrmID:
          $ref: '#/components/schemas/TrmID'
        TrxResult:
          $ref: '#/components/schemas/TrxResult'
        Brand:
          type: string
          description: Brand of means of payment
        AccountType:
          type: integer
          description: Account type
        AcqID:
          type: integer
          description: Acquirer identifier
        AID:
          type: string
          description: Base64 Encoding of application identifier
        AIDICC: 
          type: string
          description: Base64 Encoding of application identifier as read from the card
        IIN:
          type: integer
          description: 6 digit issuer identification number
        AppPANPrtCardholder:
          type: string
          description: Masked PAN on cardholder receipt
        AppPANPrtMerchant:
          type: string
          description: Masked PAN on merchant receipt
        AmtAuth:
          type: integer
          description: Authorized amount in the currency's minor unit
        AmtOther:
          type: integer
          description: Cashback amount in the currency's minor unit
        TrxAmt:
          type: integer
          description: Final transaction amount in the currency's minor unit
        AuthC:
          type: string
          description: Authorization code
        ARC:
          type: string
          description: Authorization response code
        AttendantText:
          type: string
          description: Display text of the transaction outcome for the attendant
        CardholderText:
          type: string
          description: Display text of the transaction outcome for the cardholder, in cardholder language
        IssCntryC:
          type: integer
          description: Country code of the issuer
        POSEntryMode:
          $ref: '#/components/schemas/POSEntryMode'
        TrxCurrC:
          type: integer
          description: ISO 4217 currency code
        TrxType:
          type: integer
          description: ISO 8583 transaction type
        TrxSeqCnt:
          type: integer
          description: Transaction sequence counter
        TrxRefNum:
          type: string
          description: Transaction reference number
        AppPANEnc:
          type: string
          description: Encrypted PAN on the receipt for manual resubmission
        StatKeyPANRctInd:
          type: string
          description: Base64 encoding of EP2 key PAN receipt index
        KeyPANRctDOLInd:
          type: string
          description: Base64 encoding of EP2 key PAN receipt data object list index
        AuthReslt:
          type: integer
          description: EP2 authorization result
        VoicePhone:
          type: string
          description: Phone number of the acquirer for referral transactions
        SurrogatePAN:
          type: string
          description: Base64 encoding of merchant specific surrogate PAN
        AmtAvail:
          type: integer
          description: Available amount in the currency's minor unit
        AmtAvailCurrC:
          type: integer
          description: ISO 4217 currency code of the available amount
        TrxTime:
          type: string
          description: Time HHMMSS of the transaction
        TrxDate:
          type: string
          description: Date YYMMDD of the transaction
        TrxSeqCntOri:
          type: integer
          description: Original transaction sequence counter
        DisplayName:
          type: string
          description: Display name of the means of payment as shown to the cardholder
        ESignature:
          type: string
          description: Base64 encoding of the electronic signature in PNG format
        CVMResults:
          type: string
          description: Base64 encoding of the EMVCo cardholder verification results
        TrxResultExtended:
          type: integer
          description: Extended transaction result
        TipAmt:
          type: integer
          description: Tip amount in the currency's minor unit
        AmtRemaining:
          type: integer
          description: Remaining amount in the currency's minor unit, in case of partial approval
        PreAuthExpDate:
          type: string
          description: Expiry date YYMMDD of a pre-authorized amount
        UID:
          type: string
          description: UID of an non-ISO14443 NFC card, see TransactionRequestFlags.
          example: "04A224B67C5280"
      example:
        TrxResult: 0
        Brand: "MasterCard"
        VoicePhone: "0041441234567"
        TrxRefNum: "REF12345678"
        AccountType: 0
        AcqID: 123
        AID: "oAAAAAQQEA=="
        AIDICC: "oAAAAAQQEA=="
        AmtAuth: 1500
        AuthC: "123ABC"
        ARC: "00"
        CVMResults: "PwAC"
        IssCntryC: 756
        POSEntryMode: 97
        TrmID: "TERM1234"
        TrxAmt: 1500
        TrxCurrC: 756
        TrxSeqCnt: 1234
        TrxDate: "210101"
        TrxTime: "120000"
        AuthReslt: 0
        AppPANEnc: "0123456789ABCDEFFEDCBA9876543210"
        StatKeyPANRctInd: "Aw=="
        KeyPANRctDOLInd: "Aw=="
        DisplayName: "DEBIT MASTERCARD"
        TrxResultExtended: 100
        AppPANPrtCardholder: "XXXXXXXXXXXX1234"
        AppPANPrtMerchant: "XXXXXXXXXXXX1234"
        SurrogatePAN: "/ty6mHZUMhABI0VniavN7/7cuph2VDIQASNFZ4mrze8="
        CardholderText: "Verarbeitung OK"
        AttendantText: "Transaction approved"
        TipAmt: 0
        AmtRemaining: 0
    TransactionConfirmationRequest:
      type: object
      required:
        - AccessToken
      properties:
        AccessToken:
          $ref: '#/components/schemas/AccessToken'
        TrxAmt:
          type: integer
          description: The amount to be confirmed, in the currency's minor unit. Must be less than or equal to the AmtAuth field of the transaction response.
          minimum: 0
          example: 5000
        TrxSeqCnt:
          type: integer
          description: Transaction sequence counter, used when confirming AUTHORIZATION_PURCHASE transactions.
          example: 1234
    TransactionConfirmationResponse:
      type: object
      required:
        - TrmID
        - TrxResult
      properties:
        TrmID:
          $ref: '#/components/schemas/TrmID'
    InitializationRequest:
      type: object
      required:
        - AccessToken
      properties:
        AccessToken:
          $ref: '#/components/schemas/AccessToken'
        AcqID:
          type: integer
          description: The identifier of the acquirer to initialize the terminal for.
          example: 25
    AbortTransactionRequest:
      type: object
      required:
        - AccessToken
      properties:
        AccessToken:
          $ref: '#/components/schemas/AccessToken'
        AbortTrxFlags:
          $ref: '#/components/schemas/AbortTransactionFlags'
    DeviceCommandResponse:
      type: object
      required:
        - DeviceCommandCode
      properties:
        DeviceCommandCode:
          $ref: '#/components/schemas/DeviceCommandCode'
        ScannedData:
          type: string
          description: For DeviceCommandCode 2601, the scanned data.
          example: "1234567890"
    ReportRequest:
      type: object
      required:
        - AccessToken
        - ReportType
      properties:
        AccessToken:
          $ref: '#/components/schemas/AccessToken'
        ReportType:
          $ref: '#/components/schemas/ReportType'
    ReportResponse:
      type: object
      required:
        - TrmID
        - ReportType
        - ReportFlags
      properties:
        TrmID:
          $ref: '#/components/schemas/TrmID'
        ReportType:
          $ref: '#/components/schemas/ReportType'
        FinancialReport:
          type: array
          items:
            type: object
            required:
              - Brand
              - AID
              - FinancialCounterType
              - TrxCurrC
              - TrxCount
              - TotalAmount
            properties:
              Brand:
                type: string
                description: The brand of the payment method
              AID:
                type: string
                description: The Application Identifier of the payment method
              FinancialCounterType:
                $ref: '#/components/schemas/FinancialCounterType'
                description: The type of the report entry
              TrxCurrC:
                type: integer
                description: The currency code of the transactions
              TrxCount:
                type: integer
                description: The number of transactions
              TotalAmount:
                type: integer
                description: The total amount of the transactions in the currency's minor unit
              DCCForeignCurrency:
                type: integer
                description: Foreign currency code in case of a DCC transaction
              DCCForeignAmount:
                type: integer
                description: Amount in foreign currency in case of a DCC transaction
              TipAmount: 
                type: integer
                description: Tip amount in the merchant's billing currency's minor unit. Present if not 0.
        TrxListReport:
          type: array
          items:
            type: object
            required:
              - TrxSeqCnt
              - TrxDate
              - TrxTime
            properties:
              TrxSeqCnt:
                type: integer
                description: The transaction sequence counter
              TrxDate:
                type: string
                description: The date of the transaction
              TrxTime:
                type: string
                description: The time of the transaction
              FinancialCounterType:
                $ref: '#/components/schemas/FinancialCounterType'
                description: The type of the report entry
              TrxFunction:
                $ref: '#/components/schemas/TrxFunction'
                description: The transaction function
              AuthReslt:
                description: The host authorization result
              TrxCurrC:
                type: integer
                description: The currency code of the transaction
              AmtAuth:
                type: integer
                description: The authorized amount in the currency's minor unit
              AppPANPrtAttendant:
                type: string
                description: The masked PAN
    ReceiptRequest:
      type: object
      required:
        - AccessToken
      properties:
        AccessToken:
          $ref: '#/components/schemas/AccessToken'
        ReceiptType:
          $ref: '#/components/schemas/ReceiptType'
        ReceiptID:
          type: integer
          description: Transaction Sequence Counter for transaction receipts, Acquirer Identifier for initialization receipts.
          example: 1234
    ReceiptResponse:
      type: object
      required:
        - TrmID
        - ReceiptType
        - ReceiptText
      properties:
        TrmID:
          $ref: '#/components/schemas/TrmID'
        ReceiptType:
          $ref: '#/components/schemas/ReceiptType'
        ReceiptText:
          type: string
          description: The receipt content.
          example: "  *** Terminal Activation ***\\n\\n   Test Shop\\n..."
    PrintReceiptRequest:
      type: object
      required:
        - AccessToken
        - ReceiptText
      properties:
        AccessToken:
          $ref: '#/components/schemas/AccessToken'
        ReceiptText:
          type: string
          description: The text to be printed.
          example: "  *** Terminal Activation ***\n\n   Test Shop\n..."
        ReceiptFlags:
          $ref: '#/components/schemas/ReceiptFlags'
    PrintReceiptResponse:
      type: object
      required:
        - TrmID
        - PrinterStatus
      properties:
        TrmID:
          $ref: '#/components/schemas/TrmID'
        PrinterStatus:
          $ref: '#/components/schemas/PrinterStatus'
    AccessToken:
      type: string
      description: |
        Access token for communication with the terminal.

        <em>**Warning:** Ensure its confidentiality!</em>
      example: CxOr9ssjChB/sjJ9JD0XVfrwUSjFOu/0l2FZCjSiTsCU6IX/I0Mc7RyF/qR/IPS4wpIjjTNYpCLh9wonMF3VUw==
    TrmID:
      type: string
      description: Terminal identification, 8 alphanumeric characters.
      example: 12345678
    LanguageCode:
      type: string
      description: Language code, e.g. 'de' for German.
      example: de
    IFDSerialNum:
      type: string
      description: Interface device serial number.
      example: ZPD00001
    TrmStatus:
      type: integer
      description: |
        Status of the terminal, bitwise combination of the following flags, returned as a JSON decimal integer
        - SHIFT_OPEN: 0x00000001
        - CARD_DATA_AVAILABLE: 0x00000002
        - BUSY: 0x00000004
        - READER_SLOT_OCCUPIED: 0x00000008
        - LOCKED: 0x00000010
        - APPLICATION_SELECTED: 0x00000020
        - WAITING_FOR_TRANSACTION_REQUEST: 0x00000040
        - WAITING_FOR_APPLICATION_SELECTION: 0x00000080
        - ONLINE_PROCESSING: 0x00000100
        - PRINTER_UNAVAILABLE: 0x00000200
        - OUT_OF_PAPER: 0x00000400
      example: 513
    TrxFunction:
      type: integer
      description: |
        One of the following values.
        - 0x00008000/32768: PURCHASE
        - 0x00004000/16384: PURCHASE_RESERVATION
        - 0x00002000/8192: TIP
        - 0x00001000/4096: CASH_ADVANCE
        - 0x00000800/2048: CREDIT
        - 0x00000400/1024: PURCHASE_PHONE_AUTH
        - 0x00000200/512: PURCHASE_FORCED_ACCEPTANCE
        - 0x00000100/256: PURCHASE_PHONE_ORDERED
        - 0x00000080/128: AUTHORIZATION_PURCHASE
        - 0x00000040/64: PURCHASE_MAIL_ORDERED
        - 0x00000020/32: REVERSAL
        - 0x00000010/16: RESERVATION
        - 0x00000008/8: RESERVATION_ADJUSTMENT
        - 0x00000004/4: CONFIRM_PHONE_AUTH_RESERVATION
        - 0x00000001/1: PURCHASE_WITH_CASHBACK
        - 0x00020000/131072: BALANCE_INQUIRY
        - 0x00800000/8388608: ACTIVATE_CARD
        - 0x01000000/16777216: LOAD
        - 0x02000000/33554432: CANCEL_RESERVATION
        - 0x04000000/67108864: ACCOUNT_VERIFICATION
      example: 32768
    TrxFunctions:
      type: integer
      description: |
        Bitwise combination of the following values, as a JSON decimal integer.
        - 0x00008000: PURCHASE
        - 0x00004000: PURCHASE_RESERVATION
        - 0x00002000: TIP
        - 0x00001000: CASH_ADVANCE
        - 0x00000800: CREDIT
        - 0x00000400: PURCHASE_PHONE_AUTH
        - 0x00000200: PURCHASE_FORCED_ACCEPTANCE
        - 0x00000100: PURCHASE_PHONE_ORDERED
        - 0x00000080: AUTHORIZATION_PURCHASE
        - 0x00000040: PURCHASE_MAIL_ORDERED
        - 0x00000020: REVERSAL
        - 0x00000010: RESERVATION
        - 0x00000008: RESERVATION_ADJUSTMENT
        - 0x00000004: CONFIRM_PHONE_AUTH_RESERVATION
        - 0x00000001: PURCHASE_WITH_CASHBACK
        - 0x00020000: BALANCE_INQUIRY
        - 0x00800000: ACTIVATE_CARD
        - 0x01000000: LOAD
        - 0x02000000: CANCEL_RESERVATION
        - 0x04000000: ACCOUNT_VERIFICATION
    TransactionRequestFlags:
      type: integer
      description: |
        flags that impact the behaviour when starting a transaction
        - 0x00000001: Start transaction silently, without notifying the cardholder
        - 0x00000004: Report UID of unknown (non-ISO14443) NFC cards in /status
        - 0x00000008: Abort transaction silently on unknown (non-ISO14443) NFC card; report UID in TransactionResponse
      example: 5
    AbortTransactionFlags:
      type: integer
      description: |
        flags that impact the behaviour when aborting a transaction
        - 0x00000001: Abort transaction silently, without notifying the cardholder
      example: 1
    TrxResult:
      type: integer
      description: |
        General Transaction result, one of
        - 0: Transaction approved
        - 1: Transaction declined
        - 2: Transaction referred, needs authorization by phone
        - 3: Transaction aborted
      example: 0
    DeviceCommandCode:
      type: integer
      description: |
        One of the following values
        - 1:    Eject a card left within a motorized reader
        - 2:    Force-eject a card left within a motorized reader
        - 501:  Reboot the terminal
        - 502:  Trigger software update on the terminal
        - 511:  (From SW Version >= 20) Start a remote maintenance session if configured on the TMS. Skips waiting for the usual polling interval
        - 521:  (From SW Version >= 20) Ship technical log data to the TMS
        - 1001: Show a language selection dialog if chip card without language preference is inserted
        - 1002: Don't show a language selection dialog if chip card without language preference is inserted
        - 2001: Show the terminal's idle message (usually 'Welcome, present card' in activated state)
        - 2002: Show the card insertion message to the cardholder
        - 2601: Scans a 1D/2D bar code. Available on Android devices equipped with a scanner and PayTec EP2 software equal or higher than 21.01.11
    FinancialCounterType:
      type: integer
      description: |
        One of the following values
        - 0: Debit
        - 1: Credit
        - 2: Debit reversal
        - 3: Credit reversal
        - 4: Reservation
        - 5: Non-financial
      example: 1
    ReportType:
      type: integer
      description: |
        One of the following values
        - 1: Sum of shift
        - 2: Sum of accounting period
        - 1001: List of open petrol authorizations
      example: 1
    ReceiptType:
      type: integer
      description: |
        One of the following values
        - 1: Transaction receipt
        - 2: Transaction receipt copy - usually the cardholder receipt
        - 11: Terminal activation receipt
        - 13: Terminal deactivation receipt
        - 21: Final balance receipt
        - 41: Configuration receipt
        - 43: Initialization receipt
      example: 1
    ReceiptFlags:
      type: integer
      description: |
        flags that impact the behaviour when printing a receipt
        - 0x00000004: Print with double height
        - 0x00000010: Print inverse
        - 0x00000020: ReceiptText is a base64 encoded PNG image
      example: 16
    POSEntryMode:
      type: integer
      description: |
        Point of sale entry mode, one of the following values
        - 0:    Unknown POS entry mode
        - 1:    Manual entry
        - 3:    Bar code
        - 4:    OCR
        - 5:    Integrated circuit card
        - 6:    Integrated circuit card with PAN retrieval
        - 20:   Reference-based transaction
        - 21:   Bluetooth Low Energy
        - 90:   Magnetic stripe
        - 91:   Magnetic stripe after first unsuccessful IC read
        - 92:   Magnetic stripe after unsuccessful IC read
        - 93:   Magnetic stripe after ICC processing failed
        - 97:   Contactless, EMV profile
        - 98:   Contactless, magnetic stripe profile
        - 99:   Contactless, EMV profile with PAN retrieval
        - 1001: Merchant-presented QR code
    PrinterStatus:
      type: integer
      description: |
        Bitwise combination of the following values, as a JSON decimal integer.
        - 0x00000000: Printer OK
        - 0x00000001: No paper
        - 0x00000002: Jammed
        - 0x00000004: Overheat
        - 0x00000008: Other printer error
        - 0x00000010: Print buffer full
        - 0x00000020: Printing timed out
        - 0x00000040: Printer power failure
      example: 0
