import {z} from 'zod' export type GetApiActivityTypeIdArgs = {type: 'transaction' | 'payment' | 'order' | 'boxTransaction', id: string, accountId: string, include?: ('bankFeedDetails' | 'annotations' | 'attachments' | 'forwardDetails' | 'swiftGpi' | Array<'bankFeedDetails' | 'annotations' | 'attachments' | 'forwardDetails' | 'swiftGpi'>) | undefined, personId?: (string | Array) | undefined}; export type GetApiActivityTypeIdOptions = {baseUrl?: string | undefined, CommonAuth?: string | undefined, fetch?: typeof fetch | undefined}; export const getApiActivityTypeIdResponse = z.union([z.object({resourceType: z.enum(["payment", "currencyPurchase"]), id: z.number().int(), orderId: z.number().int(), userId: z.string().max(36).nullable(), companyId: z.string().max(36), originId: z.string().max(36), originOrderId: z.string().max(36), budgetId: z.string().max(36), status: z.enum(["needsApproval", "fundsRequired", "pending", "complete", "declined", "reverted", "refunded", "cancelled", "open", "cardCheck", "fundsSettled"]), isMultiBeneficiary: z.boolean(), budget: z.literal("companyBalance").optional(), beneficiaryId: z.string().max(256), beneficiaryName: z.string().max(256), beneficiaryAddress: z.string(), beneficiaryAccountNumber: z.string().max(32), beneficiarySortCode: z.string().max(32), beneficiaryIban: z.string().max(34), beneficiaryBankCode: z.string().max(256), beneficiaryBankAddress: z.string(), beneficiaryCountryCode: z.string(), beneficiaryRoutingInfo: z.string(), remitterName: z.string().max(256).nullable(), reference: z.string(), amount: z.number(), currency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), sellCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]).nullable(), buyCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]).nullable(), settlementAmount: z.number().nullable(), settlementFee: z.number().nullable(), settlementAmountWithoutFee: z.number().nullable(), customerRate: z.number().nullable(), customerInverseRate: z.number().nullable(), confirmationKey: z.string().nullable(), uniqueId: z.string().max(256), type: z.enum(["exchange", "payment", "cardPayment", "deposit", "forwardContract", "drawdown", "load", "fee"]).nullable(), order: z.object({id: z.number().int(), companyId: z.string().max(36), events: z.array(z.unknown()).optional(), originId: z.string().max(36), status: z.string().max(25), type: z.string().max(25), userId: z.string().max(36).nullable(), userName: z.string().max(256).nullable(), lastSourceEventDatetime: z.string().nullable(), orderSource: z.string().nullable(), parentOriginId: z.string().nullable(), settlementDate: z.string().nullable(), initiator: z.string().nullable().optional(), createdAt: z.string(), updatedAt: z.string(), metadata: z.record(z.string(), z.string()).optional()}), deleted: z.boolean().nullable().optional(), budgetName: z.string(), transactionGroupId: z.string().nullable(), transactionBoxes: z.array(z.object({id: z.string(), accountId: z.string(), budgetId: z.string().max(36), transactionId: z.string().nullable(), transactionBoxableId: z.string(), transactionBoxableType: z.string(), paymentId: z.number().int().nullable(), orderId: z.string(), eventSource: z.string(), chargeBearer: z.string().nullable(), blockId: z.string().nullable(), blockTag: z.string().nullable(), blockFriendlyId: z.string().max(36).nullable(), paymentType: z.string().nullable(), creditDebitIndicator: z.enum(["Debit", "Credit"]).nullable(), thirdPartyReference: z.string().max(50).nullable(), internalAccountTransferId: z.string().nullable().optional(), affectsLedgerBalance: z.boolean().nullable().optional(), isCurrencyAlignment: z.boolean().nullable().optional(), runningBalance: z.string().nullable().optional(), transactionReference: z.string().nullable().optional(), statementReference: z.string().nullable().optional(), debtorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), creditorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), fx: z.object({sourceCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), sourceAmount: z.string(), destinationCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), destinationAmount: z.string(), rate: z.string()}).nullable().optional(), debitId: z.number().nullable().optional(), creditId: z.number().nullable().optional(), boxTransactionId: z.number().nullable().optional(), budget: z.object({accountId: z.string(), budgetId: z.string().max(36), budgetName: z.string().nullable(), boxId: z.string().max(36).nullable()}).nullable().optional(), type: z.enum(["credit", "debit", "block", "internalPayment"]).nullable(), marqetaTransactionToken: z.string().max(50).nullable(), boxId: z.string().max(36).nullable(), marqetaTransactionIdentifier: z.string().nullable(), directDebitId: z.string().max(36).nullable().optional(), amount: z.number().nullable(), currency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]).nullable(), valueDateTime: z.string().nullable(), bankFeedTransactions: z.array(z.unknown()).optional(), transactionCreditorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), transactionDebtorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), createdAt: z.string(), updatedAt: z.string()})), annotationGroup: z.object({id: z.string(), accountId: z.string(), transactionGroupId: z.string().nullable(), paymentId: z.number().nullable(), status: z.enum(["approved", "draft", "exported", "submitted"]), annotations: z.array(z.object({id: z.string(), annotationGroupId: z.string(), accountId: z.string(), amount: z.number(), annotationValues: z.array(z.unknown()), createdBy: z.string().nullable(), updatedBy: z.string().nullable(), createdAt: z.string(), updatedAt: z.string()})), createdAt: z.string().nullable().optional(), updatedAt: z.string().nullable().optional()}).nullable().optional(), attachment: z.object({id: z.string(), accountId: z.string(), isLost: z.boolean(), note: z.string().max(280).nullable(), transactionGroupId: z.string().nullable(), paymentId: z.number().nullable(), count: z.number().int().gte(0).lte(255), attachmentFiles: z.array(z.object({id: z.string(), accountId: z.string(), attachmentId: z.string(), productId: z.string().max(36), fileName: z.string().max(256), year: z.string().min(4).max(4), month: z.string().min(1).max(2), file: z.union([z.boolean().nullable(), z.object({url: z.string().nullable(), unavailable: z.boolean().nullable()})]).optional(), type: z.enum(["heic", "pdf", "jpg", "jpeg", "png"]).nullable(), createdBy: z.string(), updatedBy: z.string(), createdAt: z.string().nullable(), updatedAt: z.string().nullable()})), createdAt: z.string().nullable().optional(), updatedAt: z.string().nullable().optional()}).nullable().optional(), forwardDetails: z.object({payments: z.array(z.unknown()), events: z.array(z.unknown()), currencyPurchases: z.array(z.unknown()), deposits: z.array(z.unknown()), drawdowns: z.array(z.unknown())}).nullable().optional(), swiftGpi: z.object({uetr: z.string(), status: z.enum(["UNK", "ACSP", "PDNG", "ACCC", "ACSC", "RJCT", "CANC", "ACWC", "ACWP", "BLCK", "INVA", "WARN"]), initiatedAt: z.string().nullable(), lastUpdatedAt: z.string().nullable(), instructedAmount: z.string().max(32).nullable(), instructedCurrencyCode: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]).nullable(), events: z.array(z.object({trackerEventType: z.string().max(4), fromBankIdentifier: z.string().max(11).nullable(), toBankIdentifier: z.string().max(11).nullable(), status: z.enum(["UNK", "ACSP", "PDNG", "ACCC", "ACSC", "RJCT", "CANC", "ACWC", "ACWP", "BLCK"]), amount: z.string().max(32).nullable(), currencyCode: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]).nullable(), eventTimestamp: z.string()}))}).nullable().optional(), teams: z.union([z.string(), z.array(z.string())]).optional(), createdAt: z.string(), updatedAt: z.string()}), z.object({resourceType: z.literal("card").optional(), id: z.string(), accountId: z.string(), transactionDate: z.string(), cardTransaction: z.object({id: z.string().optional(), identifier: z.number().nullable(), localAmount: z.number().nullable(), localAmountCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), feeAmount: z.number().nullable(), feeCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]).nullable(), exchangeRate: z.number().nullable(), exchangeRateInverse: z.number().nullable(), total: z.number().nullable(), cardId: z.string(), cardProductToken: z.string().nullable(), cardType: z.enum(["VIRTUAL_PAN", "PHYSICAL_MSR", "PHYSICAL_COMBO"]), cardLastDigits: z.string(), status: z.enum(["pending", "complete", "declined", "reverted", "unknown"]), type: z.enum(["card", "cardCheck", "cardRefund", "cashWithdrawal", "fee", "unknown"]), approvalCode: z.number().nullable(), acquirerInstitutionIdCode: z.string().nullable(), acquirerReferenceNumber: z.string().nullable(), cardName: z.string().max(75), chargedAmount: z.number().nullable(), chargedTotalAmount: z.number().nullable(), chargedCurrency: z.string().max(3).nullable(), baseCurrency: z.string().max(3).optional(), paymentChannel: z.string().optional(), pos: z.object({cardDataInputCapability: z.string().optional(), cardHolderPresence: z.boolean().optional(), cardPresence: z.boolean().optional(), cardholderAuthenticationMethod: z.string().optional()}).optional(), precedingRelatedTransactionToken: z.string().optional(), runningBalance: z.string().optional(), settlementAmount: z.number().optional(), settlementAmountCurrency: z.string().max(3).optional(), transactionId: z.string().optional(), transactionType: z.string().optional(), response: z.object({code: z.string().max(10).nullable(), memo: z.string().max(256).nullable()}).optional(), transactionCompletedAt: z.string().nullable(), transactionCreatedAt: z.string(), transactionToken: z.string().max(50).nullable(), boxesResponse: z.string().max(256).nullable(), updatedAtBoxTransaction: z.string().optional(), createdAt: z.string().optional(), updatedAt: z.string().optional()}), transactionGroup: z.object({id: z.string(), accountId: z.string(), personId: z.string().max(36).nullable(), budgetId: z.string().max(36), firstName: z.string().nullable(), lastName: z.string().nullable(), budgetName: z.string(), createdAt: z.string(), updatedAt: z.string(), annotationGroup: z.object({id: z.string(), accountId: z.string(), transactionGroupId: z.string().nullable(), paymentId: z.number().nullable(), status: z.enum(["approved", "draft", "exported", "submitted"]), annotations: z.array(z.object({id: z.string(), annotationGroupId: z.string(), accountId: z.string(), amount: z.number(), annotationValues: z.array(z.unknown()), createdBy: z.string().nullable(), updatedBy: z.string().nullable(), createdAt: z.string(), updatedAt: z.string()})), createdAt: z.string().nullable().optional(), updatedAt: z.string().nullable().optional()}).nullable().optional(), attachment: z.object({id: z.string(), accountId: z.string(), isLost: z.boolean(), note: z.string().max(280).nullable(), transactionGroupId: z.string().nullable(), paymentId: z.number().nullable(), count: z.number().int().gte(0).lte(255), attachmentFiles: z.array(z.object({id: z.string(), accountId: z.string(), attachmentId: z.string(), productId: z.string().max(36), fileName: z.string().max(256), year: z.string().min(4).max(4), month: z.string().min(1).max(2), file: z.union([z.boolean().nullable(), z.object({url: z.string().nullable(), unavailable: z.boolean().nullable()})]).optional(), type: z.enum(["heic", "pdf", "jpg", "jpeg", "png"]).nullable(), createdBy: z.string(), updatedBy: z.string(), createdAt: z.string().nullable(), updatedAt: z.string().nullable()})), createdAt: z.string().nullable().optional(), updatedAt: z.string().nullable().optional()}).nullable().optional(), bankFeedTransactions: z.array(z.unknown()).optional(), totals: z.object({authorised: z.number().optional(), settled: z.number().optional()}).optional()}).optional(), transactionBox: z.object({id: z.string(), accountId: z.string(), budgetId: z.string().max(36), transactionId: z.string().nullable(), transactionBoxableId: z.string(), transactionBoxableType: z.string(), paymentId: z.number().int().nullable(), orderId: z.string(), eventSource: z.string(), chargeBearer: z.string().nullable(), blockId: z.string().nullable(), blockTag: z.string().nullable(), blockFriendlyId: z.string().max(36).nullable(), paymentType: z.string().nullable(), creditDebitIndicator: z.enum(["Debit", "Credit"]).nullable(), thirdPartyReference: z.string().max(50).nullable(), internalAccountTransferId: z.string().nullable().optional(), affectsLedgerBalance: z.boolean().nullable().optional(), isCurrencyAlignment: z.boolean().nullable().optional(), runningBalance: z.string().nullable().optional(), transactionReference: z.string().nullable().optional(), statementReference: z.string().nullable().optional(), debtorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), creditorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), fx: z.object({sourceCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), sourceAmount: z.string(), destinationCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), destinationAmount: z.string(), rate: z.string()}).nullable().optional(), debitId: z.number().nullable().optional(), creditId: z.number().nullable().optional(), boxTransactionId: z.number().nullable().optional(), budget: z.object({accountId: z.string(), budgetId: z.string().max(36), budgetName: z.string().nullable(), boxId: z.string().max(36).nullable()}).nullable().optional(), type: z.enum(["credit", "debit", "block", "internalPayment"]).nullable(), marqetaTransactionToken: z.string().max(50).nullable(), boxId: z.string().max(36).nullable(), marqetaTransactionIdentifier: z.string().nullable(), directDebitId: z.string().max(36).nullable().optional(), amount: z.number().nullable(), currency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]).nullable(), valueDateTime: z.string().nullable(), bankFeedTransactions: z.array(z.unknown()).optional(), transactionCreditorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), transactionDebtorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), createdAt: z.string(), updatedAt: z.string()}).nullable().optional(), merchant: z.object({id: z.string().optional(), name: z.string().nullable(), description: z.string().nullable(), address: z.string().nullable(), city: z.string().nullable(), state: z.string().nullable(), postalCode: z.string().nullable(), countryCode: z.string().nullable(), merchantCategoryId: z.string().nullable(), mid: z.string().nullable(), subMerchantId: z.string().nullable(), website: z.string().nullable(), emoji: z.string().optional(), logo: z.string().optional(), notes: z.string().optional(), originalName: z.string().optional(), merchantCategory: z.object({id: z.string().optional(), code: z.string().nullable(), description: z.string().optional(), createdAt: z.string().optional(), updatedAt: z.string().optional()}), createdAt: z.string().optional(), updatedAt: z.string().optional()}).optional(), paymentChannel: z.string().nullable().optional(), status: z.enum(["needsApproval", "fundsRequired", "pending", "complete", "declined", "reverted", "refunded", "cancelled", "open", "cardCheck", "fundsSettled"]), sourceGroupId: z.string(), transactionGroupId: z.string(), transactionType: z.string(), initiator: z.record(z.string(), z.unknown()).nullable(), createdAt: z.string(), updatedAt: z.string()}), z.object({resourceType: z.literal("currencyPurchase"), id: z.number().int().nullable().optional(), userId: z.string().nullable(), companyId: z.string().max(36), originOrderId: z.string().max(36).nullable(), status: z.enum(["needsApproval", "fundsRequired", "pending", "complete", "declined", "reverted", "refunded", "cancelled", "open", "cardCheck", "fundsSettled"]), sellCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), buyAmount: z.number().optional(), buyCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), settlementAmountWithoutFee: z.number().nullable(), settlementAmount: z.number().nullable(), settlementFee: z.number().nullable(), settlementDate: z.string().nullable().optional(), remainingBalance: z.number().nullable().optional(), depositPercentage: z.number().nullable().optional(), depositAmountRequired: z.number().nullable().optional(), depositSettlementDate: z.string().nullable().optional(), customerSpread: z.string().max(256).optional(), customerRate: z.number().nullable(), customerInverseRate: z.number().nullable(), confirmationKey: z.string().nullable(), budget: z.literal("companyBalance").optional(), type: z.enum(["exchange", "payment", "deposit", "forwardContract", "drawdown", "load", "fee"]).nullable(), fundsSource: z.enum(["balance", "bank", "boxes_funds_held", "cash", "accounts receivable", "card", "cheque", "internal funds transfer"]).nullable().optional(), fundsDestination: z.enum(["balance", "payment", "multiple", "unknown", "forward", "fee"]).nullable().optional(), bankEntity: z.enum(["BARC", "CITI", "RBS", "CROWN", "BARCEU"]).nullable().optional(), orderId: z.number().int(), order: z.object({id: z.number().int(), companyId: z.string().max(36), events: z.array(z.unknown()).optional(), originId: z.string().max(36), status: z.string().max(25), type: z.string().max(25), userId: z.string().max(36).nullable(), userName: z.string().max(256).nullable(), lastSourceEventDatetime: z.string().nullable(), orderSource: z.string().nullable(), parentOriginId: z.string().nullable(), settlementDate: z.string().nullable(), initiator: z.string().nullable().optional(), createdAt: z.string(), updatedAt: z.string(), metadata: z.record(z.string(), z.string()).optional()}), depositCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), depositStatus: z.string().max(25).optional(), fundsRequired: z.number().optional(), forwardDetails: z.object({payments: z.array(z.unknown()), events: z.array(z.unknown()), currencyPurchases: z.array(z.unknown()), deposits: z.array(z.unknown()), drawdowns: z.array(z.unknown())}).nullable().optional(), createdAt: z.string(), updatedAt: z.string()}), z.object({resourceType: z.literal("box").optional(), id: z.string(), accountId: z.string(), createdAt: z.string(), updatedAt: z.string(), initiator: z.record(z.string(), z.unknown()).nullable(), sourceGroupId: z.string(), status: z.enum(["needsApproval", "fundsRequired", "pending", "complete", "declined", "reverted", "refunded", "cancelled", "open", "cardCheck", "fundsSettled"]), transactionDate: z.string(), transactionGroup: z.object({id: z.string(), accountId: z.string(), personId: z.string().max(36).nullable(), budgetId: z.string().max(36), firstName: z.string().nullable(), lastName: z.string().nullable(), budgetName: z.string(), createdAt: z.string(), updatedAt: z.string(), annotationGroup: z.object({id: z.string(), accountId: z.string(), transactionGroupId: z.string().nullable(), paymentId: z.number().nullable(), status: z.enum(["approved", "draft", "exported", "submitted"]), annotations: z.array(z.object({id: z.string(), annotationGroupId: z.string(), accountId: z.string(), amount: z.number(), annotationValues: z.array(z.unknown()), createdBy: z.string().nullable(), updatedBy: z.string().nullable(), createdAt: z.string(), updatedAt: z.string()})), createdAt: z.string().nullable().optional(), updatedAt: z.string().nullable().optional()}).nullable().optional(), attachment: z.object({id: z.string(), accountId: z.string(), isLost: z.boolean(), note: z.string().max(280).nullable(), transactionGroupId: z.string().nullable(), paymentId: z.number().nullable(), count: z.number().int().gte(0).lte(255), attachmentFiles: z.array(z.object({id: z.string(), accountId: z.string(), attachmentId: z.string(), productId: z.string().max(36), fileName: z.string().max(256), year: z.string().min(4).max(4), month: z.string().min(1).max(2), file: z.union([z.boolean().nullable(), z.object({url: z.string().nullable(), unavailable: z.boolean().nullable()})]).optional(), type: z.enum(["heic", "pdf", "jpg", "jpeg", "png"]).nullable(), createdBy: z.string(), updatedBy: z.string(), createdAt: z.string().nullable(), updatedAt: z.string().nullable()})), createdAt: z.string().nullable().optional(), updatedAt: z.string().nullable().optional()}).nullable().optional(), bankFeedTransactions: z.array(z.unknown()).optional(), totals: z.object({authorised: z.number().optional(), settled: z.number().optional()}).optional()}).optional(), transactionGroupId: z.string(), transactionType: z.string(), transactionBox: z.object({id: z.string(), accountId: z.string(), budgetId: z.string().max(36), transactionId: z.string().nullable(), transactionBoxableId: z.string(), transactionBoxableType: z.string(), paymentId: z.number().int().nullable(), orderId: z.string(), eventSource: z.string(), chargeBearer: z.string().nullable(), blockId: z.string().nullable(), blockTag: z.string().nullable(), blockFriendlyId: z.string().max(36).nullable(), paymentType: z.string().nullable(), creditDebitIndicator: z.enum(["Debit", "Credit"]).nullable(), thirdPartyReference: z.string().max(50).nullable(), internalAccountTransferId: z.string().nullable().optional(), affectsLedgerBalance: z.boolean().nullable().optional(), isCurrencyAlignment: z.boolean().nullable().optional(), runningBalance: z.string().nullable().optional(), transactionReference: z.string().nullable().optional(), statementReference: z.string().nullable().optional(), debtorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), creditorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), fx: z.object({sourceCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), sourceAmount: z.string(), destinationCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), destinationAmount: z.string(), rate: z.string()}).nullable().optional(), debitId: z.number().nullable().optional(), creditId: z.number().nullable().optional(), boxTransactionId: z.number().nullable().optional(), budget: z.object({accountId: z.string(), budgetId: z.string().max(36), budgetName: z.string().nullable(), boxId: z.string().max(36).nullable()}).nullable().optional(), type: z.enum(["credit", "debit", "block", "internalPayment"]).nullable(), marqetaTransactionToken: z.string().max(50).nullable(), boxId: z.string().max(36).nullable(), marqetaTransactionIdentifier: z.string().nullable(), directDebitId: z.string().max(36).nullable().optional(), amount: z.number().nullable(), currency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]).nullable(), valueDateTime: z.string().nullable(), bankFeedTransactions: z.array(z.unknown()).optional(), transactionCreditorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), transactionDebtorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), createdAt: z.string(), updatedAt: z.string()}).nullable().optional()}), z.object({resourceType: z.literal("bvnk").optional(), id: z.string(), accountId: z.string(), initiator: z.record(z.string(), z.unknown()).nullable(), sourceGroupId: z.string(), status: z.enum(["needsApproval", "fundsRequired", "pending", "complete", "declined", "reverted", "refunded", "cancelled", "open", "cardCheck", "fundsSettled"]), transactionDate: z.string(), transactionGroup: z.object({id: z.string(), accountId: z.string(), personId: z.string().max(36).nullable(), budgetId: z.string().max(36), firstName: z.string().nullable(), lastName: z.string().nullable(), budgetName: z.string(), createdAt: z.string(), updatedAt: z.string(), annotationGroup: z.object({id: z.string(), accountId: z.string(), transactionGroupId: z.string().nullable(), paymentId: z.number().nullable(), status: z.enum(["approved", "draft", "exported", "submitted"]), annotations: z.array(z.object({id: z.string(), annotationGroupId: z.string(), accountId: z.string(), amount: z.number(), annotationValues: z.array(z.unknown()), createdBy: z.string().nullable(), updatedBy: z.string().nullable(), createdAt: z.string(), updatedAt: z.string()})), createdAt: z.string().nullable().optional(), updatedAt: z.string().nullable().optional()}).nullable().optional(), attachment: z.object({id: z.string(), accountId: z.string(), isLost: z.boolean(), note: z.string().max(280).nullable(), transactionGroupId: z.string().nullable(), paymentId: z.number().nullable(), count: z.number().int().gte(0).lte(255), attachmentFiles: z.array(z.object({id: z.string(), accountId: z.string(), attachmentId: z.string(), productId: z.string().max(36), fileName: z.string().max(256), year: z.string().min(4).max(4), month: z.string().min(1).max(2), file: z.union([z.boolean().nullable(), z.object({url: z.string().nullable(), unavailable: z.boolean().nullable()})]).optional(), type: z.enum(["heic", "pdf", "jpg", "jpeg", "png"]).nullable(), createdBy: z.string(), updatedBy: z.string(), createdAt: z.string().nullable(), updatedAt: z.string().nullable()})), createdAt: z.string().nullable().optional(), updatedAt: z.string().nullable().optional()}).nullable().optional(), bankFeedTransactions: z.array(z.unknown()).optional(), totals: z.object({authorised: z.number().optional(), settled: z.number().optional()}).optional()}).optional(), transactionGroupId: z.string(), transactionType: z.string(), transactionBox: z.object({id: z.string(), accountId: z.string(), budgetId: z.string().max(36), transactionId: z.string().nullable(), transactionBoxableId: z.string(), transactionBoxableType: z.string(), paymentId: z.number().int().nullable(), orderId: z.string(), eventSource: z.string(), chargeBearer: z.string().nullable(), blockId: z.string().nullable(), blockTag: z.string().nullable(), blockFriendlyId: z.string().max(36).nullable(), paymentType: z.string().nullable(), creditDebitIndicator: z.enum(["Debit", "Credit"]).nullable(), thirdPartyReference: z.string().max(50).nullable(), internalAccountTransferId: z.string().nullable().optional(), affectsLedgerBalance: z.boolean().nullable().optional(), isCurrencyAlignment: z.boolean().nullable().optional(), runningBalance: z.string().nullable().optional(), transactionReference: z.string().nullable().optional(), statementReference: z.string().nullable().optional(), debtorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), creditorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), fx: z.object({sourceCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), sourceAmount: z.string(), destinationCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), destinationAmount: z.string(), rate: z.string()}).nullable().optional(), debitId: z.number().nullable().optional(), creditId: z.number().nullable().optional(), boxTransactionId: z.number().nullable().optional(), budget: z.object({accountId: z.string(), budgetId: z.string().max(36), budgetName: z.string().nullable(), boxId: z.string().max(36).nullable()}).nullable().optional(), type: z.enum(["credit", "debit", "block", "internalPayment"]).nullable(), marqetaTransactionToken: z.string().max(50).nullable(), boxId: z.string().max(36).nullable(), marqetaTransactionIdentifier: z.string().nullable(), directDebitId: z.string().max(36).nullable().optional(), amount: z.number().nullable(), currency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]).nullable(), valueDateTime: z.string().nullable(), bankFeedTransactions: z.array(z.unknown()).optional(), transactionCreditorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), transactionDebtorAccount: z.object({id: z.string().optional(), ownerId: z.string().max(36).nullable(), accountId: z.string().nullable(), schemeName: z.string().nullable(), identification: z.string().nullable(), name: z.string().nullable(), address: z.string().optional(), institutionAddress: z.string().optional(), institutionBic: z.string().optional(), institutionName: z.string().optional(), transactionBoxId: z.string().optional(), sourceBudgetId: z.string().max(36).nullable().optional(), sourceBudgetName: z.string().max(256).nullable().optional(), destinationBudgetId: z.string().max(36).nullable().optional(), destinationBudgetName: z.string().max(256).nullable().optional()}).nullable().optional(), createdAt: z.string(), updatedAt: z.string()}).nullable().optional(), bvnkTransaction: z.object({id: z.string(), externalId: z.string(), type: z.string(), status: z.string(), chargedAmount: z.number(), chargedCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), chargedTotalAmount: z.number(), localAmount: z.number(), localCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), settlementAmount: z.number(), settlementCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), networkFeeAmount: z.number(), networkFeeCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), partnerFeeAmount: z.number(), partnerFeeCurrency: z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SEK", "SGD", "SHN", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMK", "ZMW", "ZWD"]), exchangeRate: z.number(), exchangeRateInverse: z.number(), runningBalance: z.string(), transactionAt: z.string(), updatedAtBoxTransaction: z.string(), createdAt: z.string(), updatedAt: z.string()}), createdAt: z.string(), updatedAt: z.string()})]); 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 }; /** * Get a single activity by type and ID * * GET /activity/{type}/{id} */ export const getApiActivityTypeId = async (args: GetApiActivityTypeIdArgs, options?: GetApiActivityTypeIdOptions) => { const {baseUrl = "https://api.equalsmoney.com/v2", fetch: fetchFn = fetch, CommonAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.accountId != null) query.append("accountId", String(args.accountId)) if (args.include != null) query.append("include", String(args.include)) if (args.personId != null) query.append("personId", String(args.personId)) if (CommonAuth !== undefined) headers.set("Authorization", CommonAuth) const url = `${baseUrl.replace(/\/+$/, '')}/activity/${encodeURIComponent(String(args.type))}/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(getApiActivityTypeIdResponse, await res.json()) };