@augno/sdk 0.12.4 → 0.12.5

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 (181) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/package.json +1 -1
  3. package/resources/auth/api-keys/api-keys.d.mts +4 -0
  4. package/resources/auth/api-keys/api-keys.d.mts.map +1 -1
  5. package/resources/auth/api-keys/api-keys.d.ts +4 -0
  6. package/resources/auth/api-keys/api-keys.d.ts.map +1 -1
  7. package/resources/auth/api-keys/api-keys.js.map +1 -1
  8. package/resources/auth/api-keys/api-keys.mjs.map +1 -1
  9. package/resources/core/audit-events.d.mts +3 -3
  10. package/resources/core/audit-events.d.mts.map +1 -1
  11. package/resources/core/audit-events.d.ts +3 -3
  12. package/resources/core/audit-events.d.ts.map +1 -1
  13. package/resources/core/core.d.mts +2 -2
  14. package/resources/core/core.d.mts.map +1 -1
  15. package/resources/core/core.d.ts +2 -2
  16. package/resources/core/core.d.ts.map +1 -1
  17. package/resources/core/core.js.map +1 -1
  18. package/resources/core/core.mjs.map +1 -1
  19. package/resources/core/request-logs.d.mts +11 -1
  20. package/resources/core/request-logs.d.mts.map +1 -1
  21. package/resources/core/request-logs.d.ts +11 -1
  22. package/resources/core/request-logs.d.ts.map +1 -1
  23. package/resources/identity/accounts.d.mts +34 -0
  24. package/resources/identity/accounts.d.mts.map +1 -0
  25. package/resources/identity/accounts.d.ts +34 -0
  26. package/resources/identity/accounts.d.ts.map +1 -0
  27. package/resources/identity/accounts.js +35 -0
  28. package/resources/identity/accounts.js.map +1 -0
  29. package/resources/identity/accounts.mjs +31 -0
  30. package/resources/identity/accounts.mjs.map +1 -0
  31. package/resources/identity/identity.d.mts +4 -0
  32. package/resources/identity/identity.d.mts.map +1 -1
  33. package/resources/identity/identity.d.ts +4 -0
  34. package/resources/identity/identity.d.ts.map +1 -1
  35. package/resources/identity/identity.js +4 -0
  36. package/resources/identity/identity.js.map +1 -1
  37. package/resources/identity/identity.mjs +4 -0
  38. package/resources/identity/identity.mjs.map +1 -1
  39. package/resources/identity/index.d.mts +1 -0
  40. package/resources/identity/index.d.mts.map +1 -1
  41. package/resources/identity/index.d.ts +1 -0
  42. package/resources/identity/index.d.ts.map +1 -1
  43. package/resources/identity/index.js +3 -1
  44. package/resources/identity/index.js.map +1 -1
  45. package/resources/identity/index.mjs +1 -0
  46. package/resources/identity/index.mjs.map +1 -1
  47. package/resources/messaging/announcements/announcements.d.mts +1 -1
  48. package/resources/messaging/announcements/announcements.d.mts.map +1 -1
  49. package/resources/messaging/announcements/announcements.d.ts +1 -1
  50. package/resources/messaging/announcements/announcements.d.ts.map +1 -1
  51. package/resources/messaging/announcements/announcements.js.map +1 -1
  52. package/resources/messaging/announcements/announcements.mjs.map +1 -1
  53. package/resources/messaging/conversations/conversations.d.mts +32 -19
  54. package/resources/messaging/conversations/conversations.d.mts.map +1 -1
  55. package/resources/messaging/conversations/conversations.d.ts +32 -19
  56. package/resources/messaging/conversations/conversations.d.ts.map +1 -1
  57. package/resources/messaging/conversations/conversations.js +2 -2
  58. package/resources/messaging/conversations/conversations.js.map +1 -1
  59. package/resources/messaging/conversations/conversations.mjs +2 -2
  60. package/resources/messaging/conversations/conversations.mjs.map +1 -1
  61. package/resources/messaging/conversations/links.d.mts +2 -2
  62. package/resources/messaging/conversations/links.d.mts.map +1 -1
  63. package/resources/messaging/conversations/links.d.ts +2 -2
  64. package/resources/messaging/conversations/links.d.ts.map +1 -1
  65. package/resources/messaging/conversations/messages.d.mts +2 -2
  66. package/resources/messaging/conversations/messages.d.mts.map +1 -1
  67. package/resources/messaging/conversations/messages.d.ts +2 -2
  68. package/resources/messaging/conversations/messages.d.ts.map +1 -1
  69. package/resources/messaging/notifications/notifications.d.mts +6 -6
  70. package/resources/messaging/notifications/notifications.d.mts.map +1 -1
  71. package/resources/messaging/notifications/notifications.d.ts +6 -6
  72. package/resources/messaging/notifications/notifications.d.ts.map +1 -1
  73. package/resources/messaging/notifications/notifications.js.map +1 -1
  74. package/resources/messaging/notifications/notifications.mjs.map +1 -1
  75. package/resources/sales/index.d.mts +1 -1
  76. package/resources/sales/index.d.mts.map +1 -1
  77. package/resources/sales/index.d.ts +1 -1
  78. package/resources/sales/index.d.ts.map +1 -1
  79. package/resources/sales/index.js +2 -2
  80. package/resources/sales/index.js.map +1 -1
  81. package/resources/sales/index.mjs +1 -1
  82. package/resources/sales/index.mjs.map +1 -1
  83. package/resources/sales/sales-orders/actions.d.mts +255 -0
  84. package/resources/sales/sales-orders/actions.d.mts.map +1 -0
  85. package/resources/sales/sales-orders/actions.d.ts +255 -0
  86. package/resources/sales/sales-orders/actions.d.ts.map +1 -0
  87. package/resources/sales/sales-orders/actions.js +156 -0
  88. package/resources/sales/sales-orders/actions.js.map +1 -0
  89. package/resources/sales/sales-orders/actions.mjs +152 -0
  90. package/resources/sales/sales-orders/actions.mjs.map +1 -0
  91. package/resources/sales/sales-orders/index.d.mts +4 -0
  92. package/resources/sales/sales-orders/index.d.mts.map +1 -0
  93. package/resources/sales/sales-orders/index.d.ts +4 -0
  94. package/resources/sales/sales-orders/index.d.ts.map +1 -0
  95. package/resources/sales/sales-orders/index.js +11 -0
  96. package/resources/sales/sales-orders/index.js.map +1 -0
  97. package/resources/sales/sales-orders/index.mjs +5 -0
  98. package/resources/sales/sales-orders/index.mjs.map +1 -0
  99. package/resources/sales/sales-orders/lines/actions.d.mts +56 -0
  100. package/resources/sales/sales-orders/lines/actions.d.mts.map +1 -0
  101. package/resources/sales/sales-orders/lines/actions.d.ts +56 -0
  102. package/resources/sales/sales-orders/lines/actions.d.ts.map +1 -0
  103. package/resources/sales/sales-orders/lines/actions.js +38 -0
  104. package/resources/sales/sales-orders/lines/actions.js.map +1 -0
  105. package/resources/sales/sales-orders/lines/actions.mjs +34 -0
  106. package/resources/sales/sales-orders/lines/actions.mjs.map +1 -0
  107. package/resources/sales/sales-orders/lines/index.d.mts +3 -0
  108. package/resources/sales/sales-orders/lines/index.d.mts.map +1 -0
  109. package/resources/sales/sales-orders/lines/index.d.ts +3 -0
  110. package/resources/sales/sales-orders/lines/index.d.ts.map +1 -0
  111. package/resources/sales/sales-orders/lines/index.js +9 -0
  112. package/resources/sales/sales-orders/lines/index.js.map +1 -0
  113. package/resources/sales/sales-orders/lines/index.mjs +4 -0
  114. package/resources/sales/sales-orders/lines/index.mjs.map +1 -0
  115. package/resources/sales/sales-orders/lines/lines.d.mts +208 -0
  116. package/resources/sales/sales-orders/lines/lines.d.mts.map +1 -0
  117. package/resources/sales/sales-orders/lines/lines.d.ts +208 -0
  118. package/resources/sales/sales-orders/lines/lines.d.ts.map +1 -0
  119. package/resources/sales/sales-orders/lines/lines.js +100 -0
  120. package/resources/sales/sales-orders/lines/lines.js.map +1 -0
  121. package/resources/sales/sales-orders/lines/lines.mjs +95 -0
  122. package/resources/sales/sales-orders/lines/lines.mjs.map +1 -0
  123. package/resources/sales/sales-orders/lines.d.mts +2 -0
  124. package/resources/sales/sales-orders/lines.d.mts.map +1 -0
  125. package/resources/sales/sales-orders/lines.d.ts +2 -0
  126. package/resources/sales/sales-orders/lines.d.ts.map +1 -0
  127. package/resources/sales/sales-orders/lines.js +6 -0
  128. package/resources/sales/sales-orders/lines.js.map +1 -0
  129. package/resources/sales/sales-orders/lines.mjs +3 -0
  130. package/resources/sales/sales-orders/lines.mjs.map +1 -0
  131. package/resources/sales/sales-orders/sales-orders.d.mts +1466 -0
  132. package/resources/sales/sales-orders/sales-orders.d.mts.map +1 -0
  133. package/resources/sales/sales-orders/sales-orders.d.ts +1466 -0
  134. package/resources/sales/sales-orders/sales-orders.d.ts.map +1 -0
  135. package/resources/sales/sales-orders/sales-orders.js +199 -0
  136. package/resources/sales/sales-orders/sales-orders.js.map +1 -0
  137. package/resources/sales/sales-orders/sales-orders.mjs +194 -0
  138. package/resources/sales/sales-orders/sales-orders.mjs.map +1 -0
  139. package/resources/sales/sales-orders.d.mts +1 -980
  140. package/resources/sales/sales-orders.d.mts.map +1 -1
  141. package/resources/sales/sales-orders.d.ts +1 -980
  142. package/resources/sales/sales-orders.d.ts.map +1 -1
  143. package/resources/sales/sales-orders.js +2 -76
  144. package/resources/sales/sales-orders.js.map +1 -1
  145. package/resources/sales/sales-orders.mjs +1 -74
  146. package/resources/sales/sales-orders.mjs.map +1 -1
  147. package/resources/sales/sales.d.mts +3 -3
  148. package/resources/sales/sales.d.mts.map +1 -1
  149. package/resources/sales/sales.d.ts +3 -3
  150. package/resources/sales/sales.d.ts.map +1 -1
  151. package/resources/sales/sales.js +2 -2
  152. package/resources/sales/sales.js.map +1 -1
  153. package/resources/sales/sales.mjs +2 -2
  154. package/resources/sales/sales.mjs.map +1 -1
  155. package/src/resources/auth/api-keys/api-keys.ts +5 -0
  156. package/src/resources/core/audit-events.ts +40 -7
  157. package/src/resources/core/core.ts +27 -5
  158. package/src/resources/core/request-logs.ts +46 -0
  159. package/src/resources/identity/accounts.ts +40 -0
  160. package/src/resources/identity/identity.ts +6 -0
  161. package/src/resources/identity/index.ts +1 -0
  162. package/src/resources/messaging/announcements/announcements.ts +2 -1
  163. package/src/resources/messaging/conversations/conversations.ts +75 -27
  164. package/src/resources/messaging/conversations/links.ts +28 -6
  165. package/src/resources/messaging/conversations/messages.ts +28 -6
  166. package/src/resources/messaging/notifications/notifications.ts +36 -10
  167. package/src/resources/sales/index.ts +16 -1
  168. package/src/resources/sales/sales-orders/actions.ts +316 -0
  169. package/src/resources/sales/sales-orders/index.ts +60 -0
  170. package/src/resources/sales/sales-orders/lines/actions.ts +72 -0
  171. package/src/resources/sales/sales-orders/lines/index.ts +17 -0
  172. package/src/resources/sales/sales-orders/lines/lines.ts +284 -0
  173. package/src/resources/sales/sales-orders/lines.ts +3 -0
  174. package/src/resources/sales/sales-orders/sales-orders.ts +1934 -0
  175. package/src/resources/sales/sales-orders.ts +1 -1239
  176. package/src/resources/sales/sales.ts +54 -24
  177. package/src/version.ts +1 -1
  178. package/version.d.mts +1 -1
  179. package/version.d.ts +1 -1
  180. package/version.js +1 -1
  181. package/version.mjs +1 -1
@@ -1,1241 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../core/resource';
4
- import * as MaterialsAPI from '../catalog/materials';
5
- import * as ProductsAPI from '../catalog/products';
6
- import * as RequestLogsAPI from '../core/request-logs';
7
- import * as APIKeysAPI from '../auth/api-keys/api-keys';
8
- import * as ItemsAPI from '../catalog/items/items';
9
- import * as CustomersAPI from './customers/customers';
10
- import { APIPromise } from '../../core/api-promise';
11
- import { RequestOptions } from '../../internal/request-options';
12
-
13
- export class SalesOrders extends APIResource {
14
- /**
15
- * Returns a paginated list of sales order statuses.
16
- *
17
- * @example
18
- * ```ts
19
- * const listSalesOrderStatus =
20
- * await client.sales.salesOrders.retrieveStatuses();
21
- * ```
22
- */
23
- retrieveStatuses(
24
- query: SalesOrderRetrieveStatusesParams | null | undefined = {},
25
- options?: RequestOptions,
26
- ): APIPromise<ListSalesOrderStatus> {
27
- return this._client.get('/v1/sales/sales-orders/statuses', { query, ...options });
28
- }
29
-
30
- /**
31
- * Returns a paginated list of sales orders for the current account.
32
- *
33
- * This endpoint requires the permissions: `sales_orders:read`, `customers:read`,
34
- * `suppliers:read`.
35
- *
36
- * @example
37
- * ```ts
38
- * const listSalesOrder =
39
- * await client.sales.salesOrders.list();
40
- * ```
41
- */
42
- list(
43
- query: SalesOrderListParams | null | undefined = {},
44
- options?: RequestOptions,
45
- ): APIPromise<ListSalesOrder> {
46
- return this._client.get('/v1/sales/sales-orders', { query, ...options });
47
- }
48
-
49
- /**
50
- * Creates a sales order in `estimate` status.
51
- *
52
- * The order number is assigned automatically, and a sales rep is auto-assigned
53
- * when none is provided. A shipping line is always added to the order, plus a
54
- * discount line when an order discount is supplied.
55
- *
56
- * This endpoint requires the permission: `sales_orders:create`.
57
- *
58
- * @example
59
- * ```ts
60
- * const salesOrder = await client.sales.salesOrders.create({
61
- * bill_to_address_id: 'ad_012c2e4aeeb20f56c1a3d06cc7',
62
- * buyer_account_id: 'ac_0170df1ac58e4d24c66fc89f5f',
63
- * lines: [
64
- * {
65
- * product_id: 'pd_013c29ab3f1518d0004094c316',
66
- * quantity: { ... },
67
- * },
68
- * ],
69
- * priority_code: 'normal',
70
- * ship_to_address_id: 'ad_012c2e4aeeb20f56c1a3d06cc7',
71
- * acknowledgement_email_contacts: [
72
- * { account_user_id: 'acus_01ea9983ddb41dacc44ecf997c' },
73
- * ],
74
- * carrier_billing_account_number: '123456789',
75
- * carrier_billing_type: 'sender',
76
- * carrier_id: 'cr_01784fd54c9ba197bb4e42f0e6',
77
- * customer_purchase_order_number: 'PO-88231',
78
- * invoice_email_contacts: [{ account_user_id: 'acus_01ea9983ddb41dacc44ecf997c' }],
79
- * note: 'Rush order for trade show',
80
- * order_discount_id: 'ords_01121c5e2f6937a6b896daad3a',
81
- * payment_term_id: 'pytm_018694d6601ea771cd1b52e890',
82
- * promised_at: '2026-05-20T00:00:00Z',
83
- * sales_rep_id: 'acus_01ea9983ddb41dacc44ecf997c',
84
- * service_level_id: 'crop_01cfaf03f104e90ef9680e2a30',
85
- * shipping_term_id: 'shtm_014341ab4bb5bf94d5b6936f86',
86
- * });
87
- * ```
88
- */
89
- create(params: SalesOrderCreateParams, options?: RequestOptions): APIPromise<SalesOrder> {
90
- const { include, ...body } = params;
91
- return this._client.post('/v1/sales/sales-orders', { query: { include }, body, ...options });
92
- }
93
- }
94
-
95
- /**
96
- * Line item input for a create sales order request.
97
- *
98
- * The item, unit cost, and (unless an internal user supplies a `unit_price`
99
- * override) the unit price are resolved server-side from the product. The quantity
100
- * unit must belong to the product's unit group.
101
- */
102
- export interface CreateSalesOrderLineInput {
103
- /**
104
- * ID of the product being ordered.
105
- */
106
- product_id: string;
107
-
108
- /**
109
- * A value with an associated unit, used in create and update requests.
110
- */
111
- quantity: CustomersAPI.QuantityInput;
112
-
113
- /**
114
- * Description recorded on the line.
115
- *
116
- * Defaults to the product's description when omitted.
117
- */
118
- product_description?: string;
119
-
120
- /**
121
- * SKU recorded on the line.
122
- *
123
- * Defaults to the product's SKU when omitted.
124
- */
125
- product_sku?: string;
126
-
127
- /**
128
- * A rate value with its numerator and denominator units, used in create and update
129
- * requests.
130
- */
131
- unit_price?: MaterialsAPI.RateInput;
132
- }
133
-
134
- /**
135
- * Request to create a sales order.
136
- */
137
- export interface CreateSalesOrderRequest {
138
- /**
139
- * Bill-to address ID.
140
- *
141
- * Must reference an existing address on the order's owner or buyer account.
142
- */
143
- bill_to_address_id: string;
144
-
145
- /**
146
- * ID of the customer account the order is for.
147
- */
148
- buyer_account_id: string;
149
-
150
- /**
151
- * Order lines to create.
152
- */
153
- lines: Array<CreateSalesOrderLineInput>;
154
-
155
- /**
156
- * Fulfillment priority used to rank the order on the shop floor.
157
- */
158
- priority_code: string;
159
-
160
- /**
161
- * Ship-to address ID.
162
- *
163
- * Must reference an existing address on the order's owner or buyer account.
164
- */
165
- ship_to_address_id: string;
166
-
167
- /**
168
- * Account users who should receive order acknowledgement emails.
169
- */
170
- acknowledgement_email_contacts?: Array<SalesOrderEmailContactInput>;
171
-
172
- /**
173
- * Carrier billing account number.
174
- */
175
- carrier_billing_account_number?: string;
176
-
177
- /**
178
- * Who is billed for freight.
179
- *
180
- * - `sender`: the sender pays for shipping.
181
- * - `third_party`: a third party pays for shipping, using the carrier billing
182
- * account number.
183
- */
184
- carrier_billing_type?: 'sender' | 'third_party';
185
-
186
- /**
187
- * Carrier ID.
188
- */
189
- carrier_id?: string;
190
-
191
- /**
192
- * The customer's own purchase order number, for cross-referencing.
193
- *
194
- * Must be unique among your orders for this customer.
195
- */
196
- customer_purchase_order_number?: string;
197
-
198
- /**
199
- * Account users who should receive invoice emails.
200
- */
201
- invoice_email_contacts?: Array<SalesOrderEmailContactInput>;
202
-
203
- /**
204
- * Order note.
205
- */
206
- note?: string;
207
-
208
- /**
209
- * Order discount ID.
210
- *
211
- * When supplied, a discount line is added to the order automatically.
212
- */
213
- order_discount_id?: string;
214
-
215
- /**
216
- * Payment term ID.
217
- */
218
- payment_term_id?: string;
219
-
220
- /**
221
- * Promised delivery date.
222
- */
223
- promised_at?: string;
224
-
225
- /**
226
- * Sales rep ID.
227
- *
228
- * When omitted, a rep is assigned automatically: the customer's default sales rep
229
- * first, then the sales territory matching the ship-to postal code, then the
230
- * ship-to state.
231
- */
232
- sales_rep_id?: string;
233
-
234
- /**
235
- * Service level ID.
236
- */
237
- service_level_id?: string;
238
-
239
- /**
240
- * Shipping term ID.
241
- */
242
- shipping_term_id?: string;
243
- }
244
-
245
- /**
246
- * CreatedBy describes who created a resource and their relationship to the account
247
- * that owns it.
248
- *
249
- * It is resolved from the resource's create audit event.
250
- */
251
- export interface CreatedBy {
252
- /**
253
- * Reference to an actor — the user, API key, agent, or group identity associated
254
- * with an action.
255
- */
256
- actor: RequestLogsAPI.Actor | null;
257
-
258
- /**
259
- * Resource type identifier.
260
- */
261
- object: 'created_by';
262
-
263
- /**
264
- * The creator's relationship to the account that owns the resource.
265
- *
266
- * - `internal`: created by a user of the owning account.
267
- * - `customer`: created by a customer of the owning account.
268
- * - `system`: created automatically with no human actor (e.g. an EDI import).
269
- */
270
- relation: 'internal' | 'customer' | 'system';
271
- }
272
-
273
- /**
274
- * Freight describes the carrier selection and freight billing for a record.
275
- *
276
- * It is a generic, reusable sub-resource shared by anything that carries shipping
277
- * configuration — for example a sales order's chosen freight, or a customer's
278
- * default freight preferences.
279
- */
280
- export interface Freight {
281
- /**
282
- * Carrier account number to bill, used when `billing_type` is `third_party`.
283
- */
284
- billing_account_number: string | null;
285
-
286
- /**
287
- * Which party the carrier bills for the shipment.
288
- *
289
- * - `sender`: the shipper (your account) is billed.
290
- * - `third_party`: a third party is billed via `billing_account_number`.
291
- */
292
- billing_type: 'sender' | 'third_party' | null;
293
-
294
- /**
295
- * A shipping carrier configured for fulfilling orders.
296
- *
297
- * Carriers with a Shippo-supported `code` (`fedex`, `ups`, `usps`) are connected
298
- * through Shippo for live rating and label purchase; other carriers represent
299
- * self-managed shipping methods such as will call or local delivery.
300
- */
301
- carrier: CustomersAPI.Carrier | null;
302
-
303
- /**
304
- * Resource type identifier.
305
- */
306
- object: 'freight';
307
-
308
- /**
309
- * How freight is arranged and billed for the record.
310
- *
311
- * Populated where a freight policy applies, such as a customer's default
312
- * preferences.
313
- *
314
- * - `free_freight`: no shipping cost to the buyer.
315
- * - `billed_freight`: freight is billed to the buyer.
316
- */
317
- policy: 'free_freight' | 'billed_freight' | null;
318
-
319
- /**
320
- * Shipping service level for a carrier.
321
- */
322
- service_level: CustomersAPI.ServiceLevel | null;
323
- }
324
-
325
- /**
326
- * List represents a paginated list of resources.
327
- */
328
- export interface ListRecord {
329
- /**
330
- * Resources in this page.
331
- */
332
- data: Array<Record>;
333
-
334
- /**
335
- * Resource type identifier.
336
- */
337
- object: 'list';
338
-
339
- /**
340
- * PageInfo contains URL-based pagination metadata.
341
- */
342
- page_info: APIKeysAPI.PageInfo;
343
- }
344
-
345
- /**
346
- * List represents a paginated list of resources.
347
- */
348
- export interface ListSalesOrder {
349
- /**
350
- * Resources in this page.
351
- */
352
- data: Array<SalesOrder>;
353
-
354
- /**
355
- * Resource type identifier.
356
- */
357
- object: 'list';
358
-
359
- /**
360
- * PageInfo contains URL-based pagination metadata.
361
- */
362
- page_info: APIKeysAPI.PageInfo;
363
- }
364
-
365
- /**
366
- * List represents a paginated list of resources.
367
- */
368
- export interface ListSalesOrderLine {
369
- /**
370
- * Resources in this page.
371
- */
372
- data: Array<SalesOrderLine>;
373
-
374
- /**
375
- * Resource type identifier.
376
- */
377
- object: 'list';
378
-
379
- /**
380
- * PageInfo contains URL-based pagination metadata.
381
- */
382
- page_info: APIKeysAPI.PageInfo;
383
- }
384
-
385
- /**
386
- * List represents a paginated list of resources.
387
- */
388
- export interface ListSalesOrderStatus {
389
- /**
390
- * Resources in this page.
391
- */
392
- data: Array<SalesOrderStatus>;
393
-
394
- /**
395
- * Resource type identifier.
396
- */
397
- object: 'list';
398
-
399
- /**
400
- * PageInfo contains URL-based pagination metadata.
401
- */
402
- page_info: APIKeysAPI.PageInfo;
403
- }
404
-
405
- /**
406
- * OrderContact groups a sales order's email recipients by notification purpose.
407
- */
408
- export interface OrderContact {
409
- /**
410
- * Email addresses that receive order acknowledgements for this order.
411
- */
412
- acknowledgement: Array<string>;
413
-
414
- /**
415
- * Email addresses that receive invoices for this order.
416
- */
417
- invoice: Array<string>;
418
-
419
- /**
420
- * Resource type identifier.
421
- */
422
- object: 'order_contact';
423
- }
424
-
425
- /**
426
- * A discount code that can be applied to a sales order.
427
- *
428
- * An order discount reduces the order total by either a percentage or a fixed
429
- * amount, depending on `discount_type`.
430
- */
431
- export interface OrderDiscount {
432
- /**
433
- * Order discount ID.
434
- */
435
- id: string;
436
-
437
- /**
438
- * Fixed amount off as a decimal string.
439
- *
440
- * Applies when `discount_type` is `amount`; otherwise `0`.
441
- */
442
- amount: string;
443
-
444
- /**
445
- * The code entered to apply this discount to an order.
446
- *
447
- * Must be unique within the account.
448
- */
449
- code: string;
450
-
451
- /**
452
- * Creation timestamp.
453
- */
454
- created_at: string;
455
-
456
- /**
457
- * How the discount is calculated, determining whether `percentage` or `amount` is
458
- * used.
459
- *
460
- * - `percentage`: the discount is a percent off, taken from `percentage`.
461
- * - `amount`: the discount is a fixed amount off, taken from `amount`.
462
- */
463
- discount_type: 'percentage' | 'amount';
464
-
465
- /**
466
- * Display name of the discount.
467
- */
468
- name: string;
469
-
470
- /**
471
- * Resource type identifier.
472
- */
473
- object: 'order_discount';
474
-
475
- /**
476
- * Number of orders currently using this discount.
477
- */
478
- order_count: number;
479
-
480
- /**
481
- * Percent off as a decimal string (e.g. `10` for 10%).
482
- *
483
- * Applies when `discount_type` is `percentage`; otherwise `0`.
484
- */
485
- percentage: string;
486
-
487
- /**
488
- * Last updated timestamp.
489
- */
490
- updated_at: string;
491
- }
492
-
493
- /**
494
- * Record is a lightweight reference to a business record — a sales order, purchase
495
- * order, pick, shipment, production run, invoice, etc.
496
- *
497
- * Like Actor and Entity, it carries just enough to identify and label the
498
- * referenced record without embedding its full resource. The optional status and
499
- * metadata fields hold type-specific detail that varies by the kind of record
500
- * referenced.
501
- */
502
- export interface Record {
503
- /**
504
- * Unique identifier for the record.
505
- */
506
- id: string;
507
-
508
- /**
509
- * Type-specific metadata.
510
- *
511
- * The set of keys varies by record type.
512
- */
513
- metadata: { [key: string]: string };
514
-
515
- /**
516
- * Human-readable record number, when the record has one.
517
- */
518
- number: string | null;
519
-
520
- /**
521
- * Resource type identifier.
522
- */
523
- object: 'record';
524
-
525
- /**
526
- * Type-specific status code, when applicable.
527
- */
528
- status: string | null;
529
-
530
- /**
531
- * The kind of business record referenced.
532
- *
533
- * Determines how to resolve the record and which `status` and `metadata` keys may
534
- * appear.
535
- *
536
- * - `sales_order`: a customer order.
537
- * - `purchase_order`: an order placed with a supplier.
538
- * - `receiving_order`: an inbound order being received into inventory.
539
- * - `pick`: a warehouse pick task.
540
- * - `shipment`: an outbound shipment.
541
- * - `delivery`: a delivery of one or more shipments to a destination.
542
- * - `production_run`: a manufacturing production run.
543
- * - `invoice`: a customer invoice.
544
- * - `transaction`: a payment or financial transaction.
545
- * - `settlement`: a settlement reconciling transactions against invoices.
546
- */
547
- type:
548
- | 'sales_order'
549
- | 'purchase_order'
550
- | 'receiving_order'
551
- | 'pick'
552
- | 'shipment'
553
- | 'delivery'
554
- | 'production_run'
555
- | 'invoice'
556
- | 'transaction'
557
- | 'settlement';
558
- }
559
-
560
- /**
561
- * Full sales order resource.
562
- */
563
- export interface SalesOrder {
564
- /**
565
- * Sales order ID.
566
- */
567
- id: string;
568
-
569
- /**
570
- * Whether an order acknowledgment has been sent to the customer.
571
- */
572
- acknowledgment_status: 'not_sent' | 'sent';
573
-
574
- /**
575
- * A saved address that can be used for billing and shipping on sales orders,
576
- * invoices, and shipments.
577
- */
578
- bill_to_address: APIKeysAPI.Address | null;
579
-
580
- /**
581
- * When the order was fulfilled and closed.
582
- */
583
- completed_at: string | null;
584
-
585
- /**
586
- * OrderContact groups a sales order's email recipients by notification purpose.
587
- */
588
- contacts: OrderContact | null;
589
-
590
- /**
591
- * Creation timestamp.
592
- */
593
- created_at: string;
594
-
595
- /**
596
- * CreatedBy describes who created a resource and their relationship to the account
597
- * that owns it.
598
- *
599
- * It is resolved from the resource's create audit event.
600
- */
601
- created_by: CreatedBy | null;
602
-
603
- /**
604
- * A business you sell to, with its contact details, default fulfillment settings,
605
- * and order policies.
606
- */
607
- customer: CustomersAPI.Customer | null;
608
-
609
- /**
610
- * The customer's own purchase order number, for cross-referencing.
611
- *
612
- * Unique among this customer's orders.
613
- */
614
- customer_purchase_order_number: string | null;
615
-
616
- /**
617
- * When this estimate expires, if an expiration was set.
618
- */
619
- expired_at: string | null;
620
-
621
- /**
622
- * When the first shipment against this order went out.
623
- */
624
- first_ship_at: string | null;
625
-
626
- /**
627
- * Freight describes the carrier selection and freight billing for a record.
628
- *
629
- * It is a generic, reusable sub-resource shared by anything that carries shipping
630
- * configuration — for example a sales order's chosen freight, or a customer's
631
- * default freight preferences.
632
- */
633
- freight: Freight | null;
634
-
635
- /**
636
- * When the order was issued (moved out of `estimate`).
637
- */
638
- issued_at: string | null;
639
-
640
- /**
641
- * Number of order lines on this order, returned even when the `lines` list itself
642
- * is not expanded.
643
- */
644
- line_count: number;
645
-
646
- /**
647
- * List represents a paginated list of resources.
648
- */
649
- lines: ListSalesOrderLine | null;
650
-
651
- /**
652
- * Order note.
653
- */
654
- note: string | null;
655
-
656
- /**
657
- * Human-readable order number, e.g. `SO-001`.
658
- *
659
- * Assigned automatically when the order is created; unique within your account.
660
- */
661
- number: string;
662
-
663
- /**
664
- * Resource type identifier.
665
- */
666
- object: 'sales_order';
667
-
668
- /**
669
- * A discount code that can be applied to a sales order.
670
- *
671
- * An order discount reduces the order total by either a percentage or a fixed
672
- * amount, depending on `discount_type`.
673
- */
674
- order_discount: OrderDiscount | null;
675
-
676
- /**
677
- * Stripe payment intent IDs recorded against this order.
678
- */
679
- payment_intent_ids: Array<string>;
680
-
681
- /**
682
- * Payment state of the order, derived from settlement allocations, invoices, and
683
- * Stripe payments.
684
- */
685
- payment_status: 'unpaid' | 'partially_paid' | 'paid';
686
-
687
- /**
688
- * A payment term describing when payment is due (e.g. `Net 30`), assignable to
689
- * customers, sales orders, purchase orders, and invoices.
690
- */
691
- payment_term: CustomersAPI.PaymentTerm | null;
692
-
693
- /**
694
- * Fulfillment priority, used to rank orders on the shop floor.
695
- */
696
- priority: 'low' | 'normal' | 'high';
697
-
698
- /**
699
- * Date promised to the customer for delivery, if one was committed.
700
- */
701
- promised_at: string | null;
702
-
703
- /**
704
- * SalesOrderRelated groups the records related to a sales order.
705
- *
706
- * The members are individually expandable (e.g. include[]=related.pick). The group
707
- * is null unless at least one of its members is expanded.
708
- */
709
- related: SalesOrderRelated | null;
710
-
711
- /**
712
- * Reference to an actor — the user, API key, agent, or group identity associated
713
- * with an action.
714
- */
715
- sales_rep: RequestLogsAPI.Actor | null;
716
-
717
- /**
718
- * A saved address that can be used for billing and shipping on sales orders,
719
- * invoices, and shipments.
720
- */
721
- ship_to_address: APIKeysAPI.Address | null;
722
-
723
- /**
724
- * A shipping term defining how freight charges are calculated for an order.
725
- */
726
- shipping_term: CustomersAPI.ShippingTerm | null;
727
-
728
- /**
729
- * Order lifecycle status.
730
- *
731
- * - `estimate`: a draft quote that has not yet been committed; not counted as a
732
- * real order.
733
- * - `issued`: the order has been issued and is being fulfilled.
734
- * - `fulfilled`: the order has been completed and closed.
735
- *
736
- * Status changes are made through the issue, unissue, close, and reopen action
737
- * endpoints rather than by updating this field.
738
- */
739
- status: 'estimate' | 'issued' | 'fulfilled';
740
-
741
- /**
742
- * SalesOrderTotals holds the derived monetary totals for a sales order or one of
743
- * its lines, following the lifecycle ordered -> packed -> invoiced.
744
- */
745
- totals: SalesOrderTotals | null;
746
-
747
- /**
748
- * Last updated timestamp.
749
- */
750
- updated_at: string;
751
- }
752
-
753
- /**
754
- * SalesOrderEmailContactInput represents an account user subscribed to a
755
- * sales-order email notification type.
756
- */
757
- export interface SalesOrderEmailContactInput {
758
- /**
759
- * Account user ID to receive the notification.
760
- */
761
- account_user_id: string;
762
- }
763
-
764
- /**
765
- * Full sales order line resource.
766
- */
767
- export interface SalesOrderLine {
768
- /**
769
- * Sales order line ID.
770
- */
771
- id: string;
772
-
773
- /**
774
- * Creation timestamp.
775
- */
776
- created_at: string;
777
-
778
- /**
779
- * Position of the line on the order.
780
- *
781
- * Assigned automatically in sequence, starting at `1`.
782
- */
783
- line_item_number: number;
784
-
785
- /**
786
- * Resource type identifier.
787
- */
788
- object: 'sales_order_line';
789
-
790
- /**
791
- * Product pairs an inventory item with how it is sold: its product type, optional
792
- * product line, and customer portal visibility.
793
- */
794
- product: ProductsAPI.Product | null;
795
-
796
- /**
797
- * Product description.
798
- */
799
- product_description: string | null;
800
-
801
- /**
802
- * Product SKU.
803
- */
804
- product_sku: string;
805
-
806
- /**
807
- * Value with an associated unit.
808
- */
809
- quantity_ordered: ItemsAPI.Quantity | null;
810
-
811
- /**
812
- * SalesOrderTotals holds the derived monetary totals for a sales order or one of
813
- * its lines, following the lifecycle ordered -> packed -> invoiced.
814
- */
815
- totals: SalesOrderTotals | null;
816
-
817
- /**
818
- * Value expressed as a ratio of two units, such as a price per kilogram or a
819
- * throughput per hour.
820
- */
821
- unit_cost: ItemsAPI.Rate | null;
822
-
823
- /**
824
- * Value expressed as a ratio of two units, such as a price per kilogram or a
825
- * throughput per hour.
826
- */
827
- unit_price: ItemsAPI.Rate | null;
828
-
829
- /**
830
- * Last updated timestamp.
831
- */
832
- updated_at: string;
833
- }
834
-
835
- /**
836
- * SalesOrderRelated groups the records related to a sales order.
837
- *
838
- * The members are individually expandable (e.g. include[]=related.pick). The group
839
- * is null unless at least one of its members is expanded.
840
- */
841
- export interface SalesOrderRelated {
842
- /**
843
- * List represents a paginated list of resources.
844
- */
845
- invoices: ListRecord | null;
846
-
847
- /**
848
- * Resource type identifier.
849
- */
850
- object: 'sales_order_related';
851
-
852
- /**
853
- * Record is a lightweight reference to a business record — a sales order, purchase
854
- * order, pick, shipment, production run, invoice, etc.
855
- *
856
- * Like Actor and Entity, it carries just enough to identify and label the
857
- * referenced record without embedding its full resource. The optional status and
858
- * metadata fields hold type-specific detail that varies by the kind of record
859
- * referenced.
860
- */
861
- pick: Record | null;
862
-
863
- /**
864
- * Record is a lightweight reference to a business record — a sales order, purchase
865
- * order, pick, shipment, production run, invoice, etc.
866
- *
867
- * Like Actor and Entity, it carries just enough to identify and label the
868
- * referenced record without embedding its full resource. The optional status and
869
- * metadata fields hold type-specific detail that varies by the kind of record
870
- * referenced.
871
- */
872
- production_run: Record | null;
873
-
874
- /**
875
- * List represents a paginated list of resources.
876
- */
877
- shipments: ListRecord | null;
878
- }
879
-
880
- /**
881
- * A lookup value describing where a sales order is in its lifecycle, from estimate
882
- * through fulfillment.
883
- */
884
- export interface SalesOrderStatus {
885
- /**
886
- * Sales order status ID.
887
- */
888
- id: string;
889
-
890
- /**
891
- * Machine-readable status code.
892
- *
893
- * - `estimate`: a draft quote that has not yet been committed.
894
- * - `issued`: the order has been issued and is being fulfilled.
895
- * - `fulfilled`: the order has been completed and closed.
896
- */
897
- code: 'estimate' | 'issued' | 'fulfilled';
898
-
899
- /**
900
- * Creation timestamp.
901
- */
902
- created_at: string;
903
-
904
- /**
905
- * Human-readable name of the status.
906
- */
907
- name: string;
908
-
909
- /**
910
- * Resource type identifier.
911
- */
912
- object: 'sales_order_status';
913
-
914
- /**
915
- * Owner describes the provenance of a resource.
916
- */
917
- owner: APIKeysAPI.Owner | null;
918
-
919
- /**
920
- * Last updated timestamp.
921
- */
922
- updated_at: string;
923
- }
924
-
925
- /**
926
- * SalesOrderTotals holds the derived monetary totals for a sales order or one of
927
- * its lines, following the lifecycle ordered -> packed -> invoiced.
928
- */
929
- export interface SalesOrderTotals {
930
- /**
931
- * Total invoiced amount as a decimal string (unit price x quantity invoiced).
932
- */
933
- invoiced: string;
934
-
935
- /**
936
- * Resource type identifier.
937
- */
938
- object: 'sales_order_totals';
939
-
940
- /**
941
- * Total ordered amount as a decimal string (unit price x quantity ordered).
942
- */
943
- ordered: string;
944
-
945
- /**
946
- * Total packed amount as a decimal string (unit price x quantity packed).
947
- */
948
- packed: string;
949
- }
950
-
951
- export interface SalesOrderRetrieveStatusesParams {
952
- /**
953
- * Opaque cursor token identifying where the page of results starts.
954
- *
955
- * Use the `cursor` value embedded in a previous response's `next_page_url` or
956
- * `previous_page_url` to fetch the adjacent page. Omit to start from the first
957
- * page.
958
- */
959
- cursor?: string;
960
-
961
- /**
962
- * Sub-objects to expand in the response. When omitted, sub-objects are returned as
963
- * `null`.
964
- */
965
- include?: Array<'owner'>;
966
-
967
- /**
968
- * Maximum number of results to return in a single page.
969
- */
970
- limit?: number;
971
-
972
- /**
973
- * Free-text search term used to filter results.
974
- *
975
- * Which fields are matched against the term varies by endpoint.
976
- */
977
- q?: string;
978
- }
979
-
980
- export interface SalesOrderListParams {
981
- /**
982
- * Opaque cursor token identifying where the page of results starts.
983
- *
984
- * Use the `cursor` value embedded in a previous response's `next_page_url` or
985
- * `previous_page_url` to fetch the adjacent page. Omit to start from the first
986
- * page.
987
- */
988
- cursor?: string;
989
-
990
- /**
991
- * Filter by customer group IDs.
992
- */
993
- customer_group_ids?: Array<string>;
994
-
995
- /**
996
- * Filter by customer IDs.
997
- */
998
- customer_ids?: Array<string>;
999
-
1000
- /**
1001
- * Latest order creation date to include, in `YYYY-MM-DD` format (inclusive).
1002
- */
1003
- end_date?: string;
1004
-
1005
- /**
1006
- * Sub-objects to expand in the response. When omitted, sub-objects are returned as
1007
- * `null`.
1008
- */
1009
- include?: Array<
1010
- | 'customer'
1011
- | 'sales_rep'
1012
- | 'created_by'
1013
- | 'bill_to_address'
1014
- | 'ship_to_address'
1015
- | 'freight'
1016
- | 'payment_term'
1017
- | 'shipping_term'
1018
- | 'order_discount'
1019
- | 'totals'
1020
- | 'contacts'
1021
- | 'related.pick'
1022
- | 'related.production_run'
1023
- | 'related.shipments'
1024
- | 'related.invoices'
1025
- | 'lines'
1026
- | 'lines.product'
1027
- | 'lines.product.item'
1028
- | 'lines.product.product_line'
1029
- | 'lines.quantity_ordered'
1030
- | 'lines.quantity_ordered.unit'
1031
- | 'lines.unit_price'
1032
- | 'lines.unit_price.numerator_unit'
1033
- | 'lines.unit_price.denominator_unit'
1034
- | 'lines.unit_cost'
1035
- | 'lines.unit_cost.numerator_unit'
1036
- | 'lines.unit_cost.denominator_unit'
1037
- | 'lines.totals'
1038
- >;
1039
-
1040
- /**
1041
- * Filter by item IDs.
1042
- */
1043
- item_ids?: Array<string>;
1044
-
1045
- /**
1046
- * Maximum number of results to return in a single page.
1047
- */
1048
- limit?: number;
1049
-
1050
- /**
1051
- * Filter by product line IDs.
1052
- */
1053
- product_line_ids?: Array<string>;
1054
-
1055
- /**
1056
- * Free-text search term used to filter results.
1057
- *
1058
- * Which fields are matched against the term varies by endpoint.
1059
- */
1060
- q?: string;
1061
-
1062
- /**
1063
- * Filter by sales rep IDs.
1064
- */
1065
- sales_rep_ids?: Array<string>;
1066
-
1067
- /**
1068
- * Earliest order creation date to include, in `YYYY-MM-DD` format (inclusive).
1069
- */
1070
- start_date?: string;
1071
-
1072
- /**
1073
- * Filter by status codes.
1074
- */
1075
- status_codes?: Array<string>;
1076
- }
1077
-
1078
- export interface SalesOrderCreateParams {
1079
- /**
1080
- * Body param: Bill-to address ID.
1081
- *
1082
- * Must reference an existing address on the order's owner or buyer account.
1083
- */
1084
- bill_to_address_id: string;
1085
-
1086
- /**
1087
- * Body param: ID of the customer account the order is for.
1088
- */
1089
- buyer_account_id: string;
1090
-
1091
- /**
1092
- * Body param: Order lines to create.
1093
- */
1094
- lines: Array<CreateSalesOrderLineInput>;
1095
-
1096
- /**
1097
- * Body param: Fulfillment priority used to rank the order on the shop floor.
1098
- */
1099
- priority_code: string;
1100
-
1101
- /**
1102
- * Body param: Ship-to address ID.
1103
- *
1104
- * Must reference an existing address on the order's owner or buyer account.
1105
- */
1106
- ship_to_address_id: string;
1107
-
1108
- /**
1109
- * Query param: Sub-objects to expand in the response. When omitted, sub-objects
1110
- * are returned as `null`.
1111
- */
1112
- include?: Array<
1113
- | 'customer'
1114
- | 'sales_rep'
1115
- | 'bill_to_address'
1116
- | 'ship_to_address'
1117
- | 'freight'
1118
- | 'payment_term'
1119
- | 'shipping_term'
1120
- | 'order_discount'
1121
- | 'totals'
1122
- | 'contacts'
1123
- | 'related.pick'
1124
- | 'related.production_run'
1125
- | 'related.shipments'
1126
- | 'related.invoices'
1127
- | 'lines'
1128
- | 'lines.product'
1129
- | 'lines.quantity_ordered'
1130
- | 'lines.quantity_ordered.unit'
1131
- | 'lines.unit_price'
1132
- | 'lines.unit_price.numerator_unit'
1133
- | 'lines.unit_price.denominator_unit'
1134
- | 'lines.unit_cost'
1135
- | 'lines.unit_cost.numerator_unit'
1136
- | 'lines.unit_cost.denominator_unit'
1137
- | 'lines.totals'
1138
- >;
1139
-
1140
- /**
1141
- * Body param: Account users who should receive order acknowledgement emails.
1142
- */
1143
- acknowledgement_email_contacts?: Array<SalesOrderEmailContactInput>;
1144
-
1145
- /**
1146
- * Body param: Carrier billing account number.
1147
- */
1148
- carrier_billing_account_number?: string;
1149
-
1150
- /**
1151
- * Body param: Who is billed for freight.
1152
- *
1153
- * - `sender`: the sender pays for shipping.
1154
- * - `third_party`: a third party pays for shipping, using the carrier billing
1155
- * account number.
1156
- */
1157
- carrier_billing_type?: 'sender' | 'third_party';
1158
-
1159
- /**
1160
- * Body param: Carrier ID.
1161
- */
1162
- carrier_id?: string;
1163
-
1164
- /**
1165
- * Body param: The customer's own purchase order number, for cross-referencing.
1166
- *
1167
- * Must be unique among your orders for this customer.
1168
- */
1169
- customer_purchase_order_number?: string;
1170
-
1171
- /**
1172
- * Body param: Account users who should receive invoice emails.
1173
- */
1174
- invoice_email_contacts?: Array<SalesOrderEmailContactInput>;
1175
-
1176
- /**
1177
- * Body param: Order note.
1178
- */
1179
- note?: string;
1180
-
1181
- /**
1182
- * Body param: Order discount ID.
1183
- *
1184
- * When supplied, a discount line is added to the order automatically.
1185
- */
1186
- order_discount_id?: string;
1187
-
1188
- /**
1189
- * Body param: Payment term ID.
1190
- */
1191
- payment_term_id?: string;
1192
-
1193
- /**
1194
- * Body param: Promised delivery date.
1195
- */
1196
- promised_at?: string;
1197
-
1198
- /**
1199
- * Body param: Sales rep ID.
1200
- *
1201
- * When omitted, a rep is assigned automatically: the customer's default sales rep
1202
- * first, then the sales territory matching the ship-to postal code, then the
1203
- * ship-to state.
1204
- */
1205
- sales_rep_id?: string;
1206
-
1207
- /**
1208
- * Body param: Service level ID.
1209
- */
1210
- service_level_id?: string;
1211
-
1212
- /**
1213
- * Body param: Shipping term ID.
1214
- */
1215
- shipping_term_id?: string;
1216
- }
1217
-
1218
- export declare namespace SalesOrders {
1219
- export {
1220
- type CreateSalesOrderLineInput as CreateSalesOrderLineInput,
1221
- type CreateSalesOrderRequest as CreateSalesOrderRequest,
1222
- type CreatedBy as CreatedBy,
1223
- type Freight as Freight,
1224
- type ListRecord as ListRecord,
1225
- type ListSalesOrder as ListSalesOrder,
1226
- type ListSalesOrderLine as ListSalesOrderLine,
1227
- type ListSalesOrderStatus as ListSalesOrderStatus,
1228
- type OrderContact as OrderContact,
1229
- type OrderDiscount as OrderDiscount,
1230
- type Record as Record,
1231
- type SalesOrder as SalesOrder,
1232
- type SalesOrderEmailContactInput as SalesOrderEmailContactInput,
1233
- type SalesOrderLine as SalesOrderLine,
1234
- type SalesOrderRelated as SalesOrderRelated,
1235
- type SalesOrderStatus as SalesOrderStatus,
1236
- type SalesOrderTotals as SalesOrderTotals,
1237
- type SalesOrderRetrieveStatusesParams as SalesOrderRetrieveStatusesParams,
1238
- type SalesOrderListParams as SalesOrderListParams,
1239
- type SalesOrderCreateParams as SalesOrderCreateParams,
1240
- };
1241
- }
3
+ export * from './sales-orders/index';