0

Create an MEA price list

by
Published Oct 17, 2025

Creates a new MEA price list.

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 MEA price list
7
 * Creates a new MEA price list.
8
 */
9
export async function main(
10
	auth: SageIntacct,
11
	body: {
12
		key?: string
13
		id?: string
14
		href?: string
15
		description?: string
16
		isDefault?: false | true
17
		status?: 'active' | 'inactive'
18
		audit?: {
19
			createdDateTime?: string
20
			modifiedDateTime?: string
21
			createdBy?: string
22
			modifiedBy?: string
23
			createdByUser?: { key?: string; id?: string; href?: string }
24
			modifiedByUser?: { key?: string; id?: string; href?: string }
25
		}
26
	} & {}
27
) {
28
	const url = new URL(`https://api.intacct.com/ia/api/v1/objects/contracts/mea-price-list`)
29

30
	const response = await fetch(url, {
31
		method: 'POST',
32
		headers: {
33
			'Content-Type': 'application/json',
34
			Authorization: 'Bearer ' + auth.token
35
		},
36
		body: JSON.stringify(body)
37
	})
38
	if (!response.ok) {
39
		const text = await response.text()
40
		throw new Error(`${response.status} ${text}`)
41
	}
42
	return await response.json()
43
}
44