export type DeleteApiV1BuyersBuyerIdArgs = {buyer_id: string}; export type DeleteApiV1BuyersBuyerIdOptions = {baseUrl: string, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a buyer * * DELETE /v1/buyers/{buyer_id} * * Also accepts auth: authorization */ export const deleteApiV1BuyersBuyerId = async (args: DeleteApiV1BuyersBuyerIdArgs, options: DeleteApiV1BuyersBuyerIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/buyers/${encodeURIComponent(String(args.buyer_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 };