export type CreateApiApiV1UsersUserIdDisclosuresKycArgs = {userId: string, 'Client-ID': string, Authorization: string}; export type CreateApiApiV1UsersUserIdDisclosuresKycOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Accept KYC Disclosure Documents * * POST /api/v1/users/:userId/disclosures/kyc */ export const createApiApiV1UsersUserIdDisclosuresKyc = async (args: CreateApiApiV1UsersUserIdDisclosuresKycArgs, options?: CreateApiApiV1UsersUserIdDisclosuresKycOptions) => { const {baseUrl = "https://merchant-api.accruesavings.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Client-ID'] != null) headers.set("Client-ID", String(args['Client-ID'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/users/:userId/disclosures/kyc${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 };