{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/barclays/main/json-schema/barclays-obwrite-file2-schema.json", "title": "OBWriteFile2", "x-generated": "2026-10-12", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/barclays-file-payments-api-openapi.yml#/components/schemas/OBWriteFile2", "type": "object", "additionalProperties": false, "deprecated": false, "properties": { "Data": { "type": "object", "additionalProperties": false, "properties": { "ConsentId": { "type": "string", "description": "OB: Unique identification as assigned by the ASPSP to uniquely identify the consent resource.", "maxLength": 25, "minLength": 1, "pattern": "^BARCLAYS-P-\\d{14}$" }, "Initiation": { "type": "object", "additionalProperties": false, "description": "The Initiation payload is sent by the initiating party to the ASPSP. It is used to request movement of funds using a payment file.", "properties": { "FileType": { "type": "string", "description": "Specifies the payment file type.", "enum": [ "UK.OBIE.PaymentInitiation.4.0" ] }, "FileHash": { "type": "string", "description": "A base64 encoding of a SHA256 hash of the file to be uploaded.", "maxLength": 44, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9+/=]{1,44})$" }, "FileReference": { "type": "string", "description": "Reference for the file.", "maxLength": 40, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9- '.,@#_\\/()]){1,40}$" }, "NumberOfTransactions": { "type": "string", "description": "Number of individual transactions contained in the payment information group.", "maxLength": 15, "minLength": 1, "pattern": "^[0-9]{1,15}$" }, "ControlSum": { "type": "number", "description": "Total of all individual amounts included in the group, irrespective of currencies.", "maximum": 999999999, "minimum": 1 }, "RequestedExecutionDateTime": { "type": "string", "format": "date-time", "description": "Date at which the initiating party requests the clearing agent to process the payment. \nUsage: This is the date on which the debtor's account is to be debited. All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00" }, "LocalInstrument": { "$ref": "#/$defs/OBInternalLocalInstrument1Code" }, "CreditorAgent": { "type": "object", "additionalProperties": false, "description": "Financial institution servicing an account for the creditor.", "properties": { "SchemeName": { "$ref": "#/$defs/OBInternalFinancialInstitutionIdentification4Code" }, "Identification": { "$ref": "#/$defs/Identification_1" }, "Name": { "$ref": "#/$defs/Name" }, "LEI": { "$ref": "#/$defs/LEI" }, "PostalAddress": { "$ref": "#/$defs/OBPostalAddress7" } } }, "DebtorAccount": { "type": "object", "additionalProperties": false, "description": "Unambiguous identification of the account of the debtor to which a debit entry will be made as a result of the transaction.", "properties": { "SchemeName": { "$ref": "#/$defs/OBInternalAccountIdentification4Code" }, "Identification": { "$ref": "#/$defs/Identification_0" }, "Name": { "type": "string", "description": "The account name is the name or names of the account owner(s) represented at an account level, as displayed by the ASPSP's online channels.\nNote, the account name is not the product name or the nickname of the account.", "maxLength": 70, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9-. '()£=\"_,&@#\\/;+]{1,70})$" }, "SecondaryIdentification": { "$ref": "#/$defs/SecondaryIdentification" }, "Proxy": { "$ref": "#/$defs/OBProxy1" } }, "required": [ "Identification", "SchemeName" ] }, "UltimateDebtor": { "$ref": "#/$defs/OBUltimateDebtor1" }, "RemittanceInformation": { "$ref": "#/$defs/OBRemittanceInformation2" }, "SupplementaryData": { "$ref": "#/$defs/OBSupplementaryData1" } }, "required": [ "FileHash", "FileType" ] } }, "required": [ "ConsentId", "Initiation" ] } }, "required": [ "Data" ], "nullable": false, "$defs": { "BuildingName": { "type": "string", "description": "Name of a referenced building.", "maxLength": 140, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_\\-]{1,140})$" }, "BuildingNumber": { "type": "string", "description": "Number that identifies the position of a building on a street.", "maxLength": 16, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9 \\s]{1,16})$" }, "CareOf": { "type": "string", "description": "The 'care of' address is used whenever sending mail to a person or organisation who does not actually live or work at the address. They will receive the mail for the individual.", "maxLength": 140, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_\\-]{1,140})$" }, "CountryCode": { "type": "string", "description": "Nation with its own government.", "maxLength": 2, "minLength": 2, "pattern": "^[A-Z]{2,2}$" }, "CountrySubDivision": { "type": "string", "description": "Identifies a subdivision of a country such as state, region, county.", "maxLength": 35, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9\\- '.,]){1,35}$" }, "Department": { "type": "string", "description": "Identification of a division of a large organisation or building.", "maxLength": 70, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9\\- '.,\\/]){1,70}$" }, "DistrictName": { "type": "string", "description": "Number that of the regional area, known as a district, which forms part of an address", "maxLength": 140, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_\\-]{1,140})$" }, "ExternalCreditorReferenceType1Code": { "type": "string", "description": "Specifies the type of creditor reference as published in an external creditor reference type code set. For more information see `ExternalCreditorReferenceType1Code` in *ISO_External_CodeSet* [here](https://github.com/OpenBankingUK/External_Internal_CodeSets)", "enum": [ "DISP", "FXDR", "PUOR", "RPIN", "RADM", "SCOR" ] }, "ExternalDocumentType1Code": { "type": "string", "description": "Specifies the document type as published in an external document type code list. For more information see `ExternalDocumentType1Code` in *ISO_External_CodeSet* [here](https://github.com/OpenBankingUK/External_Internal_CodeSets)", "enum": [ "CINV", "CNFA", "CREN", "DEBN", "DISP", "DNFA", "HIRI", "MSIN", "PUOR", "SBIN", "AROI", "BOLD", "CMCN", "SOAC", "TSUT", "VCHR" ] }, "ExternalProxyAccountType1Code": { "type": "string", "description": "Specifies the external proxy account type code, as published in the proxy account type external code set.
For a full list of values see `ExternalProxyAccountType1Code` in *ISO_External_CodeSet* [here](https://github.com/OpenBankingUK/External_Internal_CodeSets)", "enum": [ "TELE", "EMAL", "DNAM", "CINC", "COTX", "COID", "CUST", "DRLC", "EIDN", "EWAL", "PVTX", "LEIC", "MBNO", "NIDN", "CCPT", "SHID", "SOSE", "TOKN", "UBIL", "VIPN", "BIID" ] }, "Floor": { "type": "string", "description": "Number that identifies the level within a building", "maxLength": 70, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_\\-]{1,70})$" }, "Identification_0": { "type": "string", "description": "Identification assigned by an institution to identify an account. This identification is known by the account owner.", "maxLength": 256, "minLength": 1, "pattern": "^[a-zA-Z0-9]{1,256}$" }, "Identification_1": { "type": "string", "description": "Unique and unambiguous identification of a financial institution or a branch of a financial institution.", "maxLength": 35, "minLength": 1, "pattern": "^[a-zA-Z0-9]{1,35}$" }, "Identification_3": { "type": "string", "description": "Identification of the organisation issuing the invoice, when it is different from the creditor or ultimate creditor", "maxLength": 256, "minLength": 1, "pattern": "^[a-zA-Z0-9]{1,256}$" }, "Identification_4": { "type": "string", "description": "Identification of the party to whom an invoice is issued, when it is different from the debtor or ultimate debtor.", "maxLength": 256, "minLength": 1, "pattern": "^[a-zA-Z0-9]{1,256}$" }, "LEI": { "type": "string", "description": "Legal entity identification as an alternate identification for a party. Legal Entity Identifier is a code allocated to a party as described in ISO 17442 \"Financial Services - Legal Entity Identifier (LEI)\".", "maxLength": 20, "minLength": 20, "pattern": "^[A-Z0-9]{18,18}[0-9]{2,2}$" }, "Name": { "type": "string", "description": "Name by which an agent is known and which is usually used to identify that agent.", "maxLength": 140, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9-. '()£=\"_,&@#\\/;+]{1,140})$" }, "OBActiveCurrencyAndAmount_SimpleType": { "type": "string", "description": "A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217.", "maxLength": 19, "minLength": 1, "pattern": "^\\d{1,13}$|^\\d{1,13}\\.\\d{1,5}$" }, "OBAddressType2Code": { "type": "string", "description": "Identifies the nature of the postal address. For a full set of codes see `OBAddressType2Code` [here](https://github.com/OpenBankingUK/External_Internal_CodeSets).", "enum": [ "BIZZ", "DLVY", "MLTO", "PBOX", "ADDR", "HOME", "CORR", "STAT" ] }, "OBInternalAccountIdentification4Code": { "type": "string", "description": "Name of the identification scheme, in a coded form as published in an external list. For a full list of values refer to `OBInternalAccountIdentification4Code` in *OB_Internal_CodeSet* [here](https://github.com/OpenBankingUK/External_Internal_CodeSets)", "enum": [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber", "UK.OBIE.Wallet" ] }, "OBInternalFinancialInstitutionIdentification4Code": { "type": "string", "description": "Name of the identification scheme, in a coded form as published in an external list.", "enum": [ "UK.OBIE.BICFI", "UK.OBIE.NCC.GB" ] }, "OBInternalLocalInstrument1Code": { "type": "string", "description": "User community specific instrument.\nUsage: This element is used to specify a local instrument, local clearing option and/or further qualify the service or service level. For a full list of values refer to `OBInternalLocalInstrument1Code` in *OB_Internal_CodeSet* [here](https://github.com/OpenBankingUK/External_Internal_CodeSets)", "enum": [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ] }, "OBPostalAddress7": { "type": "object", "additionalProperties": false, "deprecated": false, "description": "Information that locates and identifies a specific address, as defined by postal services.", "properties": { "AddressType": { "$ref": "#/$defs/OBAddressType2Code" }, "Department": { "$ref": "#/$defs/Department" }, "SubDepartment": { "$ref": "#/$defs/SubDepartment" }, "StreetName": { "$ref": "#/$defs/StreetName" }, "BuildingNumber": { "$ref": "#/$defs/BuildingNumber" }, "BuildingName": { "$ref": "#/$defs/BuildingName" }, "Floor": { "$ref": "#/$defs/Floor" }, "UnitNumber": { "$ref": "#/$defs/UnitNumber" }, "Room": { "$ref": "#/$defs/Room" }, "PostBox": { "$ref": "#/$defs/PostBox" }, "TownLocationName": { "$ref": "#/$defs/TownName" }, "DistrictName": { "$ref": "#/$defs/DistrictName" }, "CareOf": { "$ref": "#/$defs/CareOf" }, "PostCode": { "$ref": "#/$defs/PostCode" }, "TownName": { "$ref": "#/$defs/TownName" }, "CountrySubDivision": { "$ref": "#/$defs/CountrySubDivision" }, "Country": { "$ref": "#/$defs/CountryCode" }, "AddressLine": { "type": "array", "items": { "type": "string", "description": "Information that locates and identifies a specific address, as defined by postal services, presented in free format text.", "maxLength": 70, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9-. '()£=\"_,&@#\\/]{1,70})$" }, "maxItems": 7, "minItems": 1 } }, "nullable": false }, "OBProxy1": { "type": "object", "additionalProperties": false, "deprecated": false, "description": "Specifies an alternate assumed name for the identification of the account.", "properties": { "Identification": { "type": "string", "description": "Identification used to indicate the account identification under another specified name.", "maxLength": 2048, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_-]{1,2048})$" }, "Code": { "$ref": "#/$defs/ExternalProxyAccountType1Code" }, "Type": { "type": "string", "description": "Type of the proxy identification.", "maxLength": 35, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_-]{1,35})$" } }, "required": [ "Code", "Identification" ], "nullable": false }, "OBReferredDocumentInformation": { "type": "object", "additionalProperties": false, "deprecated": false, "properties": { "Code": { "$ref": "#/$defs/ExternalDocumentType1Code" }, "Issuer": { "type": "string", "description": "Identification of the issuer of the reference document type.", "maxLength": 35, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_\\-]{1,35})$" }, "Number": { "type": "string", "description": "Identification of the type specified for the referred document line.", "maxLength": 35, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_\\-]{1,35})$" }, "RelatedDate": { "type": "string", "format": "date-time", "description": "Date associated with the referred document line." }, "LineDetails": { "type": "array", "description": "Set of elements used to provide the content of the referred document line.", "items": { "type": "string", "maxLength": 2048, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_\\-]{1,2048})$" }, "maxItems": 3, "minItems": 0 } }, "nullable": false }, "OBRemittanceInformation2": { "type": "object", "additionalProperties": false, "deprecated": false, "description": "Information supplied to enable the matching of an entry with the items that the transfer is intended to settle, such as commercial invoices in an accounts' receivable system", "properties": { "Structured": { "type": "array", "items": { "$ref": "#/$defs/OBRemittanceInformationStructured" }, "maxItems": 5, "minItems": 1 }, "Unstructured": { "type": "array", "description": "Information supplied to enable the matching/reconciliation of an entry with the items that the payment is intended to settle, such as commercial invoices in an accounts' receivable system, in an unstructured form.", "items": { "type": "string", "maxLength": 140, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9-. '()£=\"_,&@#\\/;:&+]{1,140})$" }, "maxItems": 4, "minItems": 1 } }, "nullable": false }, "OBRemittanceInformationStructured": { "type": "object", "additionalProperties": false, "deprecated": false, "properties": { "ReferredDocumentInformation": { "type": "array", "items": { "$ref": "#/$defs/OBReferredDocumentInformation" }, "maxItems": 3, "minItems": 1 }, "ReferredDocumentAmount": { "$ref": "#/$defs/OBActiveCurrencyAndAmount_SimpleType" }, "CreditorReferenceInformation": { "type": "object", "additionalProperties": false, "deprecated": false, "description": "Reference information provided by the creditor to allow the identification of the underlying documents.", "properties": { "Code": { "$ref": "#/$defs/ExternalCreditorReferenceType1Code" }, "Issuer": { "type": "string", "description": "Entity that assigns the identification.", "maxLength": 35, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_-]{1,35})$" }, "Reference": { "type": "string", "description": "Unique reference, as assigned by the creditor, to unambiguously refer to the payment transaction.", "maxLength": 35, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_-]{1,35})$" } }, "nullable": false }, "Invoicer": { "$ref": "#/$defs/Identification_3" }, "Invoicee": { "$ref": "#/$defs/Identification_4" }, "TaxRemittance": { "type": "string", "description": "Provides remittance information about a payment made for tax-related purposes.", "maxLength": 140, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_-]{1,140})$" }, "AdditionalRemittanceInformation": { "type": "array", "description": "Additional information, in free text form, to complement the structured remittance information.", "items": { "type": "string", "maxLength": 140, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_-]{1,140})$" }, "maxItems": 3, "minItems": 0 } }, "nullable": false }, "OBSupplementaryData1": { "type": "object", "additionalProperties": true, "description": "Additional information that can not be captured in the structured fields and/or any other specific block." }, "OBUltimateDebtor1": { "type": "object", "additionalProperties": false, "description": "Ultimate party that owes an amount of money to the (ultimate) creditor.", "properties": { "Name": { "type": "string", "description": "Name by which a party is known and which is usually used to identify that party.", "maxLength": 140, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_\\-]{1,140})$" }, "Identification": { "type": "string", "description": "Identification assigned by an institution.", "maxLength": 256, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_\\-]{1,256})$" }, "LEI": { "$ref": "#/$defs/LEI" }, "SchemeName": { "$ref": "#/$defs/OBInternalAccountIdentification4Code" }, "PostalAddress": { "$ref": "#/$defs/OBPostalAddress7" } } }, "PostBox": { "type": "string", "description": "Information that locates and identifies a box in a post office assigned to a person or organization, where letters for them are kept until called for.", "maxLength": 16, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_-]{1,16})$" }, "PostCode": { "type": "string", "description": "Identifier consisting of a group of letters and/or numbers that is added to a postal address to assist the sorting of mail.", "maxLength": 16, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9 ]){1,16}$" }, "Room": { "type": "string", "description": "Information that locates and identifies a room to form part of an address", "maxLength": 70, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_-]{1,70})$" }, "SecondaryIdentification": { "type": "string", "description": "This is secondary identification of the account, as assigned by the account servicing institution. \nThis can be used by building societies to additionally identify accounts with a roll number (in addition to a sort code and account number combination).", "maxLength": 34, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9-. '()£=\"_,&@#\\/;+]{1,34})$" }, "StreetName": { "type": "string", "description": "Name of a street or thoroughfare.", "maxLength": 70, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9- '.,\\/]{1,70})$" }, "SubDepartment": { "type": "string", "description": "Identification of a sub-division of a large organisation or building.", "maxLength": 70, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z0-9- '.,\\/]){1,70}$" }, "TownName": { "type": "string", "description": "Name of a built-up area, with defined boundaries, and a local government.", "maxLength": 35, "minLength": 1, "pattern": "^(?!\\s)([a-zA-Z- '.,]){1,35}$" }, "UnitNumber": { "type": "string", "description": "Number that identifies the unit of a specific address .", "maxLength": 16, "minLength": 1, "pattern": "^(?!\\s)([A-Za-z0-9!+\\/\\= '.,@#()_-]{1,16})$" } } }