export type DeleteApiV1CompaniesCompanyIdPayrollsPayrollIdArgs = {'X-Gusto-API-Version'?: '2026-06-15' | undefined, company_id: string, payroll_id: string, async?: boolean | undefined}; export type DeleteApiV1CompaniesCompanyIdPayrollsPayrollIdOptions = {baseUrl?: string | undefined, CompanyAccessAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a payroll * * DELETE /v1/companies/{company_id}/payrolls/{payroll_id} */ export const deleteApiV1CompaniesCompanyIdPayrollsPayrollId = async (args: DeleteApiV1CompaniesCompanyIdPayrollsPayrollIdArgs, options?: DeleteApiV1CompaniesCompanyIdPayrollsPayrollIdOptions) => { const {baseUrl = "https://api.gusto-demo.com", fetch: fetchFn = fetch, CompanyAccessAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Gusto-API-Version'] != null) headers.set("X-Gusto-API-Version", String(args['X-Gusto-API-Version'])) if (args.async != null) query.append("async", String(args.async)) if (CompanyAccessAuth !== undefined) headers.set('authorization', `Bearer ${CompanyAccessAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/companies/${encodeURIComponent(String(args.company_id))}/payrolls/${encodeURIComponent(String(args.payroll_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 };