import {z} from 'zod' export type CreateApiMerchantWorkflowsWorkflowCodeExecutionsExecutionIdLookupArgs = {workflowCode: string, executionId: string, 'x-idempotency-key': string, body: {amount?: {value: string, currency: string} | undefined, meta?: ({order?: ({reference?: string | undefined, description?: string | undefined, softDescriptor?: string | undefined, storeId?: string | undefined, placement?: ({country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, city?: string | undefined}) | undefined, deliveryAddress?: ({street?: string | undefined, doorNumber?: string | undefined, complement?: string | undefined, area?: string | undefined, city?: string | undefined, postalCode?: string | undefined, state?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, latitude?: number | undefined, longitude?: number | undefined, phone?: ({countryCode?: string | undefined, number: string}) | undefined, alias?: string | undefined, name?: string | undefined, lastName?: string | undefined, email?: string | undefined}) | undefined, deliveryAddressPreference?: ('noShipping' | 'userPreSpecified' | 'allowProviderOverride') | undefined, deliveryDate?: string | undefined, billingAddress?: ({street?: string | undefined, doorNumber?: string | undefined, complement?: string | undefined, area?: string | undefined, city?: string | undefined, postalCode?: string | undefined, state?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, latitude?: number | undefined, longitude?: number | undefined, phone?: ({countryCode?: string | undefined, number: string}) | undefined, alias?: string | undefined, name?: string | undefined, lastName?: string | undefined, email?: string | undefined}) | undefined, shippingType?: ('pickup' | 'physical' | 'hybrid' | 'digital') | undefined, shipping?: {value: string, currency: string} | undefined, totalDiscount?: {value: string, currency: string} | undefined, totalTax?: {value: string, currency: string} | undefined, lines?: (Array<{name?: string | undefined, description?: string | undefined, product?: ({type?: ('physical' | 'digital' | 'service') | undefined}) | undefined, type?: ('lineItem' | 'discount' | 'tax') | undefined, quantity?: number | undefined, unitPrice?: {value: string, currency: string} | undefined, total?: {value: string, currency: string} | undefined, taxPercentage?: {value: string} | undefined, totalDiscount?: {value: string, currency: string} | undefined, totalTax?: {value: string, currency: string} | undefined, id?: string | undefined, links?: ({productUrl?: string | undefined, imageUrl?: string | undefined}) | undefined, travelTicket?: ({ticketId?: string | undefined, passengers?: (Array<{name?: string | undefined, lastName?: string | undefined, phone?: ({countryCode?: string | undefined, number: string}) | undefined, passengerType?: ('adult' | 'child' | 'infant' | 'senior') | undefined, email?: string | undefined}>) | undefined, routes?: (Array<{legs?: (Array<{legId?: string | undefined, departure?: ({city?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, time?: string | undefined}) | undefined, arrival?: ({city?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, time?: string | undefined}) | undefined}>) | undefined}>) | undefined}) | undefined}>) | undefined, total?: {value: string, currency: string} | undefined, processingType?: ('Regular' | 'Subscription' | 'CardOnFile' | 'UnscheduledCardOnFile' | 'MOTO' | 'InPerson') | undefined, createdAt?: string | undefined, pendingStateDuration?: string | undefined, fundsTransfer?: ({type?: ('disbursement' | 'personToPerson' | 'accountToAccount' | 'topUp' | 'purchase' | 'cash' | 'walletLoad') | undefined, purpose?: ('donation' | 'education' | 'emergency' | 'expatriation' | 'familySupport' | 'financialServices' | 'gifts' | 'income' | 'insurance' | 'investment' | 'itServices' | 'leisure' | 'loanPayment' | 'medical' | 'business' | 'crypto' | 'assets' | 'prepaid' | 'crowdLending' | 'debitCard' | 'giftCard' | 'gaming' | 'highRiskSecurities' | 'salary' | 'pension' | 'royalities' | 'savings' | 'travelAndTourism' | 'other') | undefined, recipient?: ({account?: ({type?: ('bankAccount' | 'card' | 'wallet' | 'storedValueWallet' | 'stagedDigitalWallet' | 'merchantWallet' | 'email' | 'phone' | 'socialNetwork') | undefined, identifierType?: ('iban' | 'swift' | 'routingNumber') | undefined, iban?: string | undefined, accountNumber?: string | undefined, bankCode?: string | undefined, routingNumber?: string | undefined, reference?: string | undefined}) | undefined, customer?: ({reference?: string | undefined, name?: string | undefined, lastName?: string | undefined, email?: string | undefined, type?: string | undefined, phone?: ({countryCode?: string | undefined, number: string}) | undefined, birthDate?: string | undefined, language?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, identityCardNumber?: string | undefined, identityCardType?: string | undefined, createdAt?: string | undefined}) | undefined, address?: ({street?: string | undefined, doorNumber?: string | undefined, complement?: string | undefined, area?: string | undefined, city?: string | undefined, postalCode?: string | undefined, state?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, latitude?: number | undefined, longitude?: number | undefined, phone?: ({countryCode?: string | undefined, number: string}) | undefined, alias?: string | undefined, name?: string | undefined, lastName?: string | undefined, email?: string | undefined}) | undefined}) | undefined, sender?: ({customer?: ({reference?: string | undefined, name?: string | undefined, lastName?: string | undefined, email?: string | undefined, type?: string | undefined, phone?: ({countryCode?: string | undefined, number: string}) | undefined, birthDate?: string | undefined, language?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, identityCardNumber?: string | undefined, identityCardType?: string | undefined, createdAt?: string | undefined}) | undefined, address?: ({street?: string | undefined, doorNumber?: string | undefined, complement?: string | undefined, area?: string | undefined, city?: string | undefined, postalCode?: string | undefined, state?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, latitude?: number | undefined, longitude?: number | undefined, phone?: ({countryCode?: string | undefined, number: string}) | undefined, alias?: string | undefined, name?: string | undefined, lastName?: string | undefined, email?: string | undefined}) | undefined, type?: ('individual' | 'corporate' | 'instrument') | undefined, companyName?: string | undefined}) | undefined}) | undefined}) | undefined, customer?: ({reference?: string | undefined, name?: string | undefined, lastName?: string | undefined, email?: string | undefined, type?: string | undefined, phone?: ({countryCode?: string | undefined, number: string}) | undefined, birthDate?: string | undefined, language?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, identityCardNumber?: string | undefined, identityCardType?: string | undefined, createdAt?: string | undefined}) | undefined, clientContext?: ({ipAddress?: string | undefined, userAgent?: string | undefined, acceptHeader?: string | undefined, clientType?: ('desktop' | 'mobile' | 'app') | undefined, osType?: ('ios' | 'android') | undefined, osVersion?: string | undefined, deviceFingerprint?: string | undefined, javaEnabled?: boolean | undefined, javaScriptEnabled?: boolean | undefined, cookiesAccepted?: boolean | undefined, language?: string | undefined, colorDepth?: number | undefined, screenHeight?: number | undefined, screenWidth?: number | undefined, timeZoneOffset?: number | undefined, origin?: string | undefined, host?: string | undefined}) | undefined, vendor?: ({reference?: string | undefined, name?: string | undefined, address?: ({street?: string | undefined, doorNumber?: string | undefined, complement?: string | undefined, area?: string | undefined, city?: string | undefined, postalCode?: string | undefined, state?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, latitude?: number | undefined, longitude?: number | undefined, phone?: ({countryCode?: string | undefined, number: string}) | undefined, alias?: string | undefined, name?: string | undefined, lastName?: string | undefined, email?: string | undefined}) | undefined, device?: ({reference?: string | undefined}) | undefined, subMerchants?: (Array<{id?: string | undefined, name?: string | undefined, address?: ({street?: string | undefined, doorNumber?: string | undefined, complement?: string | undefined, area?: string | undefined, city?: string | undefined, postalCode?: string | undefined, state?: string | undefined, country?: ({code: string, iso3?: string | undefined, name?: string | undefined}) | undefined, latitude?: number | undefined, longitude?: number | undefined, phone?: ({countryCode?: string | undefined, number: string}) | undefined, alias?: string | undefined, name?: string | undefined, lastName?: string | undefined, email?: string | undefined}) | undefined, amount?: {value: string, currency: string} | undefined}>) | undefined}) | undefined, risk?: ({score?: string | undefined, skipPaymentProviderRules?: boolean | undefined, force3DS?: boolean | undefined, threeDSMode?: ('Skip' | 'Force' | 'Default') | undefined, allowNative3DS?: boolean | undefined, sessionId?: string | undefined, exemptionIndicator?: ('lowValue' | 'transactionRiskAnalysis' | 'secureCorporate' | 'trustedBeneficiary' | 'trustedBeneficiaryPrompt' | 'dataShare') | undefined}) | undefined, subscription?: ({chargeFrequency?: string | undefined, expiration?: string | undefined}) | undefined, tags?: {[key: string]: string} | undefined} | {[key: string]: unknown}) | undefined}}; export type CreateApiMerchantWorkflowsWorkflowCodeExecutionsExecutionIdLookupOptions = {baseUrl?: string | undefined, BearerToken?: string | undefined, fetch?: typeof fetch | undefined}; export const createApiMerchantWorkflowsWorkflowCodeExecutionsExecutionIdLookupResponse = z.object({name: z.literal("lookup"), actionId: z.string(), workspaceId: z.string().optional(), executedAt: z.string(), links: z.object({execution: z.union([z.string(), z.object({href: z.string(), method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional()})]), authorize: z.union([z.string(), z.object({href: z.string(), method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional()})]).optional(), startPaymentSession: z.union([z.string(), z.object({href: z.string(), method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional()})]).optional()}), data: z.object({paymentCompositionOptions: z.array(z.object({paymentMethodCode: z.enum(["alexBankMa7fazty", "amazonPay", "applePay", "audi2pay", "alfa", "alipay", "bankTransfer", "card", "capitecPay", "cibSmartWallet", "easypaisa", "etisalatCash", "fawryMobileWallet", "fawryPay", "googlePay", "jazzCash", "mercadoPago", "monoDirectDebit", "nbePhoneCash", "orangeCash", "oPayWallet", "pagaWallet", "payflex", "payjustnow", "payPal", "pix", "konnect", "qnbEWallet", "wafaCashWallet", "weCash", "genericRedirect", "eftPro", "upi", "cashFreeWallet", "paytmMWallet", "netBanking", "meezaWallet", "vodafoneCash", "alipayQRCode", "sepaDirectDebit", "dcb", "bankAccount", "modo", "ach", "payzoneCash", "revolutPay", "lean", "tabby", "boleto", "oxxo", "spei", "promptPay", "qris", "momoVN", "vietQR", "konbini", "touchNGo", "gCash", "maya", "pse", "pagoEfectivo", "napas", "duitNowQR", "grabPay", "shopeePay", "nequi", "picPay", "ovo", "trueMoney"]).optional(), integrationType: z.enum(["api", "hpp", "inperson"]), providerCode: z.string().optional(), description: z.string(), providerData: z.record(z.string(), z.unknown()).optional(), paymentInstruments: z.array(z.object({id: z.string(), createdAt: z.string(), updatedAt: z.string(), holderId: z.string(), paymentMethod: z.enum(["alexBankMa7fazty", "applePay", "audi2pay", "bankAccount", "card", "cibSmartWallet", "easypaisa", "etisalatCash", "fawryMobileWallet", "fawryPay", "googlePay", "jazzCash", "nbePhoneCash", "orangeCash", "payPal", "qnbEWallet", "weCash", "genericRedirect", "alfa", "konnect", "eftPro", "netBanking", "upi", "cashFreeWallet", "paytmWallet", "phonePe"]), status: z.enum(["created", "deleted", "enabled", "disabled", "transient"]), displayName: z.string().optional(), description: z.string().optional(), default: z.boolean().nullable().optional(), merchantReference: z.string().optional(), fingerprint: z.string().optional(), futureUsage: z.enum(["Subscription", "CardOnFile", "UnscheduledCardOnFile"]).optional(), networkTransactionReference: z.string().optional(), data: z.union([z.object({network: z.enum(["unspecified", "visa", "visadankort", "mastercard", "amex", "diners", "discover", "unionpay", "unionpayuzcard", "maestro", "maestrobancontact", "hipercard", "jcb", "jcblankapay", "argencard", "aura", "belkart", "bpfuelcard", "cabal", "carnet", "cirrus", "chjonesfuelcard", "uzcard", "codensa", "dankort", "dinacard", "duet", "ebt", "eftpos", "elo", "euroshellfuelcard", "gecapital", "bc", "hrgstore", "humo", "lankapay", "lukoilfuelcard", "bancontact", "meeza", "newday", "mir", "ourocard", "pagobancomat", "paypak", "paypal", "phhfuelcard", "prostir", "rupay", "sbercard", "sodexo", "starrewards", "cencosud", "naranja", "troy", "uatp", "ukfuelcard", "verve", "voyager", "vpay", "wex", "cmi", "atm", "bankcard", "localbrand", "loyalty", "privatelabel", "fuelcard", "redfuelcard", "redliquidfuelcard"]), preferredScheme: z.enum(["unspecified", "visa", "visadankort", "mastercard", "amex", "diners", "discover", "unionpay", "unionpayuzcard", "maestro", "maestrobancontact", "hipercard", "jcb", "jcblankapay", "argencard", "aura", "belkart", "bpfuelcard", "cabal", "carnet", "cirrus", "chjonesfuelcard", "uzcard", "codensa", "dankort", "dinacard", "duet", "ebt", "eftpos", "elo", "euroshellfuelcard", "gecapital", "bc", "hrgstore", "humo", "lankapay", "lukoilfuelcard", "bancontact", "meeza", "newday", "mir", "ourocard", "pagobancomat", "paypak", "paypal", "phhfuelcard", "prostir", "rupay", "sbercard", "sodexo", "starrewards", "cencosud", "naranja", "troy", "uatp", "ukfuelcard", "verve", "voyager", "vpay", "wex", "cmi", "atm", "bankcard", "localbrand", "loyalty", "privatelabel", "fuelcard", "redfuelcard", "redliquidfuelcard"]).optional(), bin: z.string().min(6).max(8), binLookup: z.object({bin: z.string().min(6).max(8), network: z.enum(["unspecified", "visa", "visadankort", "mastercard", "amex", "diners", "discover", "unionpay", "unionpayuzcard", "maestro", "maestrobancontact", "hipercard", "jcb", "jcblankapay", "argencard", "aura", "belkart", "bpfuelcard", "cabal", "carnet", "cirrus", "chjonesfuelcard", "uzcard", "codensa", "dankort", "dinacard", "duet", "ebt", "eftpos", "elo", "euroshellfuelcard", "gecapital", "bc", "hrgstore", "humo", "lankapay", "lukoilfuelcard", "bancontact", "meeza", "newday", "mir", "ourocard", "pagobancomat", "paypak", "paypal", "phhfuelcard", "prostir", "rupay", "sbercard", "sodexo", "starrewards", "cencosud", "naranja", "troy", "uatp", "ukfuelcard", "verve", "voyager", "vpay", "wex", "cmi", "atm", "bankcard", "localbrand", "loyalty", "privatelabel", "fuelcard", "redfuelcard", "redliquidfuelcard"]).optional(), localNetwork: z.enum(["bancontact", "cartesbancaires", "dankort", "mada"]).optional(), issuer: z.string().optional(), issuerCountry: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), segment: z.string().optional(), type: z.string().optional(), typeDetails: z.string().optional(), isNetworkToken: z.boolean().optional(), isFlexCard: z.boolean().optional()}).optional(), billingAddress: z.object({street: z.string().optional(), doorNumber: z.string().optional(), complement: z.string().optional(), area: z.string().optional(), city: z.string().optional(), postalCode: z.string().optional(), state: z.string().optional(), country: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), latitude: z.number().optional(), longitude: z.number().optional(), phone: z.object({countryCode: z.string().optional(), number: z.string()}).optional(), alias: z.string().optional(), name: z.string().optional(), lastName: z.string().optional(), email: z.string().optional()}).optional(), suffix: z.string().min(4).max(4), expiryMonth: z.string().min(2).max(2).optional(), expiryYear: z.string().min(4).max(4).optional(), holderName: z.string().optional()}), z.object({holder: z.object({firstName: z.string().optional(), lastName: z.string().optional(), companyName: z.string().optional(), address: z.object({street: z.string().optional(), doorNumber: z.string().optional(), complement: z.string().optional(), area: z.string().optional(), city: z.string().optional(), postalCode: z.string().optional(), state: z.string().optional(), country: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), latitude: z.number().optional(), longitude: z.number().optional(), phone: z.object({countryCode: z.string().optional(), number: z.string()}).optional(), alias: z.string().optional(), name: z.string().optional(), lastName: z.string().optional(), email: z.string().optional()}).optional(), email: z.string().optional(), dob: z.string().optional(), country: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), city: z.string().optional(), type: z.enum(["individual", "corporate"]).optional()}).optional(), bank: z.object({name: z.string().optional(), branchCode: z.string().optional(), code: z.string().optional(), address: z.object({street: z.string().optional(), doorNumber: z.string().optional(), complement: z.string().optional(), area: z.string().optional(), city: z.string().optional(), postalCode: z.string().optional(), state: z.string().optional(), country: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), latitude: z.number().optional(), longitude: z.number().optional(), phone: z.object({countryCode: z.string().optional(), number: z.string()}).optional(), alias: z.string().optional(), name: z.string().optional(), lastName: z.string().optional(), email: z.string().optional()}).optional(), swiftCode: z.string().optional()}).optional(), account: z.object({number: z.string().optional(), iban: z.string().optional(), currency: z.string().optional(), country: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), type: z.enum(["savings", "current"]).optional()}).optional()}), z.object({email: z.string().optional(), payerId: z.string().optional(), billingAddress: z.object({street: z.string().optional(), doorNumber: z.string().optional(), complement: z.string().optional(), area: z.string().optional(), city: z.string().optional(), postalCode: z.string().optional(), state: z.string().optional(), country: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), latitude: z.number().optional(), longitude: z.number().optional(), phone: z.object({countryCode: z.string().optional(), number: z.string()}).optional(), alias: z.string().optional(), name: z.string().optional(), lastName: z.string().optional(), email: z.string().optional()}).optional()}), z.object({network: z.enum(["unspecified", "visa", "visadankort", "mastercard", "amex", "diners", "discover", "unionpay", "unionpayuzcard", "maestro", "maestrobancontact", "hipercard", "jcb", "jcblankapay", "argencard", "aura", "belkart", "bpfuelcard", "cabal", "carnet", "cirrus", "chjonesfuelcard", "uzcard", "codensa", "dankort", "dinacard", "duet", "ebt", "eftpos", "elo", "euroshellfuelcard", "gecapital", "bc", "hrgstore", "humo", "lankapay", "lukoilfuelcard", "bancontact", "meeza", "newday", "mir", "ourocard", "pagobancomat", "paypak", "paypal", "phhfuelcard", "prostir", "rupay", "sbercard", "sodexo", "starrewards", "cencosud", "naranja", "troy", "uatp", "ukfuelcard", "verve", "voyager", "vpay", "wex", "cmi", "atm", "bankcard", "localbrand", "loyalty", "privatelabel", "fuelcard", "redfuelcard", "redliquidfuelcard"]), networkDisplayName: z.string().optional(), binLookup: z.object({network: z.enum(["unspecified", "visa", "visadankort", "mastercard", "amex", "diners", "discover", "unionpay", "unionpayuzcard", "maestro", "maestrobancontact", "hipercard", "jcb", "jcblankapay", "argencard", "aura", "belkart", "bpfuelcard", "cabal", "carnet", "cirrus", "chjonesfuelcard", "uzcard", "codensa", "dankort", "dinacard", "duet", "ebt", "eftpos", "elo", "euroshellfuelcard", "gecapital", "bc", "hrgstore", "humo", "lankapay", "lukoilfuelcard", "bancontact", "meeza", "newday", "mir", "ourocard", "pagobancomat", "paypak", "paypal", "phhfuelcard", "prostir", "rupay", "sbercard", "sodexo", "starrewards", "cencosud", "naranja", "troy", "uatp", "ukfuelcard", "verve", "voyager", "vpay", "wex", "cmi", "atm", "bankcard", "localbrand", "loyalty", "privatelabel", "fuelcard", "redfuelcard", "redliquidfuelcard"]).optional(), localNetwork: z.enum(["bancontact", "cartesbancaires", "dankort", "mada"]).optional(), issuer: z.string().optional(), issuerCountry: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), segment: z.string().optional(), type: z.string().optional(), typeDetails: z.string().optional(), isNetworkToken: z.boolean().optional(), isFlexCard: z.boolean().optional()}).optional(), billingAddress: z.object({street: z.string().optional(), doorNumber: z.string().optional(), complement: z.string().optional(), area: z.string().optional(), city: z.string().optional(), postalCode: z.string().optional(), state: z.string().optional(), country: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), latitude: z.number().optional(), longitude: z.number().optional(), phone: z.object({countryCode: z.string().optional(), number: z.string()}).optional(), alias: z.string().optional(), name: z.string().optional(), lastName: z.string().optional(), email: z.string().optional()}).optional(), suffix: z.string().min(4).max(4), expiryMonth: z.string().min(2).max(2).optional(), expiryYear: z.string().min(4).max(4).optional(), paymentToken: z.string().optional(), eci: z.string().optional(), cardHolderAuthenticated: z.boolean().optional(), googleMessageId: z.string().optional(), googleMessageExpirationId: z.string().optional()}), z.object({network: z.enum(["unspecified", "visa", "visadankort", "mastercard", "amex", "diners", "discover", "unionpay", "unionpayuzcard", "maestro", "maestrobancontact", "hipercard", "jcb", "jcblankapay", "argencard", "aura", "belkart", "bpfuelcard", "cabal", "carnet", "cirrus", "chjonesfuelcard", "uzcard", "codensa", "dankort", "dinacard", "duet", "ebt", "eftpos", "elo", "euroshellfuelcard", "gecapital", "bc", "hrgstore", "humo", "lankapay", "lukoilfuelcard", "bancontact", "meeza", "newday", "mir", "ourocard", "pagobancomat", "paypak", "paypal", "phhfuelcard", "prostir", "rupay", "sbercard", "sodexo", "starrewards", "cencosud", "naranja", "troy", "uatp", "ukfuelcard", "verve", "voyager", "vpay", "wex", "cmi", "atm", "bankcard", "localbrand", "loyalty", "privatelabel", "fuelcard", "redfuelcard", "redliquidfuelcard"]), networkDisplayName: z.string().optional(), binLookup: z.object({network: z.enum(["unspecified", "visa", "visadankort", "mastercard", "amex", "diners", "discover", "unionpay", "unionpayuzcard", "maestro", "maestrobancontact", "hipercard", "jcb", "jcblankapay", "argencard", "aura", "belkart", "bpfuelcard", "cabal", "carnet", "cirrus", "chjonesfuelcard", "uzcard", "codensa", "dankort", "dinacard", "duet", "ebt", "eftpos", "elo", "euroshellfuelcard", "gecapital", "bc", "hrgstore", "humo", "lankapay", "lukoilfuelcard", "bancontact", "meeza", "newday", "mir", "ourocard", "pagobancomat", "paypak", "paypal", "phhfuelcard", "prostir", "rupay", "sbercard", "sodexo", "starrewards", "cencosud", "naranja", "troy", "uatp", "ukfuelcard", "verve", "voyager", "vpay", "wex", "cmi", "atm", "bankcard", "localbrand", "loyalty", "privatelabel", "fuelcard", "redfuelcard", "redliquidfuelcard"]).optional(), localNetwork: z.enum(["bancontact", "cartesbancaires", "dankort", "mada"]).optional(), issuer: z.string().optional(), issuerCountry: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), segment: z.string().optional(), type: z.string().optional(), typeDetails: z.string().optional(), isNetworkToken: z.boolean().optional(), isFlexCard: z.boolean().optional()}).optional(), billingAddress: z.object({street: z.string().optional(), doorNumber: z.string().optional(), complement: z.string().optional(), area: z.string().optional(), city: z.string().optional(), postalCode: z.string().optional(), state: z.string().optional(), country: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), latitude: z.number().optional(), longitude: z.number().optional(), phone: z.object({countryCode: z.string().optional(), number: z.string()}).optional(), alias: z.string().optional(), name: z.string().optional(), lastName: z.string().optional(), email: z.string().optional()}).optional(), suffix: z.string().min(4).max(4), expiryMonth: z.string().min(2).max(2).optional(), expiryYear: z.string().min(4).max(4).optional(), paymentToken: z.string().optional(), eci: z.string().optional(), cardHolderAuthenticated: z.boolean().optional()}), z.object({msisdn: z.string().optional(), msisdnTail: z.string().optional(), country: z.object({code: z.string(), iso3: z.string().optional(), name: z.string().optional()}).optional(), carrierNetwork: z.string().optional()})]).optional(), tokens: z.array(z.object({id: z.string(), createdAt: z.string(), updatedAt: z.string(), instrumentId: z.string(), status: z.enum(["created", "enabled", "disabled", "deleted"]), type: z.enum(["network", "vault", "psp", "networkOffers", "networkGateway"]), providerId: z.string(), providerConfigId: z.string().optional(), reference: z.string(), meta: z.record(z.string(), z.unknown()).optional()})).optional()})).optional(), clientConfig: z.object({displayName: z.string().optional(), supportsSaveInstrument: z.boolean().optional(), supportsBillingInfo: z.boolean().optional(), flow: z.string().optional(), additionalConfig: z.object({}).optional(), instrumentDataSchema: z.object({}).optional()}).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 }; /** * Lookup payment options * * POST /merchant/workflows/{workflowCode}/executions/{executionId}/lookup */ export const createApiMerchantWorkflowsWorkflowCodeExecutionsExecutionIdLookup = async (args: CreateApiMerchantWorkflowsWorkflowCodeExecutionsExecutionIdLookupArgs, options?: CreateApiMerchantWorkflowsWorkflowCodeExecutionsExecutionIdLookupOptions) => { const {baseUrl = "https://api.staging.payrails.io", fetch: fetchFn = fetch, BearerToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args['x-idempotency-key'] != null) headers.set("x-idempotency-key", String(args['x-idempotency-key'])) if (BearerToken !== undefined) headers.set('authorization', `Bearer ${BearerToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/merchant/workflows/${encodeURIComponent(String(args.workflowCode))}/executions/${encodeURIComponent(String(args.executionId))}/lookup${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(createApiMerchantWorkflowsWorkflowCodeExecutionsExecutionIdLookupResponse, await res.json()) };