0

Create an item warehouse inventory information object

by
Published Oct 17, 2025

Creates a new item warehouse inventory information object. Permissions and other requirements SubscriptionInventory Control, Order Entry, or Purchasing User typeBusiness, Project Manager, Employee, Warehouse PermissionsAdd, Edit Items

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 item warehouse inventory information object
7
 * Creates a new item warehouse inventory information object.
8

9

10
Permissions and other requirements
11

12
SubscriptionInventory Control, Order Entry, or Purchasing
13
User typeBusiness, Project Manager, Employee, Warehouse
14
PermissionsAdd, Edit Items
15

16

17

18

19
 */
20
export async function main(
21
	auth: SageIntacct,
22
	body: {
23
		key?: string
24
		id?: string
25
		item?: { key?: string; id?: string; href?: string }
26
		warehouse?: { key?: string; id?: string; href?: string }
27
		storageArea?: string
28
		inventoryCycle?: { key?: string; id?: string; href?: string }
29
		economicOrderQuantity?: number
30
		standardCost?: string
31
		lastCost?: string
32
		averageCost?: string
33
		reorderMethod?: 'economicQuantity' | 'maxStockLevel' | 'reorderPoint'
34
		reorderPoint?: number
35
		reorderQuantity?: number
36
		minOrderQuantity?: number
37
		maxOrderQuantity?: number
38
		maximumStock?: number
39
		minimumStock?: number
40
		lastSoldDate?: string
41
		lastReceivedDate?: string
42
		defaultBin?: { key?: string; id?: string; href?: string }
43
		warehouseLocation?: {
44
			key?: string
45
			id?: string
46
			currency?: string
47
			href?: string
48
		}
49
		safetyStock?: number
50
		replenishmentMethod?:
51
			| 'reorderPoint'
52
			| 'demandForecastBySingleValue'
53
			| 'demandForecastByFluctuatingValues'
54
		enableReplenishment?: false | true
55
		onOrder?: number
56
		inTransit?: number
57
		onHand?: number
58
		onHold?: number
59
		reserved?: number
60
		allocated?: number
61
		unCommitted?: number
62
		href?: string
63
		itemWarehouseVendor?: {
64
			key?: string
65
			id?: string
66
			itemWarehouse?: { key?: string; id?: string; href?: string }
67
			vendor?: { key?: string; id?: string; href?: string }
68
			stockNumber?: string
69
			leadTime?: number
70
			demandForecastDuringLeadTime?: number
71
			economicalOrderQuantity?: number
72
			vendorMinimumOrderQuantity?: number
73
			bestPrice?: string
74
			latestPrice?: string
75
			unitOfMeasure?: { key?: string; id?: string; href?: string }
76
			conversionFactor?: string
77
			isPreferredVendor?: false | true
78
			href?: string
79
		}[]
80
		standardCostEntries?: {
81
			key?: string
82
			id?: string
83
			href?: string
84
			effectiveStartDate?: string
85
			standardCost?: string
86
			itemWarehouse?: {
87
				key?: string
88
				id?: string
89
				href?: string
90
				itemId?: string
91
				warehouseId?: string
92
			}
93
			audit?: {
94
				createdDateTime?: string
95
				modifiedDateTime?: string
96
				createdBy?: string
97
				modifiedBy?: string
98
			}
99
		}[]
100
		audit?: {
101
			createdDateTime?: string
102
			modifiedDateTime?: string
103
			createdBy?: string
104
			modifiedBy?: string
105
		}
106
	} & {}
107
) {
108
	const url = new URL(
109
		`https://api.intacct.com/ia/api/v1/objects/inventory-control/item-warehouse-inventory`
110
	)
111

112
	const response = await fetch(url, {
113
		method: 'POST',
114
		headers: {
115
			'Content-Type': 'application/json',
116
			Authorization: 'Bearer ' + auth.token
117
		},
118
		body: JSON.stringify(body)
119
	})
120
	if (!response.ok) {
121
		const text = await response.text()
122
		throw new Error(`${response.status} ${text}`)
123
	}
124
	return await response.json()
125
}
126