{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/cm-com/main/json-schema/cm-com-new-transaction-schema.json",
  "title": "NewTransaction",
  "description": "Information for Transaction to be created at PayPlaza",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cm-com-payments-pos-cloud-api-v1-9-0-openapi.yml#/components/schemas/NewTransaction",
  "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"
    },
    "type": {
      "$ref": "#/$defs/TransactionType"
    },
    "amount": {
      "$ref": "#/$defs/Amount"
    },
    "reference": {
      "type": [
        "object",
        "null"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/TransactionReference"
        }
      ]
    }
  },
  "$defs": {
    "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": {
          "pattern": "\\d+\\.\\d{2}",
          "type": "number"
        },
        "currency": {
          "description": "Currency Code",
          "enum": [
            "EUR",
            "USD",
            "GBP"
          ],
          "type": "string"
        }
      }
    },
    "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"
        }
      }
    },
    "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></dl>",
      "enum": [
        "PURCHASE",
        "PRE_AUTH",
        "REFUND"
      ],
      "type": "string"
    }
  }
}