0

Update an employee expense payment type

by
Published Oct 17, 2025

Updates an existing employee expense payment type by setting field values. Any fields not provided remain unchanged. Permissions and other requirements SubscriptionTime & Expenses User typeBusiness, Employee PermissionsList, View, Update Expense payment types

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 an employee expense payment type
7
 * Updates an existing employee expense payment type by setting field values. Any fields not provided remain unchanged.
8

9

10
Permissions and other requirements
11

12
SubscriptionTime & Expenses
13
User typeBusiness, Employee
14
PermissionsList, View, Update Expense payment types
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
		description?: string
27
		isNonReimbursable?: false | true
28
		offsetGLAccount?: {
29
			key?: string
30
			id?: string
31
			name?: string
32
			href?: string
33
		}
34
		href?: string
35
		status?: 'active' | 'inactive'
36
		audit?: {
37
			createdDateTime?: string
38
			modifiedDateTime?: string
39
			createdBy?: string
40
			modifiedBy?: string
41
		}
42
		entity?: { key?: string; id?: string; name?: string; href?: string }
43
	} & { id?: {} }
44
) {
45
	const url = new URL(
46
		`https://api.intacct.com/ia/api/v1/objects/expenses/employee-expense-payment-type/${key}`
47
	)
48

49
	const response = await fetch(url, {
50
		method: 'PATCH',
51
		headers: {
52
			'Content-Type': 'application/json',
53
			Authorization: 'Bearer ' + auth.token
54
		},
55
		body: JSON.stringify(body)
56
	})
57
	if (!response.ok) {
58
		const text = await response.text()
59
		throw new Error(`${response.status} ${text}`)
60
	}
61
	return await response.json()
62
}
63