export type DeleteApiV2TenantSlugEnduseraccountsWebsiteAccountIdArgs = {tenant_slug: string, website_account_id: string}; export type DeleteApiV2TenantSlugEnduseraccountsWebsiteAccountIdOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an end-user account * * DELETE /v2/{tenant_slug}/enduseraccounts/{website_account_id} */ export const deleteApiV2TenantSlugEnduseraccountsWebsiteAccountId = async (args: DeleteApiV2TenantSlugEnduseraccountsWebsiteAccountIdArgs, options?: DeleteApiV2TenantSlugEnduseraccountsWebsiteAccountIdOptions) => { const {baseUrl = "https://api.demo-retail.urbanfox.io", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/${encodeURIComponent(String(args.tenant_slug))}/enduseraccounts/${encodeURIComponent(String(args.website_account_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };