export type OnboardingCurrency = 'usd' | 'eur' | 'gbp' | 'aed'; export type CreateApiV1CustomersCustomerIdOnboardingCurrencyArgs = {customer_id: string, currency: OnboardingCurrency}; export type CreateApiV1CustomersCustomerIdOnboardingCurrencyOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Onboard a customer for a specific currency * * POST /v1/customers/{customer_id}/onboarding/{currency} */ export const createApiV1CustomersCustomerIdOnboardingCurrency = async (args: CreateApiV1CustomersCustomerIdOnboardingCurrencyArgs, options?: CreateApiV1CustomersCustomerIdOnboardingCurrencyOptions) => { const {baseUrl = "https://auth-sandbox.fuse.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/customers/${encodeURIComponent(String(args.customer_id))}/onboarding/${encodeURIComponent(String(args.currency))}${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 };