export type DeleteApiRequisitionsIdArgs = {id: number}; export type DeleteApiRequisitionsIdOptions = {baseUrl?: string | undefined, internalApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete requisition * * DELETE /requisitions/{id} */ export const deleteApiRequisitionsId = async (args: DeleteApiRequisitionsIdArgs, options?: DeleteApiRequisitionsIdOptions) => { const {baseUrl = "https://r29.coupadev.com/api", fetch: fetchFn = fetch, internalApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (internalApiKey !== undefined) headers.set("X-COUPA-API-KEY", internalApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/requisitions/${encodeURIComponent(String(args.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 };