openapi: 3.1.0
info:
  title: Vending Unit API
  description: API for interacting with ETISS Vending Unit.
  version: 1.0.0
  contact:
    email: support@maxcrc.de

servers:
  - url: https://mywellness-test-vu.maxcrc.de
    description: Test server

tags:
  - name: vu_state
    description: Everything about VU state
  - name: led_control
    description: Controlling LEDs on various devices
  - name: payment_transaction
    description: Everything related to payment transaction
  - name: order
    description: Order operations
  - name: print
    description: Printing stuff
  - name: rfid_card
    description: RFID Card information
  - name: credit_card_terminal
    description: Credit card terminal information

paths:
  /api/update/angular/state:
    post:
      operationId: getState
      summary: Get VU state
      description: Gets the current vending unit state
      tags:
        - vu_state
      responses:
        "200":
          description: Vending unit state
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/State"
              examples:
                vuStateExample:
                  $ref: "#/components/examples/vuStateExample"

        "503":
          description: Service unavailable, please perform the request again

  /api/touch-tile/enable:
    post:
      operationId: enable
      summary: Enable led for tile
      description: Allows to enable led for tile
      requestBody:
        $ref: "#/components/requestBodies/EnableTileRequestBody"
      tags:
        - led_control
      responses:
        "200":
          description: Successfully enabled led for tile
        "400":
          description: Bad request
        "503":
          description: Service unavailable, please perform the request again

  /api/touch-tile/disable:
    post:
      operationId: disable
      summary: Disable led for tile
      description: Allows to disable led for tile
      requestBody:
        $ref: "#/components/requestBodies/DisableTileRequestBody"
      tags:
        - led_control
      responses:
        "200":
          description: Successfully disabled led for tile
        "400":
          description: Bad request
        "503":
          description: Service unavailable, please perform the request again
  
  /api/touch-tile/disable-all:
    post:
      operationId: disableAll
      summary: Disable led for all tiles
      description: Allows to enable led for tiles
      tags:
        - led_control
      responses:
        "200":
          description: Successfully enabled led for all tiles
        "400":
          description: Bad request
        "503":
          description: Service unavailable, please perform the request again

  /api/touch-tile/barcode-led-enable:
    post:
      operationId: barcodeLedEnable
      summary: Enable/Disable barcode led
      description: Allows to enable or disable barcode led
      requestBody:
        $ref: "#/components/requestBodies/EnableDisableRequestBody"
      tags:
        - led_control
      responses:
        "200":
          description: Successfully enabled/disabled barcode led
        "400":
          description: Bad request
        "503":
          description: Service unavailable, please perform the request again

  /api/touch-tile/rfid-card-led-enable:
    post:
      operationId: rfidCardLedEnable
      summary: Enable/Disable RFID Card led
      description: Allows to enable or disable RFID card led
      requestBody:
        $ref: "#/components/requestBodies/EnableDisableRequestBody"
      tags:
        - led_control
      responses:
        "200":
          description: Successfully enabled/disabled RFID card led
        "400":
          description: Bad request
        "503":
          description: Service unavailable, please perform the request again

  /api/touch-tile/card-dispenser-led-enable:
    post:
      operationId: cardDispenserLedEnable
      summary: Enable/Disable card dispenser led
      description: Allows to enable or disable card dispenser led
      requestBody:
        $ref: "#/components/requestBodies/EnableDisableRequestBody"
      tags:
        - led_control
      responses:
        "200":
          description: Successfully enabled/disabled card dispenser led
        "400":
          description: Bad request
        "503":
          description: Service unavailable, please perform the request again

  /api/touch-tile/change-switch:
    post:
      operationId: changeSwitch
      summary: Enable/Disable led lights on devices
      description: Unified enpoint that’s used to turn on/off leds on different devices
      requestBody:
        $ref: "#/components/requestBodies/ChangeSwitchRequestBody"
      tags:
        - led_control
      responses:
        "200":
          description: Successfully enabled/disabled device's led
        "400":
          description: Bad request
        "503":
          description: Service unavailable, please perform the request again

  /api/payment/begin-transaction:
    post:
      operationId: beginTransaction
      summary: Begin payment transaction
      description: Initiates a new payment transaction
      requestBody:
        $ref: "#/components/requestBodies/BeginTransactionRequest"
      tags:
        - payment_transaction
      responses:
        "200":
          description: Successfully started a new payment transaction
        "503":
          description: Service unavailable, please perform the request again

  /api/payment/get-accepted-cash:
    get:
      operationId: getAcceptedCash
      summary: Get accepted payment denominations
      description: Returns currency denominations with which it is possible to pay given amount of money
      tags:
        - payment_transaction
      parameters:
        - name: value
          in: query
          description: Amount of money that you wish to pay on the VU
          required: true
          schema:
            type: integer
          example: 9
        - name: currencyCode
          in: query
          description: The currency code of the payment
          required: true
          schema:
            type: string
          example: "EUR"

      responses:
        "200":
          description: A list of possible payment denominations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AcceptedCash"
              examples:
                AcceptedCashExample:
                  $ref: "#/components/examples/AcceptedCashExample"
        "503":
          description: Service unavailable, please perform the request again

  /api/payment/status:
    get:
      operationId: paymentStatus
      summary: Get payment status
      description: Returns the status of the current payment transaction
      tags:
        - payment_transaction
      responses:
        "200":
          description: An object containing payment status information
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentStatus"
              examples:
                CashlessPaymentSuccessStatusExample:
                  $ref: "#/components/examples/CashlessPaymentSuccessStatusExample"
                CashPaymentSuccessStatusExample:
                  $ref: "#/components/examples/CashPaymentSuccessStatusExample"
                CashPaymentFailureStatusExample:
                  $ref: "#/components/examples/CashPaymentFailureStatusExample"

  /api/payment/commit-transaction:
    post:
      operationId: commitTransaction
      summary: Commits payment transaction
      description: Commit currently active payment transaction
      requestBody:
        $ref: "#/components/requestBodies/CommitTransactionRequest"
      tags:
        - payment_transaction
      responses:
        "200":
          description: Successfully committed payment transaction
        "503":
          description: Service unavailable, please perform the request again

  /api/payment/abort-cashless-transaction:
    post:
      operationId: abortCashlessTransaction
      summary: Aborts cashless payment transaction
      description: Abort currently active cashless payment transaction
      requestBody:
        $ref: "#/components/requestBodies/AbortCashlessTransactionRequest"
      tags:
        - payment_transaction
      responses:
        "200":
          description: Successfully aborted cashless payment transaction
        "503":
          description: Service unavailable, please perform the request again

  /api/payment/revert-transaction:
    post:
      operationId: revertTransaction
      summary: Revert a payment transaction
      description: Reverts cashless/cash payment transactions
      requestBody:
        $ref: "#/components/requestBodies/RevertTransactionRequest"
      tags:
        - payment_transaction
      responses:
        "200":
          description: Successfully reverted a payment transaction
        "503":
          description: Service unavailable, please perform the request again

  /api/save-order:
    post:
      operationId: saveOrder
      summary: Saves a new order
      description: Save a new order with the parameters given in the request body
      requestBody:
        $ref: "#/components/requestBodies/SaveOrderRequest"
      tags:
        - order
      responses:
        "200":
          description: Successfully created a new order
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SaveOrderResponse"
              examples:
                SaveOrderResponseExample:
                  $ref: "#/components/examples/SaveOrderResponseExample"
        "503":
          description: Service unavailable, please perform the request again

  /api/print/picture:
    post:
      operationId: printPicture
      summary: Prints a picture
      description: Prints a provided picture on XMLPrinter
      requestBody:
        $ref: "#/components/requestBodies/PrintPictureRequest"
      tags:
        - print
      responses:
        "200":
          description: Successfully printed a provided picture
        "400":
          description: Bad request
        "503":
          description: Service unavailable, please perform the request again

  /api/print/xml:
    post:
      operationId: printXML
      summary: Prints XML document
      description: Prints a provided XML document on XMLPrinter
      requestBody:
        $ref: "#/components/requestBodies/PrintXMLRequest"
      tags:
        - print
      responses:
        "200":
          description: Successfully printed a provided XML document
        "400":
          description: Bad request
        "503":
          description: Service unavailable, please perform the request again

  /api/rfid-card/status:
    get:
      operationId: rfidCardStatus
      summary: Get RFID-Card status
      description: Returns the status of the RFID-Card device
      tags:
        - rfid_card
      responses:
        "200":
          description: An object containing RFID-Card status
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RFIDCardStatus"
              examples:
                RFIDCardStatusExample:
                  $ref: "#/components/examples/RFIDCardStatusExample"

  /api/credit-card-terminal/accepted-credit-cards:
    get:
      operationId: acceptedCreditCards
      summary: Accepted credit cards
      description: A list of credit cards that are accepted on the terminal
      tags:
        - credit_card_terminal
      responses:
        "200":
          description: An object containing a list of accepted credit cards
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AcceptedCreditCards"
              examples:
                AcceptedCreditCardsExample:
                  $ref: "#/components/examples/AcceptedCreditCardsExample"
        "503":
          description: Service unavailable, please perform the request again

  /api/get-vu-configuration:
    get:
      operationId: getVUConfiguration
      summary: Get VU configuration
      description: Returns the full configuration object for the current VU
      tags:
        - vu_state
      responses:
        "200":
          description: An object containing VU configuration
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VUConfiguration"
              examples:
                VUConfigurationExample:
                  $ref: "#/components/examples/VUConfigurationExample"
        "503":
          description: Service unavailable, please perform the request again

components:
  schemas:
    State:
      description: A state of the vending unit
      type: object
      properties:
        isOfflineMode:
          type: boolean
          description: VU is offline
          examples:
            - false
        isServiceMode:
          type: boolean
          description: VU is in service mode
          examples:
            - false
        isBurglaryMode:
          type: boolean
          description: VU is in burglary mode
          examples:
            - false
        isMaintenanceMode:
          type: boolean
          description: VU is in maintenance mode
          examples:
            - false
        maintenaceModeReasons:
          type: array
          items:
            type: string
          description: An array of reasons for maintenance mode
          examples:
            - ["Minimal configuration violated"]
        minHardwareConfigurationViolation:
          type: ["string", "null"]
          examples:
            - "Gate"
          description: A list of faulty devices, without which normal operation of the device is not possible
        token:
          type: string
          examples:
            - "a2913c531578994645ff4807a221cp596ad31b56"
          description: ODOO auth token
        shopType:
          type: string
          enum:
            - PosOrder
            - PosOrderWebshop
            - SaleOrderWebshop
          description: Shop operation mode
          examples:
            - "PosOrder"
        giftCardPaymentButtonType:
          type: ["string", "null"]
          enum:
            - Gutscheine
            - NFC-Karte
            - Geldwertkarte
            - null
          examples:
            - "Gutscheine"
          description: Text for the button of gift card payments
        scanCard:
          allOf:
            - $ref: "#/components/schemas/ScanCard"
          description: Last scanned RFID card
          examples:
            - scanCardExample:
                $ref: "#/components/examples/scanCardExample"
        barcodeScan:
          allOf:
            - $ref: "#/components/schemas/BarcodeScan"
          description: Last scanned barcode
          examples:
            - barcodeScanExample:
                $ref: "#/components/examples/barcodeScanExample"
        isAutoSaleMode:
          type: boolean
          description: VU is in autosale mode
          examples:
            - false
        isTestMode:
          type: boolean
          description: VU is in test mode
          examples:
            - false

    ScanCard:
      description: Last scanned card properties
      type: ["object", "null"]
      properties:
        cardID:
          type: string
          description: Scanned card number
        scanTime:
          type: string
          format: date
          description: Card scan time

    BarcodeScan:
      description: Last scanned barcode properties
      type: object
      properties:
        barcode:
          type: string
          description: Scanned Barcode
        scanTime:
          type: string
          format: date
          description: Barcode scan time

    AcceptedCash:
      description: A list of coins and banknotes available for payment
      type: object
      properties:
        coins:
          type: array
          description: A list of coin denominations available fo payment
          items:
            type: object
            properties:
              value:
                type: number
                format: float
              currencyCode:
                type: string
        banknotes:
          type: array
          description: A list of banknote denominations available fo payment
          items:
            type: object
            properties:
              value:
                type: number
              currencyCode:
                type: string

    PaymentStatus:
      type: object
      description: Displays payment status of the current payment transaction
      properties:
        timeStamp:
          type: string
          format: date-time
          description: The timestamp of the beginning of a payment transaction
        price:
          type: object
          properties:
            value:
              type: number
              format: float
              description: The amount of money to pay
            currencyCode:
              type: string
              description: The currency code for the price
            currencySign:
              type: string
              description: The symbol representing the currency
            isEmpty:
              type: boolean
              description: Indicates if the price is empty or not
            isZero:
              type: boolean
              description: Indicates if the price is zero or not
            isPositive:
              type: boolean
              description: Indicates if the price is positive
            isNegative:
              type: boolean
              description: Indicates if the price is negative
        paymentMethod:
          type: string
          description: Displays a payment method that was used to start transaction
          enum:
            - Undefined
            - Cash
            - Terminal
            - Bluecode
            - GiftCard
        paymentState:
          type: string
          description: The state of the payment
          enum:
            - ""
            - None
            - InProgress
            - Success
            - Failure
        paymentStateInfo:
          type: string
          description: The state of the payment from card terminal
          enum:
            - ""
            - Unavailable
            - Initializing
            - PerformingEndOfDayOperations
            - Offline
            - OutOfOrder
            - ServiceMode
            - Ready
            - WaitingForCard
            - CardIsBeingRead
            - EnterPin
            - PaymentIsInProgress
            - UserInteraction
            - InvalidPin
            - InvalidPinFailure
            - FundsIsBeingReserved
            - FundsReservationIsCompleted
            - PaymentIsBeingCommitted
            - ReceiptIsBeingTransferred
            - ReceiptTransferComplete
            - PaymentCompleted
            - PaymentAborted
            - PaymentErrorMessageReceived
        cashReceived:
          type: string
          description: The amount of cash received from customer
        cashReturned:
          type: string
          description: The amount of cash returned to the customer
        moneyReturnInProgress:
          type: boolean
          description: Indicates if a money return process is currently active.

    RFIDCardStatus:
      type: object
      description: Displays RFID-Card status
      properties:
        is_available:
          type: boolean
          description: Shows if the RFID-Card device available to use
        stack_empty:
          type: boolean
          description: Indicates if the RFID-Card device's card stack is empty or not

    AcceptedCreditCards:
      type: object
      description: Displays a list of accepted credit cards
      properties:
        name:
          type: string
          description: Names of accepted credit cards separated with semicolon

    VUConfiguration:
      type: object
      description: Displays all properties of the VU configuration
      properties:

    MonetaryAmount:
      description: Describes a monetary amount
      type: object
      required:
        - value
        - currencyCode
      properties:
        value:
          type: number
          format: float
          examples:
            - 9
        currencyCode:
          type: string
          description: Currency code (e.g., EUR, USD)
          examples:
            - "EUR"

    OrderLine:
      description: A single order line
      type: object
      required:
        - uid
        - name
        - productId
        - quantity
        - amount
      properties:
        uid:
          type: string
          format: uuid
        name:
          type: string
        productId:
          type: integer
        price:
          $ref: "#/components/schemas/MonetaryAmount"
        quantity:
          type: integer
          minimum: 1
        amount:
          $ref: "#/components/schemas/MonetaryAmount"
        amountTax:
          $ref: "#/components/schemas/MonetaryAmount"
        taxRate:
          type: number
          format: float
          description: Tax rate as a decimal number ( 0.19 for 19%)
        barcode:
          type: ["string", "null"]
        ticketParameters:
          type: ["object", "null"]
        rfidCard:
          type: boolean
          default: false
        properties:
          type: object
          additionalProperties:
            type: string
          description: Custom properties for the order line

    OrderProperties:
      description: Properties of the order
      type: object
      properties:
        odoo_context:
          $ref: "#/components/schemas/OdooContext"
        card_terminal_receipt:
          type: string
      additionalProperties:
        type: string

    OdooContext:
      description: Odoo context
      type: object
      properties:
        multi_basket:
          $ref: "#/components/schemas/MultiBasket"
        basket_amount:
          type: number
          format: float

    MultiBasket:
      description: Multi basket
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/BasketItem"
        primary_basket_guid:
          type: string
        primary_basket_barcode:
          type: string
        total:
          type: number
          format: float
        total_prepay:
          type: number
          format: float
        total_pay:
          type: number
          format: float
        currency:
          type: string
        tax_values:
          type: object
          additionalProperties:
            type: number
            format: float

    BasketItem:
      description: Basket item
      type: object
      properties:
        barcode:
          type: string
        customer:
          type: string
        customer_id:
          type: integer
        total:
          type: number
          format: float
        base_total:
          type: number
          format: float
        currency:
          type: string
        log_item:
          type: integer
        order_guid:
          type: string
        basket:
          $ref: "#/components/schemas/Basket"
        pre_payment_total:
          type: number
          format: float

    Basket:
      description: Basket
      type: object
      properties:
        receipt_printed:
          type: boolean
        type:
          type: string
        order_guid:
          type: string
        customer_id:
          type: integer
        lines:
          type: array
          items:
            $ref: "#/components/schemas/BasketLine"
        payments:
          type: array
          items:
            $ref: "#/components/schemas/Payment"
        amount_total:
          type: number
          format: float
        amount_to_pay:
          type: number
          format: float
        amount_tax:
          type: number
          format: float
        currency:
          type: string
        tax_values:
          type: array
          items:
            $ref: "#/components/schemas/TaxValue"

    BasketLine:
      description: Basket line
      type: object
      properties:
        full_product_name:
          type: string
        discount:
          type: number
          format: float
        price_unit:
          type: number
          format: float
        product_id:
          type: integer
        qty:
          type: integer

    Payment:
      description: Payment
      type: object
      properties:
        method:
          type: string
        amount:
          type: number
          format: float
        journal_id:
          type: integer
        payment_method_id:
          type: integer
        payment_method_code:
          type: string

    TaxValue:
      description: Amount of taxes
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        rate:
          type: integer
        amount:
          type: number
          format: float

    SaveOrderResponse:
      description: A successful response after the order creation
      type: object
      required:
        - orderId
        - orderUid
        - isSuccess
      properties:
        orderId:
          type: integer
          description: Numeric identifier of the created order
        orderUid:
          type: string
          format: uuid
          description: Unique UUID of the order
        isSuccess:
          type: boolean
          description: Indicates if the order was successfully created
        error:
          type: string
          description: Error message if the operation failed
        properties:
          $ref: "#/components/schemas/SaveOrderResponseProperties"

    SaveOrderResponseProperties:
      description: Save order response properties
      type: object
      properties:
        order_id:
          type: integer
          description: Duplicate of orderId for legacy systems
        order_line_ids:
          type: array
          items:
            type: integer
          description: IDs of order lines
        order_name:
          type: string
          description: Human-readable order identifier
        barcodes_of_created_tickets:
          type: array
          items:
            type: string
          description: Barcodes of tickets created
        tickets:
          type: array
          items:
            type: object
          description: List of ticket details
        rfid_card_data:
          type: ["object", "null"]
          description: RFID card data
        warning_messages:
          type: array
          items:
            type: string
          description: Warning messages
        force_print_receipt:
          type: boolean
          description: Flag to force receipt printing
        fiskaltrust:
          $ref: "#/components/schemas/FiskaltrustData"

    FiskaltrustData:
      description: Fiskaltrust data
      type: object
      properties:
        wARNING:
          type: string
          description: Warning message
        ftCashBoxID:
          type: string
          format: uuid
          description: Cash box identifier
        ftQueueID:
          type: string
          format: uuid
          description: Queue identifier
        ftQueueItemID:
          type: string
          format: uuid
          description: Queue item identifier
        ftQueueRow:
          type: integer
          description: Row number in the queue
        cbTerminalID:
          type: string
          description: Terminal identifier
        cbReceiptReference:
          type: string
          description: Receipt reference code
        ftCashBoxIdentification:
          type: string
          description: Cash box identification code
        ftReceiptIdentification:
          type: string
          description: Receipt identification code
        ftReceiptMoment:
          type: string
          format: date-time
          description: Timestamp of receipt creation
        ftSignatures:
          type: array
          items:
            $ref: "#/components/schemas/FiskaltrustSignature"
          description: List of fiscal signatures
        ftState:
          type: integer
          format: int64
          description: State code for fiskaltrust

    FiskaltrustSignature:
      description: Fiskaltrust signature
      type: object
      properties:
        ftSignatureFormat:
          type: integer
          description: Format of the signature
        ftSignatureType:
          type: integer
          format: int64
          description: Type of the signature
        caption:
          type: string
          description: Label for the signature
        data:
          type: string
          description: Signature data payload

  examples:
    vuStateExample:
      description: example response body when requesting vending unit state
      value:
        isOfflineMode: false
        isServiceMode: false
        isBurglaryMode: false
        isMaintenanceMode: false
        maintenaceModeReasons: []
        minHardwareConfigurationViolation: null
        token: a2913c531578994645ff4807a221cp596ad31b56
        shopType: "PosOrder"
        giftCardPaymentButtonType: null
        scanCard: null
        barcodeScan:
          type: object
          properties:
            barcode: SIM1
            scanTime: "2025-03-17T13:03:56.6725410Z"
        isAutoSaleMode: false
        isTestMode: false

    scanCardExample:
      description: example of the scan card object
      value:
        cardId: "72672"
        scanTime: "2025-03-17T13:03:56.6725410Z"

    barcodeScanExample:
      description: example of the barcode scan object
      value:
        barcode: "SIM1"
        scanTime: "2025-03-17T13:03:56.6725410Z"

    EnableDisableRequestBodyExample:
      description: example of the enable/disable request
      value:
        enabled: true

    EnableTileRequestBodyExample:
      description: example of the enable tile request
      value:
        unitEnum: "CreditCardLight"
        color: "#2C8CCD"

    DisableTileRequestBodyExample:
      description: example of the disable tile request
      value:
        unitEnum: "CreditCardLight"

    BeginTransactionRequestExample:
      description: example of the transaction initiation
      value:
        money:
          value: "9"
          currencyCode: "EUR"
        paymentMethod: 1
        barcode: "H134Y35312"
        giftAmount:
          value: "0"
          currencyCode: "EUR"

    AcceptedCashExample:
      description: example of accepted cash denominations
      value:
        coins:
          - value: 0.10
            currencyCode: "EUR"
        banknotes:
          - value: 5.00
            currencyCode: "EUR"

    CashlessPaymentSuccessStatusExample:
      description: Successful payment status example in case of cashless payment
      value:
        timeStamp: "2025-03-18T16:04:37.0624494+02:00"
        price:
          value: 3
          currencyCode: "EUR"
          currencySign: "€"
          isEmpty: false
          isZero: false
          isPositive: true
          isNegative: false
        paymentMethod: "Terminal"
        paymentState: "Success"
        paymentStateInfo: "FundsReservationIsCompleted"
        cashReceived: "0"
        cashReturned: "0"
        moneyReturnInProgress: false

    CashPaymentSuccessStatusExample:
      description: Successful payment status example in case of cash payment
      value:
        timeStamp: "2025-03-18T16:07:39.7027464+02:00"
        price:
          value: 3
          currencyCode: "EUR"
          currencySign: "€"
          isEmpty: false
          isZero: false
          isPositive: true
          isNegative: false
        paymentMethod: "Cash"
        paymentState: "Success"
        paymentStateInfo: ""
        cashReceived: " 1 * 2,00 EUR + 1 * 1,00 EUR + 1 * 0,50 EUR + 1 * 0,10 EUR"
        cashReturned: " 1 * 0,50 EUR + 1 * 0,10 EUR"
        moneyReturnInProgress: false

    CashPaymentFailureStatusExample:
      description: Failed payment status example in case of cash payment
      value:
        timeStamp: "2025-03-18T16:07:39.7027464+02:00"
        price:
          value: 3
          currencyCode: "EUR"
          currencySign: "€"
          isEmpty: false
          isZero: false
          isPositive: true
          isNegative: false
        paymentMethod: "Cash"
        paymentState: "Failure"
        paymentStateInfo: ""
        cashReceived: " 1 * 2,00 EUR + 1 * 1,00 EUR + 1 * 0,50 EUR + 1 * 0,10 EUR"
        cashReturned: ""
        moneyReturnInProgress: false

    PrintPictureRequestExample:
      description: Specifies the picture to print along with other formatting details
      value:
        File: file.png
        PrintTaskType: 0

    PrintXMLRequestExample:
      description: Specifies an XML document to print along with other formatting details
      value:
        File: 1.xml
        PrintTaskType: 0

    RFIDCardStatusExample:
      description: Displays RFID-Card device status
      value:
        is_available: true
        stack_empty: false

    AcceptedCreditCardsExample:
      description: Displays a list of accepted credit cards
      value:
        name: "ALL"

    VUConfigurationExample:
      description: A full VU configuration example
      value:
        vuRole: "Entry"

    ChangeSwitchRequestExample:
      description: Manipulates devices led lights (on/off)
      value:
        - name: "CoinAcceptorLight"
          enabled: true

    SaveOrderRequestExample:
      description: A full save order request example
      summary: A detailed order with all fields
      value:
        isReceipt: false
        id: 0
        uid: "ce87010c-5d96-44ab-80e4-479892a6aab8"
        amountTotal:
          value: 9
          currencyCode: "EUR"
        amountPrepaid:
          value: 30
          currencyCode: "EUR"
        amountReceived:
          value: 9
          currencyCode: "EUR"
        amountReturned:
          value: 0
          currencyCode: "EUR"
        orderLines:
          - uid: "5a243960-f268-4969-b644-ca5cbaef7b94"
            name: "Saunaaufguss; Sand; 1l"
            productId: 166
            price:
              value: 0
              currencyCode: "EUR"
            quantity: 1
            amount:
              value: 0
              currencyCode: "EUR"
            amountTax:
              value: 0
              currencyCode: "EUR"
            taxRate: 0.19
            barcode: null
            ticketParameters: null
            rfidCard: false
            properties:
              full_product_name: "Saunaaufguss Sand"
        paymentMethod: 1
        barcode: ""
        type: "sale"
        originalOrderId: 0
        properties:
          odoo_context:
            multi_basket:
              items:
                - barcode: "SIM1"
                  customer: ""
                  customer_id: 399797
                  total: 39
                  base_total: 39
                  currency: "€"
                  log_item: 1564
                  order_guid: "2830738"
                  basket:
                    receipt_printed: false
                    type: "sale-order"
                    order_guid: "2830738"
                    customer_id: 399797
                    lines:
                      - full_product_name: "Saunaaufguss Sand"
                        discount: 0
                        price_unit: 0
                        product_id: 166
                        qty: 1
                      - full_product_name: "4 Macarons"
                        discount: 0
                        price_unit: 3.9
                        product_id: 21
                        qty: 5
                    payments:
                      - method: "open_invoice"
                        amount: 30
                        journal_id: 24
                        payment_method_id: 14
                        payment_method_code: "MWS"
                    amount_total: 39
                    amount_to_pay: 9
                    amount_tax: 7.41
                    currency: "€"
                    tax_values:
                      - id: 14
                        name: "19% MwSt"
                        rate: 19
                        amount: 6.22
                  pre_payment_total: 30
              primary_basket_guid: "2830738"
              primary_basket_barcode: "SIM1"
              total: 39
              total_prepay: 30
              total_pay: 9
              currency: "€"
              tax_values:
                "19% MwSt": 6.22
            basket_amount: 39
          card_terminal_receipt: ""
        giftCardEan13: ""
        giftCardName: ""
        giftCardPartialPaymentAmount: 0

    SaveOrderResponseExample:
      description: Successful response object after order creation in odoo
      summary: A successful order creation response
      value:
        orderId: 219
        orderUid: "ce87010c-5d96-44ab-80e4-479892a6aab8"
        isSuccess: true
        error: ""
        properties:
          order_id: 219
          order_line_ids: []
          order_name: "00218-00001-00030"
          barcodes_of_created_tickets: []
          tickets: []
          rfid_card_data: null
          warning_messages: []
          force_print_receipt: false
          fiskaltrust:
            wARNING: "THIS IS SIMULATED DATA !!!"
            ftCashBoxID: "9521dba0-4af5-4529-9102-b014f460f874"
            ftQueueID: "7d69975d-cbb3-4185-8e5c-053e2d31a517"
            ftQueueItemID: "7596344f-34c1-4bf0-87ce-2bed8a5e7da9"
            ftQueueRow: 246
            cbTerminalID: "TERMINAL SIMULATION"
            cbReceiptReference: "00212-00000-00029"
            ftCashBoxIdentification: "XZdpfbPLhUGOXAULTGlFw"
            ftReceiptIdentification: "ftF5#IT246"
            ftReceiptMoment: "2024-08-29T12:23:34.1370000Z"
            ftSignatures:
              - ftSignatureFormat: 3
                ftSignatureType: 4919338167972134913
                caption: "www.fiskaltrust.de"
                data: "V0;XZdpfbPLhUGOXAULTGlFw;Kassenbeleg-V1;Beleg^0.00_0.00_0.00_39.00_0.00^39.00:Unbar;246;633;2024-08-29T12:23:33.000Z;2024-08-29T12:23:33.000Z;ecdsa-plain-SHA256;unixTime;f/gZUmDdsMKMFjrLP+520to4aqB+k/Q1RxJZ4FnIJ8tnW7URlGFkIn/0mt/nBoSS1a7Kl1vvzhRnCF/5oc5r4Q==;BPsSHuh/F5Rq5QR1JBXAE+ZIicm4+sSugf9anOXr59k8WP2bZKfeA4YVIPAsc8pttVgozPYZd2qhJloDHNknlpg="
              - ftSignatureFormat: 65549
                ftSignatureType: 4919338167972134928
                caption: "start-transaction-signature"
                data: "1dCqH6xrOtFJ8fpMxAvx8qs/Ri8ewLRdkqR9DvA9xMfdxupJuC+rQDRSyEkcDDJW+BU8SBK4UJX9J/XUexoplg=="
              - ftSignatureFormat: 1
                ftSignatureType: 0
                caption: "S A N D B O X"
                data: "7d69975d-cbb3-4185-8e5c-053e2d31a517"
            ftState: 4919338167972134912

  requestBodies:
    EnableTileRequestBody:
      description: A request body that enable led lights
      content:
        application/json:
          schema:
            type: object
            properties:
              unitEnum:
                type: string
                description: Specifies the device for led lights manipulation.
                enum:
                  - CoinAcceptorLight
                  - BillAcceptorLight
                  - RFIDLight
                  - TicketBoxLight
                  - CoinBoxLight
                  - PinPadLight
                  - FrameLight
                  - BarcodeReaderLight
                  - DispenserChuteLight
                  - LogoLight
                  - CardDispenserLight
              color:
                type: string
                description: Specifies color for led tile. Each color starts with a special symbol '#'. (2C8CCD - blue, 2C8C1D - green, F44336 - red)
          examples:
            EnableTileRequestBodyExample:
              $ref: "#/components/examples/EnableTileRequestBodyExample"

    DisableTileRequestBody:
      description: A request body that disable led lights
      content:
        application/json:
          schema:
            type: object
            properties:
              unitEnum:
                type: string
                description: Specifies the device for led lights manipulation.
                enum:
                  - CoinAcceptorLight
                  - BillAcceptorLight
                  - RFIDLight
                  - TicketBoxLight
                  - CoinBoxLight
                  - PinPadLight
                  - FrameLight
                  - BarcodeReaderLight
                  - DispenserChuteLight
                  - LogoLight
                  - CardDispenserLight
          examples:
            DisableTileRequestBodyExample:
              $ref: "#/components/examples/DisableTileRequestBodyExample"

    EnableDisableRequestBody:
      description: A request body that enables/disables something, for example led lights
      content:
        application/json:
          schema:
            type: object
            properties:
              enabled:
                type: boolean
                description: enabled or disabled some device of the VU
                examples:
                  - false
          examples:
            EnableDisableRequestBodyExample:
              $ref: "#/components/examples/EnableDisableRequestBodyExample"

    BeginTransactionRequest:
      description: The request body that should be passed when starting payment transaction
      content:
        application/json:
          schema:
            type: object
            properties:
              money:
                type: object
                description: Money information for the transaction
                properties:
                  value:
                    type: string
                    description: The amount of money being paid
                  currencyCode:
                    type: string
                    description: Currency code of the money being paid
              paymentMethod:
                type: number
                description: Payment method of the transaction. (0 - cash, 1 - cashless, 2 - Bluecode, 3 - GiftCard)
              barcode:
                type: string
                description: Used in case of GiftCard payment
              giftAmount:
                type: object
                properties:
                  value:
                    type: string
                    description: The amount of money from GiftCard
                  currencyCode:
                    type: string
                    description: Currency code of the gift money being paid
          examples:
            BeginTransactionRequestExample:
              $ref: "#/components/examples/BeginTransactionRequestExample"

    CommitTransactionRequest:
      description: Specifies whether to commit transaction forcefully or not
      content:
        application/json:
          schema:
            type: object
            properties:
              BoolValue:
                type: boolean
                description: Forcefully commits active transaction
                examples:
                  - false

    RevertTransactionRequest:
      description: Specifies whether to revert transaction forcefully or not
      content:
        application/json:
          schema:
            type: object
            properties:
              BoolValue:
                type: boolean
                description: Forcefully reverts active transaction
                examples:
                  - false

    AbortCashlessTransactionRequest:
      description: Specifies which type of cashless transaction to abort.
      content:
        application/json:
          schema:
            type: object
            properties:
              paymentMethod:
                type: number
                description: Numeric representation of the payment method
                examples:
                  - 1

    PrintPictureRequest:
      description: Specifies which picture to print and print task type
      content:
        multipart/form-data:
          schema:
            type: object
            required:
              - File
            properties:
              File:
                type: string
                description: A file to print
                format: binary
                contentMediaType: application/octet-stream
                examples:
                  - file.png
              PrintTaskType:
                type: integer
                enum:
                  - 0
                  - 1
                  - 2
                  - 3
                  - 4
                  - 5
                examples:
                  - 0
          examples:
            PrintPictureRequestExample:
              $ref: "#/components/examples/PrintPictureRequestExample"

    PrintXMLRequest:
      description: Specifies which XML document to print and print task type
      content:
        multipart/form-data:
          schema:
            type: object
            required:
              - File
            properties:
              File:
                type: string
                description: An XML document to print
                format: binary
                contentMediaType: application/octet-stream
                examples:
                  - 1.xml
              PrintTaskType:
                type: integer
                enum:
                  - 0
                  - 1
                  - 2
                  - 3
                  - 4
                  - 5
                examples:
                  - 0
          examples:
            PrintXMLRequestExample:
              $ref: "#/components/examples/PrintXMLRequestExample"

    ChangeSwitchRequestBody:
      description: Specifies which devices led's to turn on or off
      content:
        application/json:
          schema:
            type: array
            items:
              type: object
              properties:
                name:
                  type: string
                  description: Specifies the device for led lights manipulation
                  enum:
                    - None
                    - CreditCardLight
                    - CoinAcceptorLight
                    - BillAcceptorLight
                    - RFIDLight
                    - TicketBoxLight
                    - CoinBoxLight
                    - PinPadLight
                    - FrameLight
                    - BarcodeReaderLight
                    - DispenserChuteLight
                    - LogoLight
                    - CardDispenserLight
                enabled:
                  type: boolean
                  description: Enable or disable device led lights
                  examples:
                    - false
          examples:
            ChangeSwitchRequestExample:
              $ref: "#/components/examples/ChangeSwitchRequestExample"

    SaveOrderRequest:
      description: Request that saves order in odoo
      content:
        application/json:
          schema:
            type: object
            required:
              - uid
              - amountTotal
              - orderLines
            properties:
              isReceipt:
                type: boolean
                default: false
                examples:
                  - false
              id:
                type: integer
                default: 0
                examples:
                  - 0
              uid:
                type: string
                format: uuid
                description: Unique identifier for the order
                examples:
                  - "ce87010c-5d96-44ab-80e4-479892a6aab8"
              amountTotal:
                $ref: "#/components/schemas/MonetaryAmount"
              amountPrepaid:
                $ref: "#/components/schemas/MonetaryAmount"
              amountReceived:
                $ref: "#/components/schemas/MonetaryAmount"
              amountReturned:
                $ref: "#/components/schemas/MonetaryAmount"
              orderLines:
                type: array
                items:
                  $ref: "#/components/schemas/OrderLine"
              paymentMethod:
                type: integer
                description: Code representing the payment method
              barcode:
                type: ["string", "null"]
              type:
                type: string
                enum: [sale, return, refund]
              originalOrderId:
                type: integer
                default: 0
              properties:
                $ref: "#/components/schemas/OrderProperties"
              giftCardEan13:
                type: string
              giftCardName:
                type: string
              giftCardPartialPaymentAmount:
                type: number
                format: float
                default: 0
          examples:
            SaveOrderRequestExample:
              $ref: "#/components/examples/SaveOrderRequestExample"
