0

Create a bin

by
Published Oct 17, 2025

Creates a new bin. Permissions and other requirements SubscriptionInventory Control ConfigurationAdvanced workflows is enabled. User typeBusiness PermissionsList, View, Add Bins

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 bin
7
 * Creates a new bin.
8

9

10
Permissions and other requirements
11

12
SubscriptionInventory Control
13
ConfigurationAdvanced workflows is enabled.
14
User typeBusiness
15
PermissionsList, View, Add Bins
16

17

18

19

20
 */
21
export async function main(
22
	auth: SageIntacct,
23
	body: {
24
		key?: string
25
		id?: string
26
		description?: string
27
		href?: string
28
		warehouse?: { key?: string; id?: string; href?: string }
29
		aisle?: { key?: string; id?: string; href?: string }
30
		row?: { key?: string; id?: string; href?: string }
31
		zone?: { key?: string; id?: string; href?: string }
32
		binFace?: { key?: string; id?: string; href?: string }
33
		binSize?: { key?: string; id?: string; href?: string }
34
		sequenceNumber?: string
35
		isPortable?: false | true
36
		status?: 'active' | 'inactive'
37
		audit?: {
38
			createdDateTime?: string
39
			modifiedDateTime?: string
40
			createdBy?: string
41
			modifiedBy?: string
42
		}
43
	} & {}
44
) {
45
	const url = new URL(`https://api.intacct.com/ia/api/v1/objects/inventory-control/bin`)
46

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