export type CreateApiTerminalsIdIdentifyArgs = {id: string, Authorization: string}; export type CreateApiTerminalsIdIdentifyOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Identify Terminal * * POST /terminals/{id}/identify */ export const createApiTerminalsIdIdentify = async (args: CreateApiTerminalsIdIdentifyArgs, options?: CreateApiTerminalsIdIdentifyOptions) => { const {baseUrl = "https://api.justifi.ai/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/terminals/${encodeURIComponent(String(args.id))}/identify${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };