{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/openpayments-io/main/json-schema/openpayments-io-payment-initiation-sepa-direct-debit-json-schema.json",
  "title": "SEPA Direct Debit Payment",
  "description": "JSON body for initiating a SEPA Direct Debit.\n",
  "x-generated": "2026-10-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openpayments-io-openapi.yml#/components/schemas/paymentInitiationSepaDirectDebit_json",
  "type": "object",
  "required": [
    "instructedAmount",
    "creditorAccount",
    "creditorName",
    "creditorAddress",
    "creditorId",
    "debtorAccount",
    "debtorName",
    "debtorAddress",
    "debtorAgent",
    "localInstrumentCode",
    "sequenceType",
    "mandateRelatedInformation",
    "requestedExecutionDate"
  ],
  "properties": {
    "instructionId": {
      "type": "string",
      "maxLength": 35,
      "description": "Instruction Id – identification for end-to-end processing."
    },
    "requestedExecutionDate": {
      "type": "string",
      "format": "date",
      "description": "Date when payment is scheduled to be collected in ISO-Date Format, e.g. 2020-10-30.\n"
    },
    "creditorName": {
      "$ref": "#/$defs/creditorName"
    },
    "creditorAddress": {
      "$ref": "#/$defs/address"
    },
    "creditorAccount": {
      "$ref": "#/$defs/accountReference"
    },
    "creditorAgent": {
      "$ref": "#/$defs/bicfi"
    },
    "creditorAgentName": {
      "$ref": "#/$defs/creditorAgentName"
    },
    "creditorId": {
      "type": "string",
      "description": "A unique identifier assigned to the creditor authorising them to initiate SEPA Direct Debit collections.\n",
      "pattern": "^[A-Z]{2}\\d{2}[A-Z0-9]{3,28}$"
    },
    "localInstrumentCode": {
      "type": "string",
      "description": "Local instrument code. See Statuses & Types documentation for full descriptions of values.",
      "enum": [
        "CORE",
        "B2B"
      ]
    },
    "sequenceType": {
      "$ref": "#/$defs/directDebitSequenceType"
    },
    "instructedAmount": {
      "$ref": "#/$defs/amount"
    },
    "chargeBearer": {
      "$ref": "#/$defs/chargeBearer"
    },
    "mandateRelatedInformation": {
      "$ref": "#/$defs/directDebitMandateRelatedInformation"
    },
    "ultimateCreditorName": {
      "$ref": "#/$defs/ultimateCreditorName"
    },
    "ultimateCreditorAddress": {
      "$ref": "#/$defs/address"
    },
    "debtorAgent": {
      "$ref": "#/$defs/bicfi"
    },
    "debtorName": {
      "$ref": "#/$defs/debtorName"
    },
    "debtorAddress": {
      "$ref": "#/$defs/address"
    },
    "debtorAgentName": {
      "$ref": "#/$defs/debtorAgentName"
    },
    "debtorAccount": {
      "$ref": "#/$defs/accountReference"
    },
    "ultimateDebtorName": {
      "$ref": "#/$defs/ultimateDebtorName"
    },
    "ultimateDebtorAddress": {
      "$ref": "#/$defs/address"
    },
    "purposeCode": {
      "$ref": "#/$defs/purposeCode"
    },
    "remittanceInformationUnstructuredArray": {
      "$ref": "#/$defs/remittanceInformationUnstructuredArray"
    },
    "remittanceInformationStructuredArray": {
      "$ref": "#/$defs/directDebitStructuredRemittanceInformationArray"
    },
    "regulatoryReporting": {
      "$ref": "#/$defs/directDebitRegulatoryReportingArray"
    }
  },
  "$defs": {
    "accountNumber": {
      "description": "Bank account number. Used to identify the particular customer account within the financial institution. \n",
      "type": "string",
      "pattern": "[a-zA-Z0-9]{1,30}"
    },
    "accountReference": {
      "description": "Reference to an account by either\n  * IBAN, of a payment account, or\n  * BBAN, for payment accounts if there is no IBAN, or \n  * the Primary Account Number (PAN) of a card, can be tokenised by the ASPSP due to PCI DSS requirements, or\n  * the Primary Account Number (PAN) of a card in a masked form, or\n  * an alias to access a payment account via a registered mobile phone number (MSISDN).\n",
      "type": "object",
      "properties": {
        "iban": {
          "$ref": "#/$defs/iban"
        },
        "bban": {
          "$ref": "#/$defs/bban"
        },
        "clearingNumber": {
          "$ref": "#/$defs/clearingNumber"
        },
        "accountNumber": {
          "$ref": "#/$defs/accountNumber"
        },
        "pan": {
          "$ref": "#/$defs/pan"
        },
        "maskedPan": {
          "$ref": "#/$defs/maskedPan"
        },
        "msisdn": {
          "$ref": "#/$defs/msisdn"
        },
        "currency": {
          "$ref": "#/$defs/currencyCode"
        }
      }
    },
    "address": {
      "type": "object",
      "required": [
        "country"
      ],
      "properties": {
        "street": {
          "type": "string",
          "maxLength": 70
        },
        "buildingNumber": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "country": {
          "$ref": "#/$defs/countryCode"
        }
      }
    },
    "amount": {
      "type": "object",
      "required": [
        "currency",
        "amount"
      ],
      "properties": {
        "currency": {
          "$ref": "#/$defs/currencyCode"
        },
        "amount": {
          "$ref": "#/$defs/amountValue"
        }
      }
    },
    "amountValue": {
      "description": "The amount given with fractional digits, where fractions must be compliant to the currency definition.\nUp to 14 significant figures. Negative amounts are signed by minus.\nThe decimal separator is a dot.\n\n**Example:**\nValid representations for EUR with up to two decimals are:\n\n  * 1056\n  * 5768.2\n  * -1.50\n  * 5877.78\n",
      "type": "string",
      "pattern": "-?[0-9]{1,14}(\\.[0-9]{1,3})?"
    },
    "bban": {
      "description": "Basic Bank Account Number (BBAN) Identifier. Used nationally by financial institutions, i.e., in individual countries, \n  generally as part of a National Account Numbering Scheme(s), \n  which uniquely identifies the account of a customer.\n",
      "type": "string",
      "pattern": "[a-zA-Z0-9]{1,30}"
    },
    "bicfi": {
      "description": "BICFI\n",
      "type": "string",
      "pattern": "[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"
    },
    "chargeBearer": {
      "description": "Charge Bearer. ChargeBearerType1Code from ISO20022",
      "type": "string",
      "enum": [
        "DEBT",
        "CRED",
        "SHAR",
        "SLEV"
      ]
    },
    "clearingNumber": {
      "description": "Bank account clearing number. Used to identify the financial institution within a domestic payment system. \n",
      "type": "string",
      "pattern": "[0-9]{1,5}"
    },
    "countryCode": {
      "description": "ISO 3166 ALPHA2 country code",
      "type": "string",
      "pattern": "[A-Z]{2}"
    },
    "creditorAgentName": {
      "description": "Creditor Agent Name",
      "type": "string",
      "maxLength": 35
    },
    "creditorName": {
      "description": "Creditor Name",
      "type": "string",
      "maxLength": 70,
      "pattern": "^[A-Za-z0-9 ]{1,70}$"
    },
    "currencyCode": {
      "description": "ISO 4217 Alpha 3 currency code.\n",
      "type": "string",
      "pattern": "[A-Z]{3}"
    },
    "debtorAgentName": {
      "description": "Debtor Agent Name",
      "type": "string",
      "maxLength": 35
    },
    "debtorName": {
      "description": "Debtor Name",
      "type": "string",
      "maxLength": 70
    },
    "directDebitMandateRelatedInformation": {
      "description": "Mandate information that authorises the SEPA Direct Debit.\n",
      "type": "object",
      "required": [
        "mandateId",
        "dateOfSignature"
      ],
      "properties": {
        "mandateId": {
          "type": "string",
          "maxLength": 35,
          "description": "Mandate Id."
        },
        "dateOfSignature": {
          "type": "string",
          "format": "date",
          "description": "Date of signature."
        }
      }
    },
    "directDebitReferenceTypeCode": {
      "description": "Reference type for structured remittance.\n",
      "type": "string",
      "enum": [
        "SCOR"
      ]
    },
    "directDebitRegulatoryReportingArray": {
      "description": "Up to 10 regulatory reporting items.",
      "type": "array",
      "maxItems": 10,
      "items": {
        "$ref": "#/$defs/directDebitRegulatoryReportingData"
      }
    },
    "directDebitRegulatoryReportingData": {
      "description": "Additional regulatory reporting information, if applicable.",
      "type": "object",
      "properties": {
        "detailsCode": {
          "type": "string",
          "maxLength": 35
        },
        "detailsInformation": {
          "type": "string",
          "maxLength": 140
        }
      }
    },
    "directDebitSequenceType": {
      "description": "Sequence type for SEPA Direct Debit collections. See Statuses & Types documentation for full descriptions of values.\n",
      "type": "string",
      "enum": [
        "OOFF",
        "FRST",
        "RCUR",
        "FNAL"
      ]
    },
    "directDebitStructuredRemittanceInformation": {
      "description": "Structured remittance information for SEPA Direct Debit",
      "type": "object",
      "required": [
        "reference"
      ],
      "properties": {
        "reference": {
          "type": "string",
          "maxLength": 35
        },
        "referenceType": {
          "$ref": "#/$defs/directDebitReferenceTypeCode"
        },
        "remittanceAmount": {
          "$ref": "#/$defs/amount"
        }
      }
    },
    "directDebitStructuredRemittanceInformationArray": {
      "description": "Array of structured remittance information elements.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/directDebitStructuredRemittanceInformation"
      }
    },
    "iban": {
      "type": "string",
      "description": "International Bank Account Number (IBAN) of an account.",
      "pattern": "[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"
    },
    "maskedPan": {
      "description": "Masked Primary Account Number.\n",
      "type": "string",
      "maxLength": 35
    },
    "msisdn": {
      "type": "string",
      "maxLength": 35,
      "description": "Mobile phone number."
    },
    "pan": {
      "description": "Primary Account Number according to ISO/IEC 7812.\n",
      "type": "string",
      "maxLength": 35
    },
    "purposeCode": {
      "description": "ExternalPurpose1Code from ISO 20022. Values from ISO 20022 External Code List ExternalCodeSets_1Q2018 June 2018.\n",
      "type": "string",
      "enum": [
        "BKDF",
        "BKFE",
        "BKFM",
        "BKIP",
        "BKPP",
        "CBLK",
        "CDCB",
        "CDCD",
        "CDCS",
        "CDDP",
        "CDOC",
        "CDQC",
        "ETUP",
        "FCOL",
        "MTUP",
        "ACCT",
        "CASH",
        "COLL",
        "CSDB",
        "DEPT",
        "INTC",
        "LIMA",
        "NETT",
        "BFWD",
        "CCIR",
        "CCPC",
        "CCPM",
        "CCSM",
        "CRDS",
        "CRPR",
        "CRSP",
        "CRTL",
        "EQPT",
        "EQUS",
        "EXPT",
        "EXTD",
        "FIXI",
        "FWBC",
        "FWCC",
        "FWSB",
        "FWSC",
        "MARG",
        "MBSB",
        "MBSC",
        "MGCC",
        "MGSC",
        "OCCC",
        "OPBC",
        "OPCC",
        "OPSB",
        "OPSC",
        "OPTN",
        "OTCD",
        "REPO",
        "RPBC",
        "RPCC",
        "RPSB",
        "RPSC",
        "RVPO",
        "SBSC",
        "SCIE",
        "SCIR",
        "SCRP",
        "SHBC",
        "SHCC",
        "SHSL",
        "SLEB",
        "SLOA",
        "SWBC",
        "SWCC",
        "SWPT",
        "SWSB",
        "SWSC",
        "TBAS",
        "TBBC",
        "TBCC",
        "TRCP",
        "AGRT",
        "AREN",
        "BEXP",
        "BOCE",
        "COMC",
        "CPYR",
        "GDDS",
        "GDSV",
        "GSCB",
        "LICF",
        "MP2B",
        "POPE",
        "ROYA",
        "SCVE",
        "SERV",
        "SUBS",
        "SUPP",
        "TRAD",
        "CHAR",
        "COMT",
        "MP2P",
        "ECPG",
        "ECPR",
        "ECPU",
        "EPAY",
        "CLPR",
        "COMP",
        "DBTC",
        "GOVI",
        "HLRP",
        "HLST",
        "INPC",
        "INPR",
        "INSC",
        "INSU",
        "INTE",
        "LBRI",
        "LIFI",
        "LOAN",
        "LOAR",
        "PENO",
        "PPTI",
        "RELG",
        "RINP",
        "TRFD",
        "FORW",
        "FXNT",
        "ADMG",
        "ADVA",
        "BCDM",
        "BCFG",
        "BLDM",
        "BNET",
        "CBFF",
        "CBFR",
        "CCRD",
        "CDBL",
        "CFEE",
        "CGDD",
        "CORT",
        "COST",
        "CPKC",
        "DCRD",
        "DSMT",
        "DVPM",
        "EDUC",
        "FACT",
        "FAND",
        "FCPM",
        "FEES",
        "GOVT",
        "ICCP",
        "IDCP",
        "IHRP",
        "INSM",
        "IVPT",
        "MCDM",
        "MCFG",
        "MSVC",
        "NOWS",
        "OCDM",
        "OCFG",
        "OFEE",
        "OTHR",
        "PADD",
        "PTSP",
        "RCKE",
        "RCPT",
        "REBT",
        "REFU",
        "RENT",
        "REOD",
        "RIMB",
        "RPNT",
        "RRBN",
        "RVPM",
        "SLPI",
        "SPLT",
        "STDY",
        "TBAN",
        "TBIL",
        "TCSC",
        "TELI",
        "TMPG",
        "TPRI",
        "TPRP",
        "TRNC",
        "TRVC",
        "WEBI",
        "ANNI",
        "CAFI",
        "CFDI",
        "CMDT",
        "DERI",
        "DIVD",
        "FREX",
        "HEDG",
        "INVS",
        "PRME",
        "SAVG",
        "SECU",
        "SEPI",
        "TREA",
        "UNIT",
        "FNET",
        "FUTR",
        "ANTS",
        "CVCF",
        "DMEQ",
        "DNTS",
        "HLTC",
        "HLTI",
        "HSPC",
        "ICRF",
        "LTCF",
        "MAFC",
        "MARF",
        "MDCS",
        "VIEW",
        "CDEP",
        "SWFP",
        "SWPP",
        "SWRS",
        "SWUF",
        "ADCS",
        "AEMP",
        "ALLW",
        "ALMY",
        "BBSC",
        "BECH",
        "BENE",
        "BONU",
        "CCHD",
        "COMM",
        "CSLP",
        "GFRP",
        "GVEA",
        "GVEB",
        "GVEC",
        "GVED",
        "GWLT",
        "HREC",
        "PAYR",
        "PEFC",
        "PENS",
        "PRCP",
        "RHBS",
        "SALA",
        "SSBE",
        "LBIN",
        "LCOL",
        "LFEE",
        "LMEQ",
        "LMFI",
        "LMRK",
        "LREB",
        "LREV",
        "LSFL",
        "ESTX",
        "FWLV",
        "GSTX",
        "HSTX",
        "INTX",
        "NITX",
        "PTXP",
        "RDTX",
        "TAXS",
        "VATX",
        "WHLD",
        "TAXR",
        "B112",
        "BR12",
        "TLRF",
        "TLRR",
        "AIRB",
        "BUSB",
        "FERB",
        "RLWY",
        "TRPT",
        "CBTV",
        "ELEC",
        "ENRG",
        "GASB",
        "NWCH",
        "NWCM",
        "OTLC",
        "PHON",
        "UBIL",
        "WTER"
      ]
    },
    "remittanceInformationUnstructured": {
      "description": "Unstructured remittance information\n",
      "type": "string",
      "maxLength": 140
    },
    "remittanceInformationUnstructuredArray": {
      "description": "Array of unstructured remittance information\n",
      "type": "array",
      "items": {
        "$ref": "#/$defs/remittanceInformationUnstructured"
      }
    },
    "ultimateCreditorName": {
      "description": "Ultimate Creditor Name",
      "type": "string",
      "maxLength": 70,
      "pattern": "^[A-Za-z0-9 ]{1,70}$"
    },
    "ultimateDebtorName": {
      "description": "Ultimate Debtor Name",
      "type": "string",
      "maxLength": 70,
      "pattern": "^[A-Za-z0-9 ]{1,70}$"
    }
  }
}