0

Create a transaction definition entity detail object

by
Published Oct 17, 2025

Creates a new transaction definition entity detail object. Permissions and other requirements SubscriptionOrder Entry User typeBusiness, Employee, Project Manager, Warehouse PermissionsList, View, Add transaction definitions

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 transaction definition entity detail object
7
 * Creates a new transaction definition entity detail object.
8

9

10
Permissions and other requirements
11

12
SubscriptionOrder Entry
13
User typeBusiness, Employee, Project Manager, Warehouse
14
PermissionsList, View, Add transaction definitions
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
		enableNumberingSequence?: false | true
27
		preserveNumberingSequence?: false | true
28
		canInheritSourceDocumentNumber?: false | true
29
		documentTemplate?: { key?: string; id?: string }
30
		enableCreateTransactionRule?: false | true
31
		subtotalTemplate?: { href?: string; key?: string; id?: string }
32
		showExpandedTaxDetail?: false | true
33
		enableOverrideTax?: false | true
34
		enableLineLevelSimpleTax?: false | true
35
		entity?: { href?: string; key?: string; id?: string }
36
		documentSequence?: { key?: string; href?: string; id?: string }
37
		audit?: {
38
			createdDateTime?: string
39
			modifiedDateTime?: string
40
			createdBy?: string
41
			modifiedBy?: string
42
		}
43
		'order-entry-txn-definition'?: { key?: string; id?: string; href?: string }
44
	} & {}
45
) {
46
	const url = new URL(
47
		`https://api.intacct.com/ia/api/v1/objects/order-entry/txn-definition-entity-setting-detail`
48
	)
49

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