0

Create a change request type

by
Published Oct 17, 2025

Creates a new change request type. Permissions and other requirements SubscriptionConstruction, Project Costing and Billing User typeBusiness, Project Manager PermissionsList, View, Add Change requests

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 a change request type
7
 * Creates a new change request type.
8

9

10
Permissions and other requirements
11

12
SubscriptionConstruction, Project Costing and Billing
13
User typeBusiness, Project Manager
14
PermissionsList, View, Add Change requests
15

16

17

18

19
 */
20
export async function main(
21
	auth: SageIntacct,
22
	body: {
23
		key?: string
24
		id?: string
25
		href?: string
26
		status?: 'active' | 'inactive'
27
		audit?: {
28
			createdDateTime?: string
29
			modifiedDateTime?: string
30
			createdBy?: string
31
			modifiedBy?: string
32
		}
33
	} & {}
34
) {
35
	const url = new URL(`https://api.intacct.com/ia/api/v1/objects/construction/change-request-type`)
36

37
	const response = await fetch(url, {
38
		method: 'POST',
39
		headers: {
40
			'Content-Type': 'application/json',
41
			Authorization: 'Bearer ' + auth.token
42
		},
43
		body: JSON.stringify(body)
44
	})
45
	if (!response.ok) {
46
		const text = await response.text()
47
		throw new Error(`${response.status} ${text}`)
48
	}
49
	return await response.json()
50
}
51