@sixtyninecommerce/admin 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +2739 -17
  2. package/dist/api-tokens/index.d.ts +15 -5
  3. package/dist/api-tokens/index.js +1 -0
  4. package/dist/apps/event-subscription.d.ts +59 -0
  5. package/dist/apps/event-subscription.js +32 -0
  6. package/dist/apps/hook-secret.d.ts +22 -0
  7. package/dist/apps/hook-secret.js +36 -0
  8. package/dist/apps/index.d.ts +54 -3
  9. package/dist/apps/index.js +17 -0
  10. package/dist/audit/index.d.ts +7 -0
  11. package/dist/auth/queries.d.ts +5 -1
  12. package/dist/auth/queries.js +6 -0
  13. package/dist/bulk/index.d.ts +323 -0
  14. package/dist/bulk/index.js +162 -0
  15. package/dist/catalog/assets.d.ts +147 -0
  16. package/dist/catalog/assets.js +164 -0
  17. package/dist/catalog/collections.d.ts +109 -0
  18. package/dist/catalog/collections.js +91 -0
  19. package/dist/catalog/facets.d.ts +103 -0
  20. package/dist/catalog/facets.js +100 -0
  21. package/dist/catalog/index.d.ts +115 -0
  22. package/dist/catalog/index.js +21 -0
  23. package/dist/catalog/options.d.ts +89 -0
  24. package/dist/catalog/options.js +88 -0
  25. package/dist/catalog/products-bulk.d.ts +21 -0
  26. package/dist/catalog/products-bulk.js +58 -0
  27. package/dist/catalog/products.d.ts +650 -0
  28. package/dist/catalog/products.js +458 -0
  29. package/dist/catalog/properties.d.ts +234 -0
  30. package/dist/catalog/properties.js +158 -0
  31. package/dist/catalog/types.d.ts +174 -0
  32. package/dist/catalog/types.js +141 -0
  33. package/dist/catalog/variants.d.ts +324 -0
  34. package/dist/catalog/variants.js +288 -0
  35. package/dist/catalog/visibility.d.ts +57 -0
  36. package/dist/catalog/visibility.js +59 -0
  37. package/dist/client.d.ts +192 -3
  38. package/dist/client.js +87 -12
  39. package/dist/compliance/index.d.ts +88 -0
  40. package/dist/compliance/index.js +88 -0
  41. package/dist/customer-data-redaction.d.ts +14 -0
  42. package/dist/customer-data-redaction.js +22 -0
  43. package/dist/customers/index.d.ts +428 -17
  44. package/dist/customers/index.js +322 -15
  45. package/dist/documents/index.d.ts +513 -16
  46. package/dist/documents/index.js +229 -3
  47. package/dist/events/index.d.ts +259 -0
  48. package/dist/events/index.js +147 -0
  49. package/dist/feeds/ai.d.ts +46 -0
  50. package/dist/feeds/ai.js +43 -0
  51. package/dist/feeds/categories.d.ts +50 -0
  52. package/dist/feeds/categories.js +56 -0
  53. package/dist/feeds/configs.d.ts +54 -0
  54. package/dist/feeds/configs.js +85 -0
  55. package/dist/feeds/identifier-fields.d.ts +25 -0
  56. package/dist/feeds/identifier-fields.js +29 -0
  57. package/dist/feeds/index.d.ts +54 -0
  58. package/dist/feeds/index.js +46 -0
  59. package/dist/feeds/preserve.d.ts +38 -0
  60. package/dist/feeds/preserve.js +74 -0
  61. package/dist/feeds/rules.d.ts +42 -0
  62. package/dist/feeds/rules.js +56 -0
  63. package/dist/feeds/types.d.ts +654 -0
  64. package/dist/feeds/types.js +135 -0
  65. package/dist/fulfillments/index.d.ts +437 -0
  66. package/dist/fulfillments/index.js +534 -0
  67. package/dist/heads/index.d.ts +60 -0
  68. package/dist/heads/index.js +45 -0
  69. package/dist/hooks/assignments.d.ts +90 -0
  70. package/dist/hooks/assignments.js +53 -0
  71. package/dist/hooks/index.d.ts +97 -0
  72. package/dist/hooks/index.js +76 -0
  73. package/dist/index.d.ts +95 -9
  74. package/dist/index.js +21 -1
  75. package/dist/integrations/index.d.ts +14 -0
  76. package/dist/integrations/index.js +9 -0
  77. package/dist/integrations/pipelines.d.ts +113 -0
  78. package/dist/integrations/pipelines.js +62 -0
  79. package/dist/integrations/types.d.ts +176 -0
  80. package/dist/integrations/types.js +8 -0
  81. package/dist/jobs/bulk-action-run.d.ts +74 -0
  82. package/dist/jobs/bulk-action-run.js +69 -0
  83. package/dist/locations/index.d.ts +6 -2
  84. package/dist/meta/index.d.ts +32 -0
  85. package/dist/orders/bulk.d.ts +75 -0
  86. package/dist/orders/bulk.js +150 -0
  87. package/dist/orders/commit-edit.d.ts +123 -0
  88. package/dist/orders/commit-edit.js +142 -0
  89. package/dist/orders/deposit-policy.d.ts +103 -0
  90. package/dist/orders/deposit-policy.js +202 -0
  91. package/dist/orders/get.d.ts +722 -0
  92. package/dist/orders/get.js +530 -0
  93. package/dist/orders/index.d.ts +186 -21
  94. package/dist/orders/index.js +57 -0
  95. package/dist/orders/line-price-preview.d.ts +297 -0
  96. package/dist/orders/line-price-preview.js +50 -0
  97. package/dist/orders/manual-discounts.d.ts +141 -0
  98. package/dist/orders/manual-discounts.js +97 -0
  99. package/dist/orders/manual-pricing.d.ts +192 -0
  100. package/dist/orders/manual-pricing.js +72 -0
  101. package/dist/orders/order-entry.d.ts +566 -0
  102. package/dist/orders/order-entry.js +129 -0
  103. package/dist/orders/parcel-charge.d.ts +45 -0
  104. package/dist/orders/parcel-charge.js +55 -0
  105. package/dist/orders/plan-edit.d.ts +489 -0
  106. package/dist/orders/plan-edit.js +93 -0
  107. package/dist/orders/status.d.ts +235 -0
  108. package/dist/orders/status.js +96 -0
  109. package/dist/orders/surcharges.d.ts +75 -2
  110. package/dist/orders/surcharges.js +110 -4
  111. package/dist/payments/account-credit.d.ts +171 -0
  112. package/dist/payments/account-credit.js +107 -0
  113. package/dist/payments/index.d.ts +241 -9
  114. package/dist/payments/index.js +92 -0
  115. package/dist/payments/methods.d.ts +37 -0
  116. package/dist/payments/methods.js +33 -0
  117. package/dist/platform/catalog.d.ts +148 -0
  118. package/dist/platform/catalog.js +74 -0
  119. package/dist/platform/entitlements.d.ts +111 -0
  120. package/dist/platform/entitlements.js +86 -0
  121. package/dist/platform/legal-entities.d.ts +139 -0
  122. package/dist/platform/legal-entities.js +126 -0
  123. package/dist/platform/legal-entity-numbering.d.ts +103 -0
  124. package/dist/platform/legal-entity-numbering.js +101 -0
  125. package/dist/platform/organization-membership.d.ts +80 -0
  126. package/dist/platform/organization-membership.js +71 -0
  127. package/dist/platform/organization-settings.d.ts +33 -0
  128. package/dist/platform/organization-settings.js +42 -0
  129. package/dist/platform/organization-sharing.d.ts +172 -0
  130. package/dist/platform/organization-sharing.js +120 -0
  131. package/dist/platform/organizations.d.ts +205 -0
  132. package/dist/platform/organizations.js +180 -0
  133. package/dist/platform/provision-store.d.ts +88 -8
  134. package/dist/platform/provision-store.js +12 -0
  135. package/dist/platform/reports.d.ts +46 -0
  136. package/dist/platform/reports.js +31 -0
  137. package/dist/platform/server-metrics.d.ts +58 -0
  138. package/dist/platform/server-metrics.js +11 -0
  139. package/dist/pos/index.d.ts +567 -0
  140. package/dist/pos/index.js +205 -0
  141. package/dist/pricing/index.d.ts +408 -0
  142. package/dist/pricing/index.js +353 -0
  143. package/dist/pricing/vouchers.d.ts +103 -0
  144. package/dist/pricing/vouchers.js +69 -0
  145. package/dist/provenance/index.d.ts +93 -0
  146. package/dist/provenance/index.js +53 -0
  147. package/dist/reports/index.d.ts +199 -0
  148. package/dist/reports/index.js +154 -0
  149. package/dist/returns/index.d.ts +225 -0
  150. package/dist/returns/index.js +160 -0
  151. package/dist/search/index.d.ts +99 -0
  152. package/dist/search/index.js +62 -0
  153. package/dist/shipping/parcel-count-suggestion.d.ts +52 -0
  154. package/dist/shipping/parcel-count-suggestion.js +73 -0
  155. package/dist/shipping/parcel-rule.d.ts +48 -0
  156. package/dist/shipping/parcel-rule.js +91 -0
  157. package/dist/stock/index.d.ts +166 -0
  158. package/dist/stock/index.js +115 -0
  159. package/dist/stock/transfers.d.ts +520 -0
  160. package/dist/stock/transfers.js +437 -0
  161. package/dist/stored-value/index.d.ts +154 -0
  162. package/dist/stored-value/index.js +130 -0
  163. package/dist/tenant/capabilities.d.ts +10 -0
  164. package/dist/tenant/entitlements.d.ts +35 -0
  165. package/dist/tenant/entitlements.js +15 -0
  166. package/dist/tenant/field-groups.d.ts +64 -0
  167. package/dist/tenant/field-groups.js +34 -0
  168. package/dist/tenant/legal-entity.d.ts +32 -0
  169. package/dist/tenant/legal-entity.js +41 -0
  170. package/dist/tenant/notifications.d.ts +148 -0
  171. package/dist/tenant/notifications.js +79 -0
  172. package/dist/tenant/retention.d.ts +10 -4
  173. package/dist/tenant/settings-sources.d.ts +103 -0
  174. package/dist/tenant/settings-sources.js +92 -0
  175. package/dist/types.d.ts +86 -11
  176. package/dist/uploads/index.d.ts +11 -7
  177. package/dist/users/index.d.ts +104 -0
  178. package/dist/users/index.js +80 -0
  179. package/package.json +3 -2
@@ -0,0 +1,722 @@
1
+ /**
2
+ * `admin.orders.get(orderId)`: one order, typed (headless spec §9.2 `orders`
3
+ * "read", plan W9-9).
4
+ *
5
+ * The read has two layers. The CORE is what the engine itself serves for an
6
+ * order, and it is all a call without `include` asks for. Around it sit the
7
+ * blocks a plugin adds to an order (payment terms, delivery terms, the order's
8
+ * own price list, the ERP and carrier references). Each is asked for by name
9
+ * in `include`, so a caller reads only what it uses, and the core document
10
+ * names no field an engine without that plugin lacks.
11
+ *
12
+ * Money is an integer in minor units of the order's currency, with three
13
+ * exceptions that are NOT converted to it: a line's `productVariant.price` and
14
+ * `priceWithTax` (the catalogue price in the currency of the request, which is
15
+ * the store's default unless the call names another), and a line's
16
+ * `customFields.cost` (the store's default currency). An instant is an ISO-8601
17
+ * string with its offset.
18
+ */
19
+ import { type Transport } from '@sixtyninecommerce/core';
20
+ import type { InventoryFlag } from '../catalog/variants.js';
21
+ import type { OrderDiscount } from '../pricing/index.js';
22
+ import type { Call } from '../types.js';
23
+ /**
24
+ * The blocks a plugin adds to an order, in the order the document lists them.
25
+ *
26
+ * - `paymentTerms`: the payment terms the order was placed under, and the
27
+ * order's own override of them (the B2B credit plugin).
28
+ * - `deliveryTerms`: the delivery terms accepted at placement (the shipping
29
+ * calculator plugin).
30
+ * - `priceList`: the order's own price list, which is its one-time pricing
31
+ * (the price-list plugin).
32
+ * - `lineAllocations`: each line's raw allocation rows (the stock-transfer
33
+ * plugin). They never decrement: `OrderLine.outstandingAllocations` is what a
34
+ * line reserves now, and needs no include.
35
+ * - `fulfillmentDetails`: each fulfillment's handler (code, name, its detail
36
+ * rows) and packing slips (the order-documents plugin).
37
+ * - `vatValidation`: the customer's VAT number and its validation status (the
38
+ * VAT-validation plugin).
39
+ * - `afas`, `parasut`: the references those ERP plugins keep on the order, its
40
+ * customer and the customer's addresses.
41
+ * - `myparcel`: the MyParcel shipment and label state on each fulfillment.
42
+ */
43
+ export declare const ORDER_INCLUDES: readonly ["paymentTerms", "deliveryTerms", "priceList", "lineAllocations", "fulfillmentDetails", "vatValidation", "afas", "parasut", "myparcel"];
44
+ export type OrderInclude = (typeof ORDER_INCLUDES)[number];
45
+ /** `Fields` when the read asked for `K` (for a union: any of them), else nothing. */
46
+ type Block<I extends OrderInclude, K extends OrderInclude, Fields> = [Extract<I, K>] extends [never] ? unknown : Fields;
47
+ /** Why an order's fulfillment is on hold. */
48
+ export type OrderFulfillmentHoldReason = 'awaiting_payment' | 'address_issue' | 'customer_request' | 'credit_check' | 'stock_issue' | 'other';
49
+ /** Whether payment terms could be established for the order's customer. */
50
+ export type OrderPaymentTermsStatus = 'ASSIGNED' | 'UNASSIGNED' | 'UNRESOLVED' | 'STALE' | 'CONFLICT';
51
+ /** What kind of payment condition the terms are. */
52
+ export type OrderPaymentTermsClassification = 'SINGLE_DUE_DATE' | 'COMPLEX' | 'UNRESOLVED' | 'UNASSIGNED' | 'CONFLICT';
53
+ /** Whether a part of the delivery terms could be established. */
54
+ export type OrderDeliveryTermsStatus = 'ASSIGNED' | 'UNASSIGNED' | 'UNRESOLVED' | 'STALE' | 'CONFLICT';
55
+ /** Where the order's shipping method came from. */
56
+ export type OrderDeliverySelectionSource = 'CUSTOMER_DEFAULT' | 'EXPLICIT_OVERRIDE' | 'IMPORTED' | 'UNKNOWN';
57
+ /** Whether the customer accepts a partial delivery. */
58
+ export type OrderDeliveryAdvice = 'PARTIAL_ALLOWED' | 'COMPLETE_ORDER' | 'PARTIAL_WITHOUT_BACKORDER' | 'UNKNOWN';
59
+ /** An address as the order holds it: a snapshot, not the customer's address book entry. */
60
+ export interface OrderAddress {
61
+ fullName: string | null;
62
+ company: string | null;
63
+ streetLine1: string | null;
64
+ streetLine2: string | null;
65
+ city: string | null;
66
+ province: string | null;
67
+ postalCode: string | null;
68
+ /** The country's name. */
69
+ country: string | null;
70
+ countryCode: string | null;
71
+ phoneNumber: string | null;
72
+ }
73
+ /** One entry of the customer's address book. */
74
+ export type OrderCustomerAddress<I extends OrderInclude = never> = {
75
+ id: string;
76
+ fullName: string | null;
77
+ company: string | null;
78
+ streetLine1: string;
79
+ streetLine2: string | null;
80
+ city: string | null;
81
+ postalCode: string | null;
82
+ country: {
83
+ code: string;
84
+ };
85
+ defaultShippingAddress: boolean | null;
86
+ defaultBillingAddress: boolean | null;
87
+ } & Block<I, 'afas', {
88
+ customFields: {
89
+ afasAddressId: string | null;
90
+ } | null;
91
+ }>;
92
+ /** The customer's VAT number and what validating it found (`vatValidation`). */
93
+ export interface OrderCustomerVatFields {
94
+ vatNumber: string | null;
95
+ vatValidationStatus: string | null;
96
+ }
97
+ /** The AFAS records the customer is linked to (`afas`). */
98
+ export interface OrderCustomerAfasFields {
99
+ /** The AFAS debtor. */
100
+ afasVrId: string | null;
101
+ afasOrgId: string | null;
102
+ afasContactId: string | null;
103
+ afasPersId: string | null;
104
+ }
105
+ /** The Parasut contact the customer is linked to (`parasut`). */
106
+ export interface OrderCustomerParasutFields {
107
+ parasutContactId: string | null;
108
+ }
109
+ /** The customer the order belongs to. */
110
+ export type OrderCustomer<I extends OrderInclude = never> = {
111
+ id: string;
112
+ firstName: string;
113
+ lastName: string;
114
+ emailAddress: string;
115
+ phoneNumber: string | null;
116
+ addresses: OrderCustomerAddress<I>[] | null;
117
+ } & Block<I, 'vatValidation' | 'afas' | 'parasut', {
118
+ customFields: (Block<I, 'vatValidation', OrderCustomerVatFields> & Block<I, 'afas', OrderCustomerAfasFields> & Block<I, 'parasut', OrderCustomerParasutFields>) | null;
119
+ }>;
120
+ export interface OrderAsset {
121
+ id: string;
122
+ /** The preview image's URL. */
123
+ preview: string;
124
+ }
125
+ /** A variant's stock at one location. */
126
+ export interface OrderLineStockLevel {
127
+ stockLocationId: string;
128
+ stockOnHand: number;
129
+ /** What open orders have reserved there. */
130
+ stockAllocated: number;
131
+ stockLocation: {
132
+ id: string;
133
+ name: string;
134
+ };
135
+ }
136
+ /** The variant a line sells, as it stands now (not as it stood at placement). */
137
+ export interface OrderLineVariant {
138
+ id: string;
139
+ name: string;
140
+ sku: string;
141
+ /**
142
+ * The catalogue unit price today, net and gross: the retail price, before any
143
+ * price list or override, unlike the line's own `unitPrice`.
144
+ *
145
+ * NOT in the order's currency. It is in the currency of the request: the
146
+ * store's default, unless the call names another (`tenant.currency`). On an
147
+ * order in another currency, never subtract it from or compare it with the
148
+ * line's own prices.
149
+ */
150
+ price: number;
151
+ priceWithTax: number;
152
+ stockOnHand: number;
153
+ stockAllocated: number;
154
+ /** How the variant tracks stock: its own setting, or the store's (`INHERIT`). */
155
+ trackInventory: InventoryFlag | (string & {});
156
+ outOfStockThreshold: number;
157
+ useGlobalOutOfStockThreshold: boolean;
158
+ stockLevels: OrderLineStockLevel[];
159
+ product: {
160
+ id: string;
161
+ name: string;
162
+ featuredAsset: OrderAsset | null;
163
+ };
164
+ }
165
+ /** What a line reserves at one location now. */
166
+ export interface OrderLineOutstandingAllocation {
167
+ stockLocationId: string;
168
+ stockLocationName: string;
169
+ quantity: number;
170
+ }
171
+ /** One raw allocation row of a line (`lineAllocations`). */
172
+ export interface OrderLineAllocation {
173
+ id: string;
174
+ stockLocation: {
175
+ id: string;
176
+ name: string;
177
+ };
178
+ quantity: number;
179
+ }
180
+ /** How a line came to its price. */
181
+ export interface OrderLineCustomFields {
182
+ /**
183
+ * A price a merchant set for this line, in the LINE's tax basis: gross when
184
+ * `OrderLine.listPriceIncludesTax`, net otherwise. It is not the charged
185
+ * price: the order's price list discounts it in turn.
186
+ */
187
+ unitPriceOverride: number | null;
188
+ priceOverrideReason: string | null;
189
+ /** The override is an exact price that the price list must not discount. */
190
+ unitPriceImported: boolean | null;
191
+ /** The price list the line was priced from, if any. */
192
+ priceListId: string | null;
193
+ priceListName: string | null;
194
+ /** The retail unit price when the line was priced. Always gross. */
195
+ retailPrice: number | null;
196
+ /** The unit price the price list gave. Always gross. */
197
+ priceListPrice: number | null;
198
+ /** `percentage`, `fixed_amount`, `fixed_price` or `chain`. */
199
+ priceListDiscountType: string | null;
200
+ /** Basis points for `percentage`, minor units for the fixed types, null for `chain`. */
201
+ priceListDiscountValue: number | null;
202
+ /** JSON: the basis-point discounts of a `chain` entry. */
203
+ priceListDiscountChain: string | null;
204
+ /**
205
+ * The variant's unit cost when the line was priced, net. NOT in the order's
206
+ * currency: it is the variant's cost as recorded, in the store's default
207
+ * currency, and is not converted.
208
+ */
209
+ cost: number | null;
210
+ /** The location a merchant picked for this line to ship from. */
211
+ preferredStockLocationId: string | null;
212
+ /** Units that stock did not cover at placement. */
213
+ backorderedQuantity: number | null;
214
+ }
215
+ export type OrderLine<I extends OrderInclude = never> = {
216
+ id: string;
217
+ quantity: number;
218
+ unitPrice: number;
219
+ unitPriceWithTax: number;
220
+ /**
221
+ * The line's list price is stored gross. It follows the customer's tax zone,
222
+ * not the store's setting: a store that prices gross still holds net lines
223
+ * for a customer in a tax-exclusive country.
224
+ */
225
+ listPriceIncludesTax: boolean;
226
+ discountedUnitPrice: number;
227
+ discountedUnitPriceWithTax: number;
228
+ linePrice: number;
229
+ linePriceWithTax: number;
230
+ discountedLinePrice: number;
231
+ discountedLinePriceWithTax: number;
232
+ /** The line total with order-level discounts spread over the lines: what the subtotal sums. */
233
+ proratedLinePrice: number;
234
+ proratedLinePriceWithTax: number;
235
+ /** A percentage: 21 for 21 %. */
236
+ taxRate: number;
237
+ productVariant: OrderLineVariant;
238
+ featuredAsset: OrderAsset | null;
239
+ /**
240
+ * The units the line reserves now: allocations plus sales minus releases. It
241
+ * is 0 after a full release, and once the line has shipped.
242
+ */
243
+ outstandingAllocatedQuantity: number;
244
+ /** The same, per location, largest first. Empty when nothing is reserved. */
245
+ outstandingAllocations: OrderLineOutstandingAllocation[];
246
+ customFields: OrderLineCustomFields | null;
247
+ } & Block<I, 'lineAllocations', {
248
+ allocations: OrderLineAllocation[];
249
+ }>;
250
+ export interface OrderSurcharge {
251
+ id: string;
252
+ description: string;
253
+ sku: string | null;
254
+ /** Net. Negative for a discount. */
255
+ price: number;
256
+ priceWithTax: number;
257
+ /** A percentage: 21 for 21 %. */
258
+ taxRate: number;
259
+ }
260
+ export interface OrderRefund {
261
+ id: string;
262
+ state: string;
263
+ total: number;
264
+ reason: string | null;
265
+ }
266
+ export interface OrderPayment {
267
+ id: string;
268
+ state: string;
269
+ /** The payment method's code. */
270
+ method: string;
271
+ amount: number;
272
+ transactionId: string | null;
273
+ createdAt: string;
274
+ refunds: OrderRefund[];
275
+ }
276
+ /** A packing slip issued for a fulfillment (`fulfillmentDetails`). */
277
+ export interface OrderPackingSlip {
278
+ id: string;
279
+ packingSlipNumber: string;
280
+ fulfillmentId: string;
281
+ languageCode: string;
282
+ storageKey: string;
283
+ createdAt: string;
284
+ }
285
+ /** What `fulfillmentDetails` adds to a fulfillment. */
286
+ export interface OrderFulfillmentDetails {
287
+ /** The code of the handler that created the fulfillment, e.g. `hendriks-3pl`. */
288
+ handlerCode: string;
289
+ /** The handler's display name, or its code when the handler is no longer registered. */
290
+ handlerName: string;
291
+ /** The handler's own rows (a 3PL order number, a barcode). Empty when it has none. */
292
+ handlerDetails: Array<{
293
+ label: string;
294
+ value: string;
295
+ }>;
296
+ packingSlips: OrderPackingSlip[];
297
+ }
298
+ /** The MyParcel shipment and label state of a fulfillment (`myparcel`). */
299
+ export interface OrderFulfillmentMyparcelFields {
300
+ myparcelShipmentId: number | null;
301
+ /** `pending`, `ready` or `failed`. */
302
+ myparcelLabelStatus: string | null;
303
+ /** `A4`, `A6` or `BOTH`. */
304
+ myparcelLabelFormat: string | null;
305
+ myparcelLabelUrlA4: string | null;
306
+ myparcelLabelUrlA6: string | null;
307
+ myparcelLabelLastError: string | null;
308
+ /** A label handoff to the 3PL is pending. Set before a shipment exists. */
309
+ myparcelLabelHandoff: boolean | null;
310
+ }
311
+ export type OrderFulfillment<I extends OrderInclude = never> = {
312
+ id: string;
313
+ state: string;
314
+ nextStates: string[];
315
+ method: string;
316
+ trackingCode: string | null;
317
+ lines: Array<{
318
+ orderLineId: string;
319
+ quantity: number;
320
+ }>;
321
+ /**
322
+ * The warehouse it ships from. Null when none was recorded, or when that
323
+ * warehouse is no longer in this store.
324
+ */
325
+ stockLocationName: string | null;
326
+ /**
327
+ * Every order this fulfillment ships in this store, this one included,
328
+ * oldest placement first. One fulfillment can ship several orders of one
329
+ * customer.
330
+ */
331
+ linkedOrders: Array<{
332
+ id: string;
333
+ code: string;
334
+ }>;
335
+ customFields: ({
336
+ /** `none`, `booking`, `booked`, `failed` or `cancelled`. Null: booked when it was created. */
337
+ bookingStatus: string | null;
338
+ } & Block<I, 'myparcel', OrderFulfillmentMyparcelFields>) | null;
339
+ createdAt: string;
340
+ } & Block<I, 'fulfillmentDetails', OrderFulfillmentDetails>;
341
+ export interface OrderHistoryEntry {
342
+ id: string;
343
+ /** The engine's history entry type, e.g. `ORDER_STATE_TRANSITION`. */
344
+ type: string;
345
+ /** The entry's own payload. Its shape depends on `type`. */
346
+ data: Record<string, unknown>;
347
+ createdAt: string;
348
+ isPublic: boolean;
349
+ /** Who caused it. Null for the customer and for the system. */
350
+ administrator: {
351
+ id: string;
352
+ firstName: string;
353
+ lastName: string;
354
+ } | null;
355
+ }
356
+ export interface OrderTaxSummary {
357
+ description: string;
358
+ /** A percentage: 21 for 21 %. */
359
+ taxRate: number;
360
+ taxBase: number;
361
+ taxTotal: number;
362
+ }
363
+ /** The order's active fulfillment hold. */
364
+ export interface OrderFulfillmentHold {
365
+ /** Null for a hold placed before holds carried a reason. */
366
+ reason: OrderFulfillmentHoldReason | (string & {}) | null;
367
+ note: string | null;
368
+ heldAt: string | null;
369
+ heldByUserId: string | null;
370
+ /** The display name of the administrator who placed it, when it can be resolved. */
371
+ heldBy: string | null;
372
+ }
373
+ /** The order's own fields that the engine itself declares. */
374
+ export interface OrderCustomFields {
375
+ /** The order's content is locked. `admin.orders.status` says by what. */
376
+ isLocked: boolean | null;
377
+ /** The order's id on the platform it was imported from. */
378
+ externalOrderId: string | null;
379
+ externalPlatform: string | null;
380
+ /**
381
+ * Whether the source platform had already handed an imported order to its
382
+ * own fulfillment provider. Null: not established, or not an imported order.
383
+ */
384
+ sourceFulfillmentHandedOff: boolean | null;
385
+ /** When an imported order was placed on its source platform. */
386
+ originalPlacedAt: string | null;
387
+ sourceWarehouse: string | null;
388
+ /** JSON: the pickup location the buyer chose. */
389
+ pickupLocation: string | null;
390
+ /** When the order's stock reservation expires. */
391
+ allocationExpiresAt: string | null;
392
+ /** A signed gross amount (0 or below) that rounds the payable total down. */
393
+ goodwillRoundingMinor: number | null;
394
+ /** Null: the tax rules decide. True: tax removed. False: tax kept. */
395
+ removeTax: boolean | null;
396
+ isGift: boolean | null;
397
+ giftNote: string | null;
398
+ hidePricesOnPackingSlip: boolean | null;
399
+ /** The buyer's purchase-order reference. */
400
+ poNumber: string | null;
401
+ requestedDeliveryDate: string | null;
402
+ orderNotes: string | null;
403
+ /** The address book entry the shipping address was taken from. */
404
+ customerShippingAddressId: string | null;
405
+ customerBillingAddressId: string | null;
406
+ /** The shipping address is for this order only. */
407
+ shippingAddressIsTemporary: boolean | null;
408
+ billingAddressIsTemporary: boolean | null;
409
+ /**
410
+ * The four projected status dimensions. Null on an order that predates
411
+ * them, and for a moment on an order just created or changed.
412
+ */
413
+ paymentStatus: string | null;
414
+ fulfillmentStatus: string | null;
415
+ returnStatus: string | null;
416
+ /** `draft`, `open`, `completed` or `cancelled`. */
417
+ lifecycleStatus: string | null;
418
+ }
419
+ /** The order's own override of its payment terms (`paymentTerms`). */
420
+ export interface OrderPaymentTermsFields {
421
+ /** A due-day override. Never set together with `paymentConditionCode`. */
422
+ paymentTermsDays: number | null;
423
+ /** An ERP payment-condition override. */
424
+ paymentConditionCode: string | null;
425
+ }
426
+ /** What AFAS holds for the order (`afas`). */
427
+ export interface OrderAfasFields {
428
+ afasSalesOrderId: string | null;
429
+ afasDirectInvoiceOrNu: string | null;
430
+ afasInvoiceNumber: string | null;
431
+ afasInvoiceDate: string | null;
432
+ /** The order is settled or invoiced in AFAS. */
433
+ afasLocked: boolean | null;
434
+ afasLockReason: string | null;
435
+ afasLastSyncAt: string | null;
436
+ }
437
+ /** What Parasut holds for the order (`parasut`). */
438
+ export interface OrderParasutFields {
439
+ parasutInvoiceId: string | null;
440
+ parasutEInvoiceStatus: string | null;
441
+ parasutEInvoiceUuid: string | null;
442
+ parasutLastError: string | null;
443
+ }
444
+ /** The payment terms the order was placed under, and what the ERP later confirmed. */
445
+ export interface OrderPaymentTerms {
446
+ /** Where the terms came from: an ERP, the store's default. */
447
+ source: string;
448
+ managedExternally: boolean;
449
+ status: OrderPaymentTermsStatus | (string & {});
450
+ conditionCode: string | null;
451
+ conditionDescription: string | null;
452
+ /** The terms in a sentence. */
453
+ summary: string;
454
+ classification: OrderPaymentTermsClassification | (string & {});
455
+ paymentDays: number | null;
456
+ paymentEndOfMonths: number | null;
457
+ paymentMethod: string | null;
458
+ percentage: number | null;
459
+ discountPaymentDays: number | null;
460
+ discountPercentage: number | null;
461
+ paymentDiscountType: string | null;
462
+ stale: boolean;
463
+ syncedAt: string | null;
464
+ error: string | null;
465
+ /** When the terms were fixed on the order. */
466
+ resolvedAt: string;
467
+ /** What the ERP holds for the order, read back after the push. */
468
+ remoteConditionCode: string | null;
469
+ remoteConfirmedAt: string | null;
470
+ /** The ERP holds a different condition than the order was placed under. */
471
+ remoteMismatch: boolean;
472
+ }
473
+ /** The delivery terms accepted when the order was placed, and what the ERP later confirmed. */
474
+ export interface OrderDeliveryTerms {
475
+ source: string;
476
+ sourceScope: string | null;
477
+ governingCustomerId: string | null;
478
+ sourceCustomerId: string | null;
479
+ managedExternally: boolean;
480
+ status: OrderDeliveryTermsStatus | (string & {});
481
+ shippingMethodStatus: OrderDeliveryTermsStatus | (string & {});
482
+ policyStatus: OrderDeliveryTermsStatus | (string & {});
483
+ /** The terms in a sentence. */
484
+ summary: string;
485
+ selectionSource: OrderDeliverySelectionSource | (string & {});
486
+ selectedShippingMethodId: string | null;
487
+ selectedShippingMethodCode: string | null;
488
+ selectedShippingMethodName: string | null;
489
+ platformShippingMethodCode: string | null;
490
+ platformShippingMethodName: string | null;
491
+ platformShippingMethodDescription: string | null;
492
+ platformShippingPrice: number | null;
493
+ platformShippingPriceWithTax: number | null;
494
+ preferredShippingMethodId: string | null;
495
+ incotermStatus: OrderDeliveryTermsStatus | (string & {});
496
+ incotermCode: string | null;
497
+ incotermVersion: number | null;
498
+ incotermAddress: string | null;
499
+ incotermDescription: string | null;
500
+ shippingLeadDays: number | null;
501
+ deliveryAdvice: OrderDeliveryAdvice | (string & {});
502
+ stale: boolean;
503
+ syncedAt: string | null;
504
+ warning: string | null;
505
+ /** When the terms were fixed on the order. */
506
+ resolvedAt: string;
507
+ /** What the ERP holds for the order, read back after the push. */
508
+ remoteShippingMethodCode: string | null;
509
+ remoteShippingMethodName: string | null;
510
+ remoteIncotermCode: string | null;
511
+ remoteIncotermVersion: number | null;
512
+ remoteIncotermAddress: string | null;
513
+ remoteDeliveryDate: string | null;
514
+ remoteConfirmedAt: string | null;
515
+ /** The ERP holds different terms than the order was placed under. */
516
+ remoteMismatch: boolean;
517
+ }
518
+ /** The price list locked to the order: its one-time pricing. */
519
+ export interface OrderPriceList {
520
+ id: string;
521
+ name: string;
522
+ /** The merchant's reason for the discount. */
523
+ description: string | null;
524
+ /** A whole-order percentage in basis points, for every line without an entry of its own. */
525
+ defaultDiscountBps: number | null;
526
+ /** A whole-order amount PER UNIT, in the store's tax basis. */
527
+ defaultDiscountAmount: number | null;
528
+ /** Keyed by variant: two lines of one variant share an entry. */
529
+ entries: Array<{
530
+ id: string;
531
+ variantId: string;
532
+ /** `percentage`, `fixed_amount` or `fixed_price`. */
533
+ discountType: string;
534
+ /** Basis points for `percentage`, minor units in the store's tax basis otherwise. */
535
+ discountValue: number;
536
+ }>;
537
+ }
538
+ /**
539
+ * An order. `I` is the set of blocks the read asked for: a block's fields are
540
+ * on the type only when it was included, as they are on the answer.
541
+ */
542
+ export type Order<I extends OrderInclude = never> = {
543
+ id: string;
544
+ code: string;
545
+ /** The engine state. `admin.orders.status` answers what it allows. */
546
+ state: string;
547
+ /**
548
+ * The order is a cart still open to its shopper. False for a draft, for a
549
+ * placed order and for a cancelled one. It says nothing about payment: an
550
+ * order placed on an authorized payment or on account is not active, with
551
+ * nothing collected yet.
552
+ */
553
+ active: boolean;
554
+ total: number;
555
+ totalWithTax: number;
556
+ subTotal: number;
557
+ subTotalWithTax: number;
558
+ shipping: number;
559
+ shippingWithTax: number;
560
+ /** ISO 4217. */
561
+ currencyCode: string;
562
+ /** Null until the order is placed. */
563
+ orderPlacedAt: string | null;
564
+ couponCodes: string[];
565
+ /** Null on an order no customer was set on yet. */
566
+ customer: OrderCustomer<I> | null;
567
+ lines: OrderLine<I>[];
568
+ surcharges: OrderSurcharge[];
569
+ /**
570
+ * Every promotion's discount on the order, one entry per promotion, amounts
571
+ * negative: the line promotions and the order promotions' shares of the lines
572
+ * and of shipping, added up per promotion. A line's own discounts are already
573
+ * in its `discountedLinePrice`, so do not add the two. The read selects these
574
+ * three fields of the pricing module's `OrderDiscount`;
575
+ * `pricing.discounts(orderId)` answers the rest.
576
+ */
577
+ discounts: Array<Pick<OrderDiscount, 'description' | 'amount' | 'amountWithTax'>>;
578
+ shippingLines: Array<{
579
+ shippingMethod: {
580
+ id: string;
581
+ name: string;
582
+ };
583
+ }>;
584
+ payments: OrderPayment[] | null;
585
+ fulfillments: OrderFulfillment<I>[] | null;
586
+ shippingAddress: OrderAddress | null;
587
+ billingAddress: OrderAddress | null;
588
+ /** The 50 most recent history entries, newest first. */
589
+ history: {
590
+ items: OrderHistoryEntry[];
591
+ };
592
+ taxSummary: OrderTaxSummary[];
593
+ /** Every state the engine's order process allows next. */
594
+ nextStates: string[];
595
+ createdAt: string;
596
+ updatedAt: string;
597
+ customFields: (OrderCustomFields & Block<I, 'paymentTerms', OrderPaymentTermsFields> & Block<I, 'afas', OrderAfasFields> & Block<I, 'parasut', OrderParasutFields>) | null;
598
+ /** Null when the order is not on hold. */
599
+ fulfillmentHold: OrderFulfillmentHold | null;
600
+ /**
601
+ * Set when the order was read by an app installation below `customerData:
602
+ * full`: the customer data its level withholds came back blanked. A blanked
603
+ * field is `null`, or an empty value where the field is never null: `""`
604
+ * for a string, `{}` for a history entry's `data`.
605
+ *
606
+ * Any part of the answer can be blanked, in the core read and in every
607
+ * block: whatever the engine counts as customer data at the installation's
608
+ * level. That is the customer and their addresses, both order addresses
609
+ * apart from the country, what the buyer typed, and text a carrier, an ERP
610
+ * or a plugin composed from the customer's record (a tracking code, a label
611
+ * link, a handler's detail rows, an error it reported, the delivery terms in
612
+ * a sentence). The engine decides the set, and it grows.
613
+ *
614
+ * So when this is set, read EVERY empty value on the order as "not
615
+ * granted", never as "none on record": an empty email is not a customer
616
+ * without one, a null label link is not a label still to come. Absent on an
617
+ * order nothing was withheld from.
618
+ */
619
+ redacted?: true;
620
+ } & Block<I, 'paymentTerms', {
621
+ paymentTerms: OrderPaymentTerms | null;
622
+ }> & Block<I, 'deliveryTerms', {
623
+ deliveryTerms: OrderDeliveryTerms | null;
624
+ }> & Block<I, 'priceList', {
625
+ priceList: OrderPriceList | null;
626
+ }>;
627
+ /**
628
+ * The order document with EVERY block, written out whole.
629
+ *
630
+ * One static literal on purpose. The repository's GraphQL cost guard
631
+ * (`services/vendure/src/rate-limit/__tests__/graphql-cost-fits-repo.spec.ts`)
632
+ * measures every document this package holds against the engine's caps, and it
633
+ * can only read a literal. This is the largest operation the dashboard sends,
634
+ * so it has to be the one that is measured: do not assemble it at run time.
635
+ *
636
+ * A block's fields sit between a `#[name` line and its `#]` line. Both are
637
+ * GraphQL comments, so the literal parses as it stands. `orderQuery` keeps a
638
+ * marked part when the call included the block, drops it otherwise, and drops
639
+ * the marker lines either way. `#[a|b` marks a part that is kept when ANY of
640
+ * the named blocks is included: an object whose every field belongs to a block
641
+ * (an empty selection is not valid GraphQL).
642
+ */
643
+ export declare const ORDER_QUERY_EVERY_BLOCK = "\n query Order($id: ID!) {\n order(id: $id) {\n id\n code\n state\n active\n total\n totalWithTax\n subTotal\n subTotalWithTax\n shipping\n shippingWithTax\n currencyCode\n orderPlacedAt\n #[paymentTerms\n paymentTerms {\n source\n managedExternally\n status\n conditionCode\n conditionDescription\n summary\n classification\n paymentDays\n paymentEndOfMonths\n paymentMethod\n percentage\n discountPaymentDays\n discountPercentage\n paymentDiscountType\n stale\n syncedAt\n error\n resolvedAt\n remoteConditionCode\n remoteConfirmedAt\n remoteMismatch\n }\n #]\n #[deliveryTerms\n deliveryTerms {\n source\n sourceScope\n governingCustomerId\n sourceCustomerId\n managedExternally\n status\n shippingMethodStatus\n policyStatus\n summary\n selectionSource\n selectedShippingMethodId\n selectedShippingMethodCode\n selectedShippingMethodName\n platformShippingMethodCode\n platformShippingMethodName\n platformShippingMethodDescription\n platformShippingPrice\n platformShippingPriceWithTax\n preferredShippingMethodId\n incotermStatus\n incotermCode\n incotermVersion\n incotermAddress\n incotermDescription\n shippingLeadDays\n deliveryAdvice\n stale\n syncedAt\n warning\n resolvedAt\n remoteShippingMethodCode\n remoteShippingMethodName\n remoteIncotermCode\n remoteIncotermVersion\n remoteIncotermAddress\n remoteDeliveryDate\n remoteConfirmedAt\n remoteMismatch\n }\n #]\n couponCodes\n customer {\n id\n firstName\n lastName\n emailAddress\n phoneNumber\n #[vatValidation|afas|parasut\n customFields {\n #[vatValidation\n vatNumber\n vatValidationStatus\n #]\n #[afas\n afasVrId\n afasOrgId\n afasContactId\n afasPersId\n #]\n #[parasut\n parasutContactId\n #]\n }\n #]\n addresses {\n id\n fullName\n company\n streetLine1\n streetLine2\n city\n postalCode\n country {\n code\n }\n defaultShippingAddress\n defaultBillingAddress\n #[afas\n customFields {\n afasAddressId\n }\n #]\n }\n }\n lines {\n id\n quantity\n unitPrice\n unitPriceWithTax\n listPriceIncludesTax\n discountedUnitPrice\n discountedUnitPriceWithTax\n linePrice\n linePriceWithTax\n discountedLinePrice\n discountedLinePriceWithTax\n proratedLinePrice\n proratedLinePriceWithTax\n taxRate\n productVariant {\n id\n name\n sku\n price\n priceWithTax\n stockOnHand\n stockAllocated\n trackInventory\n outOfStockThreshold\n useGlobalOutOfStockThreshold\n stockLevels {\n stockLocationId\n stockOnHand\n stockAllocated\n stockLocation {\n id\n name\n }\n }\n product {\n id\n name\n featuredAsset {\n id\n preview\n }\n }\n }\n featuredAsset {\n id\n preview\n }\n #[lineAllocations\n allocations {\n id\n stockLocation {\n id\n name\n }\n quantity\n }\n #]\n outstandingAllocatedQuantity\n outstandingAllocations {\n stockLocationId\n stockLocationName\n quantity\n }\n customFields {\n unitPriceOverride\n priceOverrideReason\n unitPriceImported\n priceListId\n priceListName\n retailPrice\n priceListPrice\n priceListDiscountType\n priceListDiscountValue\n priceListDiscountChain\n cost\n preferredStockLocationId\n backorderedQuantity\n }\n }\n surcharges {\n id\n description\n sku\n price\n priceWithTax\n taxRate\n }\n discounts {\n description\n amount\n amountWithTax\n }\n shippingLines {\n shippingMethod {\n id\n name\n }\n }\n payments {\n id\n state\n method\n amount\n transactionId\n createdAt\n refunds {\n id\n state\n total\n reason\n }\n }\n fulfillments {\n id\n state\n nextStates\n method\n trackingCode\n lines {\n orderLineId\n quantity\n }\n #[fulfillmentDetails\n handlerCode\n handlerName\n handlerDetails {\n label\n value\n }\n packingSlips {\n id\n packingSlipNumber\n fulfillmentId\n languageCode\n storageKey\n createdAt\n }\n #]\n stockLocationName\n linkedOrders {\n id\n code\n }\n customFields {\n #[myparcel\n myparcelShipmentId\n myparcelLabelStatus\n myparcelLabelFormat\n myparcelLabelUrlA4\n myparcelLabelUrlA6\n myparcelLabelLastError\n myparcelLabelHandoff\n #]\n bookingStatus\n }\n createdAt\n }\n shippingAddress {\n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n country\n countryCode\n phoneNumber\n }\n billingAddress {\n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n country\n countryCode\n phoneNumber\n }\n history(options: { take: 50, sort: { createdAt: DESC } }) {\n items {\n id\n type\n data\n createdAt\n isPublic\n administrator {\n id\n firstName\n lastName\n }\n }\n }\n taxSummary {\n description\n taxRate\n taxBase\n taxTotal\n }\n nextStates\n createdAt\n updatedAt\n customFields {\n isLocked\n externalOrderId\n externalPlatform\n sourceFulfillmentHandedOff\n originalPlacedAt\n sourceWarehouse\n pickupLocation\n allocationExpiresAt\n goodwillRoundingMinor\n removeTax\n isGift\n giftNote\n hidePricesOnPackingSlip\n poNumber\n requestedDeliveryDate\n orderNotes\n customerShippingAddressId\n customerBillingAddressId\n shippingAddressIsTemporary\n billingAddressIsTemporary\n paymentStatus\n fulfillmentStatus\n returnStatus\n lifecycleStatus\n #[paymentTerms\n paymentTermsDays\n paymentConditionCode\n #]\n #[afas\n afasSalesOrderId\n afasDirectInvoiceOrNu\n afasInvoiceNumber\n afasInvoiceDate\n afasLocked\n afasLockReason\n afasLastSyncAt\n #]\n #[parasut\n parasutInvoiceId\n parasutEInvoiceStatus\n parasutEInvoiceUuid\n parasutLastError\n #]\n }\n fulfillmentHold {\n reason\n note\n heldAt\n heldByUserId\n heldBy\n }\n #[priceList\n priceList {\n id\n name\n description\n defaultDiscountBps\n defaultDiscountAmount\n entries {\n id\n variantId\n discountType\n discountValue\n }\n }\n #]\n }\n }\n";
644
+ /**
645
+ * The document `get` sends for a set of blocks: {@link ORDER_QUERY_EVERY_BLOCK}
646
+ * without the blocks the call did not include, and without the marker lines.
647
+ * It depends on the SET only, never on the order the caller listed them in, so
648
+ * one set is one document.
649
+ */
650
+ export declare function orderQuery(include?: readonly OrderInclude[]): string;
651
+ /** True for a union of two or more types. */
652
+ type IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;
653
+ /** A list element that names ONE block for sure; an element that may be one of several names none. */
654
+ type SureBlock<E> = [E] extends [never] ? never : true extends IsUnion<E> ? never : E;
655
+ /**
656
+ * The blocks ONE `include` list type is sure to hold: each element of a list of
657
+ * fixed length that names exactly one block. A list whose length the type does
658
+ * not fix (`OrderInclude[]`) is sure of none, and so is an element that may be
659
+ * one of several (`[block]` for a `block: OrderInclude`).
660
+ *
661
+ * Not for a union of lists, which it would answer with every branch's blocks:
662
+ * {@link OrderFor} splits a union first and applies this to each branch. Kept
663
+ * out of the published entry for that reason.
664
+ */
665
+ type SureIncludes<L extends readonly OrderInclude[]> = number extends L['length'] ? never : {
666
+ [K in keyof L]: SureBlock<L[K]>;
667
+ }[number];
668
+ /**
669
+ * The order a call to `get` answers, from the `include` list as its TYPE says
670
+ * it is: the blocks it is sure to hold ({@link SureIncludes}), and no more. A
671
+ * list that is one of several (`wants ? ['paymentTerms'] : []`) answers one of
672
+ * the matching orders, which `'paymentTerms' in order` tells apart. A list
673
+ * that may be absent answers the core read on that branch.
674
+ */
675
+ export type OrderFor<L extends readonly OrderInclude[] | undefined> = L extends readonly OrderInclude[] ? Order<SureIncludes<L>> : Order;
676
+ /** What `get` takes besides the order id. */
677
+ export type OrderGetOptions = Call & {
678
+ include?: readonly OrderInclude[];
679
+ };
680
+ /**
681
+ * The order `get` answers for its options, as their TYPE says they are: the
682
+ * core read, plus the blocks of {@link OrderFor} when `include` is sure to be
683
+ * present. Options that may be absent, or an `include` that may be absent,
684
+ * answer the core read on that branch.
685
+ */
686
+ export type OrderGetAnswer<O extends OrderGetOptions | undefined> = O extends {
687
+ include: infer L extends readonly OrderInclude[] | undefined;
688
+ } ? OrderFor<L> : Order;
689
+ export interface OrderGetModule {
690
+ /**
691
+ * One order of this store, or null when the store holds no order with that
692
+ * id (another store's order answers null too). Needs `ReadOrder`.
693
+ *
694
+ * Without `include` the answer is the order itself: totals, customer, lines
695
+ * with their stock and reservations, surcharges, discounts, payments and
696
+ * refunds, fulfillments, both addresses, the 50 most recent history entries,
697
+ * the tax summary and the engine's own custom fields. Each name in `include`
698
+ * adds one plugin's block ({@link ORDER_INCLUDES}), on the answer and on its
699
+ * type: `get(id, { include: ['priceList'] })` answers an order with
700
+ * `priceList`, and a read that did not ask for it has no such field.
701
+ *
702
+ * The type follows the options as they are TYPED ({@link OrderGetAnswer}):
703
+ * pass a literal list of block names, or `ORDER_INCLUDES`, to have those
704
+ * blocks on the type. A list of no fixed length (`OrderInclude[]`), an
705
+ * element that may be one of several blocks, or an `include` that may be
706
+ * absent promises no block: it is on the answer, not on the type.
707
+ *
708
+ * An `include` name this version does not know is refused with a
709
+ * `ValidationError` (`INVALID_ORDER_INCLUDE`) before anything is asked.
710
+ *
711
+ * An app installation below `customerData: full` reads the order with the
712
+ * customer data its level withholds blanked, and the answer says so:
713
+ * `redacted: true` (see {@link Order}).
714
+ *
715
+ * Why the order is the way it is (its lock, what may be done to it) is
716
+ * {@link OrderStatusModule.status}, not a field here.
717
+ */
718
+ get(orderId: string): Promise<Order | null>;
719
+ get<const O extends OrderGetOptions | undefined>(orderId: string, options: O): Promise<OrderGetAnswer<O> | null>;
720
+ }
721
+ export declare function createOrderGetModule(transport: Transport): OrderGetModule;
722
+ export {};