---
openapi: 3.0.3
info:
  title: Merchant API
  description: |
    ## Payment Acceptance Made Easy
    The MerchantAPI allows merchants to interact with and retrieve information from the PayPlaza payment system.
    It allows merchants to retrieve information about how their account has been setup with **Stores** and **Terminals**.
    It allows merchants to retrieve the list and the details of **Transactions** and it allows merchants to initiate a new **Payment**.

    ## Errors
    Error responses, HTTP status 400 and higher, will contain a JSON response body with details about the error.
    We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs.
    As with our normal API responses, your client must be prepared to gracefully handle additional members of the response.

    **Note:** Problem `type` and `instance` identifiers in our APIs are not meant to be resolved.
    RFC 7807 encourages that problem types are URI references that point to human-readable documentation, but we deliberately decided against that, as all important parts of the API are documented.
  version: 1.15.0
  contact:
    name: Development
    email: ecr.developer@cm.com
    url: https://www.cm.com
security:
- ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: API-Key
      description: Authentication via the API Key provided by PayPlaza
  schemas:
    Problem:
      type: object
      properties:
        type:
          format: uri-reference
          description: |
            A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferenceable and point to a human-readable documentation nor globally unique for the problem type.
          default: about:blank
          type: string
          example: /some/uri-reference
        title:
          description: |
            A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
          type: string
          example: some title for the error situation
        status:
          format: int32
          description: |
            The HTTP status code generated by the origin server for this occurrence of the problem.
          maximum: 600
          exclusiveMaximum: true
          minimum: 100
          type: integer
        detail:
          description: |
            A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
          type: string
          example: some description for the error situation
        instance:
          format: uri-reference
          description: |
            A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code.
          type: string
          example: /some/uri-reference#specific-occurrence-context
    Address:
      type: object
      properties:
        address:
          description: "Address line, e.g. streetname and number"
          maxLength: 255
          minLength: 1
          type: string
        zipCode:
          description: Zip code
          maxLength: 255
          minLength: 1
          type: string
        city:
          description: City name
          maxLength: 255
          minLength: 1
          type: string
        stateCode:
          description: "State of province code, according to country local regulations"
          maxLength: 255
          minLength: 1
          type: string
          nullable: true
        countryCode:
          description: Alpha-2 Country code according to <a href="https://en.wikipedia.org/wiki/ISO_3166">ISO
            3166</a>
          maxLength: 2
          minLength: 2
          type: string
    Amount:
      description: "Describes how much money the transaction should be.<br />'value'\
        \ is a number value with a dot (.) as decimal separator. It should NOT have\
        \ any digit grouping or thousands separators<br />'currency' is a 3-letter-code,\
        \ compliant with <a href=\"https://en.wikipedia.org/wiki/ISO_4217\">ISO 4217</a>"
      required:
      - value
      - currency
      type: object
      properties:
        value:
          maximum: 99999.99
          pattern: "\\d+\\.\\d{2}"
          type: number
        currency:
          description: Currency Code
          enum:
          - EUR
          - USD
          - GBP
          type: string
      example:
        value: 10298.75
        currency: EUR
    CreateAPIKeyRequest:
      required:
      - label
      type: object
      properties:
        label:
          type: string
        validity:
          allOf:
          - $ref: "#/components/schemas/Validity"
          type: object
          nullable: true
    CreateAPIKeyResponse:
      required:
      - id
      - label
      - apikey
      type: object
      properties:
        id:
          maxLength: 15
          minLength: 15
          pattern: "\\d{15}"
          type: string
        label:
          type: string
        apikey:
          maxLength: 50
          minLength: 50
          pattern: "[a-z-A-Z0-9]{50}"
          type: string
    DayTotals:
      required:
      - receipt
      type: object
      properties:
        receipt:
          type: array
          items:
            type: string
    Device:
      type: object
      properties:
        manufacturer:
          description: Manufacturer name of the device
          maxLength: 255
          minLength: 1
          type: string
        model:
          description: Model name of the device
          maxLength: 255
          minLength: 1
          type: string
        serial:
          description: Serial(number) of the device
          maxLength: 255
          minLength: 1
          type: string
    DeviceEcrDTO:
      type: object
      properties:
        manufacturer:
          description: Device manufacturer name
          type: string
        model:
          description: Device model name
          type: string
        serial:
          description: Device serial number
          type: string
        ecrId:
          description: ECR identifier
          type: string
          nullable: true
    GetAPIKeyResponse:
      required:
      - id
      - label
      - lastUsage
      - validity
      type: object
      properties:
        id:
          maxLength: 15
          minLength: 15
          pattern: "\\d{15}"
          type: string
        label:
          description: The label given by the user
          type: string
        lastUsage:
          format: date-time
          type: string
          nullable: true
        validity:
          allOf:
          - $ref: "#/components/schemas/Validity"
          type: object
          nullable: true
    HttpProblem:
      description: HTTP Problem Response according to RFC9457 and RFC7807
      type: object
      properties:
        type:
          format: uri
          description: A optional URI reference that identifies the problem type
          type: string
          example: https://example.com/errors/not-found
        title:
          description: "A optional, short, human-readable summary of the problem type"
          type: string
          example: Not Found
        status:
          format: int32
          description: The HTTP status code for this occurrence of the problem
          type: integer
          example: 404
        detail:
          description: A optional human-readable explanation specific to this occurrence
            of the problem
          type: string
          example: Record not found
        instance:
          format: uri
          description: A URI reference that identifies the specific occurrence of
            the problem
          type: string
          example: https://api.example.com/errors/123
      additionalProperties: true
    HttpValidationProblem:
      description: HTTP Validation Problem Response according to RFC9457 and RFC7807
      type: object
      properties:
        type:
          format: uri
          description: A optional URI reference that identifies the problem type
          type: string
          example: https://example.com/errors/not-found
        title:
          description: "A optional, short, human-readable summary of the problem type"
          type: string
          example: Not Found
        status:
          format: int32
          description: The HTTP status code for this occurrence of the problem
          type: integer
          example: 404
        detail:
          description: A optional human-readable explanation specific to this occurrence
            of the problem
          type: string
          example: Record not found
        instance:
          format: uri
          description: A URI reference that identifies the specific occurrence of
            the problem
          type: string
          example: https://api.example.com/errors/123
        violations:
          description: List of validation constraint violations that occurred
          type: array
          items:
            $ref: "#/components/schemas/Violation"
      additionalProperties: true
    NewCnpRefundTransaction:
      description: A CNP Refund
      required:
      - transactionId
      - status
      - merchantOrderReference
      - amount
      type: object
      properties:
        transactionId:
          description: "\n                Unique identifier generated by PayPlaza\
            \ for this transaction.\n                Format will be 31 numeric characters.\n\
            \            "
          pattern: "[0-9]{31}"
          type: string
        status:
          description: Result of the operation
          pattern: "([0-9a-zA-Z]|-|_){1,14}"
          example: FAILED - SUCCESS
        merchantOrderReference:
          type: string
        amount:
          $ref: "#/components/schemas/Amount"
    NewTransaction:
      description: Information for Transaction to be created at PayPlaza
      required:
      - merchant_order_reference
      - type
      - amount
      type: object
      properties:
        merchant_order_reference:
          description: "Reference provided by the Merchant for future identification\
            \ of this Transaction<br />This field may contain all letters in lowercase\
            \ and uppercase, digit, underscore '_' and <a href=\"https://en.wikipedia.org/wiki/Hyphen-minus\"\
            >hyphen-minus</a> '-'Usually a unique identifier generated by the Merchant<br\
            \ />"
          maxLength: 14
          minLength: 1
          pattern: "([0-9a-zA-Z]|-|_){1,14}"
          type: string
          example: "Q99PM-2QHFW-FQ"
        type:
          $ref: "#/components/schemas/TransactionType"
        amount:
          $ref: "#/components/schemas/Amount"
        reference:
          allOf:
          - $ref: "#/components/schemas/TransactionReference"
          type: object
          nullable: true
    Paginated:
      required:
      - currentPage
      - currentPageIndex
      - pageCount
      - totalCount
      type: object
      properties:
        currentPage: {}
        currentPageIndex:
          format: int32
          type: integer
        pageCount:
          format: int32
          type: integer
        totalCount:
          format: int64
          type: integer
        pageSize:
          format: int32
          type: integer
    Receipt:
      type: object
      properties:
        receipt:
          description: List of lines for the receipt
          type: string
    Store:
      title: StoreSummary
      description: Information of the Store to which a transaction belongs.
      required:
      - uuid
      - name
      type: object
      properties:
        uuid:
          description: Identifier of the store
          type: string
          allOf:
          - $ref: "#/components/schemas/UUID"
        name:
          description: Name of the store
          maxLength: 255
          minLength: 1
          type: string
    Store1:
      title: Store
      description: Information about Store where merchant can do transactions
      type: object
      properties:
        uuid:
          description: Identifier of the store
          type: string
          allOf:
          - $ref: "#/components/schemas/UUID"
        name:
          description: Name of the store
          maxLength: 255
          minLength: 1
          type: string
        address:
          description: The address of the store
          type: object
          allOf:
          - $ref: "#/components/schemas/Address"
        timeZone:
          type: object
          allOf:
          - $ref: "#/components/schemas/TimeZone"
          nullable: true
          writeOnly: true
    StoreDeviceDTO:
      title: Store with Device information
      description: Information about Store where merchant can do transactions and
        its linked devices
      type: object
      properties:
        uuid:
          allOf:
          - $ref: "#/components/schemas/UUID"
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        address:
          allOf:
          - $ref: "#/components/schemas/Address"
          type: object
          nullable: true
        devices:
          type: array
          items:
            $ref: "#/components/schemas/DeviceEcrDTO"
    Terminal:
      required:
      - device
      type: object
      properties:
        device:
          $ref: "#/components/schemas/Device"
    TimeZone:
      type: object
      properties:
        ID:
          type: string
        rawOffset:
          format: int32
          type: integer
        displayName:
          type: string
        DSTSavings:
          format: int32
          type: integer
    Transaction:
      description: A transaction
      required:
      - id
      - creation_datetime
      - merchant_order_reference
      - merchant_id
      - type
      - status
      - store
      - amount
      type: object
      properties:
        id:
          description: Unique identifier generated by PayPlaza for this transaction.<br
            />Format will be 31 numeric characters
          pattern: "[0-9]{31}"
          type: string
        creation_datetime:
          description: Datetime identifying the moment the transaction was created
            at PayPlaza and in PayPlaza timezone.<br />The creation date is specified
            in the <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format.<br
            />The date on the receipt is formatted to the store timezone.
          pattern: "ISO 8601: \"YYYY-MM-DD'T'hh:mm:ssZ\""
          type: string
          allOf:
          - $ref: "#/components/schemas/ZonedDateTime"
          example: 2022-01-19T12:58:00Z
        merchant_order_reference:
          description: Identifier provided by the merchant when creating the transaction.
          maxLength: 14
          minLength: 1
          pattern: "([0-9a-zA-Z]|-|_){1,14}"
          type: string
          example: "Q99PM-2QHFW-FQ"
        brand:
          description: "Optional field, which will only be filled if this transaction\
            \ is authorized by a processor.<br /><br />Identifies the brand on the\
            \ bankcard of the consumer, possible values:<br />AMEX, CIRRUS, CUP, DINERS,\
            \ DISCOVER, JCB, MAESTRO, MASTERCARD, VISA, V_PAY."
          type: string
          nullable: true
        system_trace_audit_number:
          description: "Optional field, which will only be filled if this transaction\
            \ is authorized by a processor.<br /><br />Identifier generated by PayPlaza\
            \ to trace a transaction through its lifecycle with a processor.<br />*\
            \ Format is a 6 digit number, but should be treated as a string.<br />*\
            \ Unique per day per processor, so not unique for merchants."
          type: string
          nullable: true
        receipt:
          description: "Optional field, which will only be filled if this transaction\
            \ cleared or cancelled.<br /><br />Plain text description of the transaction,\
            \ contains required information needed to print a proof of the transaction\
            \ of the consumer."
          type: string
          nullable: true
        original_id:
          description: "Optional field, which will only be filled if this transaction\
            \ is a REFUND.<br /><br />This field contains the id of the original PURCHASE\
            \ transaction to which this transaction is a refund."
          pattern: "[0-9]{31}"
          type: string
          nullable: true
        authorization_code:
          description: "Optional field, which will only be filled if this transaction\
            \ is authorized by a processor.<br /><br />This field contains the authentication\
            \ provided by the processor of the transaction."
          pattern: "[0-9]{6}"
          type: string
          nullable: true
        merchant_id:
          description: Identifier of the merchant that initiated this transaction.
          type: string
        processor_terminal_id:
          description: "Optional field, which will only be filled after this transaction\
            \ is authorized.<br /><br />Terminal ID provided by the processor of the\
            \ transaction."
          type: string
          nullable: true
        type:
          $ref: "#/components/schemas/TransactionType"
        amount:
          $ref: "#/components/schemas/Amount"
        store:
          allOf:
          - $ref: "#/components/schemas/Store"
          type: object
          nullable: true
        merchant_receipt:
          type: string
          nullable: true
        result:
          allOf:
          - $ref: "#/components/schemas/TransactionResult"
          type: string
          nullable: true
        status:
          $ref: "#/components/schemas/TransactionStatus"
    TransactionReference:
      description: Reference object that represents a unique identifier for a transaction
      type: object
      properties:
        id:
          description: Unique identifier that identifies a transaction
          type: string
    TransactionResult:
      description: Final outcome of processing the transaction.<dl><dt>APPROVED</dt><dd>Indicates
        that the bank of the consumer authorized the payment.</dd><dt>DECLINED</dt><dd>Indicates
        that the bank of the consumer does NOT approve the payment.</dd></dl>
      enum:
      - APPROVED
      - DECLINED
      type: string
    TransactionStatus:
      description: <strong>Current state of a transaction.</strong><dl><dt>CREATED</dt><dd>Transaction
        is created and waiting authorization.</dd><dt>AUTHORIZED</dt><dd>Transaction
        is authorized and awaiting clearance.</dd><dt>CLEARED</dt><dd>Transaction
        is cleared and is completed successfully.</dd><dt>CANCELLED</dt><dd>Transaction
        is cancelled and is completed unsuccessfully.</dd>
      enum:
      - CREATED
      - AUTHORIZED
      - CLEARED
      - CANCELLED
      type: string
    TransactionType:
      description: <dl><dt>PURCHASE</dt><dd>Indicates a purchase where the money will
        flow from the consumer to the merchant</dd><dt>PRE_AUTH</dt><dd>Indicates
        a claim on a certain amount of money on the bankaccount of the consumer</dd><dt>REFUND</dt><dd>Indicates
        a refunds where the money will flow from the merchant back to the consumer</dd><dt>CNP_REFUND</dt><dd>Indicates
        a refunds where the money will flow from the merchant back - card not present</dd><dt>PURCHASE_MAT</dt><dd>Indicates
        a purchase where the money will flow from the consumer to the merchant</dd></dl>
      enum:
      - PURCHASE
      - PRE_AUTH
      - REFUND
      - CNP_REFUND
      - PURCHASE_MAT
      type: string
    UUID:
      format: uuid
      pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"
      type: string
    Validity:
      required:
      - from
      - until
      type: object
      properties:
        from:
          allOf:
          - $ref: "#/components/schemas/ZonedDateTime"
          type: string
          nullable: true
        until:
          allOf:
          - $ref: "#/components/schemas/ZonedDateTime"
          type: string
          nullable: true
    Violation:
      description: Validation constraint violation details
      type: object
      properties:
        field:
          description: The field for which the validation failed
          type: string
          example: "#/profile/email"
        in:
          description: "Part of the http request where the validation error occurred\
            \ such as query, path, header, form, body"
          type: string
          example: query
        message:
          description: Description of the validation error
          type: string
          example: Invalid email format
    ZonedDateTime:
      format: date-time
      type: string
      example: 2022-03-10T12:15:50-04:00
paths:
  /apikeys:
    get:
      operationId: getApiKeys
      summary: Retrieve details about the available APIKeys
      tags:
      - Security
      responses:
        "200":
          description: The list of APIKeys known
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/GetAPIKeyResponse"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "401":
          description: Not Authorized.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
    post:
      operationId: createApiKey
      summary: Create new API key
      tags:
      - Security
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAPIKeyRequest"
      responses:
        "201":
          description: An API Key is successfully created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateAPIKeyResponse"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "401":
          description: Not Authorized.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /apikeys/id/{id}:
    delete:
      operationId: deleteApiKey
      summary: Delete an API key
      tags:
      - Security
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        "204":
          description: No content.
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "401":
          description: Not Authorized.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "403":
          description: Forbidden.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /cnp/transactions:
    get:
      operationId: listCnpTransactions
      summary: List CNP transactions
      description: "\n            Retrieve a paginated list of CNP transactions for\
        \ the authenticated organization.\n            Returns CNP transactions from\
        \ the last 90 days based on data retention policy.\n        "
      tags:
      - cnp
      parameters:
      - description: Page number (1-based)
        name: page
        schema:
          default: 1
          minimum: 1
          type: integer
        in: query
        required: true
      - description: Page size
        name: size
        schema:
          default: 10
          maximum: 100
          minimum: 1
          type: integer
        in: query
        required: true
      responses:
        "200":
          description: List of CNP transactions
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Paginated"
        "400":
          description: Bad request - Invalid pagination parameters
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "401":
          description: Unauthorized - Invalid or missing API key
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /cnp/transactions/daytotals/today:
    get:
      operationId: getCnpDayTotals
      summary: Get CNP day totals for today
      description: "\n            Retrieves the day totals receipt for CNP transactions\
        \ for the authenticated organization.\n            Returns totals from midnight\
        \ (00:00) of the current day by default.\n            Optionally, you can\
        \ specify a start time to filter transactions from a specific hour.\n    \
        \    "
      tags:
      - cnp
      parameters:
      - description: Starting hour (0-23). Defaults to 0 (midnight)
        name: hourFrom
        schema:
          maximum: 23
          minimum: 0
          type: integer
          nullable: true
        in: query
        required: true
      - description: Starting minute (0-59). Defaults to 0
        name: minuteFrom
        schema:
          maximum: 59
          minimum: 0
          type: integer
          nullable: true
        in: query
        required: true
      responses:
        "200":
          description: CNP day totals receipt
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/DayTotals"
        "400":
          description: Bad request - Invalid time parameters
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "401":
          description: Unauthorized - Invalid or missing API key
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /cnp/transactions/{cnpTransactionId}:
    get:
      operationId: getCnpTransaction
      summary: Retrieve CNP transaction by ID
      description: "\n            Retrieve the status and details of a specific CNP\
        \ (Card Not Present) transaction.\n            Only transactions of type CNP_REFUND\
        \ are supported.\n        "
      tags:
      - cnp
      parameters:
      - description: CNP transaction identifier
        name: cnpTransactionId
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      responses:
        "200":
          description: CNP transaction found
          content:
            application/json:
              examples:
                CNP Transaction:
                  value:
                    merchant_order_reference: "656"
                    amount:
                      value: 25.0
                      currency: EUR
                    store:
                      uuid: c0803ecb-177a-4b03-9a39-6030b86beca5
                      name: Certification Store eMerchantpay
                    id: "0001012025091810182125600000004"
                    system_trace_audit_number: "100123"
                    brand: VISA
                    receipt: "  Certification Store   \n      eMerchantpay     example"
                    result: APPROVED
                    status: CLEARED
                    creation_datetime: 2025-09-18T08:18:16Z
                    merchant_id: 180ad3fe-f192-49ba-a5e7-8f09718f651c
                    type: CNP_REFUND
                    authorization_code: "148490"
              schema:
                $ref: "#/components/schemas/Transaction"
        "400":
          description: Bad request - Transaction is not of type CNP
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "401":
          description: Unauthorized - Invalid or missing API key
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "404":
          description: Not found - Transaction ID does not exist
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /cnp/transactions/{transactionId}/refunds:
    post:
      operationId: createCnpRefund
      summary: Create new card not present refund.
      description: "\n            The Merchant-API ensures that only one CNP refund\
        \ is created and processed per transaction (purchase).\n            The terminal\
        \ is not part of this refund flow.\n        "
      tags:
      - cnp
      parameters:
      - description: Original transaction identifier
        name: transactionId
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      requestBody:
        content:
          application/json:
            examples:
              CNPRefundTransaction:
                value:
                  merchant_order_reference: "1234"
                  amount:
                    value: 0.01
                    currency: EUR
            schema:
              $ref: "#/components/schemas/NewCnpRefundTransaction"
        required: true
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NewCnpRefundTransaction"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "501":
          description: Not yet implemented.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /stores:
    get:
      operationId: listStores
      summary: List all stores.
      tags:
      - Stores
      parameters:
      - description: The page number of your query result
        in: query
        name: page
        required: false
        schema:
          format: int32
          default: 1
          minimum: 1
          type: integer
      - description: The amount of results (defaults to 10)
        in: query
        name: size
        required: false
        schema:
          format: int32
          default: 10
          maximum: 100
          minimum: 1
          type: integer
      responses:
        "200":
          description: OK.
          headers:
            Link:
              description: "Multiple links providing information about how to navigate\
                \ through the entries. Links are separated by a comma ',' Format is\
                \ compliant with RFC 8288 Web Linking"
              schema:
                type: string
              required: true
              allowEmptyValue: true
            X-Total-Count:
              description: Total number of entries available
              schema:
                type: number
              required: true
              allowEmptyValue: false
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Store1"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /stores/devices:
    get:
      operationId: listStoresWithDevices
      summary: List all stores with their assigned devices.
      tags:
      - Stores
      parameters:
      - description: The page number of your query result
        in: query
        name: page
        required: false
        schema:
          format: int32
          default: 1
          minimum: 1
          type: integer
      - description: The amount of results (defaults to 10)
        in: query
        name: size
        required: false
        schema:
          format: int32
          default: 10
          maximum: 100
          minimum: 1
          type: integer
      responses:
        "200":
          description: OK.
          headers:
            Link:
              description: "Multiple links providing information about how to navigate\
                \ through the entries. Links are separated by a comma ',' Format is\
                \ compliant with RFC 8288 Web Linking"
              schema:
                type: string
              required: true
              allowEmptyValue: true
            X-Total-Count:
              description: Total number of entries available
              schema:
                type: number
              required: true
              allowEmptyValue: false
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/StoreDeviceDTO"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /terminals:
    get:
      operationId: listTerminals
      summary: List all terminals.
      tags:
      - Terminals
      parameters:
      - description: "The page number of your query result, starting at 1"
        in: query
        name: page
        required: false
        schema:
          format: int32
          default: 1
          minimum: 1
          type: integer
      - description: "The amount of results per page, maximum 100 (defaults to 10)"
        in: query
        name: size
        required: false
        schema:
          format: int32
          default: 10
          maximum: 100
          minimum: 1
          type: integer
      - description: "Filter on terminal category. Possible values: ALL (default,\
          \ all terminals), CLOUD (only terminals with Cloud Integration))"
        in: query
        name: category
        required: false
        schema:
          type: string
          nullable: true
      responses:
        "200":
          description: OK.
          headers:
            Link:
              description: "Multiple links providing information about how to navigate\
                \ through the entries. Links are seperated by a comma ',' Format is\
                \ compliant with [https://datatracker.ietf.org/doc/html/rfc8288](RFC\
                \ 8288 Web Linking)"
              schema:
                type: string
              required: true
              allowEmptyValue: true
            X-Total-Count:
              description: Total number of entries available
              schema:
                type: number
              required: true
              allowEmptyValue: false
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Terminal"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /terminals/{manufacturer}-{model}-{serial}:
    get:
      operationId: getTerminal
      summary: "Get terminal by manufacturer, model & serial."
      tags:
      - Terminals
      parameters:
      - description: Manufacturer name of the terminal
        name: manufacturer
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Model name of the terminal
        name: model
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Serial(number) of the terminal
        name: serial
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Terminal"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /terminals/{manufacturer}-{model}-{serial}/daytotals/today:
    get:
      operationId: getTerminalDayTotals
      summary: "Get the day totals for the terminal by manufacturer, model & serial."
      tags:
      - Terminals
      parameters:
      - description: Manufacturer name of the terminal
        name: manufacturer
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Model name of the terminal
        name: model
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Serial(number) of the terminal
        name: serial
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Receipt"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /terminals/{manufacturer}-{model}-{serial}/transactions:
    get:
      operationId: listTerminalTransactions
      summary: List transactions by terminal.
      tags:
      - Terminals
      parameters:
      - description: Manufacturer name of the terminal
        name: manufacturer
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Model name of the terminal
        name: model
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Serial(number) of the terminal
        name: serial
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: "The page number of your query result, starting at 1"
        in: query
        name: page
        required: false
        schema:
          format: int32
          default: 1
          minimum: 1
          type: integer
      - description: "The amount of results per page, maximum 100 (defaults to 10)"
        in: query
        name: size
        required: false
        schema:
          format: int32
          default: 10
          maximum: 100
          minimum: 1
          type: integer
      responses:
        "200":
          description: OK.
          headers:
            Link:
              description: "Multiple links providing information about how to navigate\
                \ through the entries. Links are seperated by a comma ',' Format is\
                \ compliant with RFC 8288 Web Linking"
              schema:
                type: string
              required: true
              allowEmptyValue: true
            X-Total-Count:
              description: Total number of entries available
              schema:
                type: number
              required: true
              allowEmptyValue: false
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Transaction"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
    post:
      operationId: createTerminalTransaction
      summary: Create new transaction for terminal.
      description: "The Merchant-API will make sure only one newly created transaction\
        \ is available for a specific terminal.\n            This means that when\
        \ creating a new transaction, previous transaction(s) with status CREATED\
        \ will be aborted.\n            So given transactions A and B, when transaction\
        \ A has not been retrieved by the terminal when creating transaction B the\
        \ Merchant API will abort transaction A, and the terminal will receive transaction\
        \ B.\n        "
      tags:
      - Terminals
      parameters:
      - description: Manufacturer name of the terminal
        name: manufacturer
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Model name of the terminal
        name: model
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Serial(number) of the terminal
        name: serial
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      requestBody:
        content:
          application/json:
            examples:
              Purchase:
                value:
                  type: PURCHASE
                  merchant_order_reference: "1234"
                  amount:
                    value: 0.01
                    currency: EUR
              Unreferenced refund:
                value:
                  type: REFUND
                  merchant_order_reference: "1234"
                  amount:
                    value: 0.01
                    currency: EUR
              Referenced refund:
                value:
                  type: REFUND
                  merchant_order_reference: "1234"
                  amount:
                    value: 0.01
                    currency: EUR
                  reference:
                    id: "12345678"
            schema:
              $ref: "#/components/schemas/NewTransaction"
        required: true
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "501":
          description: Not yet implemented.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /terminals/{manufacturer}-{model}-{serial}/transactions/{id}:
    get:
      operationId: getTerminalTransaction
      summary: Get transaction by terminal and id.
      tags:
      - Terminals
      parameters:
      - description: Manufacturer name of the terminal
        name: manufacturer
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Model name of the terminal
        name: model
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Serial(number) of the terminal
        name: serial
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Identifier of a transaction
        name: id
        required: true
        schema:
          maxLength: 31
          minLength: 31
          pattern: "[0-9]{31}"
          type: string
        in: path
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "404":
          description: Not found.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
    delete:
      operationId: deleteTerminalTransaction
      summary: Abort a transaction by terminal and id.
      tags:
      - Terminals
      parameters:
      - description: Manufacturer name of the terminal
        name: manufacturer
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Model name of the terminal
        name: model
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Serial(number) of the terminal
        name: serial
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
        in: path
      - description: Identifier of a transaction
        name: id
        required: true
        schema:
          maxLength: 31
          minLength: 31
          pattern: "[0-9]{31}"
          type: string
        in: path
      responses:
        "204":
          description: No Content
        "404":
          description: Not found.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "409":
          description: Conflict. The transaction is in a state that can't be aborted
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
  /version:
    get:
      operationId: getVersion
      summary: Retrieving the system version.
      tags:
      - Version
      responses:
        default:
          description: OK.
          content:
            application/json:
              example: 1.0.0
              schema:
                type: string
        "400":
          description: Bad request.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
        "500":
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/HttpProblem"
tags:
- name: Security
  description: For managing API keys
- name: Stores
  description: Operations related to stores
- name: Terminals
  description: Operations related to terminals
- name: Version
  description: Retrieves system information
- name: cnp
  description: Card not present operations
servers:
- url: /merchant/v1
