0

Create a project contract type

by
Published Oct 17, 2025

Creates a new project contract type. Permissions and other requirements SubscriptionProject Costing and Billing User typeBusiness, Project Manager PermissionsAdd Project Contract 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 a project contract type
7
 * Creates a new project contract type.
8

9

10
Permissions and other requirements
11

12
SubscriptionProject Costing and Billing
13
User typeBusiness, Project Manager
14
PermissionsAdd Project Contract Types
15

16

17

18

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

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