export type GetApiGetglobaladdressmatchArgs = {address: string}; export type GetApiGetglobaladdressmatchOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * International address matching: generates an AI-powered similarity key for a global address in any country's format, so variations of the same address produce the same key. Group on the key to deduplicate international customer, supplier, and location records. * * GET /getglobaladdressmatch */ export const getApiGetglobaladdressmatch = async (args: GetApiGetglobaladdressmatchArgs, options?: GetApiGetglobaladdressmatchOptions) => { const {baseUrl = "https://api.interzoid.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.address != null) query.append("address", String(args.address)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/getglobaladdressmatch${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 };