openapi: 3.0.0
info:
  version: v2
  title: Pay at Counter REST API
  description: |
    # Introduction

    Documentation for the yetipay Pay at Counter REST API.
  x-logo:
    url: /assets/yetipay-logo.png
    altText: yetipay Logo
    backgroundColor: '#EBE0FC'
    href: https://yetipay.me
servers:
  - url: https://connect.yeti.host
    description: Production server
  - url: https://connect.test.yeti.host
    description: Development server
security:
  - connectBasicAuth: []
components:
  securitySchemes:
    connectBasicAuth:
      type: http
      scheme: basic
  parameters:
    tidParam:
      name: tid
      description: Unique identifier of the terminal to use.
      in: path
      required: true
      schema:
        type: string
    requestIdParam:
      name: requestId
      description: Id (a UUID assigned to a terminal request) for the request to use.
      in: path
      required: true
      schema:
        type: string
  schemas:
    currency:
      description: Currency for the request. Uses the textual representation from ISO 4217.
      type: string
      enum:
        - GBP
        - EUR
      example: GBP
    format:
      type: string
      enum:
        - BOLD
        - DOUBLE_HEIGHT
        - DOUBLE_WIDTH
    issuerTotals:
      type: object
      description: >-
        A dictionary containing totals organized by issuer. {issuerName}
        represents an example key.
      properties:
        '{issuerName}':
          $ref: '#/components/schemas/totalsBreakdown'
    messageList:
      type: array
      items:
        type: string
    notifications:
      type: string
      enum:
        - APPROVED
        - ATTEMPTING_CANCEL
        - BAD_SWIPE
        - CANCELLING
        - CARD_ERROR
        - CARD_EXPIRED
        - CARD_NOT_SUPPORTED
        - CONNECTING
        - CONNECTION_MADE
        - DECLINED
        - DECLINED_BY_CARD
        - INSERT_CARD
        - PIN_ENTRY
        - PLEASE_WAIT
        - PRESENT_CARD
        - PRESENT_ONLY_ONE_CARD
        - PROCESSING_ERROR
        - REMOVE_CARD
        - RETRYING
        - REQUEST_SENT
        - RE_PRESENT_CARD
        - SIGNATURE_VERIFICATION
        - SIGNATURE_VERIFICATION_PROCESS_COMPLETED
        - SIGNATURE_VERIFICATION_PROCESS_COULD_NOT_BE_COMPLETED
        - SIGNATURE_VERIFICATION_IN_PROGRESS
        - SIGNATURE_VERIFICATION_TIMEOUT
        - TRANSACTION_FINISHED
        - TRANSACTION_STARTED
        - UNABLE_TO_CANCEL
    paymentMethod:
      type: string
      example: ICC_CHIP
      enum:
        - UNKNOWN
        - KEYED
        - SWIPED
        - ICC_CHIP
        - CONTACTLESS
    receiptLine:
      type: object
      required:
        - value
      properties:
        format:
          description: Specifies any special formatting applied to this line.
          type: array
          items:
            $ref: '#/components/schemas/format'
          example:
            - BOLD
        type:
          description: The type of content contained in the value field.
          type: string
          enum:
            - TEXT
            - BOX_DECLINE
            - BOX_VOID
            - CARRIAGE_RETURN
            - LINE_SEPARATOR_SINGLE
            - LINE_SEPARATOR_DOUBLE
            - TICKET_FEED
          example: TEXT
        value:
          description: The raw content of the line.
          type: string
          example: John's Shop
    receiptLineList:
      type: array
      items:
        $ref: '#/components/schemas/receiptLine'
    reportBalances:
      description: >-
        Local totals for the current terminal session. Only included in
        X_BALANCE, Z_BALANCE, and END_OF_DAY reports.
      type: object
      required:
        - currency
        - issuerTotals
        - totalAmount
        - totalCashbackAmount
        - totalCashbackCount
        - totalGratuityAmount
        - totalGratuityCount
        - totalRefundsAmount
        - totalRefundsCount
        - totalSalesAmount
        - totalSalesCount
        - totalsSince
        - waiterTotals
      properties:
        currency:
          $ref: '#/components/schemas/currency'
        issuerTotals:
          $ref: '#/components/schemas/issuerTotals'
        totalAmount:
          description: Total amount taken during the current session.
          type: integer
          example: '1000'
        totalCashbackAmount:
          description: >-
            Total amount of cashback (in pence) taken during the current
            session.
          type: integer
          example: '100'
        totalCashbackCount:
          description: >-
            Total number of transactions with cashback that occurred during the
            current session.
          type: integer
          example: '2'
        totalGratuityAmount:
          description: >-
            Total amount of gratuity (in pence) taken during the current
            session.
          type: integer
          example: '100'
        totalGratuityCount:
          description: >-
            Total number of transactions with gratuity that occurred during the
            current session.
          type: integer
          example: '3'
        totalRefundsAmount:
          description: >-
            Total amount of refunds (in pence) processed during the current
            session.
          type: integer
          example: '400'
        totalRefundsCount:
          description: Total number of refunds that occurred during the current session.
          type: integer
          example: '9'
        totalSalesAmount:
          description: >-
            Total amount of sales (in pence) processed during the current
            session.
          type: integer
          example: '1200'
        totalSalesCount:
          description: Total number of sales that occurred during the current session.
          type: integer
          example: '14'
        totalsSince:
          description: Timestamp indicating when the terminal totals were last reset.
          type: string
          example: INSTALLATION
        waiterTotals:
          $ref: '#/components/schemas/waiterTotals'
    reportBanking:
      type: object
      required:
        - currency
        - currentSessionIssuerTotals
        - previousSessionIssuerTotals
        - currentSessionTotals
        - previousSessionTotals
        - currentSessionTransactionNumbers
        - previousSessionTransactionNumbers
      properties:
        currency:
          $ref: '#/components/schemas/currency'
        currentSessionIssuerTotals:
          $ref: '#/components/schemas/issuerTotals'
        previousSessionIssuerTotals:
          $ref: '#/components/schemas/issuerTotals'
        currentSessionTotals:
          $ref: '#/components/schemas/totalsBreakdown'
        previousSessionTotals:
          $ref: '#/components/schemas/totalsBreakdown'
        currentSessionTransactionNumbers:
          description: Range of transaction numbers for the current terminal session.
          type: array
          items:
            type: string
          example:
            - '0076'
            - '0123'
        previousSessionTransactionNumbers:
          description: Range of transaction numbers for the previous terminal session.
          type: array
          items:
            type: string
          example:
            - '0000'
            - '0075'
    reportRequest:
      type: object
      properties:
        reportType:
          $ref: '#/components/schemas/reportType'
    reportResponse:
      type: object
      required:
        - requestId
        - location
        - notifications
      properties:
        balances:
          $ref: '#/components/schemas/reportBalances'
        banking:
          $ref: '#/components/schemas/reportsBanking'
        reportLines:
          $ref: '#/components/schemas/receiptLineList'
        reportTime:
          description: Timestamp indicating when the report was generated.
          type: string
          format: YYYY-MM-DDThh:mm:ss
          example: '2019-03-04T16:12:00'
        reportType:
          description: The type of report.
          type: string
          enum:
            - END_OF_DAY
            - BANKING
            - X_BALANCE
            - Z_BALANCE
          example: END_OF_DAY
        reportResult:
          description: The outcome of the report.
          type: string
          enum:
            - TIMED_OUT
            - COMPLETE
          example: COMPLETE
        tid:
          description: Unique identifier of the terminal used in this request.
          type: string
          example: '12345678'
        requestId:
          description: UUID for this request that can be used in other endpoints.
          type: string
          example: d19912ad-11a3-4af3-86e0-d6eb2ebea63c
        location:
          description: URI where information about this report is available.
          type: string
          format: URI
          example: https://connect.yeti.host/pac/terminals/{tid}/report/{requestId}
        notifications:
          description: Notifications that indicate the progress of the report.
          type: array
          items:
            type: string
            enum:
              - REPORT_FINISHED
              - REPORT_STARTED
            example:
              - REPORT_FINISHED
              - REPORT_STARTED
    reportsBanking:
      type: object
      description: >-
        Banking totals for the current terminal session (these are reset
        according to the banking window). Only included in BANKING and
        END_OF_DAY reports. Consists of a dictionary of reports keyed by
        acquirer name. '{acquirerName}' represents an example key
      properties:
        '{acquirerName}':
          $ref: '#/components/schemas/reportBanking'
    reportType:
      description: The type of report.
      type: string
      enum:
        - END_OF_DAY
        - BANKING
        - X_BALANCE
        - Z_BALANCE
      example: END_OF_DAY
    requestLocationResponse:
      type: object
      properties:
        requestId:
          description: UUID for this request that can be used in other endpoints.
          type: string
          example: d19912ad-11a3-4af3-86e0-d6eb2ebea63c
        location:
          description: URI where information about this request is available.
          type: string
          format: URI
          example: >-
            https://connect.yeti.host/pac/terminals/{tid}/{requestType}/{requestId}
    terminal:
      title: Terminal
      type: object
      required:
        - tid
        - status
        - currency
        - location
      properties:
        tid:
          description: Unique identifier of the terminal.
          type: string
          example: '12345678'
        status:
          description: >-
            Current status of the terminal, which indicates whether it is ready
            to accept requests.
          type: string
          enum:
            - AVAILABLE
            - BUSY
          example: AVAILABLE
        currency:
          description: >-
            Currency in which the terminal is configured. Uses the textual
            representation from ISO 4217.
          type: string
          enum:
            - GBP
            - EUR
          example: GBP
        location:
          description: URI where information about this terminal is available.
          type: string
          format: URI
          example: https://connect.yeti.host/pac/terminals/{tid}
    terminalList:
      type: array
      items:
        $ref: '#/components/schemas/terminal'
    terminalWrapper:
      type: object
      properties:
        terminals:
          $ref: '#/components/schemas/terminalList'
    totalsBreakdown:
      type: object
      required:
        - currency
        - totalAmount
        - totalRefundsAmount
        - totalRefundsCount
        - totalSalesAmount
        - totalSalesCount
      properties:
        currency:
          $ref: '#/components/schemas/currency'
        totalAmount:
          description: Total amount taken during the current session.
          type: integer
        totalRefundsAmount:
          description: >-
            Total amount of refunds (in pence) processed during the current
            session.
          type: integer
        totalRefundsCount:
          description: Total number of refunds that occurred during the current session.
          type: integer
        totalSalesAmount:
          description: >-
            Total amount of sales (in pence) processed during the current
            session.
          type: integer
        totalSalesCount:
          description: Total number of sales that occurred during the current session.
          type: integer
    transaction:
      type: object
      properties:
        amountBase:
          description: >-
            Base amount of the transaction (in pence), excluding cashback and
            gratuity.
          type: integer
          format: int32
          example: '100'
        amountCashback:
          description: Amount of cashback (in pence) included in the transaction.
          type: integer
          format: int32
          example: '30'
        amountGratuity:
          description: Amount of gratuity (in pence) included in the transaction.
          type: integer
          format: int32
          example: '20'
        amountTotal:
          description: Sum of amountBase, amountCashback, and amountGratuity (in pence).
          type: integer
          format: int32
          example: '150'
        applicationId:
          description: Identifier of the application on the card used in the transaction.
          type: string
          example: A0000000031010
        applicationLabel:
          description: Name of the application on the card used in the transaction.
          type: string
          example: VISA
        authCode:
          description: Authorization code provided by the bank to approve the transaction.
          type: string
          example: 78YT6RS0
        cardSchemeName:
          description: >-
            Scheme of the card used in the transaction. The scheme governs the
            operation of payment transactions.
          type: string
          example: VISA
        cardHolderVerificationMethod:
          description: >-
            Method used to verify that the person presenting the card is the
            legitimate cardholder.
          type: string
          enum:
            - UNKNOWN
            - NONE
            - PIN
            - SIGNATURE
            - DEVICE
          example: PIN
        currency:
          description: >-
            Currency in which the transaction was processed. Uses the textual
            representation from ISO 4217.
          type: string
          enum:
            - GBP
            - EUR
          example: GBP
        dateOfExpiry:
          description: Expiration date of the card used in the transaction.
          type: string
          format: MM/YY
          example: 01/25
        dateOfStart:
          description: Start date of the card used in the transaction.
          type: string
          format: MM/YY
          example: 01/19
        location:
          description: URI where information about this transaction is available.
          type: string
          format: URI
          example: >-
            https://connect.yeti.host/pac/terminals/{tid}/transactions/{requestId}
        notifications:
          description: Notifications that indicate the progress of the transaction.
          type: array
          items:
            $ref: '#/components/schemas/notifications'
          example:
            - TRANSACTION_FINISHED
            - APPROVED
            - CONNECTION_MADE
            - CONNECTING
            - PIN_ENTRY
            - PLEASE_WAIT
            - PRESENT_CARD
            - TRANSACTION_STARTED
            - REPLACE_PAPER
        paymentMethod:
          description: Method used to read the card details from the payment medium.
          type: string
          example: ICC_CHIP
          enum:
            - UNKNOWN
            - KEYED
            - SWIPED
            - ICC_CHIP
            - CONTACTLESS
        primaryAccountNumber:
          description: >-
            Primary account number of the card used in the transaction. Only the
            last 4 digits are provided.
          type: string
          example: '************1234'
        primaryAccountNumberSequence:
          description: >-
            Sequence number of the primary account number for the card used in
            the transaction. Used to distinguish cards with the same primary
            account number.
          type: string
          example: '01'
        receiptLines:
          description: Card terminal receipt(s) for the transaction.
          type: object
          properties:
            MERCHANT:
              $ref: '#/components/schemas/receiptLineList'
            CUSTOMER:
              $ref: '#/components/schemas/receiptLineList'
        requestId:
          description: UUID for this request that can be used in other endpoints.
          type: string
          example: d19912ad-11a3-4af3-86e0-d6eb2ebea63c
        transactionId:
          description: Identifier used by the terminal to identify this transaction.
          type: string
          example: '1234567'
        transactionNumber:
          description: Transaction number within the current terminal session.
          type: string
          example: '0012'
        transactionResult:
          description: The outcome of the transaction.
          type: string
          enum:
            - SUCCESSFUL
            - DECLINED
            - VOID
            - UNSUCCESSFUL
            - CANCELLED
            - TIMED_OUT
          example: SUCCESSFUL
        transactionTime:
          description: Timestamp indicating when the transaction occurred.
          type: string
          format: YYYY-MM-DDThh:mm:ss
          example: '2019-03-04T16:12:00'
        transactionType:
          description: The type of transaction.
          type: string
          enum:
            - LOGON
            - REFUND
            - REFUND_REVERSAL
            - SALE
            - SALE_REVERSAL
            - PRE_AUTH
            - COMPLETION
            - ACCOUNT_VERIFICATION
          example: SALE
        userMessage:
          description: >-
            Message related to the transaction that should be displayed to the
            user.
          type: string
          example: >-
            Signature check not actioned before timeout. When required,
            signatures must be verified within 80 seconds.
      required:
        - location
        - notifications
    transactionRequest:
      type: object
      properties:
        transactionType:
          $ref: '#/components/schemas/transactionType'
        currency:
          $ref: '#/components/schemas/currency'
        amount:
          description: >-
            Accepted for all transactions except duplicates. Base amount for the
            transaction (in pence).
          type: integer
          minimum: 1
          maximum: 99999999
          example: 1234
        amountCashback:
          description: >-
            Only accepted for sale transactions. Amount of cashback to attempt
            to include in this transaction (in pence). The amountCashback field
            in the transaction should always be checked to determine the actual
            amount of cashback processed.
          type: integer
          minimum: 0
          maximum: 10000
          example: 100
        cardholderNotPresent:
          description: >-
            Accepted for all transactions except duplicates. Indicates whether
            this transaction should be completed as CNP (e.g. manual entry of
            card details). If set, the PDQ will skip the present card screen
            (for sales and refunds) and immediately prompt for manual entry of
            card details. Transactions with this flag set are permitted to take
            longer to complete than a standard transaction.
          type: boolean
          example: true
        authCode:
          description: >-
            Required for completion transactions and not accepted for any other
            transaction types. Should contain the authorization code of the
            first pre-auth transaction performed on a customer's card. Pre-auths
            and completions must be completed on the same card.
          type: string
          example: ABC123
        amountPreAuthorisedTotal:
          description: >-
            Required for completion transactions and not accepted for any other
            transaction types. Should contain the sum of all pre-auth
            transactions performed on a customer's card. Pre-auths and
            completions must be processed on the same card.
          type: integer
          minimum: 1
          maximum: 99999999
          example: 1234
    saleRequest:
      type: object
      properties:
        transactionType:
          $ref: '#/components/schemas/transactionType'
        currency:
          $ref: '#/components/schemas/currency'
        amount:
          description: Base amount for the transaction (in pence).
          type: integer
          minimum: 1
          maximum: 99999999
          example: 1234
        amountCashback:
          description: >-
            Amount of cashback to attempt to include in this transaction (in
            pence). The amountCashback field in the transaction should always be
            checked to determine the actual amount of cashback processed.
          type: integer
          minimum: 0
          maximum: 10000
          example: 100
        cardholderNotPresent:
          description: >-
            Indicates whether this transaction should be completed as CNP (e.g.
            manual entry of card details). If set, the PDQ will skip the present
            card screen (for sales and refunds) and immediately prompt for
            manual entry of card details. Transactions with this flag set are
            allowed to take longer to complete than a standard transaction.
          type: boolean
          example: true
    refundRequest:
      type: object
      properties:
        transactionType:
          $ref: '#/components/schemas/transactionType'
        currency:
          $ref: '#/components/schemas/currency'
        amount:
          description: Base amount for the transaction (in pence).
          type: integer
          example: 1234
        cardholderNotPresent:
          description: >-
            Indicates whether this transaction should be completed as CNP (e.g.
            manual entry of card details). If set, the PDQ will skip the present
            card screen (for sales and refunds) and immediately prompt for
            manual entry of card details. Transactions with this flag set are
            allowed to take longer to complete than a standard transaction.
          type: boolean
          example: true
    preAuthRequest:
      type: object
      properties:
        transactionType:
          $ref: '#/components/schemas/transactionType'
        currency:
          $ref: '#/components/schemas/currency'
        amount:
          description: Base amount for the transaction (in pence).
          type: integer
          example: 1234
        cardholderNotPresent:
          description: >-
            Indicates whether this transaction should be completed as CNP (e.g.
            manual entry of card details). If set, the PDQ will skip the present
            card screen (for sales and refunds) and immediately prompt for
            manual entry of card details. Transactions with this flag set are
            allowed to take longer to complete than a standard transaction.
          type: boolean
          example: true
    completionRequest:
      type: object
      properties:
        transactionType:
          $ref: '#/components/schemas/transactionType'
        currency:
          $ref: '#/components/schemas/currency'
        amount:
          description: Base amount for the transaction (in pence).
          type: integer
          example: 1234
        cardholderNotPresent:
          description: >-
            Indicates whether this transaction should be completed as CNP (e.g.
            manual entry of card details). If set, the PDQ will skip the present
            card screen (for sales and refunds) and immediately prompt for
            manual entry of card details. Transactions with this flag set are
            allowed to take longer to complete than a standard transaction.
          type: boolean
          example: true
        authCode:
          description: >-
            Should contain the authorization code of the first pre-auth
            transaction performed on a customer's card. Pre-auths and
            completions must be completed on the same card.
          type: string
          example: ABC123
    duplicateRequest:
      type: object
      properties:
        transactionType:
          $ref: '#/components/schemas/transactionType'
        currency:
          $ref: '#/components/schemas/currency'
    accountVerificationRequest:
      type: object
      properties:
        transactionType:
          $ref: '#/components/schemas/transactionType'
        currency:
          $ref: '#/components/schemas/currency'
    transactionType:
      description: Type of the transaction.
      type: string
      enum:
        - SALE
        - REFUND
        - DUPLICATE
        - PRE_AUTH
        - COMPLETION
        - ACCOUNT_VERIFICATION
      example: SALE
    userMessage:
      type: object
      properties:
        userMessage:
          description: Error message that should be displayed to the user.
          type: string
          example: >-
            This is an example error message. The string here should be
            displayed to the user.
    waiterTotals:
      type: object
      description: >-
        A dictionary containing totals organized by waiter. {waiterId}
        represents an example key.
      properties:
        '{waiterId}':
          $ref: '#/components/schemas/totalsBreakdown'
  responses:
    unauthorized:
      description: >-
        Request could not be authorized:<ul><li>Authorization credentials were
        not included in the request headers</li><li>The authorization
        credentials provided were incorrect</li></ul>
      content:
        application/connect.v2+json:
          schema:
            $ref: '#/components/schemas/userMessage'
    internalError:
      description: >-
        An internal error occurred within the API. The request should be
        retried, and if the problem persists, support should be contacted.
    unprocessibleEntity:
      description: >-
        Request could not be processed:<ul><li>The JSON received was invalid
        (e.g. missing field, invalid value in field)</li><li>Missing
        <strong>Software-House-Id</strong> or <strong>Installer-Id</strong>
        header</li></ul>
      content:
        application/connect.v2+json:
          schema:
            $ref: '#/components/schemas/userMessage'
    unprocessibleAndBusy:
      description: >-
        Request could not be processed:<ul><li>The JSON received was invalid
        (e.g. missing field, invalid value in field)</li><li>Terminal is
        currently busy processing another request</li><li>Missing
        <strong>Software-House-Id</strong> or <strong>Installer-Id</strong>
        header</li></ul>
      content:
        application/connect.v2+json:
          schema:
            $ref: '#/components/schemas/userMessage'
    unavailableTerminal:
      description: >-
        Terminal could not be found:<ul><li>Terminal is unavailable</li><li>No
        data is available for the terminal</li></ul>
      content:
        application/connect.v2+json:
          schema:
            $ref: '#/components/schemas/userMessage'
    unavailableTerminalOrTransaction:
      description: >-
        Terminal or transaction could not be found:<ul><li>Terminal is
        unavailable</li><li>No data is available for the
        terminal</li><li>Transaction requestId was not found</li></ul>
      content:
        application/connect.v2+json:
          schema:
            $ref: '#/components/schemas/userMessage'
    unavailableReportOrTransaction:
      description: >-
        Terminal or report could not be found:<ul><li>Terminal is
        unavailable</li><li>No data is available for the terminal</li><li>Report
        requestId was not found</li></ul>
      content:
        application/connect.v2+json:
          schema:
            $ref: '#/components/schemas/userMessage'
paths:
  /pac/terminals:
    get:
      description: >-
        Retrieves a list of all currently connected card terminals. Results can
        be filtered by currency and status.
      tags:
        - Terminals
      operationId: List Terminals
      parameters:
        - name: status
          in: query
          required: false
          description: >-
            Restricts the response to show only available or only busy
            terminals.
          schema:
            type: string
            enum:
              - AVAILABLE
              - BUSY
        - name: currency
          in: query
          required: false
          description: >-
            Restricts the response to terminals configured for a specific
            currency.
          schema:
            type: string
            enum:
              - GBP
              - EUR
      responses:
        '200':
          description: A list of terminals is returned
          content:
            application/connect.v2+json:
              schema:
                $ref: '#/components/schemas/terminalWrapper'
        '401':
          $ref: '#/components/responses/unauthorized'
        '422':
          $ref: '#/components/responses/unprocessibleEntity'
        '500':
          $ref: '#/components/responses/internalError'
  /pac/terminals/{tid}:
    parameters:
      - $ref: '#/components/parameters/tidParam'
    get:
      description: Retrieves details for a specific terminal.
      tags:
        - Terminals
      operationId: Get Terminal by ID
      x-displayName: Get Terminal by ID
      responses:
        '200':
          description: Information about the requested terminal is returned
          content:
            application/connect.v2+json:
              schema:
                $ref: '#/components/schemas/terminal'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/unavailableTerminal'
        '422':
          $ref: '#/components/responses/unprocessibleEntity'
        '500':
          $ref: '#/components/responses/internalError'
  /pac/terminals/{tid}/transactions:
    parameters:
      - $ref: '#/components/parameters/tidParam'
    post:
      description: >-
        Initiates a transaction on the terminal identified by the given terminal
        identifier.
      tags:
        - Transactions
      operationId: Start Transaction
      requestBody:
        required: true
        content:
          application/connect.v2+json:
            schema:
              $ref: '#/components/schemas/transactionRequest'
            examples:
              Sale:
                value:
                  transactionType: SALE
                  amount: 100
                  amountCashback: 50
                  currency: GBP
                  cardholderNotPresent: true
              Refund:
                value:
                  transactionType: REFUND
                  amount: 100
                  currency: GBP
              Duplicate:
                value:
                  transactionType: DUPLICATE
              Account Verification:
                value:
                  transactionType: ACCOUNT_VERIFICATION
              Pre-auth:
                value:
                  transactionType: PRE_AUTH
                  amount: 100
                  currency: GBP
              Completion:
                value:
                  transactionType: COMPLETION
                  amount: 100
                  currency: GBP
                  authCode: ABC123
                  amountPreAuthorisedTotal: 200
      responses:
        '201':
          description: >-
            Transaction request has been accepted. Polling should begin on the
            returned requestId to determine the progress and result of the
            transaction.
          content:
            application/connect.v2+json:
              schema:
                $ref: '#/components/schemas/requestLocationResponse'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/unavailableTerminal'
        '422':
          $ref: '#/components/responses/unprocessibleAndBusy'
        '500':
          $ref: '#/components/responses/internalError'
  /pac/terminals/{tid}/transactions/{requestId}:
    parameters:
      - $ref: '#/components/parameters/tidParam'
      - $ref: '#/components/parameters/requestIdParam'
    get:
      description: Retrieves data for the transaction identified by the given requestId.
      tags:
        - Transactions
      operationId: Get Transaction Status
      responses:
        '200':
          description: >-
            Transaction details have been returned successfully.

            Properties marked with an * are always included in the response.
            Additional properties are only included after a transaction has
            completed (e.g. when the most recent notification is
            "TRANSACTION_FINISHED"), though their values may be empty.
          content:
            application/connect.v2+json:
              schema:
                $ref: '#/components/schemas/transaction'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/unavailableTerminalOrTransaction'
        '422':
          $ref: '#/components/responses/unprocessibleEntity'
        '500':
          $ref: '#/components/responses/internalError'
    delete:
      description: Attempts to cancel the transaction identified by the given requestId.
      tags:
        - Transactions
      operationId: Cancel Transaction
      responses:
        '202':
          description: >-
            Request to attempt cancellation of the transaction has been
            accepted. The outcome of this request should be determined from
            standard transaction polling.
          content:
            application/connect.v2+json: {}
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/unavailableTerminalOrTransaction'
        '422':
          $ref: '#/components/responses/unprocessibleEntity'
        '500':
          $ref: '#/components/responses/internalError'
  /pac/terminals/{tid}/reports:
    parameters:
      - $ref: '#/components/parameters/tidParam'
    post:
      description: >-
        Initiates a report on the terminal identified by the given terminal
        identifier.
      tags:
        - Reports
      operationId: Request Report
      requestBody:
        required: true
        content:
          application/connect.v2+json:
            schema:
              $ref: '#/components/schemas/reportRequest'
      responses:
        '201':
          description: >-
            Report request has been accepted. Polling should begin on the
            returned requestId to determine the progress and result of the
            report.
          content:
            application/connect.v2+json:
              schema:
                $ref: '#/components/schemas/requestLocationResponse'
        '401':
          $ref: '#/components/responses/unauthorized'
        '422':
          $ref: '#/components/responses/unprocessibleAndBusy'
        '500':
          $ref: '#/components/responses/internalError'
  /pac/terminals/{tid}/reports/{requestId}:
    parameters:
      - $ref: '#/components/parameters/tidParam'
      - $ref: '#/components/parameters/requestIdParam'
    get:
      description: Retrieves data for the report identified by the given requestId.
      tags:
        - Reports
      operationId: Retrieve Report
      responses:
        '200':
          description: >-
            Report details have been returned successfully.

            Properties marked with an * are always included in the response.
            Additional properties are only included after a report has completed
            (e.g. when the most recent notification is "REPORT_FINISHED"),
            though their values may be empty.
          content:
            application/connect.v2+json:
              schema:
                $ref: '#/components/schemas/reportResponse'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/unavailableReportOrTransaction'
        '422':
          $ref: '#/components/responses/unprocessibleEntity'
        '500':
          $ref: '#/components/responses/internalError'
