export type CreateApiV1ShopsShopIdAffiliatesCustomerIdSuspendOptions = {baseUrl?: string | undefined, defaultValue?: string | undefined, fetch?: typeof fetch | undefined}; /** * Suspend Affiliate * * POST /v1/shops/{shopId}/affiliates/{customerId}/suspend */ export const createApiV1ShopsShopIdAffiliatesCustomerIdSuspend = async (options?: CreateApiV1ShopsShopIdAffiliatesCustomerIdSuspendOptions) => { const {baseUrl = "https://api.sellauth.com", fetch: fetchFn = fetch, defaultValue} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (defaultValue !== undefined) headers.set('authorization', `Bearer ${defaultValue}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/shops/${encodeURIComponent(String(args.shopId))}/affiliates/${encodeURIComponent(String(args.customerId))}/suspend${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 };