{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adorsys/json-schema/adorsys-psu-auth-request-schema.json",
  "title": "PsuAuthRequest",
  "description": "Contains information used to legitimate a request.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adorsys-consent-openapi.yml#/components/schemas/PsuAuthRequest",
  "required": [
    "scaAuthenticationData"
  ],
  "type": "object",
  "properties": {
    "consentAuth": {
      "$ref": "#/$defs/ConsentAuth"
    },
    "scaAuthenticationData": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "SCA authentication data, depending on the chosen authentication method. If the data is binary, then it is base64 encoded."
    },
    "extras": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "ASPSP customary authorization parameters required to i.e. initiate consent."
    }
  },
  "$defs": {
    "AccountBalance": {
      "title": "AccountBalance",
      "type": "object",
      "properties": {
        "amount": {
          "$ref": "#/$defs/Amount"
        },
        "balanceType": {
          "$ref": "#/$defs/BalanceType"
        },
        "iban": {
          "type": "string"
        },
        "lastChangeDateTime": {
          "type": "string",
          "format": "date-time"
        },
        "lastCommittedTransaction": {
          "type": "string"
        },
        "referenceDate": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "AccountDetails": {
      "title": "AccountDetails",
      "type": "object",
      "properties": {
        "accountStatus": {
          "$ref": "#/$defs/AccountStatus"
        },
        "accountType": {
          "$ref": "#/$defs/AccountType"
        },
        "balances": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AccountBalance"
          }
        },
        "bban": {
          "type": "string"
        },
        "bic": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "details": {
          "type": "string"
        },
        "iban": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "linkedAccounts": {
          "type": "string"
        },
        "maskedPan": {
          "type": "string"
        },
        "msisdn": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "pan": {
          "type": "string"
        },
        "product": {
          "type": "string"
        },
        "usageType": {
          "type": "string",
          "enum": [
            "PRIV",
            "ORGA"
          ]
        }
      }
    },
    "AccountReference": {
      "title": "AccountReference",
      "type": "object",
      "properties": {
        "bban": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "iban": {
          "type": "string"
        },
        "maskedPan": {
          "type": "string"
        },
        "msisdn": {
          "type": "string"
        },
        "pan": {
          "type": "string"
        }
      }
    },
    "AccountStatus": {
      "type": "string",
      "enum": [
        "ENABLED",
        "DELETED",
        "BLOCKED"
      ]
    },
    "AccountType": {
      "type": "string",
      "enum": [
        "CACC",
        "CASH",
        "CHAR",
        "CISH",
        "COMM",
        "CPAC",
        "LLSV",
        "LOAN",
        "MGLD",
        "MOMA",
        "NREX",
        "ODFT",
        "ONDP",
        "OTHR",
        "SACC",
        "SLRY",
        "SVGS",
        "TAXE",
        "TRAN",
        "TRAS"
      ]
    },
    "Address": {
      "title": "Address",
      "type": "object",
      "properties": {
        "buildingNumber": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "street": {
          "type": "string"
        }
      }
    },
    "AisAccountAccessInfo": {
      "title": "AisAccountAccessInfo",
      "type": "object",
      "properties": {
        "accounts": {
          "type": "array",
          "description": "Access to accounts",
          "items": {
            "$ref": "#/$defs/AccountReference"
          }
        },
        "allPsd2": {
          "type": "string",
          "description": "Consent on all accounts, balances and transactions of psu",
          "enum": [
            "ALL_ACCOUNTS",
            "ALL_ACCOUNTS_WITH_BALANCES"
          ]
        },
        "availableAccounts": {
          "type": "string",
          "description": "Consent on all available accounts of psu",
          "enum": [
            "ALL_ACCOUNTS",
            "ALL_ACCOUNTS_WITH_BALANCES"
          ]
        },
        "balances": {
          "type": "array",
          "description": "Access to balances",
          "items": {
            "$ref": "#/$defs/AccountReference"
          }
        },
        "transactions": {
          "type": "array",
          "description": "Access to transactions",
          "items": {
            "$ref": "#/$defs/AccountReference"
          }
        }
      },
      "description": "Ais account access information"
    },
    "AisConsentRequest": {
      "title": "AisConsentRequest",
      "required": [
        "access",
        "frequencyPerDay",
        "recurringIndicator",
        "validUntil"
      ],
      "type": "object",
      "properties": {
        "access": {
          "$ref": "#/$defs/AisAccountAccessInfo"
        },
        "frequencyPerDay": {
          "type": "integer",
          "description": "Maximum frequency for an access per day. For a once-off access, this attribute is set to 1",
          "format": "int32"
        },
        "recurringIndicator": {
          "type": "boolean",
          "description": "'true', if the consent is for recurring access to the account data , 'false', if the consent is for one access to the account data"
        },
        "validUntil": {
          "type": "string",
          "description": "Consent`s expiration date. The content is the local ASPSP date in ISODate Format",
          "format": "date"
        },
        "combinedServiceIndicator": {
          "type": "boolean",
          "description": "'true', if the consent is i.e. account list and then payment 'false', if the consent is for one access to the account data",
          "default": false
        }
      },
      "description": "Ais consent request"
    },
    "Amount": {
      "title": "Amount",
      "type": "object",
      "properties": {
        "amount": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        }
      }
    },
    "AuthViolation": {
      "title": "AuthViolation",
      "type": "object",
      "description": "Missing parameters required for authorization",
      "properties": {
        "type": {
          "type": "string"
        },
        "scope": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "captionMessage": {
          "type": "string"
        }
      }
    },
    "BalanceType": {
      "type": "string",
      "enum": [
        "CLOSING_BOOKED",
        "EXPECTED",
        "AUTHORISED",
        "OPENING_BOOKED",
        "INTERIM_AVAILABLE",
        "FORWARD_AVAILABLE",
        "NONINVOICED"
      ]
    },
    "BulkPayment": {
      "title": "BulkPayment",
      "type": "object",
      "properties": {
        "batchBookingPreferred": {
          "type": "boolean"
        },
        "debtorAccount": {
          "$ref": "#/$defs/AccountReference"
        },
        "paymentId": {
          "type": "string"
        },
        "paymentProduct": {
          "$ref": "#/$defs/PaymentProduct"
        },
        "paymentStatus": {
          "$ref": "#/$defs/PaymentStatus"
        },
        "payments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SinglePayment"
          }
        },
        "requestedExecutionDate": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "ChallengeData": {
      "title": "ChallengeData",
      "type": "object",
      "description": "Challege data for SCA like OpticTAN image",
      "properties": {
        "image": {
          "type": "string",
          "format": "byte"
        },
        "data": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "imageLink": {
          "type": "string"
        },
        "otpMaxLength": {
          "type": "integer",
          "format": "int32"
        },
        "otpFormat": {
          "type": "string",
          "enum": [
            "CHARACTERS",
            "INTEGER"
          ]
        },
        "additionalInformation": {
          "type": "string"
        }
      }
    },
    "ConsentAuth": {
      "title": "ConsentAuth",
      "type": "object",
      "description": "Transport object for consent API request response",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "LIST_ACCOUNTS",
            "LIST_TRANSACTIONS",
            "INITIATE_PAYMENT"
          ]
        },
        "violations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AuthViolation"
          }
        },
        "accounts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AccountDetails"
          }
        },
        "supportedConsentTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "DEDICATED_ALL",
              "GLOBAL_ALL",
              "GLOBAL_ACCOUNTS"
            ]
          }
        },
        "authMessageTemplate": {
          "type": "string"
        },
        "authenticationMethodId": {
          "type": "string",
          "description": "An identification provided by the ASPSP for the later identification of the authentication method selection."
        },
        "bulkPayment": {
          "$ref": "#/$defs/BulkPayment"
        },
        "consent": {
          "$ref": "#/$defs/AisConsentRequest"
        },
        "bankName": {
          "type": "string",
          "description": "Name of current bank"
        },
        "fintechName": {
          "type": "string",
          "description": "Name of current fintech"
        },
        "consentAuthState": {
          "type": "string",
          "description": "This is the CSRF-State String of the ConsentAuthorisationApi. It is a transient reference of the consent request. It encodes a key that is used to encrypt information stored in the corresponding ConsentAuthSessionCookie."
        },
        "periodicPayment": {
          "$ref": "#/$defs/PeriodicPayment"
        },
        "psuCorporateId": {
          "type": "string"
        },
        "psuId": {
          "type": "string"
        },
        "scaMethods": {
          "type": "array",
          "description": "List of sca methods for selection if necessary.",
          "items": {
            "$ref": "#/$defs/ScaUserData"
          }
        },
        "scaMethodSelected": {
          "$ref": "#/$defs/ScaUserData"
        },
        "scaStatus": {
          "$ref": "#/$defs/ScaStatus"
        },
        "singlePayment": {
          "$ref": "#/$defs/SinglePayment"
        },
        "challengeData": {
          "$ref": "#/$defs/ChallengeData"
        }
      }
    },
    "PaymentProduct": {
      "type": "string",
      "enum": [
        "SEPA",
        "INSTANT_SEPA",
        "TARGET2",
        "CROSS_BORDER"
      ]
    },
    "PaymentStatus": {
      "type": "string",
      "enum": [
        "ACCC",
        "ACCP",
        "ACSC",
        "ACSP",
        "ACTC",
        "ACWC",
        "ACWP",
        "RCVD",
        "PDNG",
        "RJCT",
        "CANC",
        "ACFC",
        "PATC"
      ]
    },
    "PeriodicPayment": {
      "title": "PeriodicPayment",
      "type": "object",
      "properties": {
        "paymentData": {
          "$ref": "#/$defs/SinglePayment"
        },
        "dayOfExecution": {
          "type": "integer",
          "format": "int32"
        },
        "endDate": {
          "type": "string",
          "format": "date"
        },
        "executionRule": {
          "type": "string"
        },
        "frequency": {
          "type": "string",
          "enum": [
            "Daily",
            "Weekly",
            "EveryTwoWeeks",
            "Monthly",
            "EveryTwoMonths",
            "Quarterly",
            "SemiAnnual",
            "Annual"
          ]
        },
        "startDate": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "ScaStatus": {
      "type": "string",
      "description": "The sca status. Used to manage the consent authorization flows.",
      "enum": [
        "received",
        "psuIdentified",
        "psuAuthenticated",
        "scaMethodSelected",
        "started",
        "finalised",
        "failed",
        "exempted"
      ]
    },
    "ScaUserData": {
      "title": "ScaUserData",
      "type": "object",
      "properties": {
        "decoupled": {
          "type": "boolean"
        },
        "id": {
          "type": "string"
        },
        "methodValue": {
          "type": "string"
        },
        "explanation": {
          "type": "string"
        },
        "scaMethod": {
          "type": "string",
          "enum": [
            "EMAIL",
            "MOBILE",
            "CHIP_OTP",
            "PHOTO_OTP",
            "PUSH_OTP",
            "SMS_OTP",
            "APP_OTP"
          ]
        },
        "staticTan": {
          "type": "string"
        },
        "usesStaticTan": {
          "type": "boolean"
        }
      }
    },
    "SinglePayment": {
      "title": "SinglePayment",
      "type": "object",
      "properties": {
        "creditorAccount": {
          "$ref": "#/$defs/AccountReference"
        },
        "creditorAddress": {
          "$ref": "#/$defs/Address"
        },
        "creditorAgent": {
          "type": "string"
        },
        "creditorName": {
          "type": "string"
        },
        "debtorAccount": {
          "$ref": "#/$defs/AccountReference"
        },
        "endToEndIdentification": {
          "type": "string"
        },
        "instructedAmount": {
          "$ref": "#/$defs/Amount"
        },
        "paymentId": {
          "type": "string"
        },
        "paymentProduct": {
          "$ref": "#/$defs/PaymentProduct"
        },
        "paymentStatus": {
          "$ref": "#/$defs/PaymentStatus"
        },
        "remittanceInformationUnstructured": {
          "type": "string"
        },
        "requestedExecutionDate": {
          "type": "string",
          "format": "date"
        },
        "requestedExecutionTime": {
          "type": "string"
        }
      }
    }
  }
}