export type DeleteApiV3MerchantsMIdTendersTenderIdArgs = {'User-Agent': string, mId: string, tenderId: string}; export type DeleteApiV3MerchantsMIdTendersTenderIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes an existing tender * * DELETE /v3/merchants/{mId}/tenders/{tenderId} */ export const deleteApiV3MerchantsMIdTendersTenderId = async (args: DeleteApiV3MerchantsMIdTendersTenderIdArgs, options?: DeleteApiV3MerchantsMIdTendersTenderIdOptions) => { const {baseUrl = "https://apisandbox.dev.clover.com", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['User-Agent'] != null) headers.set("User-Agent", String(args['User-Agent'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v3/merchants/${encodeURIComponent(String(args.mId))}/tenders/${encodeURIComponent(String(args.tenderId))}${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 };