export type DeleteApiV3AccountingIntegrationIntegrationIdTaxCodesBrexIdArgs = {brex_id: string, integration_id: string}; export type DeleteApiV3AccountingIntegrationIntegrationIdTaxCodesBrexIdOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete tax code * * DELETE /v3/accounting/integration/{integration_id}/tax-codes/{brex_id} * * Also accepts auth: oauth2 */ export const deleteApiV3AccountingIntegrationIntegrationIdTaxCodesBrexId = async (args: DeleteApiV3AccountingIntegrationIntegrationIdTaxCodesBrexIdArgs, options?: DeleteApiV3AccountingIntegrationIntegrationIdTaxCodesBrexIdOptions) => { const {baseUrl = "https://api.brex.com", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v3/accounting/integration/${encodeURIComponent(String(args.integration_id))}/tax-codes/${encodeURIComponent(String(args.brex_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 };