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