{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/atlar/json-schema/atlar-connection-schema.json",
  "title": "Connection",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/atlar-connections-api-openapi.yml#/components/schemas/Connection",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/ResourceID",
      "readOnly": true
    },
    "organizationId": {
      "$ref": "#/$defs/OrganizationID",
      "readOnly": true
    },
    "connectionTypeId": {
      "description": "ID of the associated connection type.",
      "type": "string",
      "readOnly": true
    },
    "thirdPartyId": {
      "description": "ID of the associated third-party.",
      "type": "string",
      "readOnly": true
    },
    "affiliationId": {
      "description": "ID of the affiliation. An affiliation is and describes the relationship between the legal entity owning this connection.",
      "type": "string",
      "readOnly": true
    },
    "alias": {
      "description": "Optional alias of the connection",
      "type": "string"
    },
    "configuration": {
      "$ref": "#/$defs/ConnectionConfiguration"
    },
    "deprecatedConfiguration": {
      "type": "object",
      "$ref": "#/$defs/DeprecatedConnectionConfiguration"
    },
    "capabilities": {
      "$ref": "#/$defs/Capabilities"
    },
    "lifecycleState": {
      "description": "The lifecycle state of the connection.",
      "type": "string",
      "enum": [
        "UNDER_DEVELOPMENT",
        "LIVE",
        "CANCELLED"
      ]
    },
    "inactive": {
      "description": "True if connection has been inactivated",
      "type": "boolean"
    },
    "version": {
      "$ref": "#/$defs/ResourceVersion"
    },
    "etag": {
      "$ref": "#/$defs/ETag"
    },
    "created": {
      "$ref": "#/$defs/CreatedTimestamp"
    },
    "updated": {
      "$ref": "#/$defs/UpdatedTimestamp"
    }
  },
  "required": [
    "id",
    "organizationId",
    "connectionTypeId",
    "thirdPartyId",
    "affiliationId",
    "configuration",
    "deprecatedConfiguration",
    "capabilities",
    "inactive",
    "lifecycleState",
    "created",
    "updated",
    "version",
    "etag"
  ],
  "$defs": {
    "Capabilities": {
      "type": "object"
    },
    "ConnectionConfiguration": {
      "type": "object",
      "properties": {
        "thirdParty": {
          "$ref": "#/$defs/ThirdPartyConfiguration"
        },
        "reports": {
          "$ref": "#/$defs/ReportsConfiguration"
        },
        "transport": {
          "$ref": "#/$defs/TransportConfiguration"
        }
      },
      "required": [
        "thirdParty",
        "reports",
        "transport"
      ]
    },
    "ConnectionPool": {
      "type": "object",
      "properties": {
        "forwards": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Forward"
          },
          "description": "List of forwarding rules",
          "x-omitempty": true
        }
      }
    },
    "CreatedTimestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Time at which the resource was created.",
      "readOnly": true
    },
    "Date": {
      "type": "string",
      "format": "date",
      "description": "`full-date` notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2017-07-21`."
    },
    "DeprecatedConnectionConfiguration": {
      "type": "object",
      "properties": {
        "disabledTransport": {
          "type": "boolean",
          "description": "general configuration for transport"
        },
        "maxBatchSize": {
          "type": "integer",
          "description": "push scheduling config - maximum batch size"
        },
        "pushSchedule": {
          "$ref": "#/$defs/SchedulingSchedule",
          "description": "push scheduling configuration"
        },
        "pushPriority": {
          "type": "integer",
          "description": "push scheduling priority"
        },
        "bypassTimeToSchedulePaymentCheck": {
          "type": "boolean",
          "description": "if true, bypasses all timeToSchedulePayment checks and schedules payments immediately"
        },
        "fetchFrequency": {
          "type": "string",
          "enum": [
            "DEFAULT",
            "EVERY_15M",
            "HOURLY",
            "DISABLED"
          ],
          "description": "DEPRECATED - fetch scheduling frequency"
        },
        "fetchSchedules": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/SchedulingSchedule"
          },
          "description": "fetch scheduling configuration mapped by fetch type"
        },
        "fetchDataTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "PAYMENT_STATUS_REPORTS",
              "TRANSACTIONS",
              "ACCOUNTS",
              "PAYMENTS"
            ]
          },
          "description": "fetch data types configuration"
        },
        "ebicsFetchConfig": {
          "type": "object",
          "properties": {
            "eodyFetchTypesOverride": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "interimFetchTypesOverride": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "description": "EBICS fetcher configuration"
        },
        "connectionPool": {
          "$ref": "#/$defs/ConnectionPool"
        },
        "thirdParty": {
          "type": "object",
          "properties": {
            "env": {
              "type": "string"
            }
          },
          "description": "third party configuration"
        },
        "ignoredData": {
          "type": "array",
          "description": "ignored data configuration"
        },
        "transport": {
          "type": "object",
          "properties": {
            "requiredSignatures": {
              "type": "integer"
            },
            "signatureScope": {
              "type": "string",
              "enum": [
                "ALL",
                "CUSTOMER_UPLOADED_ONLY"
              ]
            }
          }
        }
      },
      "required": [
        "disabledTransport",
        "maxBatchSize",
        "pushSchedule",
        "pushPriority",
        "fetchSchedules",
        "fetchDataTypes",
        "ebicsFetchConfig",
        "connectionPool",
        "thirdParty",
        "ignoredData"
      ]
    },
    "ETag": {
      "type": "string",
      "description": "[ETag](https://en.wikipedia.org/wiki/HTTP_ETag) based on the\nresource version. This can be passed along in `If-Match` HTTP\nheader when updating a resource to perform a conditional\nupdate.",
      "pattern": "^version:\\d{1,4}$",
      "readOnly": true
    },
    "Exclusion": {
      "type": "object",
      "description": "A recurring or one-off time period to exclude from the schedule. dayOfWeek and date are mutually exclusive: set at most one of them. from and to are always required. Times and dates are evaluated in the schedule's location (UTC when unset).",
      "properties": {
        "dayOfWeek": {
          "type": "integer",
          "minimum": 0,
          "maximum": 7,
          "description": "Day of week (1 = Monday, 7 = Sunday). 0 or omitted means the exclusion is not restricted to a weekday. Mutually exclusive with date."
        },
        "date": {
          "$ref": "#/$defs/Date"
        },
        "from": {
          "type": "string",
          "format": "time",
          "description": "Start time of exclusion (HH:MM:SS)"
        },
        "to": {
          "type": "string",
          "format": "time",
          "description": "End time of exclusion (HH:MM:SS)"
        }
      },
      "required": [
        "from",
        "to"
      ]
    },
    "Forward": {
      "type": "object",
      "properties": {
        "matches": {
          "$ref": "#/$defs/Matches"
        },
        "affiliationId": {
          "type": "string",
          "description": "The ID of the affiliation to forward to"
        },
        "canInitiatePayments": {
          "type": "boolean",
          "description": "Whether this forward can be used to initiate payments"
        }
      },
      "required": [
        "matches"
      ]
    },
    "Matches": {
      "type": "object",
      "properties": {
        "bic": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of BIC identifiers",
          "x-omitempty": true
        },
        "vendor": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ThirdPartyVendor"
          },
          "description": "List of third-party vendors",
          "x-omitempty": true
        }
      }
    },
    "OrganizationID": {
      "type": "string",
      "description": "Unique resource identifier for an Organization."
    },
    "ReportsConfiguration": {
      "type": "object",
      "properties": {
        "transport": {
          "$ref": "#/$defs/ReportsTransportConfiguration"
        }
      },
      "required": [
        "transport"
      ]
    },
    "ReportsTransportConfiguration": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "ATLAR_INITIATED",
            "THIRDPARTY_INITIATED",
            "DISABLED"
          ]
        }
      },
      "required": [
        "mode"
      ]
    },
    "ResourceID": {
      "type": "string",
      "description": "Unique resource identifier.",
      "minLength": 32,
      "maxLength": 64
    },
    "ResourceVersion": {
      "type": "integer",
      "description": "Resource version. Starts at value `1` when the resource is\ncreated and increases by one for each successive update.",
      "minimum": 1,
      "readOnly": true
    },
    "SchedulingSchedule": {
      "type": "object",
      "properties": {
        "frequency": {
          "type": "string",
          "enum": [
            "DEFAULT",
            "EVERY_15M",
            "HOURLY",
            "DISABLED"
          ],
          "description": "The frequency of the schedule"
        },
        "schedule": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Schedule integers (0-23 for HOURLY, 0-3 for EVERY_15M)",
          "x-omitempty": true
        },
        "location": {
          "type": "string",
          "description": "The timezone location (e.g. \"Europe/London\")"
        },
        "exclusions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Exclusion"
          },
          "description": "Time periods to exclude from the schedule",
          "x-omitempty": true
        }
      },
      "required": [
        "frequency"
      ]
    },
    "ThirdPartyConfiguration": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "description": "The environment of the third-party. This is intentionally not an enum,\nas it is up to the third-party to define their environments. However,\nwe do have a common one: \"production\".\n"
        }
      },
      "required": [
        "environment"
      ]
    },
    "ThirdPartyVendor": {
      "type": "string",
      "enum": [
        "astropay",
        "checkout",
        "directa24",
        "inpay",
        "paypal",
        "skrill",
        "nuvei",
        "truelayer",
        "trustly"
      ]
    },
    "TransportConfiguration": {
      "type": "object",
      "properties": {
        "requiredSignatures": {
          "type": "integer"
        },
        "disabled": {
          "type": "boolean"
        },
        "signatureScope": {
          "type": "string",
          "enum": [
            "ALL",
            "CUSTOMER_UPLOADED_ONLY"
          ],
          "default": "ALL",
          "description": "Controls which instructions require signatures.\nALL: RequiredSignatures applies to all instructions (default).\nCUSTOMER_UPLOADED_ONLY: RequiredSignatures only applies to customer-uploaded instructions; system-generated instructions auto-release.\n"
        }
      },
      "required": [
        "requiredSignatures",
        "disabled"
      ]
    },
    "UpdatedTimestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Time at which the resource was last updated.",
      "readOnly": true
    }
  }
}