0

Create an employee expense payment type

by
Published Oct 17, 2025

Creates a new employee expense payment type. Permissions and other requirements SubscriptionTime & Expenses User typeBusiness, Employee PermissionsList, View, Add 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
 * Create an employee expense payment type
7
 * Creates a new employee expense payment type.
8

9

10
Permissions and other requirements
11

12
SubscriptionTime & Expenses
13
User typeBusiness, Employee
14
PermissionsList, View, Add Expense payment types
15

16

17

18

19
 */
20
export async function main(
21
	auth: SageIntacct,
22
	body: {
23
		key?: string
24
		id?: string
25
		description?: string
26
		isNonReimbursable?: false | true
27
		offsetGLAccount?: {
28
			key?: string
29
			id?: string
30
			name?: string
31
			href?: string
32
		}
33
		href?: string
34
		status?: 'active' | 'inactive'
35
		audit?: {
36
			createdDateTime?: string
37
			modifiedDateTime?: string
38
			createdBy?: string
39
			modifiedBy?: string
40
		}
41
		entity?: { key?: string; id?: string; name?: string; href?: string }
42
	} & {}
43
) {
44
	const url = new URL(
45
		`https://api.intacct.com/ia/api/v1/objects/expenses/employee-expense-payment-type`
46
	)
47

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