@sixtyninecommerce/admin 0.11.0 → 0.13.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 (153) hide show
  1. package/README.md +1509 -28
  2. package/dist/auth/index.d.ts +7 -1
  3. package/dist/auth/index.js +8 -1
  4. package/dist/catalog/documents.d.ts +142 -0
  5. package/dist/catalog/documents.js +114 -0
  6. package/dist/catalog/index.d.ts +48 -7
  7. package/dist/catalog/index.js +6 -1
  8. package/dist/catalog/metadata.d.ts +244 -0
  9. package/dist/catalog/metadata.js +220 -0
  10. package/dist/catalog/properties.d.ts +38 -0
  11. package/dist/catalog/properties.js +52 -1
  12. package/dist/catalog/recommendations.d.ts +33 -6
  13. package/dist/catalog/recommendations.js +94 -2
  14. package/dist/catalog/reviews.d.ts +17 -4
  15. package/dist/catalog/reviews.js +7 -0
  16. package/dist/catalog/variants.d.ts +60 -0
  17. package/dist/catalog/variants.js +39 -0
  18. package/dist/catalog/visibility.d.ts +18 -2
  19. package/dist/client.d.ts +29 -3
  20. package/dist/client.js +19 -8
  21. package/dist/content/assets.d.ts +3 -4
  22. package/dist/content/forms.d.ts +332 -1
  23. package/dist/content/forms.js +140 -4
  24. package/dist/content/items.d.ts +31 -8
  25. package/dist/content/items.js +1 -1
  26. package/dist/content/menus.d.ts +254 -0
  27. package/dist/content/menus.js +70 -0
  28. package/dist/content/strings.d.ts +137 -0
  29. package/dist/content/strings.js +82 -0
  30. package/dist/customers/delivery-terms.d.ts +44 -0
  31. package/dist/customers/delivery-terms.js +32 -0
  32. package/dist/customers/groups.d.ts +16 -5
  33. package/dist/customers/groups.js +6 -2
  34. package/dist/customers/index.d.ts +15 -0
  35. package/dist/customers/index.js +4 -0
  36. package/dist/documents/emails.d.ts +154 -0
  37. package/dist/documents/emails.js +220 -0
  38. package/dist/documents/index.d.ts +13 -0
  39. package/dist/documents/index.js +2 -0
  40. package/dist/fulfillments/create.d.ts +1 -1
  41. package/dist/fulfillments/create.js +5 -2
  42. package/dist/fulfillments/index.d.ts +119 -1
  43. package/dist/fulfillments/index.js +124 -4
  44. package/dist/fulfillments/warehouse.d.ts +29 -17
  45. package/dist/fulfillments/warehouse.js +32 -1
  46. package/dist/index.d.ts +43 -23
  47. package/dist/index.js +11 -5
  48. package/dist/integrations/exact-online-types.d.ts +542 -0
  49. package/dist/integrations/exact-online.d.ts +541 -5
  50. package/dist/integrations/exact-online.js +714 -1
  51. package/dist/integrations/index.d.ts +23 -8
  52. package/dist/integrations/index.js +9 -4
  53. package/dist/integrations/pipeline-discoveries.d.ts +65 -0
  54. package/dist/integrations/pipeline-discoveries.js +65 -0
  55. package/dist/integrations/pipeline-runs.d.ts +119 -0
  56. package/dist/integrations/pipeline-runs.js +87 -0
  57. package/dist/integrations/pipelines.d.ts +73 -2
  58. package/dist/integrations/pipelines.js +36 -1
  59. package/dist/integrations/price-import.d.ts +223 -0
  60. package/dist/integrations/price-import.js +124 -0
  61. package/dist/integrations/types.d.ts +221 -3
  62. package/dist/integrations/types.js +4 -3
  63. package/dist/meta/index.d.ts +10 -0
  64. package/dist/metafields/index.d.ts +8 -1
  65. package/dist/metafields/index.js +10 -0
  66. package/dist/orders/cancel-with-money.d.ts +10 -0
  67. package/dist/orders/cancel-with-money.js +2 -0
  68. package/dist/orders/commit-edit.d.ts +16 -0
  69. package/dist/orders/commit-edit.js +14 -1
  70. package/dist/orders/deposit-policy.d.ts +3 -1
  71. package/dist/orders/index.d.ts +22 -11
  72. package/dist/orders/index.js +5 -2
  73. package/dist/orders/list.d.ts +26 -5
  74. package/dist/orders/list.js +123 -13
  75. package/dist/orders/manual-discounts.d.ts +13 -5
  76. package/dist/orders/money-view.d.ts +149 -0
  77. package/dist/orders/money-view.js +99 -0
  78. package/dist/orders/plan-edit.d.ts +34 -2
  79. package/dist/orders/plan-edit.js +110 -12
  80. package/dist/orders/surcharges.d.ts +12 -0
  81. package/dist/orders/surcharges.js +34 -9
  82. package/dist/payments/account-credit.d.ts +17 -1
  83. package/dist/payments/account-credit.js +25 -2
  84. package/dist/payments/credit-noted-fields.d.ts +8 -1
  85. package/dist/payments/credit-noted-fields.js +34 -2
  86. package/dist/payments/customer-consent.d.ts +30 -0
  87. package/dist/payments/customer-consent.js +49 -0
  88. package/dist/payments/index.d.ts +89 -14
  89. package/dist/payments/index.js +22 -2
  90. package/dist/payments/requests.d.ts +6 -3
  91. package/dist/payments/requests.js +1 -0
  92. package/dist/pickups/index.d.ts +5 -3
  93. package/dist/pickups/index.js +5 -2
  94. package/dist/platform/email-gateways.d.ts +165 -0
  95. package/dist/platform/email-gateways.js +78 -0
  96. package/dist/platform/tax.d.ts +11 -3
  97. package/dist/platform/tax.js +30 -0
  98. package/dist/pos/exchanges.d.ts +6 -1
  99. package/dist/pos/index.d.ts +229 -10
  100. package/dist/pos/index.js +113 -4
  101. package/dist/pos/offline-sales.d.ts +44 -3
  102. package/dist/pos/offline-sales.js +57 -3
  103. package/dist/pos/returns.d.ts +28 -1
  104. package/dist/pos/returns.js +36 -6
  105. package/dist/pricing/price-lists.d.ts +3 -1
  106. package/dist/purchasing/alerts.d.ts +19 -4
  107. package/dist/purchasing/alerts.js +29 -3
  108. package/dist/purchasing/backorders.d.ts +61 -0
  109. package/dist/purchasing/backorders.js +92 -0
  110. package/dist/purchasing/index.d.ts +21 -3
  111. package/dist/purchasing/index.js +8 -0
  112. package/dist/purchasing/links.d.ts +263 -0
  113. package/dist/purchasing/links.js +192 -0
  114. package/dist/purchasing/purchase-orders.d.ts +4 -1
  115. package/dist/purchasing/receipts.d.ts +396 -0
  116. package/dist/purchasing/receipts.js +287 -0
  117. package/dist/purchasing/returns.d.ts +273 -0
  118. package/dist/purchasing/returns.js +229 -0
  119. package/dist/quotes/index.d.ts +20 -3
  120. package/dist/returns/index.d.ts +62 -1
  121. package/dist/returns/index.js +61 -0
  122. package/dist/seo/config.d.ts +128 -0
  123. package/dist/seo/config.js +95 -0
  124. package/dist/seo/redirects.d.ts +125 -0
  125. package/dist/seo/redirects.js +60 -1
  126. package/dist/seo/settings.d.ts +147 -0
  127. package/dist/seo/settings.js +209 -0
  128. package/dist/shipping/index.d.ts +6 -0
  129. package/dist/shipping/index.js +2 -0
  130. package/dist/shipping/methods.d.ts +8 -1
  131. package/dist/shipping/myparcel.d.ts +415 -1
  132. package/dist/shipping/myparcel.js +291 -3
  133. package/dist/shipping/rate-tables.d.ts +149 -4
  134. package/dist/shipping/rate-tables.js +229 -23
  135. package/dist/shipping/ship-to-countries.d.ts +75 -0
  136. package/dist/shipping/ship-to-countries.js +47 -0
  137. package/dist/stock/by-location.d.ts +86 -0
  138. package/dist/stock/by-location.js +94 -0
  139. package/dist/stock/index.d.ts +8 -1
  140. package/dist/stock/index.js +4 -0
  141. package/dist/stock/settings.d.ts +106 -0
  142. package/dist/stock/settings.js +103 -0
  143. package/dist/stock/transfers.d.ts +171 -10
  144. package/dist/stock/transfers.js +82 -4
  145. package/dist/stored-value/index.d.ts +98 -7
  146. package/dist/stored-value/index.js +71 -4
  147. package/dist/tax/display-policy.d.ts +105 -0
  148. package/dist/tax/display-policy.js +84 -0
  149. package/dist/tax/index.d.ts +3 -0
  150. package/dist/tax/index.js +2 -0
  151. package/dist/tenant/email-templates.d.ts +222 -1
  152. package/dist/tenant/email-templates.js +227 -10
  153. package/package.json +2 -2
@@ -1,23 +1,33 @@
1
1
  import type { Transport } from '@sixtyninecommerce/core';
2
2
  import { type PurchasingAlertsModule } from './alerts.js';
3
+ import { type PurchasingBackordersModule } from './backorders.js';
3
4
  import { type PurchasingCostModule } from './cost.js';
5
+ import { type PurchasingLinksModule } from './links.js';
4
6
  import { type PurchasingPurchaseOrdersModule } from './purchase-orders.js';
7
+ import { type PurchasingReceiptsModule } from './receipts.js';
5
8
  import { type PurchasingReplenishmentModule } from './replenishment.js';
9
+ import { type PurchasingReturnsModule } from './returns.js';
6
10
  import { type PurchasingSettingsModule } from './settings.js';
7
11
  import { type PurchasingSuppliersModule } from './suppliers.js';
8
12
  export type { PurchasingAlert, PurchasingAlertRecipients, PurchasingAlertRecipientsInput, PurchasingAlertRecipientsModule, PurchasingAlertSummary, PurchasingAlertsModule, } from './alerts.js';
13
+ export type { BackorderReadyLine, BackordersReadyOptions, PurchasingBackordersModule, } from './backorders.js';
9
14
  export type { OverrideVariantCostInput, PurchasingCostModule, VariantCost, VariantCostCause, VariantCostEntry, VariantCostEntryList, VariantCostHistoryOptions, } from './cost.js';
15
+ export type { BackToBackLinkQuantities, BackToBackLinkResult, CreateBackToBackLinkInput, DropShipShipmentFulfillment, DropShipShipmentResult, PurchaseOrderDropShip, PurchaseOrderDropShipLine, PurchaseOrderLink, PurchaseOrderLinkKind, PurchaseOrderLinkReleaseReason, PurchaseOrderLinkStatus, PurchasingBackToBackLinksModule, PurchasingDropShipLinksModule, PurchasingLinksModule, RecordDropShipShipmentInput, } from './links.js';
10
16
  export type { CreatePurchaseOrderInput, PurchaseOrder, PurchaseOrderCancelOptions, PurchaseOrderConfirmation, PurchaseOrderConfirmationInput, PurchaseOrderDocumentOptions, PurchaseOrderDocumentUrl, PurchaseOrderHeaderFields, PurchaseOrderKeyedCall, PurchaseOrderLine, PurchaseOrderLineConfirmationInput, PurchaseOrderLineImportOptions, PurchaseOrderLineImportResult, PurchaseOrderLineImportRow, PurchaseOrderLineInput, PurchaseOrderLinesModule, PurchaseOrderListOptions, PurchaseOrderLocation, PurchaseOrderReasonOptions, PurchaseOrderRevision, PurchaseOrderRevisionInput, PurchaseOrderRevisionsModule, PurchaseOrderSendVia, PurchaseOrderStatus, PurchaseOrderStatusEntry, PurchaseOrderSupplier, PurchasingPurchaseOrdersModule, UpdatePurchaseOrderInput, UpdatePurchaseOrderLineInput, } from './purchase-orders.js';
17
+ export type { AddGoodsReceiptChargeInput, GoodsReceipt, GoodsReceiptChargesModule, GoodsReceiptDetail, GoodsReceiptKeyedCall, GoodsReceiptKind, GoodsReceiptLine, GoodsReceiptListOptions, GoodsReceiptReference, GoodsReceiptTraceability, GoodsReceiptTraceabilityInput, LandedCharge, LandedChargeAllocation, LandedChargeAllocationBasis, LandedChargeKind, PostGoodsReceiptInput, PostGoodsReceiptLineInput, PurchasingReceiptsModule, ReceivablePurchaseOrderLine, ReceivablePurchaseOrderLinesOptions, RemoveGoodsReceiptChargeInput, ReverseGoodsReceiptInput, } from './receipts.js';
11
18
  export type { PurchasingReplenishmentModule, ReplenishmentComputeResult, ReplenishmentDraftLine, ReplenishmentDrafts, ReplenishmentLocation, ReplenishmentRule, ReplenishmentRuleFields, ReplenishmentRuleImportInput, ReplenishmentRuleImportResult, ReplenishmentRuleImportRow, ReplenishmentRuleListOptions, ReplenishmentRulesModule, ReplenishmentSuggestion, ReplenishmentSuggestionListOptions, ReplenishmentSuggestionsModule, ReplenishmentSupplier, ReplenishmentVariant, } from './replenishment.js';
19
+ export type { CreateSupplierReturnInput, PurchasingReturnsModule, ResolveSupplierReturnLineInput, ShipSupplierReturnInput, SupplierReturn, SupplierReturnCancelOptions, SupplierReturnDocumentUrl, SupplierReturnKeyedCall, SupplierReturnLine, SupplierReturnLineInput, SupplierReturnListOptions, SupplierReturnOrigin, SupplierReturnOutcome, SupplierReturnResolution, SupplierReturnStatus, SupplierReturnStatusEntry, UpdateSupplierReturnInput, } from './returns.js';
12
20
  export type { PurchasingNumbering, PurchasingNumberingKind, PurchasingNumberingModule, PurchasingSettings, PurchasingSettingsModule, UpdatePurchasingNumberingInput, UpdatePurchasingSettingsInput, } from './settings.js';
13
21
  export type { CreateSupplierContactInput, CreateSupplierInput, PurchasingSuppliersModule, Supplier, SupplierAddress, SupplierAddressInput, SupplierContact, SupplierContactFields, SupplierContactsModule, SupplierFields, SupplierItem, SupplierItemFields, SupplierItemImportResult, SupplierItemImportRowResult, SupplierItemListOptions, SupplierItemPrice, SupplierItemPriceInput, SupplierItemPricesModule, SupplierItemPricesOptions, SupplierItemRow, SupplierItemSupplier, SupplierItemsBulkUpsertInput, SupplierItemsModule, SupplierItemVariant, SupplierListOptions, SupplierPriceListImportInput, SupplierStatusOptions, UpdateSupplierContactInput, UpdateSupplierInput, } from './suppliers.js';
14
22
  /**
15
23
  * `admin.purchasing` (purchase-orders spec §10.1): buying stock from suppliers, per legal entity.
16
24
  * `settings` (with its document `numbering`), `suppliers` (with their `contacts`),
17
25
  * `purchaseOrders` (with their `lines`; the spec's `orders` submodule), `replenishment` (reorder
18
- * `rules` and `suggestions`), `cost` (a variant's cost ledger) and `alerts` (what needs attention,
19
- * and who the alert emails go to) so far; `receipts` and `returns` join them as their engine
20
- * surfaces ship.
26
+ * `rules` and `suggestions`), `cost` (a variant's cost ledger), `alerts` (what needs attention,
27
+ * and who the alert emails go to), `receipts` (goods receipts and what can be received),
28
+ * `backorders` (the store's backordered order lines stock on hand can ship now),
29
+ * `returns` (goods sent back to suppliers) and `links` (customer order lines bought on purchase
30
+ * order lines: back-to-back links, phase 5).
21
31
  */
22
32
  export interface PurchasingModule {
23
33
  /** The legal entity's purchasing settings and document numbering. */
@@ -32,5 +42,13 @@ export interface PurchasingModule {
32
42
  alerts: PurchasingAlertsModule;
33
43
  /** A variant's cost in the legal entity's ledger: read it, its history, and override it. */
34
44
  cost: PurchasingCostModule;
45
+ /** Receiving goods against the legal entity's sent purchase orders, and its receipts. */
46
+ receipts: PurchasingReceiptsModule;
47
+ /** Returns of goods to the legal entity's suppliers: refused at a receipt, or from stock. */
48
+ returns: PurchasingReturnsModule;
49
+ /** The active store's backordered order lines that stock on hand can ship now. */
50
+ backorders: PurchasingBackordersModule;
51
+ /** Customer order lines bought on purchase order lines: "Order from supplier" and its reads. */
52
+ links: PurchasingLinksModule;
35
53
  }
36
54
  export declare function createPurchasingModule(transport: Transport): PurchasingModule;
@@ -1,7 +1,11 @@
1
1
  import { createPurchasingAlertsModule } from './alerts.js';
2
+ import { createPurchasingBackordersModule } from './backorders.js';
2
3
  import { createPurchasingCostModule } from './cost.js';
4
+ import { createPurchasingLinksModule } from './links.js';
3
5
  import { createPurchasingPurchaseOrdersModule, } from './purchase-orders.js';
6
+ import { createPurchasingReceiptsModule } from './receipts.js';
4
7
  import { createPurchasingReplenishmentModule, } from './replenishment.js';
8
+ import { createPurchasingReturnsModule } from './returns.js';
5
9
  import { createPurchasingSettingsModule } from './settings.js';
6
10
  import { createPurchasingSuppliersModule } from './suppliers.js';
7
11
  export function createPurchasingModule(transport) {
@@ -12,5 +16,9 @@ export function createPurchasingModule(transport) {
12
16
  replenishment: createPurchasingReplenishmentModule(transport),
13
17
  alerts: createPurchasingAlertsModule(transport),
14
18
  cost: createPurchasingCostModule(transport),
19
+ receipts: createPurchasingReceiptsModule(transport),
20
+ returns: createPurchasingReturnsModule(transport),
21
+ backorders: createPurchasingBackordersModule(transport),
22
+ links: createPurchasingLinksModule(transport),
15
23
  };
16
24
  }
@@ -0,0 +1,263 @@
1
+ import type { Transport } from '@sixtyninecommerce/core';
2
+ import type { OrderAddress } from '../orders/get.js';
3
+ import type { Call } from '../types.js';
4
+ import { type PurchaseOrder, type PurchaseOrderKeyedCall } from './purchase-orders.js';
5
+ /** What a link buys for: a back-to-back claim, or a drop-ship decision. A string on the wire. */
6
+ export type PurchaseOrderLinkKind = 'back_to_back' | 'drop_ship' | (string & {});
7
+ /**
8
+ * A link's state, derived on the server: `open` (waiting for goods), `partially_allocated`,
9
+ * `allocated` (every unit it claims arrived for the order line), `released` (the order or line was
10
+ * cancelled, or the link removed) or `supplier_cancelled` (its purchase order line can no longer
11
+ * supply it: show "Supplier cancelled"). A drop-ship link reads `partially_shipped` and `shipped`
12
+ * (its supplier sent part or all of it to the customer) where a back-to-back one reads the
13
+ * allocation states; an engine before step 5.2 answers `open` for every drop-ship link.
14
+ */
15
+ export type PurchaseOrderLinkStatus = 'open' | 'partially_allocated' | 'allocated' | 'partially_shipped' | 'shipped' | 'released' | 'supplier_cancelled' | (string & {});
16
+ /** Why a link ended. */
17
+ export type PurchaseOrderLinkReleaseReason = 'order_cancelled' | 'line_cancelled' | 'po_line_cancelled' | 'removed' | (string & {});
18
+ /**
19
+ * A customer order line bought on a purchase order line (purchase-orders spec §8.12). Quantities
20
+ * are base (stock) units.
21
+ */
22
+ export interface PurchaseOrderLink {
23
+ id: string;
24
+ kind: PurchaseOrderLinkKind;
25
+ status: PurchaseOrderLinkStatus;
26
+ orderId: string;
27
+ /** Null when the order is another store's of the legal entity. */
28
+ orderCode: string | null;
29
+ orderLineId: string;
30
+ productVariantId: string;
31
+ sku: string | null;
32
+ purchaseOrderId: string | null;
33
+ /** The purchase order's number. */
34
+ purchaseOrderCode: string | null;
35
+ purchaseOrderStatus: string | null;
36
+ purchaseOrderLineId: string | null;
37
+ supplierId: string;
38
+ supplierName: string;
39
+ /** Where the purchase order delivers: the goods are allocated to the order line there. */
40
+ stockLocationId: string | null;
41
+ /** What the link claims. */
42
+ baseQuantity: number;
43
+ /** Of those, what receipts gave the order line. */
44
+ allocatedBaseQuantity: number;
45
+ /** Drop-ship: what the supplier shipped to the customer. */
46
+ shippedBaseQuantity: number;
47
+ /** `YYYY-MM-DD`: the purchase order line's confirmed day, else its requested day. */
48
+ expectedOn: string | null;
49
+ /** Whether `expectedOn` is the supplier's confirmed day. */
50
+ expectedOnConfirmed: boolean;
51
+ /** ISO-8601 UTC; null while the link is active. */
52
+ releasedAt: string | null;
53
+ releaseReason: PurchaseOrderLinkReleaseReason | null;
54
+ /** ISO-8601 UTC. */
55
+ createdAt: string;
56
+ }
57
+ export interface CreateBackToBackLinkInput {
58
+ /** A line of an order of the active store. */
59
+ orderLineId: string;
60
+ /** Base units to buy for it, at most its open units not yet linked. Default: all of those. */
61
+ baseQuantity?: number;
62
+ /** Default: the variant's preferred supplier. */
63
+ supplierId?: string;
64
+ /** The purchase order's destination. Default: the tenant's location, else the store's only one. */
65
+ stockLocationId?: string;
66
+ /** A draft of the supplier to add the line to. Default: its newest draft, else a new one. */
67
+ purchaseOrderId?: string;
68
+ }
69
+ export interface BackToBackLinkResult {
70
+ link: PurchaseOrderLink;
71
+ /** The draft the line went onto. */
72
+ purchaseOrder: PurchaseOrder;
73
+ /** Whether a new draft was created for it. */
74
+ createdPurchaseOrder: boolean;
75
+ }
76
+ /**
77
+ * What "Order from supplier" may order for an order line: the figures a dialog defaults to. The
78
+ * link judges them again when it is made. Quantities are base (stock) units.
79
+ */
80
+ export interface BackToBackLinkQuantities {
81
+ orderLineId: string;
82
+ /** Its units not yet in a live fulfilment. */
83
+ openBaseQuantity: number;
84
+ /** What its active back-to-back links claim. */
85
+ linkedBaseQuantity: number;
86
+ /** The most a new link may claim: more is refused `PURCHASE_LINK_EXCEEDS_OPEN_QUANTITY`. */
87
+ maxBaseQuantity: number;
88
+ /**
89
+ * What `backToBack.create` takes when `baseQuantity` is left out. Below `maxBaseQuantity` (0
90
+ * included) when goods that arrived for the line's earlier links may already cover it: name the
91
+ * quantity to order more anyway.
92
+ */
93
+ suggestedBaseQuantity: number;
94
+ }
95
+ /**
96
+ * The customer order a drop-ship purchase order ships to (purchase-orders spec §8.12.2), and what
97
+ * each of its lines has left to ship. Quantities are base (stock) units.
98
+ */
99
+ export interface PurchaseOrderDropShip {
100
+ purchaseOrderId: string;
101
+ /** The purchase order's number. */
102
+ purchaseOrderCode: string;
103
+ /** The customer's order. */
104
+ orderId: string;
105
+ /** Null when the order is another store's of the legal entity. */
106
+ orderCode: string | null;
107
+ /**
108
+ * The delivery address taken from the order when the draft was made; null once the customer is
109
+ * erased, and for an order of another store of the legal entity (its staff read the purchase
110
+ * order, never its customer). `country` (the name) is null: the snapshot keeps the code.
111
+ */
112
+ address: OrderAddress | null;
113
+ lines: PurchaseOrderDropShipLine[];
114
+ }
115
+ export interface PurchaseOrderDropShipLine {
116
+ purchaseOrderLineId: string;
117
+ /** The customer's order line it ships; null when no link names it. */
118
+ orderLineId: string | null;
119
+ sku: string;
120
+ /** What the line orders less what was cancelled. */
121
+ orderedBaseQuantity: number;
122
+ /** What the supplier shipped to the customer so far. */
123
+ shippedBaseQuantity: number;
124
+ /**
125
+ * What may be recorded shipped now: what the line still orders, at most what the customer's
126
+ * line still waits for. 0 once that line is cancelled or fulfilled.
127
+ */
128
+ toShipBaseQuantity: number;
129
+ }
130
+ export interface RecordDropShipShipmentInput {
131
+ /** A sent drop-ship purchase order of an order of the active store. */
132
+ purchaseOrderId: string;
133
+ /** Left out: every line, all it still has to ship. */
134
+ lines?: Array<{
135
+ purchaseOrderLineId: string;
136
+ baseQuantity: number;
137
+ }>;
138
+ /** The supplier's carrier, shown on the fulfilment. */
139
+ carrier?: string;
140
+ /** The supplier's tracking code. */
141
+ trackingCode?: string;
142
+ /**
143
+ * `YYYY-MM-DD`: the day the supplier shipped, in the legal entity's time zone, never after
144
+ * today. Default: today. The cost's exchange rate is this day's.
145
+ */
146
+ shippedOn?: string;
147
+ /**
148
+ * The rate from the purchase order's currency to the customer order's, when they differ (a
149
+ * positive decimal string, at most 8 decimals). Needs `ManageInventoryCost`. Default: the
150
+ * platform rate of `shippedOn`, or of up to 7 days earlier.
151
+ */
152
+ fxRate?: string;
153
+ }
154
+ /** The fulfilment a drop-ship shipment created on the customer's order. */
155
+ export interface DropShipShipmentFulfillment {
156
+ id: string;
157
+ /** `Shipped`: the supplier sent it. */
158
+ state: string;
159
+ /**
160
+ * The carrier, else "Shipment" in the store's language. Never the supplier: the shopper reads it
161
+ * (a store may drop-ship white-label).
162
+ */
163
+ method: string;
164
+ trackingCode: string | null;
165
+ }
166
+ export interface DropShipShipmentResult {
167
+ purchaseOrder: PurchaseOrder;
168
+ /** The drop-ship links the shipment moved, with what they have shipped now. */
169
+ links: PurchaseOrderLink[];
170
+ fulfillment: DropShipShipmentFulfillment;
171
+ /** Whether every line has now shipped, so the purchase order closed. */
172
+ closedPurchaseOrder: boolean;
173
+ }
174
+ export declare const PURCHASE_ORDER_LINK_FIELDS = "\n id\n kind\n status\n orderId\n orderCode\n orderLineId\n productVariantId\n sku\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderStatus\n purchaseOrderLineId\n supplierId\n supplierName\n stockLocationId\n baseQuantity\n allocatedBaseQuantity\n shippedBaseQuantity\n expectedOn\n expectedOnConfirmed\n releasedAt\n releaseReason\n createdAt\n";
175
+ export declare const ORDER_PURCHASE_ORDER_LINKS_QUERY = "\n query OrderPurchaseOrderLinks($orderId: ID!) {\n orderPurchaseOrderLinks(orderId: $orderId) { \n id\n kind\n status\n orderId\n orderCode\n orderLineId\n productVariantId\n sku\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderStatus\n purchaseOrderLineId\n supplierId\n supplierName\n stockLocationId\n baseQuantity\n allocatedBaseQuantity\n shippedBaseQuantity\n expectedOn\n expectedOnConfirmed\n releasedAt\n releaseReason\n createdAt\n }\n }\n";
176
+ export declare const PURCHASE_ORDER_LINKS_QUERY = "\n query PurchaseOrderLinks($purchaseOrderId: ID!) {\n purchaseOrderLinks(purchaseOrderId: $purchaseOrderId) { \n id\n kind\n status\n orderId\n orderCode\n orderLineId\n productVariantId\n sku\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderStatus\n purchaseOrderLineId\n supplierId\n supplierName\n stockLocationId\n baseQuantity\n allocatedBaseQuantity\n shippedBaseQuantity\n expectedOn\n expectedOnConfirmed\n releasedAt\n releaseReason\n createdAt\n }\n }\n";
177
+ export declare const BACK_TO_BACK_LINK_QUANTITIES_QUERY = "\n query PurchaseOrderBackToBackLinkQuantities($orderLineId: ID!) {\n purchaseOrderBackToBackLinkQuantities(orderLineId: $orderLineId) {\n orderLineId\n openBaseQuantity\n linkedBaseQuantity\n maxBaseQuantity\n suggestedBaseQuantity\n }\n }\n";
178
+ export declare const CREATE_BACK_TO_BACK_LINK_MUTATION = "\n mutation CreatePurchaseOrderBackToBackLink(\n $input: CreatePurchaseOrderBackToBackLinkInput!\n $idempotencyKey: String\n ) {\n createPurchaseOrderBackToBackLink(input: $input, idempotencyKey: $idempotencyKey) {\n link { \n id\n kind\n status\n orderId\n orderCode\n orderLineId\n productVariantId\n sku\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderStatus\n purchaseOrderLineId\n supplierId\n supplierName\n stockLocationId\n baseQuantity\n allocatedBaseQuantity\n shippedBaseQuantity\n expectedOn\n expectedOnConfirmed\n releasedAt\n releaseReason\n createdAt\n }\n purchaseOrder { \n \n id\n scopeId\n legalEntityId\n originChannelId\n code\n kind\n status\n supplierId\n supplier { id code name status }\n destinationStockLocationId\n destinationStockLocation { id name }\n currencyCode\n revision\n approvedRevision\n approvedAmount\n requestedDeliveryOn\n supplierReference\n notesToSupplier\n internalNotes\n managedBy\n externalId\n externalNumber\n externalApprovalStatus\n sentAt\n closedAt\n closeReason\n createdByRef\n total\n lineCount\n confirmation\n lines { \n id\n purchaseOrderId\n position\n productVariantId\n supplierItemId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n orderedQuantity\n orderedBaseQuantity\n cancelledBaseQuantity\n receivedBaseQuantity\n returnedForReplacementBaseQuantity\n unitPrice\n discountBps\n priceSource\n vatRateBps\n lineTotal\n requestedOn\n confirmedBaseQuantity\n confirmedOn\n confirmedAt\n externalLineId\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n\n statusHistory { id fromStatus status actorRef reason metadata createdAt }\n revisions {\n id\n revision\n state\n diff\n totalAfter\n createdByRef\n createdAt\n appliedAt\n sentAt\n sentVia\n }\n }\n createdPurchaseOrder\n }\n }\n";
179
+ export declare const REMOVE_BACK_TO_BACK_LINK_MUTATION = "\n mutation RemovePurchaseOrderBackToBackLink($id: ID!, $idempotencyKey: String) {\n removePurchaseOrderBackToBackLink(id: $id, idempotencyKey: $idempotencyKey) {\n \n id\n kind\n status\n orderId\n orderCode\n orderLineId\n productVariantId\n sku\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderStatus\n purchaseOrderLineId\n supplierId\n supplierName\n stockLocationId\n baseQuantity\n allocatedBaseQuantity\n shippedBaseQuantity\n expectedOn\n expectedOnConfirmed\n releasedAt\n releaseReason\n createdAt\n\n }\n }\n";
180
+ export declare const PURCHASE_ORDER_DROP_SHIP_QUERY = "\n query PurchaseOrderDropShip($purchaseOrderId: ID!) {\n purchaseOrderDropShip(purchaseOrderId: $purchaseOrderId) {\n purchaseOrderId\n purchaseOrderCode\n orderId\n orderCode\n address {\n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n country\n countryCode\n phoneNumber\n }\n lines {\n purchaseOrderLineId\n orderLineId\n sku\n orderedBaseQuantity\n shippedBaseQuantity\n toShipBaseQuantity\n }\n }\n }\n";
181
+ export declare const RECORD_DROP_SHIP_SHIPMENT_MUTATION = "\n mutation RecordPurchaseOrderDropShipShipment(\n $input: RecordDropShipShipmentInput!\n $idempotencyKey: String!\n ) {\n recordPurchaseOrderDropShipShipment(input: $input, idempotencyKey: $idempotencyKey) {\n purchaseOrder { \n \n id\n scopeId\n legalEntityId\n originChannelId\n code\n kind\n status\n supplierId\n supplier { id code name status }\n destinationStockLocationId\n destinationStockLocation { id name }\n currencyCode\n revision\n approvedRevision\n approvedAmount\n requestedDeliveryOn\n supplierReference\n notesToSupplier\n internalNotes\n managedBy\n externalId\n externalNumber\n externalApprovalStatus\n sentAt\n closedAt\n closeReason\n createdByRef\n total\n lineCount\n confirmation\n lines { \n id\n purchaseOrderId\n position\n productVariantId\n supplierItemId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n orderedQuantity\n orderedBaseQuantity\n cancelledBaseQuantity\n receivedBaseQuantity\n returnedForReplacementBaseQuantity\n unitPrice\n discountBps\n priceSource\n vatRateBps\n lineTotal\n requestedOn\n confirmedBaseQuantity\n confirmedOn\n confirmedAt\n externalLineId\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n\n statusHistory { id fromStatus status actorRef reason metadata createdAt }\n revisions {\n id\n revision\n state\n diff\n totalAfter\n createdByRef\n createdAt\n appliedAt\n sentAt\n sentVia\n }\n }\n links { \n id\n kind\n status\n orderId\n orderCode\n orderLineId\n productVariantId\n sku\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderStatus\n purchaseOrderLineId\n supplierId\n supplierName\n stockLocationId\n baseQuantity\n allocatedBaseQuantity\n shippedBaseQuantity\n expectedOn\n expectedOnConfirmed\n releasedAt\n releaseReason\n createdAt\n }\n fulfillment {\n id\n state\n method\n trackingCode\n }\n closedPurchaseOrder\n }\n }\n";
182
+ /**
183
+ * `admin.purchasing.links.backToBack` (purchase-orders spec §8.12.1, §10.1): "Order from supplier"
184
+ * on a customer order line. The received goods are allocated to the line first, at the purchase
185
+ * order's destination, whatever the order's payment terms.
186
+ */
187
+ export interface PurchasingBackToBackLinksModule {
188
+ /**
189
+ * Adds a line for the order line to a draft purchase order (the one named, else the supplier's
190
+ * newest draft into the destination, else a new one) and links it. Needs `UpdatePurchaseOrder`,
191
+ * and `CreatePurchaseOrder` when a new draft is made (`PURCHASE_LINK_DRAFT_DENIED`, 403).
192
+ * Refusals: `PURCHASE_LINK_ORDER_LINE_NOT_FOUND` (404, another store's order included),
193
+ * `PURCHASE_LINK_ORDER_NOT_LINKABLE` (422: not placed, cancelled, imported, or drop-shipped),
194
+ * `PURCHASE_LINK_EXCEEDS_OPEN_QUANTITY` (422; `details[0].maxBaseQuantity`),
195
+ * `PURCHASE_LINK_SUPPLIER_REQUIRED` (422: no preferred supplier), `PURCHASE_LINK_INVALID` (400),
196
+ * `PURCHASE_ORDER_NOT_EDITABLE` (422: the named order is no draft), `SUPPLIER_ARCHIVED` (422),
197
+ * `STOCK_LOCATION_REQUIRED`, `LOCATION_NOT_IN_CHANNEL`, `LOCATION_NOT_ALLOWED` (403).
198
+ */
199
+ create(input: CreateBackToBackLinkInput, call?: Call): Promise<BackToBackLinkResult>;
200
+ /**
201
+ * What `create` may order for an order line: its open units, what its active links claim, the
202
+ * most a new link may claim and what `create` takes with no `baseQuantity` (a dialog's
203
+ * defaults). Needs `UpdatePurchaseOrder`, as `create` does. Refused as `create` is for a line it
204
+ * would refuse whatever the quantity: `PURCHASE_LINK_ORDER_LINE_NOT_FOUND` (404),
205
+ * `PURCHASE_LINK_ORDER_NOT_LINKABLE` (422). Needs an engine with purchase-orders step 5.4.
206
+ */
207
+ quantities(orderLineId: string, call?: Call): Promise<BackToBackLinkQuantities>;
208
+ /**
209
+ * Ends a link (`removed`): the order line no longer waits for that purchase order, whose line
210
+ * keeps its quantity. Refusals: `PURCHASE_LINK_NOT_FOUND` (404),
211
+ * `PURCHASE_LINK_ALREADY_RELEASED` (422), `MANAGED_BY_PROVIDER` (422).
212
+ */
213
+ remove(id: string, call?: Call): Promise<PurchaseOrderLink>;
214
+ }
215
+ /**
216
+ * `admin.purchasing.links.dropShip` (purchase-orders spec §8.12.2, §10.1): purchase orders a
217
+ * supplier ships straight to the customer. They are drafted by the platform when an order with
218
+ * drop-ship lines is placed (one per supplier, with the order's address); staff then approve and
219
+ * send them as any purchase order, and record what the supplier shipped here.
220
+ */
221
+ export interface PurchasingDropShipLinksModule {
222
+ /**
223
+ * The customer order, address and lines left to ship of a drop-ship purchase order; null for a
224
+ * standard purchase order or an unknown id. Needs `ReadPurchaseOrder`.
225
+ */
226
+ get(purchaseOrderId: string, call?: Call): Promise<PurchaseOrderDropShip | null>;
227
+ /**
228
+ * Records what the supplier of a SENT drop-ship purchase order shipped: a fulfilment of the
229
+ * customer's lines (method `drop-ship`, no stock of ours moves), shipped at once, which sends
230
+ * the customer's shipping email; each line's cost in the order's currency; and the purchase
231
+ * order closes once no line can ship more (what no customer line waits for, such as whole
232
+ * purchase units beyond the customer's quantity, is cancelled as a close short would). Needs
233
+ * `UpdatePurchaseOrder` and `UpdateOrder`. The key is required: a retried shipment must never
234
+ * fulfil twice. Refusals:
235
+ * `PURCHASE_ORDER_NOT_FOUND` (404), `PURCHASE_ORDER_INVALID_TRANSITION` (422: not sent),
236
+ * `PURCHASE_LINK_INVALID` (400: a standard purchase order, a line named twice or not its own, a
237
+ * day after today), `DROP_SHIP_SHIPMENT_EXCEEDS_ORDERED` (422; `details[0].maxBaseQuantity`),
238
+ * `DROP_SHIP_SHIPMENT_DENIED` (403: no `UpdateOrder`), `DROP_SHIP_FULFILLMENT_REFUSED` (422),
239
+ * `FX_RATE_UNAVAILABLE` (422: no platform rate for the day, state `fxRate`),
240
+ * `FX_RATE_OVERRIDE_NOT_ALLOWED` (403), `LOCATION_NOT_ALLOWED` (403: a location-restricted
241
+ * credential), `MANAGED_BY_PROVIDER` (422).
242
+ */
243
+ recordShipment(input: RecordDropShipShipmentInput, call: PurchaseOrderKeyedCall): Promise<DropShipShipmentResult>;
244
+ }
245
+ /**
246
+ * `admin.purchasing.links` (purchase-orders spec §10.1): customer order lines bought on purchase
247
+ * order lines. Every method needs the Purchasing plugin on the store and purchasing switched on
248
+ * for its legal entity (`PURCHASING_NOT_ENABLED`, 422); the reads need `ReadPurchaseOrder`.
249
+ */
250
+ export interface PurchasingLinksModule {
251
+ /** Back-to-back (special-order) links. */
252
+ backToBack: PurchasingBackToBackLinksModule;
253
+ /** Drop-ship purchase orders and their supplier shipments. */
254
+ dropShip: PurchasingDropShipLinksModule;
255
+ /**
256
+ * The links of an order of the active store, oldest first, ended ones included ("Supplier
257
+ * cancelled" reads from them). Another store's order answers none.
258
+ */
259
+ forOrder(orderId: string, call?: Call): Promise<PurchaseOrderLink[]>;
260
+ /** The links of a purchase order, oldest first, ended ones included. */
261
+ forPurchaseOrder(purchaseOrderId: string, call?: Call): Promise<PurchaseOrderLink[]>;
262
+ }
263
+ export declare function createPurchasingLinksModule(transport: Transport): PurchasingLinksModule;
@@ -0,0 +1,192 @@
1
+ import { PURCHASE_ORDER_FIELDS, } from './purchase-orders.js';
2
+ export const PURCHASE_ORDER_LINK_FIELDS = /* GraphQL */ `
3
+ id
4
+ kind
5
+ status
6
+ orderId
7
+ orderCode
8
+ orderLineId
9
+ productVariantId
10
+ sku
11
+ purchaseOrderId
12
+ purchaseOrderCode
13
+ purchaseOrderStatus
14
+ purchaseOrderLineId
15
+ supplierId
16
+ supplierName
17
+ stockLocationId
18
+ baseQuantity
19
+ allocatedBaseQuantity
20
+ shippedBaseQuantity
21
+ expectedOn
22
+ expectedOnConfirmed
23
+ releasedAt
24
+ releaseReason
25
+ createdAt
26
+ `;
27
+ export const ORDER_PURCHASE_ORDER_LINKS_QUERY = /* GraphQL */ `
28
+ query OrderPurchaseOrderLinks($orderId: ID!) {
29
+ orderPurchaseOrderLinks(orderId: $orderId) { ${PURCHASE_ORDER_LINK_FIELDS} }
30
+ }
31
+ `;
32
+ export const PURCHASE_ORDER_LINKS_QUERY = /* GraphQL */ `
33
+ query PurchaseOrderLinks($purchaseOrderId: ID!) {
34
+ purchaseOrderLinks(purchaseOrderId: $purchaseOrderId) { ${PURCHASE_ORDER_LINK_FIELDS} }
35
+ }
36
+ `;
37
+ export const BACK_TO_BACK_LINK_QUANTITIES_QUERY = /* GraphQL */ `
38
+ query PurchaseOrderBackToBackLinkQuantities($orderLineId: ID!) {
39
+ purchaseOrderBackToBackLinkQuantities(orderLineId: $orderLineId) {
40
+ orderLineId
41
+ openBaseQuantity
42
+ linkedBaseQuantity
43
+ maxBaseQuantity
44
+ suggestedBaseQuantity
45
+ }
46
+ }
47
+ `;
48
+ export const CREATE_BACK_TO_BACK_LINK_MUTATION = /* GraphQL */ `
49
+ mutation CreatePurchaseOrderBackToBackLink(
50
+ $input: CreatePurchaseOrderBackToBackLinkInput!
51
+ $idempotencyKey: String
52
+ ) {
53
+ createPurchaseOrderBackToBackLink(input: $input, idempotencyKey: $idempotencyKey) {
54
+ link { ${PURCHASE_ORDER_LINK_FIELDS} }
55
+ purchaseOrder { ${PURCHASE_ORDER_FIELDS} }
56
+ createdPurchaseOrder
57
+ }
58
+ }
59
+ `;
60
+ export const REMOVE_BACK_TO_BACK_LINK_MUTATION = /* GraphQL */ `
61
+ mutation RemovePurchaseOrderBackToBackLink($id: ID!, $idempotencyKey: String) {
62
+ removePurchaseOrderBackToBackLink(id: $id, idempotencyKey: $idempotencyKey) {
63
+ ${PURCHASE_ORDER_LINK_FIELDS}
64
+ }
65
+ }
66
+ `;
67
+ export const PURCHASE_ORDER_DROP_SHIP_QUERY = /* GraphQL */ `
68
+ query PurchaseOrderDropShip($purchaseOrderId: ID!) {
69
+ purchaseOrderDropShip(purchaseOrderId: $purchaseOrderId) {
70
+ purchaseOrderId
71
+ purchaseOrderCode
72
+ orderId
73
+ orderCode
74
+ address {
75
+ fullName
76
+ company
77
+ streetLine1
78
+ streetLine2
79
+ city
80
+ province
81
+ postalCode
82
+ country
83
+ countryCode
84
+ phoneNumber
85
+ }
86
+ lines {
87
+ purchaseOrderLineId
88
+ orderLineId
89
+ sku
90
+ orderedBaseQuantity
91
+ shippedBaseQuantity
92
+ toShipBaseQuantity
93
+ }
94
+ }
95
+ }
96
+ `;
97
+ export const RECORD_DROP_SHIP_SHIPMENT_MUTATION = /* GraphQL */ `
98
+ mutation RecordPurchaseOrderDropShipShipment(
99
+ $input: RecordDropShipShipmentInput!
100
+ $idempotencyKey: String!
101
+ ) {
102
+ recordPurchaseOrderDropShipShipment(input: $input, idempotencyKey: $idempotencyKey) {
103
+ purchaseOrder { ${PURCHASE_ORDER_FIELDS} }
104
+ links { ${PURCHASE_ORDER_LINK_FIELDS} }
105
+ fulfillment {
106
+ id
107
+ state
108
+ method
109
+ trackingCode
110
+ }
111
+ closedPurchaseOrder
112
+ }
113
+ }
114
+ `;
115
+ const RECORD_SHIPMENT_INPUT_FIELDS = [
116
+ 'purchaseOrderId',
117
+ 'lines',
118
+ 'carrier',
119
+ 'trackingCode',
120
+ 'shippedOn',
121
+ 'fxRate',
122
+ ];
123
+ const CREATE_INPUT_FIELDS = [
124
+ 'orderLineId',
125
+ 'baseQuantity',
126
+ 'supplierId',
127
+ 'stockLocationId',
128
+ 'purchaseOrderId',
129
+ ];
130
+ function picked(input, fields) {
131
+ const out = {};
132
+ for (const field of fields) {
133
+ const value = input[field];
134
+ if (value !== undefined)
135
+ out[field] = value;
136
+ }
137
+ return out;
138
+ }
139
+ export function createPurchasingLinksModule(transport) {
140
+ return {
141
+ backToBack: {
142
+ async create(input, call) {
143
+ const data = await transport.graphql({
144
+ api: 'admin',
145
+ query: CREATE_BACK_TO_BACK_LINK_MUTATION,
146
+ variables: {
147
+ input: picked(input, CREATE_INPUT_FIELDS),
148
+ idempotencyKey: call?.idempotencyKey,
149
+ },
150
+ }, call);
151
+ return data.createPurchaseOrderBackToBackLink;
152
+ },
153
+ async quantities(orderLineId, call) {
154
+ const data = await transport.graphql({ api: 'admin', query: BACK_TO_BACK_LINK_QUANTITIES_QUERY, variables: { orderLineId } }, call);
155
+ return data.purchaseOrderBackToBackLinkQuantities;
156
+ },
157
+ async remove(id, call) {
158
+ const data = await transport.graphql({
159
+ api: 'admin',
160
+ query: REMOVE_BACK_TO_BACK_LINK_MUTATION,
161
+ variables: { id, idempotencyKey: call?.idempotencyKey },
162
+ }, call);
163
+ return data.removePurchaseOrderBackToBackLink;
164
+ },
165
+ },
166
+ dropShip: {
167
+ async get(purchaseOrderId, call) {
168
+ const data = await transport.graphql({ api: 'admin', query: PURCHASE_ORDER_DROP_SHIP_QUERY, variables: { purchaseOrderId } }, call);
169
+ return data.purchaseOrderDropShip;
170
+ },
171
+ async recordShipment(input, call) {
172
+ const data = await transport.graphql({
173
+ api: 'admin',
174
+ query: RECORD_DROP_SHIP_SHIPMENT_MUTATION,
175
+ variables: {
176
+ input: picked(input, RECORD_SHIPMENT_INPUT_FIELDS),
177
+ idempotencyKey: call.idempotencyKey,
178
+ },
179
+ }, call);
180
+ return data.recordPurchaseOrderDropShipShipment;
181
+ },
182
+ },
183
+ async forOrder(orderId, call) {
184
+ const data = await transport.graphql({ api: 'admin', query: ORDER_PURCHASE_ORDER_LINKS_QUERY, variables: { orderId } }, call);
185
+ return data.orderPurchaseOrderLinks;
186
+ },
187
+ async forPurchaseOrder(purchaseOrderId, call) {
188
+ const data = await transport.graphql({ api: 'admin', query: PURCHASE_ORDER_LINKS_QUERY, variables: { purchaseOrderId } }, call);
189
+ return data.purchaseOrderLinks;
190
+ },
191
+ };
192
+ }
@@ -541,7 +541,10 @@ export interface PurchasingPurchaseOrdersModule {
541
541
  reopen(id: string, options?: PurchaseOrderReasonOptions): Promise<PurchaseOrder>;
542
542
  /**
543
543
  * A five-minute link to a sent revision's PDF (`ReadPurchaseOrder`), the latest sent one when
544
- * `revision` is left out. Refusal: `PURCHASE_ORDER_DOCUMENT_NOT_FOUND` (404, never sent).
544
+ * `revision` is left out. Refusal: `PURCHASE_ORDER_DOCUMENT_NOT_FOUND` (404: never sent, or a
545
+ * drop-ship order of another store's customer). A drop-ship order's PDF prints its customer's
546
+ * address, so it opens only from that order's store, and an app installed below
547
+ * `customerData: full` reads `url` as `''` for every purchase order (engine step 5.2 on).
545
548
  */
546
549
  document(id: string, options?: PurchaseOrderDocumentOptions): Promise<PurchaseOrderDocumentUrl>;
547
550
  }