export type CreateApiOnboardingCustomersCustomerIdSubmitArgs = {customerId: string}; export type CreateApiOnboardingCustomersCustomerIdSubmitOptions = {baseUrl?: string | undefined, ApiAccessKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Submit a completed customer onboarding application * * POST /onboarding/customers/{customerId}/submit */ export const createApiOnboardingCustomersCustomerIdSubmit = async (args: CreateApiOnboardingCustomersCustomerIdSubmitArgs, options?: CreateApiOnboardingCustomersCustomerIdSubmitOptions) => { const {baseUrl = "https://api.anchorage-staging.com/v2", fetch: fetchFn = fetch, ApiAccessKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiAccessKey !== undefined) headers.set("Api-Access-Key", ApiAccessKey) const url = `${baseUrl.replace(/\/+$/, '')}/onboarding/customers/${encodeURIComponent(String(args.customerId))}/submit${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 };