export type GetApiApiDepositorderV20DepositsAccountsAccountIdArgs = {version: string, accountId: string, referenceId?: string | undefined, wallet?: string | undefined, amount?: number | undefined, taxId?: string | undefined, taxIdCountry?: ('ALB' | 'AND' | 'ARE' | 'ARG' | 'ARM' | 'AUS' | 'AUT' | 'AZE' | 'BEL' | 'BGR' | 'BHR' | 'BIH' | 'BLR' | 'BOL' | 'BRA' | 'CAN' | 'CHE' | 'CHL' | 'CHN' | 'COL' | 'CRI' | 'CUB' | 'CYP' | 'CZE' | 'DEU' | 'DNK' | 'DOM' | 'ECU' | 'ESP' | 'EST' | 'FIN' | 'FLK' | 'FRA' | 'FRO' | 'GBR' | 'GEO' | 'GRC' | 'GTM' | 'GUF' | 'GUY' | 'HKG' | 'HRV' | 'HUN' | 'IDN' | 'IND' | 'IRL' | 'ISL' | 'ISR' | 'ITA' | 'JPN' | 'KAZ' | 'KOR' | 'LTU' | 'LUX' | 'LVA' | 'MCO' | 'MDA' | 'MEX' | 'MKD' | 'MLT' | 'MNE' | 'MUS' | 'MYS' | 'NGA' | 'NLD' | 'NOR' | 'NZL' | 'PAK' | 'PER' | 'PHL' | 'POL' | 'PRT' | 'PRY' | 'ROU' | 'RUS' | 'SLV' | 'SMR' | 'SRB' | 'SUR' | 'SVK' | 'SVN' | 'SWE' | 'THA' | 'TUR' | 'TWN' | 'UKR' | 'URY' | 'USA' | 'UZB' | 'VEN' | 'ZAF') | undefined, beginDate?: string | undefined, endDate?: string | undefined, status?: string | undefined, transactionId?: string | undefined, externalId?: string | undefined, pageNumber?: number | undefined, pageSize?: number | undefined, Authorization?: string | undefined}; export type GetApiApiDepositorderV20DepositsAccountsAccountIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve Deposit Orders * * GET /api/depositorder/v2.0/deposits/accounts/{accountId} */ export const getApiApiDepositorderV20DepositsAccountsAccountId = async (args: GetApiApiDepositorderV20DepositsAccountsAccountIdArgs, options?: GetApiApiDepositorderV20DepositsAccountsAccountIdOptions) => { const {baseUrl = "https://sandbox-api-baasic.transfero.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.referenceId != null) query.append("referenceId", String(args.referenceId)) if (args.wallet != null) query.append("wallet", String(args.wallet)) if (args.amount != null) query.append("amount", String(args.amount)) if (args.taxId != null) query.append("taxId", String(args.taxId)) if (args.taxIdCountry != null) query.append("taxIdCountry", String(args.taxIdCountry)) if (args.beginDate != null) query.append("beginDate", String(args.beginDate)) if (args.endDate != null) query.append("endDate", String(args.endDate)) if (args.status != null) query.append("status", String(args.status)) if (args.transactionId != null) query.append("transactionId", String(args.transactionId)) if (args.externalId != null) query.append("externalId", String(args.externalId)) if (args.pageNumber != null) query.append("pageNumber", String(args.pageNumber)) if (args.pageSize != null) query.append("pageSize", String(args.pageSize)) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/api/depositorder/v2.0/deposits/accounts/${encodeURIComponent(String(args.accountId))}${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 (await res.json()) as unknown };