import {z} from 'zod' export type OBInternalLocalInstrument1Code = string; export type OBInternalChargeBearerType1Code = 'BorneByCreditor' | 'BorneByDebtor' | 'FollowingServiceLevel' | 'Shared'; export type OBActiveCurrencyAndAmountSimpleType = string; export type ActiveOrHistoricCurrencyCode = string; export type OBInternalAccountIdentification4Code = string; export type Identification0 = string; export type SecondaryIdentification = string; export type ExternalProxyAccountType1Code = 'TELE' | 'EMAL' | 'DNAM' | 'CINC' | 'COTX' | 'COID' | 'CUST' | 'DRLC' | 'EIDN' | 'EWAL' | 'PVTX' | 'LEIC' | 'MBNO' | 'NIDN' | 'CCPT' | 'SHID' | 'SOSE' | 'TOKN' | 'UBIL' | 'VIPN' | 'BIID'; export type OBProxy1 = {Identification: string, Code: ExternalProxyAccountType1Code, Type?: string | undefined}; export type LEI = string; export type OBAddressType2Code = 'BIZZ' | 'DLVY' | 'MLTO' | 'PBOX' | 'ADDR' | 'HOME' | 'CORR' | 'STAT'; export type Department = string; export type SubDepartment = string; export type StreetName = string; export type BuildingNumber = string; export type BuildingName = string; export type Floor = string; export type UnitNumber = string; export type Room = string; export type PostBox = string; export type TownName = string; export type DistrictName = string; export type CareOf = string; export type PostCode = string; export type CountrySubDivision = string; export type CountryCode = string; export type OBPostalAddress7 = {AddressType?: OBAddressType2Code | undefined, Department?: Department | undefined, SubDepartment?: SubDepartment | undefined, StreetName?: StreetName | undefined, BuildingNumber?: BuildingNumber | undefined, BuildingName?: BuildingName | undefined, Floor?: Floor | undefined, UnitNumber?: UnitNumber | undefined, Room?: Room | undefined, PostBox?: PostBox | undefined, TownLocationName?: TownName | undefined, DistrictName?: DistrictName | undefined, CareOf?: CareOf | undefined, PostCode?: PostCode | undefined, TownName?: TownName | undefined, CountrySubDivision?: CountrySubDivision | undefined, Country?: CountryCode | undefined, AddressLine?: Array | undefined}; export type OBInternalFinancialInstitutionIdentification4Code = string; export type Identification1 = string; export type Name = string; export type OBUltimateCreditor1 = {Name?: string | undefined, Identification?: string | undefined, LEI?: LEI | undefined, SchemeName?: OBInternalAccountIdentification4Code | undefined, PostalAddress?: OBPostalAddress7 | undefined}; export type OBUltimateDebtor1 = {Name?: string | undefined, Identification?: string | undefined, LEI?: LEI | undefined, SchemeName?: OBInternalAccountIdentification4Code | undefined, PostalAddress?: OBPostalAddress7 | undefined}; export type OBRegulatoryAuthority2 = {Name?: string | undefined, CountryCode?: CountryCode | undefined}; export type ISODateTime = string; export type OBActiveOrHistoricCurrencyAndAmount = {Amount: OBActiveCurrencyAndAmountSimpleType, Currency: ActiveOrHistoricCurrencyCode}; export type OBStructuredRegulatoryReporting3 = {Type?: string | undefined, Date?: ISODateTime | undefined, Country?: CountryCode | undefined, Amount?: OBActiveOrHistoricCurrencyAndAmount | undefined, Information?: Array | undefined}; export type OBRegulatoryReporting1 = {DebitCreditReportingIndicator?: ('CRED' | 'DEBT' | 'BOTH') | undefined, Authority?: OBRegulatoryAuthority2 | undefined, Details?: Array | undefined}; export type ExternalDocumentType1Code = 'CINV' | 'CNFA' | 'CONT' | 'CREN' | 'DEBN' | 'DISP' | 'DNFA' | 'HIRI' | 'INVS' | 'MSIN' | 'PROF' | 'PUOR' | 'QUOT' | 'SBIN' | 'SPRR' | 'TISH'; export type OBReferredDocumentInformation = {Code?: ExternalDocumentType1Code | undefined, Issuer?: string | undefined, Number?: string | undefined, RelatedDate?: string | undefined, LineDetails?: Array | undefined}; export type ExternalCreditorReferenceType1Code = 'DISP' | 'FXDR' | 'PUOR' | 'RPIN' | 'RADM' | 'SCOR'; export type Identification3 = string; export type Identification4 = string; export type OBRemittanceInformationStructured = {ReferredDocumentInformation?: Array | undefined, ReferredDocumentAmount?: OBActiveCurrencyAndAmountSimpleType | undefined, CreditorReferenceInformation?: ({Code?: ExternalCreditorReferenceType1Code | undefined, Issuer?: string | undefined, Reference?: string | undefined}) | undefined, Invoicer?: Identification3 | undefined, Invoicee?: Identification4 | undefined, TaxRemittance?: string | undefined, AdditionalRemittanceInformation?: Array | undefined}; export type OBRemittanceInformation2 = {Structured?: Array | undefined, Unstructured?: Array | undefined}; export type OBSupplementaryData1 = {[key: string]: unknown}; export type OBSCASupportData1 = {RequestedSCAExemptionType?: ('BillPayment' | 'ContactlessTravel' | 'EcommerceGoods' | 'EcommerceServices' | 'Kiosk' | 'Parking' | 'PartyToParty') | undefined, AppliedAuthenticationApproach?: ('CA' | 'SCA') | undefined, ReferencePaymentOrderId?: string | undefined}; export type ExternalPurpose1Code = 'BKDF' | 'BKFE' | 'BKFM' | 'BKIP' | 'BKPP' | 'CBLK' | 'CDCB' | 'CDCD' | 'CDCS' | 'CDDP' | 'CDOC' | 'CDQC' | 'ETUP' | 'FCOL' | 'MTUP' | 'ACCT' | 'CASH' | 'COLL' | 'CSDB' | 'DEPT' | 'INTC' | 'INTP' | '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' | 'GIFT' | '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' | 'RRCT' | 'RRTP' | 'RVPM' | 'SLPI' | 'SPLT' | 'STDY' | 'TBAN' | 'TBIL' | 'TCSC' | 'TELI' | 'TMPG' | 'TPRI' | 'TPRP' | 'TRNC' | 'TRVC' | 'WEBI' | 'IPAY' | 'IPCA' | 'IPDO' | 'IPEA' | 'IPEC' | 'IPEW' | 'IPPS' | 'IPRT' | 'IPU2' | 'IPUW' | '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' | 'SPSP' | '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' | 'BOND' | 'CABD' | 'CAEQ' | 'CBCR' | 'DBCR' | 'DICL' | 'EQTS' | 'FLCR' | 'EFTC' | 'EFTD' | 'MOMA' | 'RAPI' | 'GAMB' | 'LOTT' | 'AMEX' | 'SASW' | 'AUCO' | 'PCOM' | 'PDEP' | 'PLDS' | 'PLRF' | 'GAFA' | 'GAHO' | 'CPEN' | 'DEPD' | 'RETL' | 'DEBT' | 'CRYP'; export type ExternalCategoryPurpose1Code = 'BONU' | 'CASH' | 'CBLK' | 'CCRD' | 'CGWV' | 'CIPC' | 'CONC' | 'CORT' | 'DCRD' | 'DIVI' | 'DVPM' | 'EPAY' | 'FCDT' | 'FCIN' | 'FCOL' | 'GOVT' | 'GP2P' | 'HEDG' | 'ICCP' | 'IDCP' | 'INTC' | 'INTE' | 'LBOX' | 'LOAN' | 'MP2B' | 'MP2P' | 'OTHR' | 'PENS' | 'RPRE' | 'RRCT' | 'RVPM' | 'SALA' | 'SECU' | 'SSBE' | 'SUPP' | 'SWEP' | 'TAXS' | 'TOPG' | 'TRAD' | 'TREA' | 'VATX' | 'VOST' | 'WHLD' | 'ZABA'; export type OBInternalExtendedAccountType1Code = 'Business' | 'BusinessSavingsAccount' | 'Charity' | 'Collection' | 'Corporate' | 'Ewallet' | 'Government' | 'Investment' | 'ISA' | 'JointPersonal' | 'Pension' | 'Personal' | 'PersonalSavingsAccount' | 'Premier' | 'Wealth'; export type OBRisk1 = {PaymentContextCode?: ('BillingGoodsAndServicesInAdvance' | 'BillingGoodsAndServicesInArrears' | 'EcommerceMerchantInitiatedPayment' | 'FaceToFacePointOfSale' | 'TransferToSelf' | 'TransferToThirdParty' | 'BillPayment' | 'EcommerceGoods' | 'EcommerceServices' | 'PartyToParty' | 'PispPayee' | 'Other') | undefined, MerchantCategoryCode?: string | undefined, MerchantCustomerIdentification?: string | undefined, ContractPresentIndicator?: boolean | undefined, BeneficiaryPrepopulatedIndicator?: boolean | undefined, PaymentPurposeCode?: ExternalPurpose1Code | undefined, CategoryPurposeCode?: ExternalCategoryPurpose1Code | undefined, BeneficiaryAccountType?: OBInternalExtendedAccountType1Code | undefined, DeliveryAddress?: OBPostalAddress7 | undefined}; export type OBWriteInternationalScheduledConsent5 = {Data: {Permission: 'Create', ReadRefundAccount?: ('No' | 'Yes') | undefined, Initiation: {InstructionIdentification: string, EndToEndIdentification?: string | undefined, LocalInstrument?: OBInternalLocalInstrument1Code | undefined, InstructionPriority?: ('Normal' | 'Urgent') | undefined, ExtendedPurpose?: string | undefined, ChargeBearer?: OBInternalChargeBearerType1Code | undefined, RequestedExecutionDateTime: string, CurrencyOfTransfer: string, DestinationCountryCode?: string | undefined, InstructedAmount: {Amount: OBActiveCurrencyAndAmountSimpleType, Currency: ActiveOrHistoricCurrencyCode}, ExchangeRateInformation?: ({UnitCurrency: string, ExchangeRate?: number | undefined, RateType: 'Actual' | 'Agreed' | 'Indicative', ContractIdentification?: string | undefined}) | undefined, DebtorAccount?: ({SchemeName: OBInternalAccountIdentification4Code, Identification: Identification0, Name?: string | undefined, SecondaryIdentification?: SecondaryIdentification | undefined, Proxy?: OBProxy1 | undefined}) | undefined, Creditor?: ({Name?: string | undefined, LEI?: LEI | undefined, PostalAddress?: OBPostalAddress7 | undefined}) | undefined, CreditorAgent?: ({SchemeName?: OBInternalFinancialInstitutionIdentification4Code | undefined, Identification?: Identification1 | undefined, LEI?: LEI | undefined, Name?: Name | undefined, PostalAddress?: OBPostalAddress7 | undefined}) | undefined, CreditorAccount: {SchemeName: OBInternalAccountIdentification4Code, Identification: Identification0, Name: string, SecondaryIdentification?: SecondaryIdentification | undefined, Proxy?: OBProxy1 | undefined}, UltimateCreditor?: OBUltimateCreditor1 | undefined, UltimateDebtor?: OBUltimateDebtor1 | undefined, RegulatoryReporting?: Array | undefined, RemittanceInformation?: OBRemittanceInformation2 | undefined, SupplementaryData?: OBSupplementaryData1 | undefined}, Authorisation?: ({AuthorisationType: 'Any' | 'Single', CompletionDateTime?: string | undefined}) | undefined, SCASupportData?: OBSCASupportData1 | undefined}, Risk: OBRisk1}; export type CreateApiInternationalScheduledPaymentConsentsArgs = {'x-fapi-auth-date'?: string | undefined, 'x-fapi-customer-ip-address'?: string | undefined, 'x-fapi-interaction-id'?: string | undefined, Authorization: string, 'x-idempotency-key': string, 'x-jws-signature': string, 'x-customer-user-agent'?: string | undefined, 'x-client-id'?: string | undefined, body: OBWriteInternationalScheduledConsent5}; export type CreateApiInternationalScheduledPaymentConsentsOptions = {baseUrl: string, TPPOAuth2Security?: string | undefined, fetch?: typeof fetch | undefined}; export const oBInternalConsentStatus2Code = z.enum(["AWAU", "RJCT", "AUTH", "COND"]); export const oBStatusReason = z.object({StatusReasonCode: z.string().min(1).max(4).optional(), StatusReasonDescription: z.string().min(1).max(500).optional(), Path: z.string().min(1).max(500).optional()}); export const oBInternalChargeBearerType1Code = z.enum(["BorneByCreditor", "BorneByDebtor", "FollowingServiceLevel", "Shared"]); export const oBInternalPaymentChargeType1Code = z.string(); export const oBActiveCurrencyAndAmountSimpleType = z.string(); export const activeOrHistoricCurrencyCode = z.string(); export const oBActiveOrHistoricCurrencyAndAmount = z.object({Amount: oBActiveCurrencyAndAmountSimpleType, Currency: activeOrHistoricCurrencyCode}); export const oBInternalLocalInstrument1Code = z.string(); export const oBInternalAccountIdentification4Code = z.string(); export const identification0 = z.string().min(1).max(256); export const secondaryIdentification = z.string().min(1).max(34); export const externalProxyAccountType1Code = z.enum(["TELE", "EMAL", "DNAM", "CINC", "COTX", "COID", "CUST", "DRLC", "EIDN", "EWAL", "PVTX", "LEIC", "MBNO", "NIDN", "CCPT", "SHID", "SOSE", "TOKN", "UBIL", "VIPN", "BIID"]); export const oBProxy1 = z.object({Identification: z.string().min(1).max(2048), Code: externalProxyAccountType1Code, Type: z.string().min(1).max(35).optional()}); export const lEI = z.string().min(1).max(20); export const oBAddressType2Code = z.enum(["BIZZ", "DLVY", "MLTO", "PBOX", "ADDR", "HOME", "CORR", "STAT"]); export const department = z.string().min(1).max(70); export const subDepartment = z.string().min(1).max(70); export const streetName = z.string().min(1).max(140); export const buildingNumber = z.string().min(1).max(16); export const buildingName = z.string().min(1).max(140); export const floor = z.string().min(1).max(70); export const unitNumber = z.string().min(1).max(16); export const room = z.string().min(1).max(70); export const postBox = z.string().min(1).max(16); export const townName = z.string().min(1).max(140); export const districtName = z.string().min(1).max(140); export const careOf = z.string().min(1).max(140); export const postCode = z.string().min(1).max(16); export const countrySubDivision = z.string().min(1).max(35); export const countryCode = z.string(); export const oBPostalAddress7 = z.object({AddressType: oBAddressType2Code.optional(), Department: department.optional(), SubDepartment: subDepartment.optional(), StreetName: streetName.optional(), BuildingNumber: buildingNumber.optional(), BuildingName: buildingName.optional(), Floor: floor.optional(), UnitNumber: unitNumber.optional(), Room: room.optional(), PostBox: postBox.optional(), TownLocationName: townName.optional(), DistrictName: districtName.optional(), CareOf: careOf.optional(), PostCode: postCode.optional(), TownName: townName.optional(), CountrySubDivision: countrySubDivision.optional(), Country: countryCode.optional(), AddressLine: z.array(z.string().min(1).max(70)).optional()}); export const oBInternalFinancialInstitutionIdentification4Code = z.string(); export const identification1 = z.string().min(1).max(35); export const name = z.string().min(1).max(140); export const oBUltimateCreditor1 = z.object({Name: z.string().min(1).max(140).optional(), Identification: z.string().min(1).max(256).optional(), LEI: lEI.optional(), SchemeName: oBInternalAccountIdentification4Code.optional(), PostalAddress: oBPostalAddress7.optional()}); export const oBUltimateDebtor1 = z.object({Name: z.string().min(1).max(140).optional(), Identification: z.string().min(1).max(256).optional(), LEI: lEI.optional(), SchemeName: oBInternalAccountIdentification4Code.optional(), PostalAddress: oBPostalAddress7.optional()}); export const oBRegulatoryAuthority2 = z.object({Name: z.string().min(1).max(140).optional(), CountryCode: countryCode.optional()}); export const iSODateTime = z.string(); export const oBStructuredRegulatoryReporting3 = z.object({Type: z.string().min(1).max(35).optional(), Date: iSODateTime.optional(), Country: countryCode.optional(), Amount: oBActiveOrHistoricCurrencyAndAmount.optional(), Information: z.array(z.string().min(1).max(35)).optional()}); export const oBRegulatoryReporting1 = z.object({DebitCreditReportingIndicator: z.enum(["CRED", "DEBT", "BOTH"]).optional(), Authority: oBRegulatoryAuthority2.optional(), Details: z.array(oBStructuredRegulatoryReporting3).optional()}); export const externalDocumentType1Code = z.enum(["CINV", "CNFA", "CONT", "CREN", "DEBN", "DISP", "DNFA", "HIRI", "INVS", "MSIN", "PROF", "PUOR", "QUOT", "SBIN", "SPRR", "TISH"]).min(1).max(4); export const oBReferredDocumentInformation = z.object({Code: externalDocumentType1Code.optional(), Issuer: z.string().min(1).max(35).optional(), Number: z.string().min(1).max(35).optional(), RelatedDate: z.string().optional(), LineDetails: z.array(z.string().min(1).max(2048)).optional()}); export const externalCreditorReferenceType1Code = z.enum(["DISP", "FXDR", "PUOR", "RPIN", "RADM", "SCOR"]).min(1).max(4); export const identification3 = z.string().min(1).max(256); export const identification4 = z.string().min(1).max(256); export const oBRemittanceInformationStructured = z.object({ReferredDocumentInformation: z.array(oBReferredDocumentInformation).optional(), ReferredDocumentAmount: oBActiveCurrencyAndAmountSimpleType.optional(), CreditorReferenceInformation: z.object({Code: externalCreditorReferenceType1Code.optional(), Issuer: z.string().min(1).max(35).optional(), Reference: z.string().min(1).max(35).optional()}).optional(), Invoicer: identification3.optional(), Invoicee: identification4.optional(), TaxRemittance: z.string().min(1).max(140).optional(), AdditionalRemittanceInformation: z.array(z.string().min(1).max(140)).optional()}); export const oBRemittanceInformation2 = z.object({Structured: z.array(oBRemittanceInformationStructured).optional(), Unstructured: z.array(z.string().min(1).max(140)).optional()}); export const oBSupplementaryData1 = z.record(z.string(), z.unknown()); export const oBSCASupportData1 = z.object({RequestedSCAExemptionType: z.enum(["BillPayment", "ContactlessTravel", "EcommerceGoods", "EcommerceServices", "Kiosk", "Parking", "PartyToParty"]).optional(), AppliedAuthenticationApproach: z.enum(["CA", "SCA"]).max(40).optional(), ReferencePaymentOrderId: z.string().min(1).max(40).optional()}); export const oBCashAccountDebtor4 = z.object({SchemeName: z.string().optional(), Identification: z.string().optional(), Name: z.string().optional(), SecondaryIdentification: z.string().optional(), LEI: lEI.optional()}); export const externalPurpose1Code = z.enum(["BKDF", "BKFE", "BKFM", "BKIP", "BKPP", "CBLK", "CDCB", "CDCD", "CDCS", "CDDP", "CDOC", "CDQC", "ETUP", "FCOL", "MTUP", "ACCT", "CASH", "COLL", "CSDB", "DEPT", "INTC", "INTP", "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", "GIFT", "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", "RRCT", "RRTP", "RVPM", "SLPI", "SPLT", "STDY", "TBAN", "TBIL", "TCSC", "TELI", "TMPG", "TPRI", "TPRP", "TRNC", "TRVC", "WEBI", "IPAY", "IPCA", "IPDO", "IPEA", "IPEC", "IPEW", "IPPS", "IPRT", "IPU2", "IPUW", "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", "SPSP", "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", "BOND", "CABD", "CAEQ", "CBCR", "DBCR", "DICL", "EQTS", "FLCR", "EFTC", "EFTD", "MOMA", "RAPI", "GAMB", "LOTT", "AMEX", "SASW", "AUCO", "PCOM", "PDEP", "PLDS", "PLRF", "GAFA", "GAHO", "CPEN", "DEPD", "RETL", "DEBT", "CRYP"]).min(1).max(4); export const externalCategoryPurpose1Code = z.enum(["BONU", "CASH", "CBLK", "CCRD", "CGWV", "CIPC", "CONC", "CORT", "DCRD", "DIVI", "DVPM", "EPAY", "FCDT", "FCIN", "FCOL", "GOVT", "GP2P", "HEDG", "ICCP", "IDCP", "INTC", "INTE", "LBOX", "LOAN", "MP2B", "MP2P", "OTHR", "PENS", "RPRE", "RRCT", "RVPM", "SALA", "SECU", "SSBE", "SUPP", "SWEP", "TAXS", "TOPG", "TRAD", "TREA", "VATX", "VOST", "WHLD", "ZABA"]); export const oBInternalExtendedAccountType1Code = z.enum(["Business", "BusinessSavingsAccount", "Charity", "Collection", "Corporate", "Ewallet", "Government", "Investment", "ISA", "JointPersonal", "Pension", "Personal", "PersonalSavingsAccount", "Premier", "Wealth"]); export const oBRisk1 = z.object({PaymentContextCode: z.enum(["BillingGoodsAndServicesInAdvance", "BillingGoodsAndServicesInArrears", "EcommerceMerchantInitiatedPayment", "FaceToFacePointOfSale", "TransferToSelf", "TransferToThirdParty", "BillPayment", "EcommerceGoods", "EcommerceServices", "PartyToParty", "PispPayee", "Other"]).optional(), MerchantCategoryCode: z.string().min(3).max(4).optional(), MerchantCustomerIdentification: z.string().min(1).max(70).optional(), ContractPresentIndicator: z.boolean().optional(), BeneficiaryPrepopulatedIndicator: z.boolean().optional(), PaymentPurposeCode: externalPurpose1Code.optional(), CategoryPurposeCode: externalCategoryPurpose1Code.optional(), BeneficiaryAccountType: oBInternalExtendedAccountType1Code.optional(), DeliveryAddress: oBPostalAddress7.optional()}); export const links = z.object({Self: z.string(), First: z.string().optional(), Prev: z.string().optional(), Next: z.string().optional(), Last: z.string().optional()}); export const meta = z.object({TotalPages: z.number().int().optional(), FirstAvailableDateTime: iSODateTime.optional(), LastAvailableDateTime: iSODateTime.optional()}); export const oBWriteInternationalScheduledConsentResponse6 = z.object({Data: z.object({ConsentId: z.string().min(1).max(128), CreationDateTime: z.string(), Status: oBInternalConsentStatus2Code, StatusReason: z.array(oBStatusReason).optional(), StatusUpdateDateTime: z.string(), Permission: z.literal("Create"), ReadRefundAccount: z.enum(["No", "Yes"]).optional(), CutOffDateTime: z.string().optional(), ExpectedExecutionDateTime: z.string().optional(), ExpectedSettlementDateTime: z.string().optional(), Charges: z.array(z.object({ChargeBearer: oBInternalChargeBearerType1Code, Type: oBInternalPaymentChargeType1Code, Amount: oBActiveOrHistoricCurrencyAndAmount})).optional(), ExchangeRateInformation: z.object({UnitCurrency: z.string(), ExchangeRate: z.number(), RateType: z.enum(["Actual", "Agreed", "Indicative"]), ContractIdentification: z.string().min(1).max(256).optional(), ExpirationDateTime: z.string().optional()}).optional(), Initiation: z.object({InstructionIdentification: z.string().min(1).max(35), EndToEndIdentification: z.string().min(1).max(35).optional(), LocalInstrument: oBInternalLocalInstrument1Code.optional(), InstructionPriority: z.enum(["Normal", "Urgent"]).optional(), ExtendedPurpose: z.string().min(1).max(140).optional(), ChargeBearer: oBInternalChargeBearerType1Code.optional(), RequestedExecutionDateTime: z.string(), CurrencyOfTransfer: z.string(), DestinationCountryCode: z.string().optional(), InstructedAmount: z.object({Amount: oBActiveCurrencyAndAmountSimpleType, Currency: activeOrHistoricCurrencyCode}), ExchangeRateInformation: z.object({UnitCurrency: z.string(), ExchangeRate: z.number().optional(), RateType: z.enum(["Actual", "Agreed", "Indicative"]), ContractIdentification: z.string().min(1).max(256).optional()}).optional(), DebtorAccount: z.object({SchemeName: oBInternalAccountIdentification4Code, Identification: identification0, Name: z.string().min(1).max(350).optional(), SecondaryIdentification: secondaryIdentification.optional(), Proxy: oBProxy1.optional()}).optional(), Creditor: z.object({Name: z.string().min(1).max(350).optional(), LEI: lEI.optional(), PostalAddress: oBPostalAddress7.optional()}).optional(), CreditorAgent: z.object({SchemeName: oBInternalFinancialInstitutionIdentification4Code.optional(), Identification: identification1.optional(), LEI: lEI.optional(), Name: name.optional(), PostalAddress: oBPostalAddress7.optional()}).optional(), CreditorAccount: z.object({SchemeName: oBInternalAccountIdentification4Code, Identification: identification0, Name: z.string().min(1).max(350), SecondaryIdentification: secondaryIdentification.optional(), Proxy: oBProxy1.optional()}), UltimateCreditor: oBUltimateCreditor1.optional(), UltimateDebtor: oBUltimateDebtor1.optional(), RegulatoryReporting: z.array(oBRegulatoryReporting1).optional(), RemittanceInformation: oBRemittanceInformation2.optional(), SupplementaryData: oBSupplementaryData1.optional()}), Authorisation: z.object({AuthorisationType: z.enum(["Any", "Single"]), CompletionDateTime: z.string().optional()}).optional(), SCASupportData: oBSCASupportData1.optional(), Debtor: oBCashAccountDebtor4.optional()}), Risk: oBRisk1, Links: links.optional(), Meta: meta.optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Create an International Scheduled Payment Consent * * POST /international-scheduled-payment-consents */ export const createApiInternationalScheduledPaymentConsents = async (args: CreateApiInternationalScheduledPaymentConsentsArgs, options: CreateApiInternationalScheduledPaymentConsentsOptions) => { const {baseUrl, fetch: fetchFn = fetch, TPPOAuth2Security} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args['x-fapi-auth-date'] != null) headers.set("x-fapi-auth-date", String(args['x-fapi-auth-date'])) if (args['x-fapi-customer-ip-address'] != null) headers.set("x-fapi-customer-ip-address", String(args['x-fapi-customer-ip-address'])) if (args['x-fapi-interaction-id'] != null) headers.set("x-fapi-interaction-id", String(args['x-fapi-interaction-id'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args['x-idempotency-key'] != null) headers.set("x-idempotency-key", String(args['x-idempotency-key'])) if (args['x-jws-signature'] != null) headers.set("x-jws-signature", String(args['x-jws-signature'])) if (args['x-customer-user-agent'] != null) headers.set("x-customer-user-agent", String(args['x-customer-user-agent'])) if (args['x-client-id'] != null) headers.set("x-client-id", String(args['x-client-id'])) if (TPPOAuth2Security !== undefined) headers.set('authorization', `Bearer ${TPPOAuth2Security}`) const url = `${baseUrl.replace(/\/+$/, '')}/international-scheduled-payment-consents${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(oBWriteInternationalScheduledConsentResponse6, await res.json()) };