openapi: 3.0.1
info:
  title: Cloud Payment Provider
  description: Cloud Payment Provider API
  version: v1
paths:
  /api/v1/auth/authenticate:
    post:
      tags:
        - Authentication
      summary: Authenticates directly against PaymentProvider
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Requests.Authentication.Authentication'
          text/json:
            schema:
              $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Requests.Authentication.Authentication'
          application/*+json:
            schema:
              $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Requests.Authentication.Authentication'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Responses.Authentication.Authentication'
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Responses.Authentication.Authentication'
            text/json:
              schema:
                $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Responses.Authentication.Authentication'
        '403':
          description: Forbidden
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error'
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error'
            text/json:
              schema:
                $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error'
  /api/v1/devices/{deviceCode}:
    get:
      tags:
        - Device
      summary: 'Gets a device information'
      parameters:
        - name: deviceCode
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Device.Device
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Device.Device
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Device.Device
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
    put:
      tags:
        - Device
      summary: 'Updates a device (Auth roles: PaymentProvider.Admin,PaymentProvider.Integration)'
      parameters:
        - name: deviceCode
          in: path
          description: External reference for the device
          required: true
          schema:
            type: string
      requestBody:
        description: Payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Requests.Device.Device'
          text/json:
            schema:
              $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Requests.Device.Device'
          application/*+json:
            schema:
              $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Requests.Device.Device'
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
  /api/v1/devices/{deviceCode}/ping:
    post:
      tags:
        - Device
      summary: 'Updates a device (Auth roles: PaymentProvider.Admin,PaymentProvider.Integration)'
      parameters:
        - name: deviceCode
          in: path
          description: External reference for the device
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
  /api/v1/devices/{deviceCode}/transactions:
    post:
      tags:
        - DeviceTransaction
      summary: Instructs the device to perform a purchase. (Auth) 
      description: This is used in card payment solution to charge the amount which is higher than pre-authorization amount. Cloud/Mobile payment integration developer does not need to use it
      parameters:
        - name: deviceCode
          in: path
          description: ''
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Transaction.DeviceTransaction
          text/json:
            schema:
              $ref: >-
                #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Transaction.DeviceTransaction
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Transaction.DeviceTransaction
      responses:
        '201':
          description: Created
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.Transaction
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.Transaction
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.Transaction
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
        '422':
          description: Client Error
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
        '504':
          description: Server Error
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
  /api/v1/devices/{deviceCode}/transactions/{transactionId}/capture:
    post:
      tags:
        - DeviceTransaction
      summary: >-
        Instructs the device to capture the ongoing transaction. This can only
        happen *once*. (Auth)
      parameters:
        - name: deviceCode
          in: path
          required: true
          schema:
            type: string
        - name: transactionId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Device.DeviceCapture
          text/json:
            schema:
              $ref: >-
                #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Device.DeviceCapture
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Device.DeviceCapture
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
        '504':
          description: Server Error
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
  /api/v1/devices/{deviceCode}/transactions/{transactionId}/reversal:
    post:
      tags:
        - DeviceTransaction
      summary: >-
        Instructs the device to reverse the ongoing transaction. This can only
        happen *once*. (Auth)
      parameters:
        - name: deviceCode
          in: path
          required: true
          schema:
            type: string
        - name: transactionId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:      # Request body contents
              type: object
              properties:
                transactionId:
                  type: string
                  example: "112121212"
                  description: "transacition id of payment session"
                deviceCode:
                  type: string
                  example: "if-2121-2121-4343"
                  description: "cabinet device code"
                receiptItems:
                  minItems: 1
                  type: array
                  items:
                    $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Requests.Receipt.Item'
                orderId:
                  type: string
                  example: "Order-12293209321"
                  nullable: true
                  description: "Order Id generated from selfly system, it is used to query transaction from selfly cloud api"
             
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
        '504':
          description: Server Error
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
  /api/v1/devices/{deviceCode}/transactions/{transactionId}/cancel:
    post:
      tags:
        - DeviceTransaction
      summary: "Instructs the terminal to attempt to cancel the ongoing transaction. \r\nThis action is not guaranteed, as the terminal might very well choose to ignore it, if\r\nit is currently processing the transaction. (Auth)"
      description: This is used in card payment solution to cancel the amount which is higher than pre-authorization amount. Cloud/Mobile payment integration developer does not need to use it
      parameters:
        - name: deviceCode
          in: path
          required: true
          schema:
            type: string
        - name: transactionId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
        '504':
          description: Server Error
          content:
            text/plain:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.Error
  
components:
  schemas:
    PaymentProvider.API.Messages.v1.Requests.Authentication.Authentication:
      required:
        - apiKey
      type: object
      properties:
        apiKey:
          type: string
          description: Api-Key to exchange for a JWT
      additionalProperties: false
      description: Authentication request
    PaymentProvider.API.Messages.v1.Responses.Authentication.Authentication:
      type: object
      properties:
        token:
          type: string
          description: JWT
          nullable: true
        expiration:
          type: string
          description: ''
          format: date-time
      additionalProperties: false
      description: Authentication response
    PaymentProvider.API.Messages.v1.Responses.Error.Error:
      type: object
      properties:
        entity:
          $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Responses.Error.EntityType'
        message:
          type: string
          nullable: true
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Requests.Device.AuthorizationSettings:
      required:
        - amount
        - currency
      type: object
      properties:
        currency:
          maxLength: 3
          minLength: 3
          type: string
          description: Test
          example: DKK
        amount:
          type: integer
          description: Test
          format: int32
          example: 42000
        exponent:
          type: integer
          description: (Optional) Defaults to 2.
          format: int32
          nullable: true
          example: 2
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Requests.Transaction.TransactionType:
      enum:
        - AuthorizeCapture
        - Purchase
      type: string
    PaymentProvider.API.Messages.v1.Requests.Device.Device:
      required:
        - authorizationSettings
        - operation
      type: object
      properties:
        operation:
          $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Requests.OperationalMode'
        message:
          maxLength: 100
          type: string
          description: (Optional) Set when OperationalMode = Warning as description.
          nullable: true
          example: ''
        authorizationSettings:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Device.AuthorizationSettings
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Requests.Device.DeviceCapture:
      required:
        - receiptItems
        - totalPrice
      type: object
      properties:
        totalPrice:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Transaction.TotalPrice
        receiptItems:
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Requests.Receipt.Item'
        orderId:
          type: string
          example: "Order-12293209321"
          nullable: true
          description: "Order Id generated from selfly system, it is used to query transaction from selfly cloud api"
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Requests.OperationalMode:
      enum:
        - OutOfService
        - Warning
        - Maintenance
        - Normal
        - Pending
      type: string
    PaymentProvider.API.Messages.v1.Requests.Receipt.DiscountInfo:
      required:
        - amount
        - descriptions
        - percentage
      type: object
      properties:
        amount:
          type: integer
          description: Discounted amount.
          format: int32
          example: 4200
        exponent:
          type: integer
          format: int32
          nullable: true
        percentage:
          type: number
          format: double
        descriptions:
          type: array
          items:
            $ref: >-
              #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Receipt.Translation
          description: Description of why the discount was applied
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Requests.Receipt.Item:
      required:
        - names
        - originalPrice
      type: object
      properties:
        productId:
          maxLength: 32
          type: string
          description: >-
            Product ID. Defines a product type. I.e. "Coca Cola" or "Coca Cola
            Zero".
          nullable: true
        itemId:
          maxLength: 32
          type: string
          description: >-
            Item ID. Describes a specific item. I.e. there are 10 items of
            ProductId "coca cola zero", but all 10 have unique identifiers.
          nullable: true
        names:
          minItems: 1
          type: array
          items:
            $ref: >-
              #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Receipt.Translation
          description: List of translations of the name of the item being sold
        descriptions:
          type: array
          items:
            $ref: >-
              #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Receipt.Translation
          description: List of translations of the description of the item being sold
          nullable: true
        originalPrice:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Transaction.ReceiptPriceInfo
        discount:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Receipt.DiscountInfo
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Requests.Receipt.Translation:
      required:
        - language
        - value
      type: object
      properties:
        language:
          maxLength: 5
          minLength: 2
          type: string
          description: ISO 639-1 Language Code
          example: da-DK
        value:
          maxLength: 100
          type: string
          description: Value of the translation, for the given code.
          example: Translation
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Requests.Transaction.DeviceTransaction:
      required:
        - language
        - totalPrice
        - type
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Transaction.TransactionType
        language:
          maxLength: 5
          minLength: 2
          type: string
          description: ISO 639 language code.
          example: da-DK
        totalPrice:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Requests.Transaction.TotalPrice
        receiptItems:
          type: array
          items:
            $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Requests.Receipt.Item'
          description: >-
            (Optional) List of items for the receipt. Should not be used for
            PaymentProvider.API.Messages.v1.Requests.Transaction.TransactionType.AuthorizeCapture
          nullable: true
        transactionReference:
          maxLength: 32
          type: string
          description: Also known as ChainID
          nullable: true
          example: '100700123451234567891234567'
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Requests.Transaction.ReceiptPriceInfo:
      required:
        - currency
        - price
        - vatPct
      type: object
      properties:
        currency:
          maxLength: 3
          minLength: 3
          type: string
          description: Currency code in accordance with ISO 4217.
          example: DKK
        price:
          type: integer
          description: >-
            Price of product / service times 10^Exponent, inc. VAT. Example: For
            Danish Kroner and Øre, a price of 42,- should be listed as 4200.
          format: int32
          example: 4200
        exponent:
          type: integer
          description: Assumes 2 if omitted, to comply with Danish kroner and ører.
          format: int32
          nullable: true
          example: 2
        vatPct:
          type: number
          description: >-
            Vat percentage for the item. Example: Cost of an item: 100 DKK, Vat
            = 20 DKK, VatPct = 25.0.
          format: double
          example: 25
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Requests.Transaction.TotalPrice:
      required:
        - currency
        - price
      type: object
      properties:
        currency:
          maxLength: 3
          minLength: 3
          type: string
          description: Currency code in accordance with ISO 4217.
          example: DKK
        price:
          type: integer
          description: >-
            Price of product / service times 10^Exponent, inc. VAT. Example: For
            Danish Kroner and Øre, a price of 42,- should be listed as 4200.
          format: int32
          example: 4200
        exponent:
          type: integer
          description: Assumes 2 if omitted, to comply with Danish kroner and ører.
          format: int32
          nullable: true
          example: 2
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Device.AuthorizationSettings:
      required:
        - amount
        - currency
        - exponent
      type: object
      properties:
        currency:
          maxLength: 3
          minLength: 3
          type: string
          description: ''
          example: DKK
        amount:
          type: integer
          description: ''
          format: int32
          example: 42000
        exponent:
          type: integer
          description: ''
          format: int32
          example: 2
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Device.Device:
      required:
        - deviceCode
        - lastPing
        - operation
      type: object
      properties:
        deviceCode:
          maxLength: 150
          type: string
        operation:
          $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Responses.OperationalMode'
        lastPing:
          type: string
          format: date-time
        message:
          maxLength: 100
          type: string
          nullable: true
        authorizationSettings:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Device.AuthorizationSettings
        terminals:
          type: array
          items:
            $ref: >-
              #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Device.DeviceTerminal
          nullable: true
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Device.DeviceTerminal:
      required:
        - terminalReference
      type: object
      properties:
        terminalReference:
          maxLength: 10
          minLength: 10
          type: string
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Error.EntityType:
      enum:
        - Unknown
        - Integration
        - Terminal
        - Transaction
        - Device
      type: string
    PaymentProvider.API.Messages.v1.Responses.OperationalMode:
      enum:
        - Warning
        - OutOfService
        - Maintenance
        - Normal
        - Pending
      type: string
    PaymentProvider.API.Messages.v1.Responses.Receipt.Discount:
      required:
        - amount
        - descriptions
        - exponent
        - percentage
      type: object
      properties:
        amount:
          type: integer
          format: int32
        exponent:
          type: integer
          format: int32
        percentage:
          type: number
          format: double
        descriptions:
          type: array
          items:
            $ref: >-
              #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Receipt.Translation
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Receipt.OriginalPrice:
      required:
        - currency
        - exponent
        - price
        - vatPct
      type: object
      properties:
        currency:
          maxLength: 3
          minLength: 3
          type: string
        price:
          type: integer
          format: int32
        exponent:
          type: integer
          format: int32
        vatPct:
          type: number
          format: double
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Receipt.ReceiptItem:
      required:
        - descriptions
        - names
        - originalPrice
      type: object
      properties:
        productId:
          maxLength: 32
          type: string
          nullable: true
        itemId:
          maxLength: 32
          type: string
          nullable: true
        names:
          type: array
          items:
            $ref: >-
              #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Receipt.Translation
        descriptions:
          type: array
          items:
            $ref: >-
              #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Receipt.Translation
        originalPrice:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Receipt.OriginalPrice
        discount:
          $ref: '#/components/schemas/PaymentProvider.API.Messages.v1.Responses.Receipt.Discount'
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Receipt.Translation:
      required:
        - language
        - value
      type: object
      properties:
        language:
          maxLength: 5
          minLength: 2
          type: string
          description: ISO 639-1 Language Code
          example: da-DK
        value:
          maxLength: 100
          type: string
          description: Value of the translation, for the given code.
          example: Translation
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Transaction.Authorization:
      required:
        - amount
        - currency
      type: object
      properties:
        amount:
          type: integer
          description: Amount authorized
          format: int32
          example: 42000
        exponent:
          type: integer
          description: ''
          format: int32
          nullable: true
          example: 2
        currency:
          maxLength: 3
          minLength: 3
          type: string
          description: ''
          example: DKK
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Transaction.ChargedAmount:
      required:
        - amount
        - currency
        - exponent
      type: object
      properties:
        currency:
          maxLength: 3
          minLength: 3
          type: string
          description: Currency code in accordance with ISO 4217.
          example: DKK
        amount:
          type: integer
          description: >-
            The actual charged amount. This might differ from the Authorization
            amount, in TransactionType
            PaymentProvider.API.Messages.v1.Responses.Transaction.TransactionType.AuthorizeCapture
          format: int32
          example: 4200
        exponent:
          type: integer
          description: Assumes 2 if omitted, to comply with Danish kroner and ører.
          format: int32
          example: 2
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Transaction.CustomerIdentifier:
      required:
        - value
      type: object
      properties:
        identifierType:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.IdentifierType
        encoding:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.Encoding
        value:
          maxLength: 255
          type: string
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Transaction.Encoding:
      enum:
        - None
        - Base64
        - HEX
        - UUID
      type: string
    PaymentProvider.API.Messages.v1.Responses.Transaction.IdentifierType:
      enum:
        - PAN
        - EmvHash31
        - EmvHash32
      type: string
    PaymentProvider.API.Messages.v1.Responses.Transaction.Media:
      enum:
        - Unknown
        - EMV
        - LocalCard
        - MobilePay
        - Swish
        - Vipps
      type: string
    PaymentProvider.API.Messages.v1.Responses.Transaction.PaymentInformation:
      type: object
      properties:
        media:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.Media
        customerIdentifiers:
          type: array
          items:
            $ref: >-
              #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.CustomerIdentifier
          nullable: true
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Transaction.Reason:
      enum:
        - None
        - TransactionComplete
        - AuthorizedAmountExceeded
        - OutOfBalance
        - CardRejected
        - CancelledByDevice
        - CancelledByTerminal
      type: string
    PaymentProvider.API.Messages.v1.Responses.Transaction.RemainingAmount:
      required:
        - amount
        - currency
        - exponent
        - reason
      type: object
      properties:
        currency:
          maxLength: 3
          minLength: 3
          type: string
          description: Currency code in accordance with ISO 4217.
          example: DKK
        amount:
          type: integer
          description: >-
            The actual charged amount. This might differ from the Authorization
            amount, in TransactionType
            PaymentProvider.API.Messages.v1.Responses.Transaction.TransactionType.AuthorizeCapture
          format: int32
          example: 4200
        exponent:
          type: integer
          description: Assumes 2 if omitted, to comply with Danish kroner and ører.
          format: int32
          example: 2
        reason:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.Reason
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Transaction.TotalPrice:
      required:
        - currency
        - exponent
        - price
      type: object
      properties:
        currency:
          maxLength: 3
          minLength: 3
          type: string
          description: Currency code in accordance with ISO 4217.
          example: DKK
        price:
          type: integer
          description: >-
            Price of product / service times 10^Exponent, inc. VAT. Example: For
            Danish Kroner and Øre, a price of 42,- should be listed as 4200.
          format: int32
          example: 4200
        exponent:
          type: integer
          description: Assumes 2 if omitted, to comply with Danish kroner and ører.
          format: int32
          example: 2
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Transaction.Transaction:
      required:
        - transactionId
      type: object
      properties:
        transactionId:
          type: integer
          description: ''
          format: int64
          example: 27
        transactionReference:
          maxLength: 32
          type: string
          description: Also known as ChainID
          nullable: true
          example: '100700123451234567891234567'
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
          nullable: true
        transactionState:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.TransactionState
        transactionType:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.TransactionType
        claimToken:
          type: string
          format: uuid
        captureRequested:
          type: string
          format: date-time
          nullable: true
        captured:
          type: string
          format: date-time
          nullable: true
        reversalRequested:
          type: string
          format: date-time
          nullable: true
        reversed:
          type: string
          format: date-time
          nullable: true
        purchased:
          type: string
          format: date-time
          nullable: true
        failed:
          type: string
          format: date-time
          nullable: true
        removed:
          type: string
          format: date-time
          nullable: true
        error:
          maxLength: 2048
          type: string
          description: ''
          nullable: true
          example: ''
        language:
          maxLength: 5
          minLength: 2
          type: string
          description: ''
          nullable: true
          example: da-DK
        authorization:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.Authorization
        chargedAmount:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.ChargedAmount
        remainingAmount:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.RemainingAmount
        totalPrice:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.TotalPrice
        paymentInformation:
          $ref: >-
            #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Transaction.PaymentInformation
        receiptItems:
          type: array
          items:
            $ref: >-
              #/components/schemas/PaymentProvider.API.Messages.v1.Responses.Receipt.ReceiptItem
          nullable: true
      additionalProperties: false
    PaymentProvider.API.Messages.v1.Responses.Transaction.TransactionState:
      enum:
        - Open
        - PurchaseRequested
        - CaptureRequested
        - ReversalRequested
        - Captured
        - Reversed
        - Purchased
        - Failed
      type: string
    PaymentProvider.API.Messages.v1.Responses.Transaction.TransactionType:
      enum:
        - AuthorizeCapture
        - Purchase
      type: string
  securitySchemes:
    Bearer:
      type: apiKey
      description: Please insert JWT with Bearer into field
      name: Authorization
      in: header
security:
  - Bearer: []
