@augno/sdk 0.18.2 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/package.json +1 -1
  3. package/resources/catalog/catalog.d.mts +6 -6
  4. package/resources/catalog/catalog.d.mts.map +1 -1
  5. package/resources/catalog/catalog.d.ts +6 -6
  6. package/resources/catalog/catalog.d.ts.map +1 -1
  7. package/resources/catalog/catalog.js.map +1 -1
  8. package/resources/catalog/catalog.mjs.map +1 -1
  9. package/resources/catalog/index.d.mts +3 -3
  10. package/resources/catalog/index.d.mts.map +1 -1
  11. package/resources/catalog/index.d.ts +3 -3
  12. package/resources/catalog/index.d.ts.map +1 -1
  13. package/resources/catalog/index.js.map +1 -1
  14. package/resources/catalog/index.mjs.map +1 -1
  15. package/resources/catalog/items/actions.d.mts +249 -0
  16. package/resources/catalog/items/actions.d.mts.map +1 -0
  17. package/resources/catalog/items/actions.d.ts +249 -0
  18. package/resources/catalog/items/actions.d.ts.map +1 -0
  19. package/resources/catalog/items/actions.js +46 -0
  20. package/resources/catalog/items/actions.js.map +1 -0
  21. package/resources/catalog/items/actions.mjs +42 -0
  22. package/resources/catalog/items/actions.mjs.map +1 -0
  23. package/resources/catalog/items/index.d.mts +3 -1
  24. package/resources/catalog/items/index.d.mts.map +1 -1
  25. package/resources/catalog/items/index.d.ts +3 -1
  26. package/resources/catalog/items/index.d.ts.map +1 -1
  27. package/resources/catalog/items/index.js +5 -1
  28. package/resources/catalog/items/index.js.map +1 -1
  29. package/resources/catalog/items/index.mjs +2 -0
  30. package/resources/catalog/items/index.mjs.map +1 -1
  31. package/resources/catalog/items/inventory.d.mts +247 -0
  32. package/resources/catalog/items/inventory.d.mts.map +1 -0
  33. package/resources/catalog/items/inventory.d.ts +247 -0
  34. package/resources/catalog/items/inventory.d.ts.map +1 -0
  35. package/resources/catalog/items/inventory.js +75 -0
  36. package/resources/catalog/items/inventory.js.map +1 -0
  37. package/resources/catalog/items/inventory.mjs +71 -0
  38. package/resources/catalog/items/inventory.mjs.map +1 -0
  39. package/resources/catalog/items/items.d.mts +9 -104
  40. package/resources/catalog/items/items.d.mts.map +1 -1
  41. package/resources/catalog/items/items.d.ts +9 -104
  42. package/resources/catalog/items/items.d.ts.map +1 -1
  43. package/resources/catalog/items/items.js +8 -21
  44. package/resources/catalog/items/items.js.map +1 -1
  45. package/resources/catalog/items/items.mjs +8 -21
  46. package/resources/catalog/items/items.mjs.map +1 -1
  47. package/resources/catalog/materials/index.d.mts +1 -1
  48. package/resources/catalog/materials/index.d.mts.map +1 -1
  49. package/resources/catalog/materials/index.d.ts +1 -1
  50. package/resources/catalog/materials/index.d.ts.map +1 -1
  51. package/resources/catalog/materials/index.js.map +1 -1
  52. package/resources/catalog/materials/index.mjs.map +1 -1
  53. package/resources/catalog/materials/materials.d.mts +36 -3
  54. package/resources/catalog/materials/materials.d.mts.map +1 -1
  55. package/resources/catalog/materials/materials.d.ts +36 -3
  56. package/resources/catalog/materials/materials.d.ts.map +1 -1
  57. package/resources/catalog/materials/materials.js.map +1 -1
  58. package/resources/catalog/materials/materials.mjs.map +1 -1
  59. package/resources/catalog/product-lines/index.d.mts +1 -1
  60. package/resources/catalog/product-lines/index.d.mts.map +1 -1
  61. package/resources/catalog/product-lines/index.d.ts +1 -1
  62. package/resources/catalog/product-lines/index.d.ts.map +1 -1
  63. package/resources/catalog/product-lines/index.js.map +1 -1
  64. package/resources/catalog/product-lines/index.mjs.map +1 -1
  65. package/resources/catalog/product-lines/product-lines.d.mts +8 -23
  66. package/resources/catalog/product-lines/product-lines.d.mts.map +1 -1
  67. package/resources/catalog/product-lines/product-lines.d.ts +8 -23
  68. package/resources/catalog/product-lines/product-lines.d.ts.map +1 -1
  69. package/resources/catalog/product-lines/product-lines.js.map +1 -1
  70. package/resources/catalog/product-lines/product-lines.mjs.map +1 -1
  71. package/resources/core/audit-events.d.mts +4 -4
  72. package/resources/core/audit-events.d.mts.map +1 -1
  73. package/resources/core/audit-events.d.ts +4 -4
  74. package/resources/core/audit-events.d.ts.map +1 -1
  75. package/resources/core/core.d.mts +2 -2
  76. package/resources/core/core.d.mts.map +1 -1
  77. package/resources/core/core.d.ts +2 -2
  78. package/resources/core/core.d.ts.map +1 -1
  79. package/resources/core/core.js.map +1 -1
  80. package/resources/core/core.mjs.map +1 -1
  81. package/resources/core/jobs.d.mts +2 -2
  82. package/resources/core/jobs.d.mts.map +1 -1
  83. package/resources/core/jobs.d.ts +2 -2
  84. package/resources/core/jobs.d.ts.map +1 -1
  85. package/resources/messaging/blocks.d.mts +4 -3
  86. package/resources/messaging/blocks.d.mts.map +1 -1
  87. package/resources/messaging/blocks.d.ts +4 -3
  88. package/resources/messaging/blocks.d.ts.map +1 -1
  89. package/resources/messaging/blocks.js.map +1 -1
  90. package/resources/messaging/blocks.mjs.map +1 -1
  91. package/resources/messaging/conversations/conversations.d.mts +3 -3
  92. package/resources/messaging/conversations/conversations.d.mts.map +1 -1
  93. package/resources/messaging/conversations/conversations.d.ts +3 -3
  94. package/resources/messaging/conversations/conversations.d.ts.map +1 -1
  95. package/resources/messaging/conversations/conversations.js.map +1 -1
  96. package/resources/messaging/conversations/conversations.mjs.map +1 -1
  97. package/resources/messaging/conversations/links.d.mts +2 -2
  98. package/resources/messaging/conversations/links.d.mts.map +1 -1
  99. package/resources/messaging/conversations/links.d.ts +2 -2
  100. package/resources/messaging/conversations/links.d.ts.map +1 -1
  101. package/resources/messaging/conversations/messages.d.mts +2 -2
  102. package/resources/messaging/conversations/messages.d.mts.map +1 -1
  103. package/resources/messaging/conversations/messages.d.ts +2 -2
  104. package/resources/messaging/conversations/messages.d.ts.map +1 -1
  105. package/resources/messaging/notifications/notifications.d.mts +2 -2
  106. package/resources/messaging/notifications/notifications.d.mts.map +1 -1
  107. package/resources/messaging/notifications/notifications.d.ts +2 -2
  108. package/resources/messaging/notifications/notifications.d.ts.map +1 -1
  109. package/resources/messaging/notifications/notifications.js.map +1 -1
  110. package/resources/messaging/notifications/notifications.mjs.map +1 -1
  111. package/resources/operations/machine-downtime-events.d.mts +5 -5
  112. package/resources/operations/machine-downtime-events.d.mts.map +1 -1
  113. package/resources/operations/machine-downtime-events.d.ts +5 -5
  114. package/resources/operations/machine-downtime-events.d.ts.map +1 -1
  115. package/resources/operations/shipping-terms.d.mts +9 -9
  116. package/resources/operations/shipping-terms.d.mts.map +1 -1
  117. package/resources/operations/shipping-terms.d.ts +9 -9
  118. package/resources/operations/shipping-terms.d.ts.map +1 -1
  119. package/resources/sales/account-prices/account-prices.d.mts +3 -3
  120. package/resources/sales/account-prices/account-prices.d.mts.map +1 -1
  121. package/resources/sales/account-prices/account-prices.d.ts +3 -3
  122. package/resources/sales/account-prices/account-prices.d.ts.map +1 -1
  123. package/resources/sales/account-users/sales-targets.d.mts +2 -2
  124. package/resources/sales/account-users/sales-targets.d.mts.map +1 -1
  125. package/resources/sales/account-users/sales-targets.d.ts +2 -2
  126. package/resources/sales/account-users/sales-targets.d.ts.map +1 -1
  127. package/resources/sales/customers/customers.d.mts +5 -5
  128. package/resources/sales/customers/customers.d.mts.map +1 -1
  129. package/resources/sales/customers/customers.d.ts +5 -5
  130. package/resources/sales/customers/customers.d.ts.map +1 -1
  131. package/resources/sales/sales-orders/lines/lines.d.mts +5 -5
  132. package/resources/sales/sales-orders/lines/lines.d.mts.map +1 -1
  133. package/resources/sales/sales-orders/lines/lines.d.ts +5 -5
  134. package/resources/sales/sales-orders/lines/lines.d.ts.map +1 -1
  135. package/resources/sales/sales-orders/sales-orders.d.mts +8 -4
  136. package/resources/sales/sales-orders/sales-orders.d.mts.map +1 -1
  137. package/resources/sales/sales-orders/sales-orders.d.ts +8 -4
  138. package/resources/sales/sales-orders/sales-orders.d.ts.map +1 -1
  139. package/resources/sales/sales-orders/sales-orders.js.map +1 -1
  140. package/resources/sales/sales-orders/sales-orders.mjs.map +1 -1
  141. package/src/resources/catalog/catalog.ts +2 -8
  142. package/src/resources/catalog/index.ts +1 -4
  143. package/src/resources/catalog/items/actions.ts +296 -0
  144. package/src/resources/catalog/items/index.ts +23 -3
  145. package/src/resources/catalog/items/inventory.ts +294 -0
  146. package/src/resources/catalog/items/items.ts +54 -124
  147. package/src/resources/catalog/materials/index.ts +1 -0
  148. package/src/resources/catalog/materials/materials.ts +41 -2
  149. package/src/resources/catalog/product-lines/index.ts +0 -1
  150. package/src/resources/catalog/product-lines/product-lines.ts +7 -25
  151. package/src/resources/core/audit-events.ts +26 -10
  152. package/src/resources/core/core.ts +13 -5
  153. package/src/resources/core/jobs.ts +7 -3
  154. package/src/resources/messaging/blocks.ts +4 -3
  155. package/src/resources/messaging/conversations/conversations.ts +21 -9
  156. package/src/resources/messaging/conversations/links.ts +14 -6
  157. package/src/resources/messaging/conversations/messages.ts +14 -6
  158. package/src/resources/messaging/notifications/notifications.ts +14 -6
  159. package/src/resources/operations/machine-downtime-events.ts +5 -5
  160. package/src/resources/operations/shipping-terms.ts +9 -9
  161. package/src/resources/sales/account-prices/account-prices.ts +3 -3
  162. package/src/resources/sales/account-users/sales-targets.ts +2 -2
  163. package/src/resources/sales/customers/customers.ts +5 -5
  164. package/src/resources/sales/sales-orders/lines/lines.ts +5 -5
  165. package/src/resources/sales/sales-orders/sales-orders.ts +9 -4
  166. package/src/version.ts +1 -1
  167. package/version.d.mts +1 -1
  168. package/version.d.ts +1 -1
  169. package/version.js +1 -1
  170. package/version.mjs +1 -1
@@ -1,18 +1,38 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ export {
4
+ Actions,
5
+ type BulkReconcileItemInput,
6
+ type BulkReconcileItemsRequest,
7
+ type BulkReconcileItemsResponse,
8
+ type ListReconcileErrorResult,
9
+ type ListReconciledItemResult,
10
+ type ListSkippedItemResult,
11
+ type ReconcileErrorResult,
12
+ type ReconciledItemResult,
13
+ type SkippedItemResult,
14
+ type ActionBulkReconcileParams,
15
+ } from './actions';
3
16
  export { Attributes, type AttributeUpdateParams, type AttributeDeleteParams } from './attributes';
17
+ export {
18
+ Inventory,
19
+ type ComputedQuantity,
20
+ type ItemInventory,
21
+ type QuantityInput,
22
+ type UpdateItemInventoryRequest,
23
+ type InventoryUpdateResponse,
24
+ type InventoryListParams,
25
+ type InventoryUpdateParams,
26
+ } from './inventory';
4
27
  export {
5
28
  Items,
6
29
  type Item,
7
30
  type ItemCategory,
8
- type ItemInventory,
9
31
  type ItemLotDefault,
10
32
  type ListItem,
11
- type Quantity,
12
33
  type Rate,
13
34
  type ItemListParams,
14
35
  type ItemRetrieveParams,
15
- type ItemRetrieveInventoryParams,
16
36
  type ItemRetrieveLotDefaultParams,
17
37
  type ItemChangeCategoryParams,
18
38
  } from './items';
@@ -0,0 +1,294 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as UnitsAPI from '../units/units';
5
+ import { APIPromise } from '../../../core/api-promise';
6
+ import { RequestOptions } from '../../../internal/request-options';
7
+ import { path } from '../../../internal/utils/path';
8
+
9
+ /**
10
+ * List and manage inventory items.
11
+ */
12
+ export class Inventory extends APIResource {
13
+ /**
14
+ * Returns the stock position for an item: what is on hand, what is reserved
15
+ * against existing orders, what is free to promise, and what is short.
16
+ *
17
+ * Stock your account either owns or holds counts toward the on-hand figure, so
18
+ * customer-supplied material sitting in your facility is included. All four
19
+ * quantities are reported in the base unit of the item's category.
20
+ *
21
+ * This endpoint requires the permission: `items:read`.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const itemInventory =
26
+ * await client.catalog.items.inventory.list(
27
+ * 'it_pej07ckhvu62',
28
+ * );
29
+ * ```
30
+ */
31
+ list(
32
+ id: string,
33
+ query: InventoryListParams | null | undefined = {},
34
+ options?: RequestOptions,
35
+ ): APIPromise<ItemInventory> {
36
+ return this._client.get(path`/v1/catalog/items/${id}/inventory`, { query, ...options });
37
+ }
38
+
39
+ /**
40
+ * Adjusts or reconciles the quantity of an item you hold.
41
+ *
42
+ * With `operation` set to `adjust` (the behavior when it is omitted), `quantity`
43
+ * is added to the current quantity; with `reconcile`, the current quantity is set
44
+ * to exactly `quantity`. Either way it is the resulting difference that gets
45
+ * written, so a difference of zero moves no stock.
46
+ *
47
+ * The figure a `reconcile` measures against is what is on hand net of demand
48
+ * nothing has covered — the same figure `available_to_promise` is derived from,
49
+ * not the raw on-hand total. Reconciling to the quantity already reported
50
+ * therefore writes nothing.
51
+ *
52
+ * Stock that arrives is allocated against unfilled demand for the item, so an
53
+ * adjustment can settle a shortfall instead of raising the quantity free to
54
+ * promise. That allocation happens just after the request rather than inside it,
55
+ * because it walks every open issue for the item. The change is recorded in the
56
+ * item's inventory audit trail as a user correction attributed to the caller.
57
+ *
58
+ * This endpoint requires the permission: `items:update`.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const inventory =
63
+ * await client.catalog.items.inventory.update(
64
+ * 'it_pej07ckhvu62',
65
+ * {
66
+ * quantity: {
67
+ * value: '10.5',
68
+ * unit_id: 'un_82bd37dae5po',
69
+ * },
70
+ * customer_id: 'ac_opnlh43ymyee',
71
+ * location_id: 'lc_yonnys0hx3ju',
72
+ * operation: 'adjust',
73
+ * },
74
+ * );
75
+ * ```
76
+ */
77
+ update(
78
+ id: string,
79
+ body: InventoryUpdateParams,
80
+ options?: RequestOptions,
81
+ ): APIPromise<InventoryUpdateResponse> {
82
+ return this._client.patch(path`/v1/catalog/items/${id}/inventory`, { body, ...options });
83
+ }
84
+ }
85
+
86
+ /**
87
+ * An amount calculated on demand rather than stored.
88
+ *
89
+ * The same shape as a quantity minus the ID, because nothing was written: it is
90
+ * derived per request, such as a total rolled up across invoiced lines for one
91
+ * analysis.
92
+ */
93
+ export interface ComputedQuantity {
94
+ /**
95
+ * Formatted value with unit abbreviation (e.g. "1,200 pr").
96
+ */
97
+ display_value: string;
98
+
99
+ /**
100
+ * Resource type identifier.
101
+ */
102
+ object: 'computed_quantity';
103
+
104
+ /**
105
+ * Unit of measurement used for conversions and product quantities.
106
+ */
107
+ unit: UnitsAPI.Unit | null;
108
+
109
+ /**
110
+ * Raw decimal value, as a string to preserve precision.
111
+ *
112
+ * This is the unformatted machine value; see `display_value` for the
113
+ * human-readable rendering.
114
+ */
115
+ value: string;
116
+ }
117
+
118
+ /**
119
+ * The stock position for an item: what is in stock, what is already committed, and
120
+ * what is still free to sell.
121
+ *
122
+ * All four quantities are reported in the same unit — the base unit of the item's
123
+ * category. Derived figures, not stored rows: each is netted out of the ledger at
124
+ * read time, so none of them carries a quantity id.
125
+ */
126
+ export interface ItemInventory {
127
+ /**
128
+ * An amount calculated on demand rather than stored.
129
+ *
130
+ * The same shape as a quantity minus the ID, because nothing was written: it is
131
+ * derived per request, such as a total rolled up across invoiced lines for one
132
+ * analysis.
133
+ */
134
+ available_to_promise: ComputedQuantity | null;
135
+
136
+ /**
137
+ * Resource type identifier.
138
+ */
139
+ object: 'item_inventory';
140
+
141
+ /**
142
+ * An amount calculated on demand rather than stored.
143
+ *
144
+ * The same shape as a quantity minus the ID, because nothing was written: it is
145
+ * derived per request, such as a total rolled up across invoiced lines for one
146
+ * analysis.
147
+ */
148
+ on_hand: ComputedQuantity | null;
149
+
150
+ /**
151
+ * An amount calculated on demand rather than stored.
152
+ *
153
+ * The same shape as a quantity minus the ID, because nothing was written: it is
154
+ * derived per request, such as a total rolled up across invoiced lines for one
155
+ * analysis.
156
+ */
157
+ reserved: ComputedQuantity | null;
158
+
159
+ /**
160
+ * An amount calculated on demand rather than stored.
161
+ *
162
+ * The same shape as a quantity minus the ID, because nothing was written: it is
163
+ * derived per request, such as a total rolled up across invoiced lines for one
164
+ * analysis.
165
+ */
166
+ short: ComputedQuantity | null;
167
+ }
168
+
169
+ /**
170
+ * An amount together with the unit it is expressed in.
171
+ *
172
+ * The unit may be a currency, so money amounts such as a credit limit are written
173
+ * the same way as physical amounts like weights or counts.
174
+ */
175
+ export interface QuantityInput {
176
+ /**
177
+ * ID of the unit of measure for the value.
178
+ */
179
+ unit_id: string;
180
+
181
+ /**
182
+ * Decimal value, as a string to preserve precision.
183
+ */
184
+ value: string;
185
+ }
186
+
187
+ /**
188
+ * Request to adjust or reconcile inventory for an item.
189
+ */
190
+ export interface UpdateItemInventoryRequest {
191
+ /**
192
+ * An amount together with the unit it is expressed in.
193
+ *
194
+ * The unit may be a currency, so money amounts such as a credit limit are written
195
+ * the same way as physical amounts like weights or counts.
196
+ */
197
+ quantity: QuantityInput;
198
+
199
+ /**
200
+ * ID of the customer account that owns the resulting inventory.
201
+ *
202
+ * Use this for stock you hold but do not own, such as customer-supplied material.
203
+ * It only affects quantity being added: your account stays the holder, the
204
+ * customer becomes the owner, and the current quantity a `reconcile` measures
205
+ * against is still your account's. Requires edit access to that customer.
206
+ */
207
+ customer_id?: string;
208
+
209
+ /**
210
+ * ID of the location to record the inventory change against.
211
+ *
212
+ * Must be a location in your account.
213
+ */
214
+ location_id?: string;
215
+
216
+ /**
217
+ * Lot number to record the inventory change against.
218
+ *
219
+ * The lot is created for the item if it does not already exist.
220
+ */
221
+ lot_number?: string;
222
+
223
+ /**
224
+ * How `quantity` is applied.
225
+ *
226
+ * - `adjust`: adds `quantity` to the current quantity.
227
+ * - `reconcile`: sets the current quantity to exactly `quantity`.
228
+ */
229
+ operation?: 'adjust' | 'reconcile';
230
+ }
231
+
232
+ export interface InventoryUpdateResponse {}
233
+
234
+ export interface InventoryListParams {
235
+ /**
236
+ * Sub-objects to expand in the response. When omitted, sub-objects are returned as
237
+ * `null`.
238
+ */
239
+ include?: Array<'on_hand' | 'reserved' | 'available_to_promise' | 'short'>;
240
+ }
241
+
242
+ export interface InventoryUpdateParams {
243
+ /**
244
+ * An amount together with the unit it is expressed in.
245
+ *
246
+ * The unit may be a currency, so money amounts such as a credit limit are written
247
+ * the same way as physical amounts like weights or counts.
248
+ */
249
+ quantity: QuantityInput;
250
+
251
+ /**
252
+ * ID of the customer account that owns the resulting inventory.
253
+ *
254
+ * Use this for stock you hold but do not own, such as customer-supplied material.
255
+ * It only affects quantity being added: your account stays the holder, the
256
+ * customer becomes the owner, and the current quantity a `reconcile` measures
257
+ * against is still your account's. Requires edit access to that customer.
258
+ */
259
+ customer_id?: string;
260
+
261
+ /**
262
+ * ID of the location to record the inventory change against.
263
+ *
264
+ * Must be a location in your account.
265
+ */
266
+ location_id?: string;
267
+
268
+ /**
269
+ * Lot number to record the inventory change against.
270
+ *
271
+ * The lot is created for the item if it does not already exist.
272
+ */
273
+ lot_number?: string;
274
+
275
+ /**
276
+ * How `quantity` is applied.
277
+ *
278
+ * - `adjust`: adds `quantity` to the current quantity.
279
+ * - `reconcile`: sets the current quantity to exactly `quantity`.
280
+ */
281
+ operation?: 'adjust' | 'reconcile';
282
+ }
283
+
284
+ export declare namespace Inventory {
285
+ export {
286
+ type ComputedQuantity as ComputedQuantity,
287
+ type ItemInventory as ItemInventory,
288
+ type QuantityInput as QuantityInput,
289
+ type UpdateItemInventoryRequest as UpdateItemInventoryRequest,
290
+ type InventoryUpdateResponse as InventoryUpdateResponse,
291
+ type InventoryListParams as InventoryListParams,
292
+ type InventoryUpdateParams as InventoryUpdateParams,
293
+ };
294
+ }
@@ -3,8 +3,33 @@
3
3
  import { APIResource } from '../../../core/resource';
4
4
  import * as CoreAPI from '../../core/core';
5
5
  import * as APIKeysAPI from '../../auth/api-keys/api-keys';
6
+ import * as ActionsAPI from './actions';
7
+ import {
8
+ ActionBulkReconcileParams,
9
+ Actions,
10
+ BulkReconcileItemInput,
11
+ BulkReconcileItemsRequest,
12
+ BulkReconcileItemsResponse,
13
+ ListReconcileErrorResult,
14
+ ListReconciledItemResult,
15
+ ListSkippedItemResult,
16
+ ReconcileErrorResult,
17
+ ReconciledItemResult,
18
+ SkippedItemResult,
19
+ } from './actions';
6
20
  import * as AttributesAPI from './attributes';
7
21
  import { AttributeDeleteParams, AttributeUpdateParams, Attributes } from './attributes';
22
+ import * as InventoryAPI from './inventory';
23
+ import {
24
+ ComputedQuantity,
25
+ Inventory,
26
+ InventoryListParams,
27
+ InventoryUpdateParams,
28
+ InventoryUpdateResponse,
29
+ ItemInventory,
30
+ QuantityInput,
31
+ UpdateItemInventoryRequest,
32
+ } from './inventory';
8
33
  import * as PropertiesAPI from '../properties/properties';
9
34
  import * as UnitGroupsAPI from '../unit-groups/unit-groups';
10
35
  import * as UnitsAPI from '../units/units';
@@ -16,7 +41,9 @@ import { path } from '../../../internal/utils/path';
16
41
  * List and manage inventory items.
17
42
  */
18
43
  export class Items extends APIResource {
44
+ inventory: InventoryAPI.Inventory = new InventoryAPI.Inventory(this._client);
19
45
  attributes: AttributesAPI.Attributes = new AttributesAPI.Attributes(this._client);
46
+ actions: ActionsAPI.Actions = new ActionsAPI.Actions(this._client);
20
47
 
21
48
  /**
22
49
  * Returns a paginated list of items, newest first.
@@ -57,32 +84,6 @@ export class Items extends APIResource {
57
84
  return this._client.get(path`/v1/catalog/items/${id}`, { query, ...options });
58
85
  }
59
86
 
60
- /**
61
- * Returns the stock position for an item: what is on hand, what is reserved
62
- * against existing orders, what is free to promise, and what is short.
63
- *
64
- * Stock your account either owns or holds counts toward the on-hand figure, so
65
- * customer-supplied material sitting in your facility is included. All four
66
- * quantities are reported in the base unit of the item's category.
67
- *
68
- * This endpoint requires the permission: `items:read`.
69
- *
70
- * @example
71
- * ```ts
72
- * const itemInventory =
73
- * await client.catalog.items.retrieveInventory(
74
- * 'it_pej07ckhvu62',
75
- * );
76
- * ```
77
- */
78
- retrieveInventory(
79
- id: string,
80
- query: ItemRetrieveInventoryParams | null | undefined = {},
81
- options?: RequestOptions,
82
- ): APIPromise<ItemInventory> {
83
- return this._client.get(path`/v1/catalog/items/${id}/inventory`, { query, ...options });
84
- }
85
-
86
87
  /**
87
88
  * Returns the lot this item is made in — how many, counted in what.
88
89
  *
@@ -300,56 +301,6 @@ export interface ItemCategory {
300
301
  updated_at: string;
301
302
  }
302
303
 
303
- /**
304
- * The stock position for an item: what is in stock, what is already committed, and
305
- * what is still free to sell.
306
- *
307
- * All four quantities are reported in the same unit — the base unit of the item's
308
- * category.
309
- */
310
- export interface ItemInventory {
311
- /**
312
- * A measured amount: a numeric value together with the unit it is expressed in.
313
- *
314
- * Quantities are shared building blocks rather than standalone records — other
315
- * resources point at them to report stock levels, ordered and packed amounts,
316
- * money, weights, and durations.
317
- */
318
- available_to_promise: Quantity | null;
319
-
320
- /**
321
- * Resource type identifier.
322
- */
323
- object: 'item_inventory';
324
-
325
- /**
326
- * A measured amount: a numeric value together with the unit it is expressed in.
327
- *
328
- * Quantities are shared building blocks rather than standalone records — other
329
- * resources point at them to report stock levels, ordered and packed amounts,
330
- * money, weights, and durations.
331
- */
332
- on_hand: Quantity | null;
333
-
334
- /**
335
- * A measured amount: a numeric value together with the unit it is expressed in.
336
- *
337
- * Quantities are shared building blocks rather than standalone records — other
338
- * resources point at them to report stock levels, ordered and packed amounts,
339
- * money, weights, and durations.
340
- */
341
- reserved: Quantity | null;
342
-
343
- /**
344
- * A measured amount: a numeric value together with the unit it is expressed in.
345
- *
346
- * Quantities are shared building blocks rather than standalone records — other
347
- * resources point at them to report stock levels, ordered and packed amounts,
348
- * money, weights, and durations.
349
- */
350
- short: Quantity | null;
351
- }
352
-
353
304
  /**
354
305
  * The lot an item is made in — how many, counted in what.
355
306
  *
@@ -427,43 +378,6 @@ export interface ListItem {
427
378
  page_info: APIKeysAPI.PageInfo;
428
379
  }
429
380
 
430
- /**
431
- * A measured amount: a numeric value together with the unit it is expressed in.
432
- *
433
- * Quantities are shared building blocks rather than standalone records — other
434
- * resources point at them to report stock levels, ordered and packed amounts,
435
- * money, weights, and durations.
436
- */
437
- export interface Quantity {
438
- /**
439
- * Quantity ID.
440
- */
441
- id: string;
442
-
443
- /**
444
- * Formatted value with unit abbreviation (e.g. "$1,234.56" or "100 kg").
445
- */
446
- display_value: string;
447
-
448
- /**
449
- * Resource type identifier.
450
- */
451
- object: 'quantity';
452
-
453
- /**
454
- * Unit of measurement used for conversions and product quantities.
455
- */
456
- unit: UnitsAPI.Unit | null;
457
-
458
- /**
459
- * Raw decimal value of the quantity, as a string to preserve precision.
460
- *
461
- * This is the unformatted machine value; see `display_value` for the
462
- * human-readable rendering with unit and thousands separators.
463
- */
464
- value: string;
465
- }
466
-
467
381
  /**
468
382
  * Value expressed as a ratio of two units, such as a price per kilogram or a
469
383
  * throughput per hour.
@@ -627,14 +541,6 @@ export interface ItemRetrieveParams {
627
541
  >;
628
542
  }
629
543
 
630
- export interface ItemRetrieveInventoryParams {
631
- /**
632
- * Sub-objects to expand in the response. When omitted, sub-objects are returned as
633
- * `null`.
634
- */
635
- include?: Array<'on_hand' | 'reserved' | 'available_to_promise' | 'short'>;
636
- }
637
-
638
544
  export interface ItemRetrieveLotDefaultParams {
639
545
  /**
640
546
  * Sub-objects to expand in the response. When omitted, sub-objects are returned as
@@ -667,27 +573,51 @@ export interface ItemChangeCategoryParams {
667
573
  >;
668
574
  }
669
575
 
576
+ Items.Inventory = Inventory;
670
577
  Items.Attributes = Attributes;
578
+ Items.Actions = Actions;
671
579
 
672
580
  export declare namespace Items {
673
581
  export {
674
582
  type Item as Item,
675
583
  type ItemCategory as ItemCategory,
676
- type ItemInventory as ItemInventory,
677
584
  type ItemLotDefault as ItemLotDefault,
678
585
  type ListItem as ListItem,
679
- type Quantity as Quantity,
680
586
  type Rate as Rate,
681
587
  type ItemListParams as ItemListParams,
682
588
  type ItemRetrieveParams as ItemRetrieveParams,
683
- type ItemRetrieveInventoryParams as ItemRetrieveInventoryParams,
684
589
  type ItemRetrieveLotDefaultParams as ItemRetrieveLotDefaultParams,
685
590
  type ItemChangeCategoryParams as ItemChangeCategoryParams,
686
591
  };
687
592
 
593
+ export {
594
+ Inventory as Inventory,
595
+ type ComputedQuantity as ComputedQuantity,
596
+ type ItemInventory as ItemInventory,
597
+ type QuantityInput as QuantityInput,
598
+ type UpdateItemInventoryRequest as UpdateItemInventoryRequest,
599
+ type InventoryUpdateResponse as InventoryUpdateResponse,
600
+ type InventoryListParams as InventoryListParams,
601
+ type InventoryUpdateParams as InventoryUpdateParams,
602
+ };
603
+
688
604
  export {
689
605
  Attributes as Attributes,
690
606
  type AttributeUpdateParams as AttributeUpdateParams,
691
607
  type AttributeDeleteParams as AttributeDeleteParams,
692
608
  };
609
+
610
+ export {
611
+ Actions as Actions,
612
+ type BulkReconcileItemInput as BulkReconcileItemInput,
613
+ type BulkReconcileItemsRequest as BulkReconcileItemsRequest,
614
+ type BulkReconcileItemsResponse as BulkReconcileItemsResponse,
615
+ type ListReconcileErrorResult as ListReconcileErrorResult,
616
+ type ListReconciledItemResult as ListReconciledItemResult,
617
+ type ListSkippedItemResult as ListSkippedItemResult,
618
+ type ReconcileErrorResult as ReconcileErrorResult,
619
+ type ReconciledItemResult as ReconciledItemResult,
620
+ type SkippedItemResult as SkippedItemResult,
621
+ type ActionBulkReconcileParams as ActionBulkReconcileParams,
622
+ };
693
623
  }
@@ -12,6 +12,7 @@ export {
12
12
  type CreateMaterialRequest,
13
13
  type ListMaterial,
14
14
  type Material,
15
+ type Quantity,
15
16
  type QuantityInputRequest,
16
17
  type RateInput,
17
18
  type UpdateMaterialRequest,
@@ -11,6 +11,7 @@ import {
11
11
  UpsertMaterialInput,
12
12
  UpsertMaterialProperty,
13
13
  } from './actions';
14
+ import * as UnitsAPI from '../units/units';
14
15
  import { APIPromise } from '../../../core/api-promise';
15
16
  import { RequestOptions } from '../../../internal/request-options';
16
17
  import { path } from '../../../internal/utils/path';
@@ -301,7 +302,7 @@ export interface Material {
301
302
  * resources point at them to report stock levels, ordered and packed amounts,
302
303
  * money, weights, and durations.
303
304
  */
304
- lead_time: ItemsAPI.Quantity | null;
305
+ lead_time: Quantity | null;
305
306
 
306
307
  /**
307
308
  * Resource type identifier.
@@ -315,7 +316,7 @@ export interface Material {
315
316
  * resources point at them to report stock levels, ordered and packed amounts,
316
317
  * money, weights, and durations.
317
318
  */
318
- order_point: ItemsAPI.Quantity | null;
319
+ order_point: Quantity | null;
319
320
 
320
321
  /**
321
322
  * Last updated timestamp.
@@ -323,6 +324,43 @@ export interface Material {
323
324
  updated_at: string;
324
325
  }
325
326
 
327
+ /**
328
+ * A measured amount: a numeric value together with the unit it is expressed in.
329
+ *
330
+ * Quantities are shared building blocks rather than standalone records — other
331
+ * resources point at them to report stock levels, ordered and packed amounts,
332
+ * money, weights, and durations.
333
+ */
334
+ export interface Quantity {
335
+ /**
336
+ * Quantity ID.
337
+ */
338
+ id: string;
339
+
340
+ /**
341
+ * Formatted value with unit abbreviation (e.g. "$1,234.56" or "100 kg").
342
+ */
343
+ display_value: string;
344
+
345
+ /**
346
+ * Resource type identifier.
347
+ */
348
+ object: 'quantity';
349
+
350
+ /**
351
+ * Unit of measurement used for conversions and product quantities.
352
+ */
353
+ unit: UnitsAPI.Unit | null;
354
+
355
+ /**
356
+ * Raw decimal value of the quantity, as a string to preserve precision.
357
+ *
358
+ * This is the unformatted machine value; see `display_value` for the
359
+ * human-readable rendering with unit and thousands separators.
360
+ */
361
+ value: string;
362
+ }
363
+
326
364
  /**
327
365
  * A quantity, given as a decimal value and the unit it is measured in.
328
366
  */
@@ -620,6 +658,7 @@ export declare namespace Materials {
620
658
  type CreateMaterialRequest as CreateMaterialRequest,
621
659
  type ListMaterial as ListMaterial,
622
660
  type Material as Material,
661
+ type Quantity as Quantity,
623
662
  type QuantityInputRequest as QuantityInputRequest,
624
663
  type RateInput as RateInput,
625
664
  type UpdateMaterialRequest as UpdateMaterialRequest,
@@ -11,7 +11,6 @@ export {
11
11
  type CreateProductLineRequest,
12
12
  type ListProductLine,
13
13
  type ProductLine,
14
- type QuantityInput,
15
14
  type UpdateProductLineRequest,
16
15
  type ProductLineDeleteResponse,
17
16
  type ProductLineListParams,