0

Update a financial institution

by
Published Oct 17, 2025

Updates an existing financial institution by setting field values. Any fields not provided remain unchanged. Permissions and other requirements SubscriptionCash Management, Sage Cloud Services User typeBusiness user with admin permissions PermissionsMap accounts, List, View, Add, Edit Financial Institution

Script sage_intacct Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type SageIntacct = {
3
	token: string
4
}
5
/**
6
 * Update a financial institution
7
 * Updates an existing financial institution by setting field values. Any fields not provided remain unchanged.
8

9

10
Permissions and other requirements
11

12
SubscriptionCash Management, Sage Cloud Services
13
User typeBusiness user with admin permissions
14
PermissionsMap accounts, List, View, Add, Edit Financial Institution
15

16

17

18

19
 */
20
export async function main(
21
	auth: SageIntacct,
22
	key: string,
23
	body: {
24
		key?: string
25
		id?: string
26
		name?: string
27
		addOnServices?: {
28
			name?: string
29
			serviceContract?: {
30
				key?: string
31
				accountType?: 'checking' | 'savings' | 'creditCard'
32
			}
33
		}[]
34
		checkingAccounts?: {
35
			key?: string
36
			externalBankAccount?: { id?: string; name?: string }
37
			requestedStartDate?: string
38
		}[]
39
		savingsAccounts?: {
40
			key?: string
41
			externalBankAccount?: { id?: string; name?: string }
42
			requestedStartDate?: string
43
		}[]
44
		creditCards?: {
45
			key?: string
46
			externalBankAccount?: { id?: string; name?: string }
47
			requestedStartDate?: string
48
		}[]
49
		totalAccounts?: number
50
		href?: string
51
		audit?: {
52
			createdDateTime?: string
53
			modifiedDateTime?: string
54
			createdBy?: string
55
			modifiedBy?: string
56
		} & { modifiedBy?: string }
57
		entity?: { key?: string; id?: string; name?: string; href?: string }
58
	} & {}
59
) {
60
	const url = new URL(
61
		`https://api.intacct.com/ia/api/v1/objects/cash-management/financial-institution/${key}`
62
	)
63

64
	const response = await fetch(url, {
65
		method: 'PATCH',
66
		headers: {
67
			'Content-Type': 'application/json',
68
			Authorization: 'Bearer ' + auth.token
69
		},
70
		body: JSON.stringify(body)
71
	})
72
	if (!response.ok) {
73
		const text = await response.text()
74
		throw new Error(`${response.status} ${text}`)
75
	}
76
	return await response.json()
77
}
78