import {z} from 'zod' export type Hierarchy = {internalMerchantId: string, merchantLevelCode: 'MEMBER' | 'GROUP' | 'SUB_GROUP', parentInternalMerchantId?: string | undefined}; export type RequiredDetails = {externalMerchantId: string, tradeName: string, companyName: string, legalFormIndex: string, languageIndex: string, mcciso: string, eCommerceIndCode: 'TRADITIONAL_ONLY' | 'ECOMMERCE_ONLY' | 'BOTH', residentStatusCode: 'NA' | 'RESIDENT' | 'NON_RESIDENT', accountOfficerIndex: string, residencyFeeLevelCode: 'NA' | 'GROUP_CLIENT' | 'SUB_GROUP_CLIENT' | 'MEMBER_CLIENT', retailerClassificationCode: string, branchIndex: string}; export type OPYMerchantSecondaryTaxId = string; export type OPYMerchantProsaDeterminant = string; export type OPYMerchantProsaBDUNumber = string; export type OPYMerchantSignerDateOfBirth = string; export type OPYMerchantMerchantLongName = string; export type OPYMerchantMcpRateType = string; export type OPYMerchantDomesticMcc = string; export type OptionalDetails = {registrationNo?: string | undefined, vatRegNo?: string | undefined, contractReference?: string | undefined, bankReference?: string | undefined, floorLimitCurrencyCode?: string | undefined, dynamicPricing?: boolean | undefined, paymentAdviceGenerationIndex?: string | undefined, paymentDeliveryMethodCode?: ('EMAIL' | 'FAX' | 'POST' | 'COLLECT' | 'HAND_DELIVER' | 'COURIER' | 'ONLINE' | 'MY_02_FAX' | 'MY_03_COURIE' | 'MY_04_HAND_KL' | 'MY_05_HAND_PJ' | 'MY_06_SPECIAL_DELIVE' | 'MY_07_EMAIL' | 'MY_01_EMAIL' | 'NA') | undefined, merchantGradeIndex?: string | undefined, secondaryTaxID?: OPYMerchantSecondaryTaxId | undefined, prosaDeterminant?: OPYMerchantProsaDeterminant | undefined, prosaBDUNumber?: OPYMerchantProsaBDUNumber | undefined, signerDateOfBirth?: OPYMerchantSignerDateOfBirth | undefined, merchantLongName?: OPYMerchantMerchantLongName | undefined, mcpRateType?: OPYMerchantMcpRateType | undefined, domesticMcc?: OPYMerchantDomesticMcc | undefined}; export type Contract = {serviceContractIndex: string, clientTariffIndex: string, postingTariffIndex: string, settlementMethodIndex: string, paymentMethodIndex?: string | undefined, protectAgainstFXChange: boolean, clientRegionIndex: string, tierStructureIndex?: string | undefined, reclassBillbackIndicatorCode?: ('NA' | 'NO_BILLBACK' | 'AUT_BILLBACK_DR' | 'AUT_BILLBACK_ALL' | 'MANUAL_BILLBACK') | undefined, withholdIncomeTariffIndex?: string | undefined, withholdVatTariffIndex?: string | undefined, regionalTaxIndex?: string | undefined, tierPricingFlag?: string | undefined}; export type OPYMerchantTelephone = string; export type OPYMerchantRegionOverrideFlag = boolean; export type OPYMerchantUrl = string; export type Location = {countryCode: string, state?: string | undefined, cityUrl: string, zip?: string | undefined, street?: string | undefined, serviceTelNo?: string | undefined, countyIndex?: string | undefined, municipalityIndex?: string | undefined, telephone?: OPYMerchantTelephone | undefined, regionOverrideFlag?: OPYMerchantRegionOverrideFlag | undefined, url?: OPYMerchantUrl | undefined}; export type OPYMerchantGlobalTravelB2BFeeInd = string; export type OPYMerchantMcCnpMotoFee = 'NO_FEE' | 'MC_CNP_FEE_ONLY' | 'MC_MOTO_FEE_ONLY' | 'BOTH_MC_CNP_&_MOTO_FEE'; export type OPYMerchantMcPifFeeInd = boolean; export type OPYMerchantDinersIntesCode = string; export type OPYMerchantMerchantCountryOfOrigin = string; export type OPYMerchantMerchantSizeIndex = string; export type GlobalFees = {feeIndex: string, feeMode: boolean, cardOrganization: string}; export type OPYMerchantUpiIPQualificationCode = string; export type OPYMerchantMarketPlaceId = string; export type OPYMerchantStagedDigitalWalletId = string; export type OPYMerchantRampProviderId = string; export type OPYMerchantAcquirerBusinessId = string; export type OPYMerchantMcStagedDigitalWalletId = string; export type SchemeDetails = {crossBorderFeeCode?: ('NONE' | 'MASTERCARD' | 'VISA' | 'BOTH') | undefined, masterCardIPQualificationCode?: ('NA' | 'CHARITY' | 'MASTERCARD_AID' | 'GAMBLING') | undefined, masterCardIPValue?: string | undefined, visaIPQualificationCode?: ('NA' | 'CHARITY' | 'SG_EZ_LINKS' | 'TRANCHE_2' | 'TRANCHE_3' | 'VAU_VALIDATED' | 'VISA_EPS' | 'VISA_MVV_PROGRAM' | 'LOW_VALUE_PAYMENTS' | 'SMALL_MERCHANT' | 'VISA_SPEND_QUALF_IND' | 'SG_STRATGC_SUPERMRKT' | 'SG_STRATGC_GOVERNMNT' | 'BILL_PAY' | 'VISA_INDIAN_FUND_TXN' | 'HK_STRATGC_GOV' | 'SG_STRATGC_ULITITIES' | 'SG_STRATGC_VISA_BPAY' | 'TH_STRATGC_4' | 'TH_STRATGC_5' | 'TH_STRATGC_8' | 'CPS_RETAIL' | 'VISA_MVV_PROGRAM_CLR' | 'INDIA_PM_CARES') | undefined, visaIPValue?: string | undefined, paymentLowValue?: boolean | undefined, cbdipVisaSmiCode?: string | undefined, mcPaymentFacilitatorId?: string | undefined, mcIndependentSalesOrgId?: string | undefined, visaCanIasfFee?: boolean | undefined, viLacFeeCode?: ('NA' | 'VISA_LAC_IA_FEE' | 'VISA_LAC_ISA_FEE' | 'BOTH_LAC_FEES') | undefined, mcLacFeeCode?: ('NA' | 'MC_LAC_CB' | 'MC_LAC_CB_REBATE' | 'MC_LAC_BOTH') | undefined, mcAbvFeeInd?: boolean | undefined, visaEuFeeIndCode?: ('NEITHER' | 'VISA_IA_FEE' | 'VISA_ECOM_FEE' | 'BOTH_VISA_EU_FEES') | undefined, mcIntlEcomFee?: boolean | undefined, viUsApIafFee?: string | undefined, pagobancomatIndex?: string | undefined, visaPaymentFacilitatorId?: string | undefined, globalTravelB2BFeeInd?: OPYMerchantGlobalTravelB2BFeeInd | undefined, mcCnpMotoFee?: OPYMerchantMcCnpMotoFee | undefined, mcPifFeeInd?: OPYMerchantMcPifFeeInd | undefined, dinersIntesCode?: OPYMerchantDinersIntesCode | undefined, amexModelIndex?: string | undefined, merchantCountryOfOrigin?: OPYMerchantMerchantCountryOfOrigin | undefined, merchantSizeIndex?: OPYMerchantMerchantSizeIndex | undefined, globalFees?: Array | undefined, upiIPQualificationCode?: OPYMerchantUpiIPQualificationCode | undefined, marketPlaceId?: OPYMerchantMarketPlaceId | undefined, stagedDigitalWalletId?: OPYMerchantStagedDigitalWalletId | undefined, rampProviderId?: OPYMerchantRampProviderId | undefined, acquirerBusinessId?: OPYMerchantAcquirerBusinessId | undefined, mcStagedDigitalWalletId?: OPYMerchantMcStagedDigitalWalletId | undefined}; export type SalesDetails = {accSignedDate: string, accCreationDate: string, accApprovalDate: string, salesAgentId: string, businessOwnerId: string, salesChannelIndex: string, salesCurrencyCode: string, signedSalesValue?: string | undefined, signedAverageTicketValue?: string | undefined, salesLead?: string | undefined, signedNumberSales?: string | undefined, priorityMemo?: string | undefined}; export type MerchantDetail = {hierarchy: Hierarchy, requiredDetails: RequiredDetails, optionalDetails?: OptionalDetails | undefined, contract: Contract, location: Location, schemeDetails?: SchemeDetails | undefined, salesDetails?: SalesDetails | undefined}; export type OPYGenericCode3 = string; export type OPYGenericDescription = string; export type OPYAddressCategoryObj = {categoryIndex?: OPYGenericCode3 | undefined, categoryDescription?: OPYGenericDescription | undefined}; export type OPYAddressContactName = string; export type OPYAddressGroupSpecific = boolean; export type OPYAddressLine1 = string; export type OPYAddressLine2 = string; export type OPYAddressLine3 = string; export type OPYAddressLine4 = string; export type OPYAddressLine5 = string; export type OPYAddressPostCode = string; export type OPYAddressCity = string; export type OPYAddressState = string; export type OPYAddressCountryCode = string; export type OPYAddressTelephone = string; export type OPYAddressFax = string; export type OPYAddressEmail = string; export type OPYAddressDeliveryMethodObj = {deliveryMethodIndex?: OPYGenericCode3 | undefined, deliveryMethodDescription?: OPYGenericDescription | undefined}; export type OPYAddressEffectiveDate = string; export type OPYLastUpdatedBy = string; export type OPYLastUpdated = string; export type MerchantAddress = {category?: OPYAddressCategoryObj | undefined, contactName?: OPYAddressContactName | undefined, groupSpecific?: OPYAddressGroupSpecific | undefined, line1?: OPYAddressLine1 | undefined, line2?: OPYAddressLine2 | undefined, line3?: OPYAddressLine3 | undefined, line4?: OPYAddressLine4 | undefined, line5?: OPYAddressLine5 | undefined, postCode?: OPYAddressPostCode | undefined, city?: OPYAddressCity | undefined, state?: OPYAddressState | undefined, countryCode?: OPYAddressCountryCode | undefined, telephone?: OPYAddressTelephone | undefined, fax?: OPYAddressFax | undefined, email?: OPYAddressEmail | undefined, deliveryMethodIndex?: OPYAddressDeliveryMethodObj | undefined, effectiveDate?: OPYAddressEffectiveDate | undefined, lastUpdatedBy?: OPYLastUpdatedBy | undefined, lastUpdated?: OPYLastUpdated | undefined}; export type OPYAccountInternalAccountNumber = string; export type OPYAccountAccountTypeObj = {accountTypeIndex?: OPYGenericCode3 | undefined, accountTypeDescription?: OPYGenericDescription | undefined}; export type OPYAccountAccountCurrencyCode = string; export type OPYAccountBillingLevel = boolean; export type OPYAccountAccountStatus = 'ACTIVE' | 'CLOSED' | 'SUSPENDED' | 'COLLECT_EPS' | 'SUSPENSE_ACCT'; export type OPYAccountReceiverCountryCode = string; export type OPYAccountPaymentReference = string; export type OPYAccountStatementTypeObj = {statementTypeIndex?: OPYGenericCode3 | undefined, statementTypeDescription?: OPYGenericDescription | undefined}; export type OPYAccountStatementGenerationCode = 'SUPPRESS' | 'GENERATE' | 'GENERATE_IF_ACTIVITY' | 'GENERATE_IF_NO_ACTIVITY'; export type OPYAccountAnnualFeeDueDate = string; export type OPYAccountCalendarTypeObj = {calendarTypeIndex?: OPYGenericCode3 | undefined, calendarTypeDescription?: OPYGenericDescription | undefined}; export type OPYAccountLiabilityAccount = string; export type OPYAccountSepaDirectDebitSeq = 'FRST' | 'RCUR'; export type OPYHierarchyParentInternalMerchantId = string; export type OPYMerchantTradeName = string; export type OPYAccountPayableBankName = string; export type OPYAccountPayableAccountName = string; export type OPYAccountPayableCounterBankNumber = string; export type OPYAccountPayableAccountNumber = string; export type OPYAccountPayableBankTelephone = string; export type OPYAccountPayableBankContactName = string; export type OPYAccountPayableCorrespondentBankNo = string; export type OPYAccountPayableIban = string; export type OPYAccountPayableCustomerPaymentText = string; export type OPYAccountPayableBankCity = string; export type OPYAccountPayablePaymentFormatObj = {paymentFormatIndex?: OPYGenericCode3 | undefined, paymentFormatDescription?: OPYGenericDescription | undefined}; export type OPYAccountPayableClearingEntityObj = {clearingEntityIndex?: OPYGenericCode3 | undefined, clearingEntityDescription?: OPYGenericDescription | undefined}; export type OPYAccountPayableCorrespondentBankAccount = string; export type OPYAccountPayableCalendarDays = string; export type OPYAccountPayablePaymentDelayDays = string; export type OPYAccountPayableCeilingLimit = string; export type MerchantAccountPayable = {bankName?: OPYAccountPayableBankName | undefined, accountName?: OPYAccountPayableAccountName | undefined, counterBankNumber?: OPYAccountPayableCounterBankNumber | undefined, accountNumber?: OPYAccountPayableAccountNumber | undefined, bankTelephone?: OPYAccountPayableBankTelephone | undefined, bankContactName?: OPYAccountPayableBankContactName | undefined, correspondentBankNo?: OPYAccountPayableCorrespondentBankNo | undefined, iban?: OPYAccountPayableIban | undefined, customerPaymentText?: OPYAccountPayableCustomerPaymentText | undefined, bankCity?: OPYAccountPayableBankCity | undefined, paymentFormat?: OPYAccountPayablePaymentFormatObj | undefined, clearingEntity?: OPYAccountPayableClearingEntityObj | undefined, correspondentBankAccount?: OPYAccountPayableCorrespondentBankAccount | undefined, calendarDays?: OPYAccountPayableCalendarDays | undefined, paymentDelayDays?: OPYAccountPayablePaymentDelayDays | undefined, ceilingLimit?: OPYAccountPayableCeilingLimit | undefined}; export type OPYAccountReceivableBankName = string; export type OPYAccountReceivableAccountName = string; export type OPYAccountReceivableCounterBankNumber = string; export type OPYAccountReceivableAccountNumber = string; export type OPYAccountReceivableBankTelephone = string; export type OPYAccountReceivableBankContactName = string; export type OPYAccountReceivableCorrespondentBankNo = string; export type OPYAccountReceivableIban = string; export type OPYAccountReceivableCustomerPaymentText = string; export type OPYAccountReceivableBankCity = string; export type OPYAccountReceivablePaymentFormatObj = {paymentFormatIndex?: OPYGenericCode3 | undefined, paymentFormatDescription?: OPYGenericDescription | undefined}; export type OPYAccountReceivableClearingEntityObj = {clearingEntityIndex?: OPYGenericCode3 | undefined, clearingEntityDescription?: OPYGenericDescription | undefined}; export type OPYAccountReceivableCorrespondentBankAccount = string; export type OPYAccountReceivableCalendarDays = string; export type OPYAccountReceivableCollectionDelayDays = string; export type OPYAccountReceivableDdMandateReference = string; export type MerchantAccountReceivable = {bankName?: OPYAccountReceivableBankName | undefined, accountName?: OPYAccountReceivableAccountName | undefined, counterBankNumber?: OPYAccountReceivableCounterBankNumber | undefined, accountNumber?: OPYAccountReceivableAccountNumber | undefined, bankTelephone?: OPYAccountReceivableBankTelephone | undefined, bankContactName?: OPYAccountReceivableBankContactName | undefined, correspondentBankNo?: OPYAccountReceivableCorrespondentBankNo | undefined, iban?: OPYAccountReceivableIban | undefined, customerPaymentText?: OPYAccountReceivableCustomerPaymentText | undefined, bankCity?: OPYAccountReceivableBankCity | undefined, paymentFormat?: OPYAccountReceivablePaymentFormatObj | undefined, clearingEntity?: OPYAccountReceivableClearingEntityObj | undefined, correspondentBankAccount?: OPYAccountReceivableCorrespondentBankAccount | undefined, calendarDays?: OPYAccountReceivableCalendarDays | undefined, collectionDelayDays?: OPYAccountReceivableCollectionDelayDays | undefined, ddMandateReference?: OPYAccountReceivableDdMandateReference | undefined}; export type MerchantAccount = {internalAccountNumber?: OPYAccountInternalAccountNumber | undefined, accountType?: OPYAccountAccountTypeObj | undefined, accountCurrencyCode?: OPYAccountAccountCurrencyCode | undefined, billingLevel?: OPYAccountBillingLevel | undefined, accountStatus?: OPYAccountAccountStatus | undefined, receiverCountryCode?: OPYAccountReceiverCountryCode | undefined, paymentReference?: OPYAccountPaymentReference | undefined, statementType?: OPYAccountStatementTypeObj | undefined, statementGenerationCode?: OPYAccountStatementGenerationCode | undefined, annualFeeDueDate?: OPYAccountAnnualFeeDueDate | undefined, calendarTypeIndex?: OPYAccountCalendarTypeObj | undefined, liabilityAccount?: OPYAccountLiabilityAccount | undefined, sepaDirectDebitSeq?: OPYAccountSepaDirectDebitSeq | undefined, parentInternalMerchantId?: OPYHierarchyParentInternalMerchantId | undefined, parentTradeName?: OPYMerchantTradeName | undefined, payable?: MerchantAccountPayable | undefined, receivable?: MerchantAccountReceivable | undefined}; export type OPYTransactionChargesServiceIDObjV11 = {serviceIndex?: OPYGenericCode3 | undefined, serviceDescription?: OPYGenericDescription | undefined}; export type OPYServicesStatus = 'ACTIVE' | 'CLOSED'; export type OPYGenericCode6 = string; export type OPYServicesTariffObj = {tariffIndex?: OPYGenericCode6 | undefined, tariffDescription?: OPYGenericDescription | undefined}; export type OPYServicesFloorLimit = string; export type OPYServicesLimitCurrency = string; export type OPYServicesDinersCode = 'CONVEYANCE_CLEARING' | 'DINERS_AND_DISCOVER' | 'NA'; export type OPYServicesJcbStateCodeIndex = string; export type OPYServicesJcbAreaCode1Index = string; export type OPYServicesJcbArea2Index = string; export type OPYServicesMerchantSubId = string; export type OPYServicesAcquirerNoOfInstallment = number; export type MerchantServices = {serviceId?: OPYTransactionChargesServiceIDObjV11 | undefined, status?: OPYServicesStatus | undefined, serviceMerchantTariffs?: OPYServicesTariffObj | undefined, floorLimit?: OPYServicesFloorLimit | undefined, limitCurrency?: OPYServicesLimitCurrency | undefined, dinersCode?: OPYServicesDinersCode | undefined, jcbStateCodeIndex?: OPYServicesJcbStateCodeIndex | undefined, jcbAreaCode1Index?: OPYServicesJcbAreaCode1Index | undefined, jcbArea2Index?: OPYServicesJcbArea2Index | undefined, merchantSubId?: OPYServicesMerchantSubId | undefined, acquirerNoOfInstallment?: OPYServicesAcquirerNoOfInstallment | undefined, lastUpdatedBy?: OPYLastUpdatedBy | undefined, lastUpdated?: OPYLastUpdated | undefined}; export type OPYReferencesObj = {referenceIndex?: OPYGenericCode3 | undefined, referenceDescription?: OPYGenericDescription | undefined}; export type OPYReferencesReferenceValue = string; export type OPYAccountFeesLastUpdatedBy = string; export type OPYAccountFeesLastUpdated = string; export type MerchantReferences = {merchantReference?: OPYReferencesObj | undefined, referenceValue?: OPYReferencesReferenceValue | undefined, lastUpdatedBy?: OPYAccountFeesLastUpdatedBy | undefined, lastUpdated?: OPYAccountFeesLastUpdated | undefined}; export type MerchantDevices = {externalTerminalId: string, serialNumber?: string | undefined, contactName?: string | undefined, terminalLocation?: string | undefined, telephone?: string | undefined, schemeId?: string | undefined, accountCurrencyCode?: string | undefined, systemBatchId?: string | undefined, feeEffeciveDate?: string | undefined, lastFeeDate?: string | undefined, clientFeeIndex?: string | undefined, feeExpiryDate?: string | undefined, configOfTerminalIndex?: string | undefined, installDate?: string | undefined, activeDate?: string | undefined, terminationDate?: string | undefined, terminalPassword?: string | undefined, terminalTypeIndex?: string | undefined, terminalCountryCode?: string | undefined, serviceProviderIndex?: string | undefined, emv?: boolean | undefined, city?: string | undefined, amex?: boolean | undefined, acquiringProfileIndex?: string | undefined, templateId?: string | undefined, amexPhoneNo1?: string | undefined, amexPhoneNo2?: string | undefined, relatedTId?: string | undefined, waiver?: string | undefined, socCode?: string | undefined, setupFee?: string | undefined, gprsRentalAmount?: string | undefined, gprsRental?: string | undefined, installed?: string | undefined, workStation?: string | undefined}; export type OPYAccountFeesRecordIdNumber = string; export type OPYFxRateMarginsEffectiveDate = string; export type OPYAccountFeesExpiryDate = string; export type OPYAccountFeesTriggerSourceObj = {triggerSourceIndex?: OPYGenericCode3 | undefined, triggerSourceDescription?: OPYGenericDescription | undefined}; export type OPYAccountFeesRuleIDObj = {ruleIDIndex?: OPYGenericCode3 | undefined, ruleIDDescription?: OPYGenericDescription | undefined}; export type OPYAccountFeesCurrencyCode = string; export type OPYAccountFeesFeePercentage = string; export type OPYAccountFeesFeeBase = string; export type OPYAccountFeesFeeMinimum = string; export type OPYAccountFeesFeeMaximum = string; export type OPYAccountFeesFeeMode = boolean; export type OPYAccountFeesTriggerHighValue = string; export type OPYAccountFeesTriggerLowValue = string; export type OPYAccountFeesTriggerVolumeHigh = string; export type OPYAccountFeesTriggerVolumeLow = string; export type OPYAccountFeesFeeTypeObj = {feeTypeIndex?: OPYGenericCode3 | undefined, feeTypeDescription?: OPYGenericDescription | undefined}; export type OPYAccountFeesRateCategoryObj = {rateCategoryIndex?: OPYGenericCode3 | undefined, rateCategoryDescription?: OPYGenericDescription | undefined}; export type OPYAccountFeesFeeIdObj = {feeIdIndex?: OPYGenericCode3 | undefined, feeIdDescription?: OPYGenericDescription | undefined}; export type OPYAccountFeesFeeLevelObj = {feeLevelIndex?: OPYGenericCode3 | undefined, feeLevelDescription?: OPYGenericDescription | undefined}; export type OPYAccountFeesTriggerFrequencyObj = {triggerFrequencyIndex?: OPYGenericCode3 | undefined, triggerFrequencyDescription?: OPYGenericDescription | undefined}; export type OPYAccountFeesTriggerCurrencyObj = {triggerCurrencyIndex?: OPYGenericCode3 | undefined, triggerCurrencyDescription?: OPYGenericDescription | undefined}; export type OPYAccountFeesPostToAccountObj = {postToAccountIndex?: OPYGenericCode3 | undefined, postToAccountDescription?: OPYGenericDescription | undefined}; export type MerchantAccountFees = {feeModel?: ('INDIVIDUAL' | 'DEFAULT') | undefined, recordIdNumber: OPYAccountFeesRecordIdNumber, status?: ('ACTIVE' | 'FUTURE' | 'INACTIVE') | undefined, accountType?: OPYAccountAccountTypeObj | undefined, accountCurrencyCode?: OPYAccountAccountCurrencyCode | undefined, effectiveDate?: OPYFxRateMarginsEffectiveDate | undefined, expiryDate?: OPYAccountFeesExpiryDate | undefined, triggerSource?: OPYAccountFeesTriggerSourceObj | undefined, rule?: OPYAccountFeesRuleIDObj | undefined, feeBaseCurrencyCode?: OPYAccountFeesCurrencyCode | undefined, feePercentage?: OPYAccountFeesFeePercentage | undefined, feeBase?: OPYAccountFeesFeeBase | undefined, feeMinimum?: OPYAccountFeesFeeMinimum | undefined, feeMaximum?: OPYAccountFeesFeeMaximum | undefined, feeMode?: OPYAccountFeesFeeMode | undefined, triggerHighValue?: OPYAccountFeesTriggerHighValue | undefined, triggerLowValue?: OPYAccountFeesTriggerLowValue | undefined, triggerVolumeHigh?: OPYAccountFeesTriggerVolumeHigh | undefined, triggerVolumeLow?: OPYAccountFeesTriggerVolumeLow | undefined, feeType?: OPYAccountFeesFeeTypeObj | undefined, rateCategory?: OPYAccountFeesRateCategoryObj | undefined, feeId?: OPYAccountFeesFeeIdObj | undefined, feeLevel?: OPYAccountFeesFeeLevelObj | undefined, triggerFrequency?: OPYAccountFeesTriggerFrequencyObj | undefined, triggerCurrency?: OPYAccountFeesTriggerCurrencyObj | undefined, postToAccount?: OPYAccountFeesPostToAccountObj | undefined, lastUpdated?: OPYAccountFeesLastUpdated | undefined, lastUpdatedBy?: OPYAccountFeesLastUpdatedBy | undefined}; export type OPYTransactionChargesRecordIdNumber = string; export type OPYTransactionChargesCardServiceTypeObj = {cardServiceTypeIndex?: OPYGenericCode3 | undefined, cardServiceTypeDescription?: OPYGenericDescription | undefined}; export type OPYTransactionChargesChargeTypeObj = {chargeTypeIndex?: OPYGenericCode3 | undefined, chargeTypeIndexDescription?: OPYGenericDescription | undefined}; export type OPYTransactionChargesTransactionTypeObj = {transactionType?: OPYGenericCode3 | undefined, transactionTypeDescription?: OPYGenericDescription | undefined}; export type OPYTransactionChargesCaptureMethodObj = {captureMethodIndex?: OPYGenericCode3 | undefined, captureMethodDescription?: OPYGenericDescription | undefined}; export type OPYTransactionChargesAreaOfEventObj = {areaOfEventIndex?: OPYGenericCode3 | undefined, areaOfEventDescription?: OPYGenericDescription | undefined}; export type OPYTransactionChargesFeeCategoryObj = {feeCategoryIndex?: OPYGenericCode3 | undefined, feeCategoryIndexDescription?: OPYGenericDescription | undefined}; export type OPYTransactionChargesEffectiveDate = string; export type OPYTransactionChargesExpiryDate = string; export type OPYTransactionChargesFeeMode = boolean; export type OPYTransactionChargesFeePercentage = string; export type OPYTransactionChargesFeeBase = string; export type OPYTransactionChargesFeeMinimum = string; export type OPYTransactionChargesFeeMaximum = string; export type OPYTransactionChargesChargeCurrencyCode = string; export type OPYTransactionChargesChargeTierLevel = string; export type OPYTransactionChargesFeeTypeObj = {feeTypeIndex?: OPYGenericCode3 | undefined, feeTypeDescription?: OPYGenericDescription | undefined}; export type OPYTransactionChargesTransactionCurrencyObj = {transactionCurrencyIndex?: OPYGenericCode3 | undefined, transactionCurrencyDescription?: OPYGenericDescription | undefined}; export type OPYTransactionChargesLastUpdatedBy = string; export type OPYTransactionChargesLastUpdated = string; export type TransactionCharges = {chargeModel?: ('INDIVIDUAL' | 'DEFAULT') | undefined, chargeStatus?: ('ACTIVE' | 'FUTURE' | 'INACTIVE') | undefined, recordIdNumber: OPYTransactionChargesRecordIdNumber, cardType?: OPYTransactionChargesCardServiceTypeObj | undefined, chargeType?: OPYTransactionChargesChargeTypeObj | undefined, serviceId?: OPYTransactionChargesServiceIDObjV11 | undefined, transactionType?: OPYTransactionChargesTransactionTypeObj | undefined, captureMethod?: OPYTransactionChargesCaptureMethodObj | undefined, areaOfEvent?: OPYTransactionChargesAreaOfEventObj | undefined, feeCategory?: OPYTransactionChargesFeeCategoryObj | undefined, effectiveDate?: OPYTransactionChargesEffectiveDate | undefined, expiryDate?: OPYTransactionChargesExpiryDate | undefined, feeMode?: OPYTransactionChargesFeeMode | undefined, feePercentage?: OPYTransactionChargesFeePercentage | undefined, feeBase?: OPYTransactionChargesFeeBase | undefined, feeMinimum?: OPYTransactionChargesFeeMinimum | undefined, feeMaximum?: OPYTransactionChargesFeeMaximum | undefined, chargeCurrencyCode?: OPYTransactionChargesChargeCurrencyCode | undefined, chargeTierLevel?: OPYTransactionChargesChargeTierLevel | undefined, feeType?: OPYTransactionChargesFeeTypeObj | undefined, transactionCurrency?: OPYTransactionChargesTransactionCurrencyObj | undefined, lastUpdatedBy?: OPYTransactionChargesLastUpdatedBy | undefined, lastUpdated?: OPYTransactionChargesLastUpdated | undefined}; export type MerchantRequests = {requestIndex: string, quantity: number}; export type PaymentInstruction = {accountTypeIndex: string, accountCurrencyCode: string, instructionTypeIndex: string, deductionStartDate: string, deductionEndDate: string, deductionPercentage?: string | undefined, deductionMinAmount?: string | undefined, deductionMaxAmount?: string | undefined, deductionBaseAmount?: string | undefined, deductionTotalCnt?: string | undefined, deductionTotalAmount?: string | undefined, factorAgent?: string | undefined, note?: string | undefined}; export type MerchantProperty = {propertyIndex: string, propertyValue?: string | undefined}; export type Merchant = {detail: MerchantDetail, addresses: Array, accounts: Array, services?: Array | undefined, references?: Array | undefined, merchantDevices?: Array | undefined, merchantAccountFees?: Array | undefined, transactionCharges?: Array | undefined, merchantRequest?: Array | undefined, paymentInstructions?: Array | undefined, merchantProperties?: Array | undefined}; export type CreateApiMerchantsArgs = {'Content-Type': 'application/json' | 'application/json;charset=UTF-8', 'Correlation-Id': string, Environment: string, institutionNumber: string, intent: 'CREATE' | 'BATCH' | 'VALIDATE', body: Merchant}; export type CreateApiMerchantsOptions = {baseUrl?: string | undefined, AppKey?: string | undefined, JWSSignature?: string | undefined, fetch?: typeof fetch | undefined}; export const pagingMetaType = z.object({count: z.number().int().optional(), totalPages: z.number().int().optional(), currentOffset: z.number().int().optional(), currentNumberOfRetrievedRecords: z.number().int().optional(), maxLimit: z.number().int().optional(), hasMoreRecords: z.boolean().optional(), pageNumber: z.number().int().optional()}); export const sortingMetaType = z.object({sort: z.string().optional()}); export const sourceType = z.object({pointer: z.string().optional(), parameter: z.string().optional(), header: z.string().optional()}); export const errorType = z.object({id: z.string().optional(), code: z.string(), title: z.string(), detail: z.string().optional(), source: sourceType.optional()}); export const metaType = z.object({paging: pagingMetaType.optional(), sorting: sortingMetaType.optional(), messages: z.array(errorType).optional()}); export const oPYAccountInternalAccountNumber = z.string().max(11); export const oPYGenericCode3 = z.string().min(1).max(3); export const oPYGenericDescription = z.string().max(100); export const oPYAccountAccountTypeObj = z.object({accountTypeIndex: oPYGenericCode3.optional(), accountTypeDescription: oPYGenericDescription.optional()}); export const oPYAccountAccountCurrencyCode = z.string().min(3).max(3); export const oPYAccountBillingLevel = z.boolean(); export const oPYAccountAccountStatus = z.enum(["ACTIVE", "CLOSED", "SUSPENDED", "COLLECT_EPS", "SUSPENSE_ACCT"]).max(16); export const oPYAccountReceiverCountryCode = z.string().min(3).max(3); export const oPYAccountPaymentReference = z.string().max(18); export const oPYAccountStatementTypeObj = z.object({statementTypeIndex: oPYGenericCode3.optional(), statementTypeDescription: oPYGenericDescription.optional()}); export const oPYAccountStatementGenerationCode = z.enum(["SUPPRESS", "GENERATE", "GENERATE_IF_ACTIVITY", "GENERATE_IF_NO_ACTIVITY"]); export const oPYAccountAnnualFeeDueDate = z.string().min(8).max(8); export const oPYAccountCalendarTypeObj = z.object({calendarTypeIndex: oPYGenericCode3.optional(), calendarTypeDescription: oPYGenericDescription.optional()}); export const oPYAccountLiabilityAccount = z.string().max(11); export const oPYAccountSepaDirectDebitSeq = z.enum(["FRST", "RCUR"]).max(32); export const oPYHierarchyParentInternalMerchantId = z.string().min(8).max(8); export const oPYMerchantTradeName = z.string().min(1).max(22); export const oPYAccountPayableBankName = z.string().max(40); export const oPYAccountPayableAccountName = z.string().max(35); export const oPYAccountPayableCounterBankNumber = z.string().max(22); export const oPYAccountPayableAccountNumber = z.string().max(35); export const oPYAccountPayableBankTelephone = z.string().max(15); export const oPYAccountPayableBankContactName = z.string().max(35); export const oPYAccountPayableCorrespondentBankNo = z.string().max(11); export const oPYAccountPayableIban = z.string().max(35); export const oPYAccountPayableCustomerPaymentText = z.string().max(18); export const oPYAccountPayableBankCity = z.string().max(35); export const oPYAccountPayablePaymentFormatObj = z.object({paymentFormatIndex: oPYGenericCode3.optional(), paymentFormatDescription: oPYGenericDescription.optional()}); export const oPYAccountPayableClearingEntityObj = z.object({clearingEntityIndex: oPYGenericCode3.optional(), clearingEntityDescription: oPYGenericDescription.optional()}); export const oPYAccountPayableCorrespondentBankAccount = z.string().max(16); export const oPYAccountPayableCalendarDays = z.string().min(3).max(3); export const oPYAccountPayablePaymentDelayDays = z.string().min(3).max(3); export const oPYAccountPayableCeilingLimit = z.string().max(16); export const merchantAccountPayable = z.object({bankName: oPYAccountPayableBankName.optional(), accountName: oPYAccountPayableAccountName.optional(), counterBankNumber: oPYAccountPayableCounterBankNumber.optional(), accountNumber: oPYAccountPayableAccountNumber.optional(), bankTelephone: oPYAccountPayableBankTelephone.optional(), bankContactName: oPYAccountPayableBankContactName.optional(), correspondentBankNo: oPYAccountPayableCorrespondentBankNo.optional(), iban: oPYAccountPayableIban.optional(), customerPaymentText: oPYAccountPayableCustomerPaymentText.optional(), bankCity: oPYAccountPayableBankCity.optional(), paymentFormat: oPYAccountPayablePaymentFormatObj.optional(), clearingEntity: oPYAccountPayableClearingEntityObj.optional(), correspondentBankAccount: oPYAccountPayableCorrespondentBankAccount.optional(), calendarDays: oPYAccountPayableCalendarDays.optional(), paymentDelayDays: oPYAccountPayablePaymentDelayDays.optional(), ceilingLimit: oPYAccountPayableCeilingLimit.optional()}); export const oPYAccountReceivableBankName = z.string().max(40); export const oPYAccountReceivableAccountName = z.string().max(35); export const oPYAccountReceivableCounterBankNumber = z.string().max(22); export const oPYAccountReceivableAccountNumber = z.string().max(35); export const oPYAccountReceivableBankTelephone = z.string().max(15); export const oPYAccountReceivableBankContactName = z.string().max(35); export const oPYAccountReceivableCorrespondentBankNo = z.string().max(11); export const oPYAccountReceivableIban = z.string().max(35); export const oPYAccountReceivableCustomerPaymentText = z.string().max(18); export const oPYAccountReceivableBankCity = z.string().max(35); export const oPYAccountReceivablePaymentFormatObj = z.object({paymentFormatIndex: oPYGenericCode3.optional(), paymentFormatDescription: oPYGenericDescription.optional()}); export const oPYAccountReceivableClearingEntityObj = z.object({clearingEntityIndex: oPYGenericCode3.optional(), clearingEntityDescription: oPYGenericDescription.optional()}); export const oPYAccountReceivableCorrespondentBankAccount = z.string().max(16); export const oPYAccountReceivableCalendarDays = z.string().min(3).max(3); export const oPYAccountReceivableCollectionDelayDays = z.string().min(3).max(3); export const oPYAccountReceivableDdMandateReference = z.string().max(35); export const merchantAccountReceivable = z.object({bankName: oPYAccountReceivableBankName.optional(), accountName: oPYAccountReceivableAccountName.optional(), counterBankNumber: oPYAccountReceivableCounterBankNumber.optional(), accountNumber: oPYAccountReceivableAccountNumber.optional(), bankTelephone: oPYAccountReceivableBankTelephone.optional(), bankContactName: oPYAccountReceivableBankContactName.optional(), correspondentBankNo: oPYAccountReceivableCorrespondentBankNo.optional(), iban: oPYAccountReceivableIban.optional(), customerPaymentText: oPYAccountReceivableCustomerPaymentText.optional(), bankCity: oPYAccountReceivableBankCity.optional(), paymentFormat: oPYAccountReceivablePaymentFormatObj.optional(), clearingEntity: oPYAccountReceivableClearingEntityObj.optional(), correspondentBankAccount: oPYAccountReceivableCorrespondentBankAccount.optional(), calendarDays: oPYAccountReceivableCalendarDays.optional(), collectionDelayDays: oPYAccountReceivableCollectionDelayDays.optional(), ddMandateReference: oPYAccountReceivableDdMandateReference.optional()}); export const linksType = z.object({self: z.string().optional(), first: z.string().optional(), last: z.string().optional(), prev: z.string().optional(), next: z.string().optional()}); export const inlineResponse200 = z.object({meta: metaType.optional(), data: z.array(z.object({internalAccountNumber: oPYAccountInternalAccountNumber.optional(), accountType: oPYAccountAccountTypeObj.optional(), accountCurrencyCode: oPYAccountAccountCurrencyCode.optional(), billingLevel: oPYAccountBillingLevel.optional(), accountStatus: oPYAccountAccountStatus.optional(), receiverCountryCode: oPYAccountReceiverCountryCode.optional(), paymentReference: oPYAccountPaymentReference.optional(), statementType: oPYAccountStatementTypeObj.optional(), statementGenerationCode: oPYAccountStatementGenerationCode.optional(), annualFeeDueDate: oPYAccountAnnualFeeDueDate.optional(), calendarTypeIndex: oPYAccountCalendarTypeObj.optional(), liabilityAccount: oPYAccountLiabilityAccount.optional(), sepaDirectDebitSeq: oPYAccountSepaDirectDebitSeq.optional(), parentInternalMerchantId: oPYHierarchyParentInternalMerchantId.optional(), parentTradeName: oPYMerchantTradeName.optional(), payable: merchantAccountPayable.optional(), receivable: merchantAccountReceivable.optional()})).optional(), errors: z.array(errorType).optional(), links: linksType.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 }; /** * On-board a new merchant * * POST /merchants */ export const createApiMerchants = async (args: CreateApiMerchantsArgs, options?: CreateApiMerchantsOptions) => { const {baseUrl = "https://prod.emea.api.fiservapps.com/ipp/omnipay/acquirerprofile/v1.0", fetch: fetchFn = fetch, AppKey, JWSSignature} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args['Correlation-Id'] != null) headers.set("Correlation-Id", String(args['Correlation-Id'])) if (args.Environment != null) headers.set("Environment", String(args.Environment)) if (args.institutionNumber != null) headers.set("institutionNumber", String(args.institutionNumber)) if (args.intent != null) query.append("intent", String(args.intent)) if (AppKey !== undefined) headers.set("Api-Key", AppKey) if (JWSSignature !== undefined) headers.set("JWS-Signature", JWSSignature) const url = `${baseUrl.replace(/\/+$/, '')}/merchants${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(inlineResponse200, await res.json()) };