swagger: '2.0'
info:
  version: v1
  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
basePath: /
schemes:
  - https
consumes:
  - application/connect.v1+json
produces:
  - application/connect.v1+json
securityDefinitions:
  connectBasicAuth:
    type: basic
security:
  - connectBasicAuth: []
paths:
  /pac/terminals:
    get:
      description: >-
        Retrieves a list of all currently connected card terminals. Results can
        be filtered by currency, capabilities, and status.
      tags:
        - Terminals
      operationId: List Terminals
      parameters:
        - name: status
          in: query
          required: false
          type: string
          description: >-
            Restricts the response to show only available or only busy
            terminals.
          enum:
            - AVAILABLE
            - BUSY
        - name: capabilities
          in: query
          required: false
          type: string
          description: >-
            Restricts the response to terminals that have specific capabilities.
            Values should be provided as a comma-separated list.
        - name: currency
          in: query
          required: false
          type: string
          description: >-
            Restricts the response to terminals configured for a specific
            currency.
          enum:
            - GBP
            - EUR
      responses:
        '200':
          description: A list of terminals is returned
          schema:
            $ref: '#/definitions/terminalWrapper'
        '401':
          description: Request headers must include authorization credentials.
        '401 ':
          description: The authorization credentials provided were incorrect.
        '500 ':
          description: An internal error occurred within the API.
  /pac/terminals/{tpi}:
    get:
      description: Retrieves details for a specific terminal.
      tags:
        - Terminals
      operationId: Get Terminal by ID
      parameters:
        - $ref: '#/parameters/tpiParam'
      responses:
        '200':
          description: Information about the requested terminal is returned
          schema:
            $ref: '#/definitions/terminal'
        '401':
          description: Request headers must include authorization credentials.
        '401 ':
          description: The authorization credentials provided were incorrect.
        '404 ':
          description: Terminal is unavailable or no data is available for the terminal.
        '500 ':
          description: An internal error occurred within the API.
  /pac/terminals/{tpi}/transactions:
    post:
      description: >-
        Initiates a transaction on the terminal identified by the given terminal
        identifier.
      tags:
        - Transactions
      operationId: Start Transaction
      parameters:
        - $ref: '#/parameters/tpiParam'
        - name: TransactionRequest
          in: body
          required: true
          schema:
            $ref: '#/definitions/transactionRequest'
      responses:
        '201':
          description: >-
            Transaction was successfully initiated. The response includes the
            transaction requestId and an endpoint location for retrieving
            additional details.
          schema:
            $ref: '#/definitions/requestLocationResponse'
        '401':
          description: Request headers must include authorization credentials.
        '422':
          description: The card terminal is currently busy.
        '401 ':
          description: The authorization credentials provided were incorrect.
        '404 ':
          description: Terminal is unavailable or no data is available for the terminal.
        '422 ':
          description: The JSON received was invalid.
        '500 ':
          description: An internal error occurred within the API.
  /pac/terminals/{tpi}/transactions/{requestId}:
    get:
      description: Retrieves data for the transaction identified by the given requestId.
      tags:
        - Transactions
      operationId: Get Transaction Status
      parameters:
        - $ref: '#/parameters/tpiParam'
        - $ref: '#/parameters/requestIdParam'
      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.
          schema:
            $ref: '#/definitions/transaction'
        '401':
          description: Request headers must include authorization credentials.
        '404':
          description: Terminal is unavailable or no data is available for the terminal.
        '401 ':
          description: The authorization credentials provided were incorrect.
        '404 ':
          description: The specified requestId was not found.
        '500 ':
          description: An internal error occurred within the API.
    delete:
      description: Attempts to cancel the transaction identified by the given requestId.
      tags:
        - Transactions
      operationId: Cancel Transaction
      parameters:
        - $ref: '#/parameters/tpiParam'
        - $ref: '#/parameters/requestIdParam'
      responses:
        '204':
          description: The transaction associated with the requestId has been cancelled.
          schema: {}
        '401':
          description: Request headers must include authorization credentials.
        '401 ':
          description: The authorization credentials provided were incorrect.
        '404 ':
          description: The specified requestId was not found.
        '422 ':
          description: The transaction could not be cancelled.
        '500 ':
          description: An internal error occurred within the API.
  /pac/terminals/{tpi}/reports:
    post:
      description: >-
        Initiates a report on the terminal identified by the given terminal
        identifier.
      tags:
        - Reports
      operationId: Request Report
      parameters:
        - $ref: '#/parameters/tpiParam'
        - name: reportRequest
          in: body
          required: true
          schema:
            $ref: '#/definitions/reportRequest'
      responses:
        '201':
          description: >-
            Report was successfully initiated. The response includes the report
            requestId and an endpoint location for retrieving additional
            details.
          schema:
            $ref: '#/definitions/requestLocationResponse'
        '401':
          description: Request headers must include authorization credentials.
        '401 ':
          description: The authorization credentials provided were incorrect.
        '422 ':
          description: The JSON received was invalid.
        '500 ':
          description: An internal error occurred within the API.
  /pac/terminals/{tpi}/reports/{requestId}:
    get:
      description: Retrieves data for the report identified by the given requestId.
      tags:
        - Reports
      operationId: Retrieve Report
      parameters:
        - $ref: '#/parameters/tpiParam'
        - $ref: '#/parameters/requestIdParam'
      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.
          schema:
            $ref: '#/definitions/reportResponsePAC'
        '401':
          description: Request headers must include authorization credentials.
        '404':
          description: Terminal is unavailable or no data is available for the terminal.
        '500':
          description: An internal error occurred within the API.
        '401 ':
          description: The authorization credentials provided were incorrect.
        '404 ':
          description: The specified requestId was not found.
parameters:
  tpiParam:
    name: tpi
    description: Unique identifier of the terminal to use in this request.
    in: path
    required: true
    type: string
  requestIdParam:
    name: requestId
    description: >-
      Request Id (a UUID assigned to a terminal request) for the terminal
      request to use in this request.
    in: path
    required: true
    type: string
definitions:
  capabilities:
    type: string
    enum:
      - SALE
      - REFUND
      - DUPLICATE
      - CANCEL_TRANSACTION
      - REPORT_END_OF_DAY
      - REPORT_BANKING
      - REPORT_X_BALANCE
      - REPORT_Z_BALANCE
      - TERMINAL_STATUS
  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: '#/definitions/totalsBreakdown'
  messageList:
    type: array
    items:
      type: string
  reportResultsPAT:
    type: string
    enum:
      - COMPLETE
  notifications:
    type: string
    enum:
      - APPROVED
      - BAD_SWIPE
      - 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
  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: '#/definitions/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
  'receiptLine ':
    type: object
    required:
      - value
    properties:
      format:
        description: Specifies any special formatting applied to this line.
        type: array
        items:
          $ref: '#/definitions/format'
        example:
          - BOLD
      type:
        type: string
        enum:
          - TEXT
          - IMAGE_LOGO
          - CARRIAGE_RETURN
          - LINE_SEPARATOR_SINGLE
          - LINE_SEPARATOR_DOUBLE
          - TICKET_FEED
          - BARCODE_CODE25
          - BARCODE_CODE39
          - BARCODE_CODE128
      value:
        type: string
  receiptLineList:
    type: array
    items:
      $ref: '#/definitions/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: '#/definitions/currency'
      issuerTotals:
        $ref: '#/definitions/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: Time at which the terminal totals were last reset.
        type: string
        example: INSTALLATION
      waiterTotals:
        $ref: '#/definitions/waiterTotals'
  reportBanking:
    type: object
    required:
      - currency
      - currentSessionIssuerTotals
      - previousSessionIssuerTotals
      - currentSessionTotals
      - previousSessionTotals
      - currentSessionTransactionNumbers
      - previousSessionTransactionNumbers
    properties:
      currency:
        $ref: '#/definitions/currency'
      currentSessionIssuerTotals:
        $ref: '#/definitions/issuerTotals'
      previousSessionIssuerTotals:
        $ref: '#/definitions/issuerTotals'
      currentSessionTotals:
        $ref: '#/definitions/totalsBreakdown'
      previousSessionTotals:
        $ref: '#/definitions/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'
  reportList:
    type: array
    items:
      $ref: '#/definitions/reportResponsePAT'
  reportListResponse:
    type: object
    properties:
      reports:
        $ref: '#/definitions/reportList'
  reportRequest:
    type: object
    properties:
      reportType:
        $ref: '#/definitions/reportType'
  reportResponsePAC:
    type: object
    required:
      - requestId
      - location
      - notifications
    properties:
      balances:
        $ref: '#/definitions/reportBalances'
      banking:
        $ref: '#/definitions/reportsBanking'
      reportLines:
        $ref: '#/definitions/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
      tpi:
        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/{tpi}/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
  reportResponsePAT:
    type: object
    required:
      - balances
      - banking
      - reportLines
      - reportTime
      - reportType
      - reportResult
      - tpi
      - requestId
      - location
    properties:
      balances:
        $ref: '#/definitions/reportBalances'
      banking:
        $ref: '#/definitions/reportsBanking'
      reportLines:
        $ref: '#/definitions/receiptLineList'
      reportTime:
        type: string
        format: date-time
      reportType:
        $ref: '#/definitions/reportType'
      reportResult:
        type: string
        $ref: '#/definitions/reportResultsPAT'
      tpi:
        type: string
      reportId:
        type: string
      location:
        type: string
        description: The URI where information about this particular report is available.
  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: '#/definitions/reportBanking'
  reportType:
    description: Type of the 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/{tpi}/{requestType}/{requestId}
  table:
    type: object
    required:
      - tableName
      - amount
      - amountCashback
      - amountGratuity
      - amountPaid
      - payments
      - locked
      - lockedBy
      - waiterIds
    properties:
      tableName:
        type: string
      amount:
        type: integer
      amountCashback:
        type: integer
      amountGratuity:
        type: integer
      amountPaid:
        type: integer
      payments:
        $ref: '#/definitions/tablePaymentList'
      receipt:
        $ref: '#/definitions/receiptLineList'
      locked:
        type: boolean
      lockedBy:
        type: string
      waiterIds:
        type: array
        items:
          type: string
  'table ':
    type: object
    required:
      - tableName
      - amount
      - amountCashback
      - amountGratuity
      - amountPaid
      - payments
      - locked
      - lockedBy
      - waiterIds
    properties:
      tableName:
        type: string
      amount:
        type: integer
      amountCashback:
        type: integer
      amountGratuity:
        type: integer
      amountPaid:
        type: integer
      payments:
        $ref: '#/definitions/tablePaymentList'
      locked:
        type: boolean
      lockedBy:
        type: string
      waiterIds:
        type: array
        items:
          type: string
  tableAmountUpdate:
    type: object
    required:
      - lastKnownAmount
      - lastKnownPaidAmount
      - newAmount
    properties:
      lastKnownAmount:
        type: integer
      lastKnownPaidAmount:
        type: integer
      newAmount:
        type: integer
  tableCreation:
    type: object
    required:
      - tableName
      - amount
      - currency
    properties:
      tableName:
        type: string
      amount:
        type: integer
      currency:
        $ref: '#/definitions/currency'
      receipt:
        $ref: '#/definitions/receiptLineList'
      waiterIds:
        type: array
        items:
          type: string
  tableCreationResponse:
    type: object
    required:
      - location
      - tableName
    properties:
      location:
        type: string
        description: The URI where information about this particular table is available.
      tableName:
        type: string
  tableDeletion:
    type: object
    required:
      - lastKnownAmount
      - lastKnownPaidAmount
    properties:
      lastKnownAmount:
        type: integer
      lastKnownPaidAmount:
        type: integer
  tableList:
    type: array
    items:
      $ref: '#/definitions/table '
  tableListWrapper:
    type: object
    properties:
      tables:
        $ref: '#/definitions/tableList'
    required:
      - tables
  tableLockUpdate:
    type: object
    required:
      - lastKnownAmount
      - lastKnownPaidAmount
      - locked
    properties:
      lastKnownAmount:
        type: integer
      lastKnownPaidAmount:
        type: integer
      locked:
        type: boolean
      lockedBy:
        type: string
        description: >-
          Indicates which EPoS or User has locked a table. Defaults to 'EPoS' if
          not specified.
      override:
        type: boolean
        description: >-
          Allows overriding an existing table lock. Should be used with caution
          when a terminal or EPoS has malfunctioned while holding a lock.
  tablePayment:
    type: object
    required:
      - amountPaid
      - amountCashback
      - amountGratuity
      - authCode
      - currency
      - cardSchemeName
      - paymentId
      - paymentMethod
      - time
    properties:
      amountPaid:
        type: integer
      amountCashback:
        type: integer
      amountGratuity:
        type: integer
      authCode:
        type: string
      currency:
        type: string
        $ref: '#/definitions/currency'
      cardSchemeName:
        type: string
      paymentId:
        type: string
      paymentMethod:
        type: string
        $ref: '#/definitions/paymentMethod'
      time:
        type: string
        format: date-time
  tablePaymentList:
    type: array
    items:
      $ref: '#/definitions/tablePayment'
  tableReceiptUpdate:
    type: object
    required:
      - lastKnownAmount
      - lastKnownPaidAmount
      - newReceipt
    properties:
      lastKnownAmount:
        type: integer
      lastKnownPaidAmount:
        type: integer
      newReceipt:
        $ref: '#/definitions/receiptLineList'
  tableWaiterIdsUpdate:
    type: object
    required:
      - lastKnownAmount
      - lastKnownPaidAmount
      - newWaiterIds
    properties:
      lastKnownAmount:
        type: integer
      lastKnownPaidAmount:
        type: integer
      newWaiterIds:
        type: array
        items:
          type: string
  terminal:
    title: Terminal
    type: object
    required:
      - tpi
      - status
      - currency
      - capabilities
      - location
    properties:
      tpi:
        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
      capabilities:
        description: >-
          Defines the actions that this terminal can perform. This field is
          scheduled to be deprecated in the next API version (v2).
        type: array
        items:
          type: string
          enum:
            - SALE
            - REFUND
            - DUPLICATE
            - CANCEL_TRANSACTION
            - REPORT_END_OF_DAY
            - REPORT_BANKING
            - REPORT_X_BALANCE
            - REPORT_Z_BALANCE
            - TERMINAL_STATUS
        example:
          - SALE
          - REFUND
      location:
        description: URI where information about this terminal is available.
        type: string
        format: URI
        example: https://connect.yeti.host/pac/terminals/{tpi}
  terminalList:
    type: array
    items:
      $ref: '#/definitions/terminal'
  terminalWrapper:
    type: object
    properties:
      terminals:
        $ref: '#/definitions/terminalList'
  totalsBreakdown:
    type: object
    required:
      - currency
      - totalAmount
      - totalRefundsAmount
      - totalRefundsCount
      - totalSalesAmount
      - totalSalesCount
    properties:
      currency:
        $ref: '#/definitions/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:
          - 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/{tpi}/transactions/{requestId}
      notifications:
        description: Notifications that indicate the progress of the transaction.
        type: array
        items:
          $ref: '#/definitions/notifications'
        example:
          - TRANSACTION_FINISHED
          - APPROVED
          - CONNECTION_MADE
          - CONNECTING
          - PIN_ENTRY
          - PLEASE_WAIT
          - PRESENT_CARD
          - TRANSACTION_STARTED
      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: '#/definitions/receiptLineList'
          CUSTOMER:
            $ref: '#/definitions/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
        example: SALE
    required:
      - location
      - notifications
  transactionList:
    type: array
    items:
      $ref: '#/definitions/transaction'
  transactionListWrapper:
    type: object
    properties:
      transactions:
        $ref: '#/definitions/transactionList'
  transactionRequest:
    type: object
    properties:
      transactionType:
        $ref: '#/definitions/transactionType'
      amount:
        description: Base amount for the transaction (in pence).
        type: integer
        example: 1234
      currency:
        $ref: '#/definitions/currency'
  transactionType:
    description: Type of the transaction.
    type: string
    enum:
      - SALE
      - REFUND
      - DUPLICATE
    example: SALE
  waiterTotals:
    type: object
    description: >-
      A dictionary containing totals organized by waiter. {waiterId} represents
      an example key.
    properties:
      '{waiterId}':
        $ref: '#/definitions/totalsBreakdown'
