{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/swift/json-schema/swift-fin-message-emission-schema.json",
  "title": "FinEmission",
  "description": "FIN Message upload",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/swift-messaging-api-openapi.yml#/components/schemas/FinMessageEmission",
  "required": [
    "message_type",
    "payload",
    "receiver",
    "sender",
    "sender_reference"
  ],
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "sender_reference": {
      "description": "The reference provided by the back office application for further reconciliation.\nFor reconciliation to behave as expected, this reference is expected to be unique for a given user/institution (User Unique Message Identifier - UUMID)",
      "maxLength": 70,
      "type": "string"
    },
    "message_type": {
      "description": "The type of the message. For an MT message, the format is fin|apc.<msgtype>[.<variant>]. For example: fin.103, fin.103.REMIT or fin.202, fin.202.COV",
      "maxLength": 30,
      "type": "string"
    },
    "sender": {
      "description": "It corresponds to the BIC12 of the sender. The format of the BIC12 is: <BIC8><Logical terminal><Branch code>.\nFor received messages, the Logical terminal value will always be X.",
      "maxLength": 12,
      "minLength": 12,
      "type": "string"
    },
    "receiver": {
      "description": "It corresponds to the BIC12 of the receiver. The format of the BIC12 is: <BIC8><Logical terminal><Branch code>.\nFor sent messages, the Logical terminal value will always be X.",
      "maxLength": 12,
      "minLength": 12,
      "type": "string"
    },
    "interface_info": {
      "$ref": "#/$defs/FinMessageInterfaceInfoEmission"
    },
    "network_info": {
      "$ref": "#/$defs/FinMessageNetworkInfoEmission"
    },
    "payload": {
      "description": "The business message contents. As this is a FIN message, this contains the MT block 4 (text) data.",
      "type": "string",
      "format": "byte",
      "maxLength": 14000
    }
  },
  "$defs": {
    "FinMessageInterfaceInfoEmission": {
      "title": "FinMessageInterfaceInfoEmission",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "product_info": {
          "$ref": "#/$defs/ProductInfoEmission"
        }
      },
      "description": "The interface information elements for a sent FIN message."
    },
    "FinMessageNetworkInfoEmission": {
      "title": "FinMessageNetworkInfoEmission",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "network_priority": {
          "description": "The Network priority",
          "type": [
            "string",
            "null"
          ],
          "default": "Normal",
          "enum": [
            "Normal",
            "Urgent",
            "System"
          ]
        },
        "possible_duplicate": {
          "description": "For messages originated from the BO: if set to true, the BO indicates that the message is a PDE (Possible Duplicate Emission)",
          "type": "boolean"
        },
        "delivery_monitoring": {
          "description": "Indicates whether a non-delivery warning and/or a positive delivery notification is requested.",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "None",
            "NonDelivery",
            "NonDeliveryAndDelivery",
            "Delivery"
          ]
        },
        "banking_priority": {
          "description": "FIN User Header field 113: Banking Priority set by the creator of the message.",
          "maxLength": 4,
          "type": "string"
        },
        "fincopy_service": {
          "description": "Service code of the fin copy service.",
          "maxLength": 3,
          "type": "string"
        },
        "fincopy_central_institution_destination": {
          "description": "BIC8 of the central institution used for FIN Copy.",
          "maxLength": 8,
          "type": "string"
        },
        "validation_identifier": {
          "description": "FIN User Header field 119: Contains the Validation Identifier and indicates whether FIN central system must perform a special validation.",
          "maxLength": 8,
          "type": "string"
        },
        "uetr": {
          "description": "A unique end-to-end transaction reference. This reference must contain a Universally Unique IDentifier (UUID) compliant with version 4 of standard RFC4122.\nIt is transported in field 121 of gpi messages.",
          "type": "string",
          "format": "uuid"
        },
        "message_user_reference": {
          "description": "The Message User Reference set by the BO for messages received by the BO or by the user for messages manually created or by the sender for received messages.\nFor FIN, this corresponds to the MUR (field 108 of block 3).",
          "maxLength": 16,
          "type": "string"
        },
        "service_type_identifier": {
          "description": "A numeric code contained in field 111 of a FIN gpi message that identifies the gpi service against which the gpi customer will be measured.\nFor example, the service type identifier for the gpi customer credit transfer service is 001.",
          "maxLength": 3,
          "type": "string"
        }
      },
      "description": "The network information elements for a FIN message sent to Alliance Cloud."
    },
    "ProductEmission": {
      "title": "ProductEmission",
      "required": [
        "product_name",
        "vendor_name",
        "version"
      ],
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "vendor_name": {
          "description": "Name of the vendor of the product application.",
          "maxLength": 8,
          "type": "string"
        },
        "product_name": {
          "description": "Name of the product application.",
          "maxLength": 8,
          "type": "string"
        },
        "version": {
          "description": "Version of the product application.",
          "maxLength": 8,
          "type": "string"
        }
      },
      "description": "Single information about a product that processed the sent message."
    },
    "ProductInfoEmission": {
      "title": "ProductInfoEmission",
      "maxItems": 3,
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProductEmission"
      },
      "description": "Information about products (back-office, interface...) that processed the sent message."
    }
  }
}