platform-types 1.10.780 → 1.10.781
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.
- package/dist/cart.d.ts +5 -5
- package/dist/cjs/order.js +13 -0
- package/dist/cjs/store.js +9 -0
- package/dist/order.d.ts +54 -1
- package/dist/order.js +13 -0
- package/dist/store.d.ts +48 -1
- package/dist/store.js +9 -0
- package/package.json +1 -1
package/dist/cart.d.ts
CHANGED
|
@@ -538,11 +538,11 @@ declare global {
|
|
|
538
538
|
/**
|
|
539
539
|
* Whether this promotion waives the cart's shipping.
|
|
540
540
|
*
|
|
541
|
-
* ⚠️ `CartTotals.shipping`
|
|
542
|
-
*
|
|
543
|
-
* checkout
|
|
544
|
-
*
|
|
545
|
-
*
|
|
541
|
+
* ⚠️ `CartTotals.shipping` stays structurally `0`: the cart has no
|
|
542
|
+
* delivery method, so the shipping cost is chosen at checkout. Storefront
|
|
543
|
+
* checkout reads this flag there: a priced delivery method (`Method.fee`)
|
|
544
|
+
* books its freight line at `0` with `Order.freight.waivedBy: 'promotion'`.
|
|
545
|
+
* Do not read its absence as "shipping was charged".
|
|
546
546
|
*/
|
|
547
547
|
shippingWaived?: boolean;
|
|
548
548
|
}
|
package/dist/cjs/order.js
CHANGED
|
@@ -387,6 +387,15 @@ exports.orderFulfilmentProgress = orderFulfilmentProgress;
|
|
|
387
387
|
* - `DELIVERY_METHOD_NOT_FOUND` · 400 — `deliveryMethod` is not in the store's
|
|
388
388
|
* delivery catalogue, including an absent/empty catalogue. `data: {}`;
|
|
389
389
|
* refused before reading the cart.
|
|
390
|
+
* - `DELIVERY_FEE_CURRENCY_UNSUPPORTED` · 409 — the chosen delivery method
|
|
391
|
+
* carries a `fee` and the cart is not in the store's order currency
|
|
392
|
+
* (`config.displayCurrency`, pesos when unset), the currency the fee is
|
|
393
|
+
* stated in. `data: {}`; refused after the re-price.
|
|
394
|
+
* - `DELIVERY_FEE_CHANGED` · 409 — `expectedFreight` (absent reads as `0`)
|
|
395
|
+
* differs from the freight the server computes for the chosen delivery
|
|
396
|
+
* method. `data: DeliveryFeeChangedData` carries the server figure; show it
|
|
397
|
+
* and confirm again. Refused after the re-price and the minimum purchase,
|
|
398
|
+
* before any order id, coupon redemption or write.
|
|
390
399
|
* - `ORDER_INVALID_CART` · 400 — the normalized cart has no finite numeric
|
|
391
400
|
* `totals.grandTotal`. `data: {}`; refused before repricing/allocation.
|
|
392
401
|
* - `CART_CHANGED_SINCE_CONFIRM` · 409 — the body sent `expectedCartId` /
|
|
@@ -662,6 +671,10 @@ exports.ORDER_ERROR_CODES = [
|
|
|
662
671
|
'CART_PRICES_CHANGED',
|
|
663
672
|
'ORDER_ID_COLLISION',
|
|
664
673
|
'DELIVERY_METHOD_NOT_FOUND',
|
|
674
|
+
// A priced delivery method (`Method.fee`): the freight moved since the shopper
|
|
675
|
+
// saw it, or the cart is not in the store's order currency.
|
|
676
|
+
'DELIVERY_FEE_CHANGED',
|
|
677
|
+
'DELIVERY_FEE_CURRENCY_UNSUPPORTED',
|
|
665
678
|
'ORDER_BELOW_MINIMUM_PURCHASE',
|
|
666
679
|
'ORDER_INVALID_CART',
|
|
667
680
|
// The storefront's confirmed-cart pin (`StorefrontOrderCreateRequest.expectedCartId` / `expectedCartVersion`).
|
package/dist/cjs/store.js
CHANGED
|
@@ -139,6 +139,14 @@ exports.STORE_MODULE_ERROR_CODES = [
|
|
|
139
139
|
* entry naming no list of the store, with `data: { field, value }` where
|
|
140
140
|
* `field` is `<catalog>[<row>].availability.priceLists[<entry>]`.
|
|
141
141
|
*
|
|
142
|
+
* - `DELIVERY_FEE_INVALID` — `POST /store` only: a delivery row's `fee` carries
|
|
143
|
+
* an amount or a `freeAbove` that is not a finite number of at least `0` at
|
|
144
|
+
* the order currency's ledger scale, with `data: { field }` where `field` is
|
|
145
|
+
* `deliveryMethods[<row>].fee.<key>`; or a `paymentMethods` row carries a
|
|
146
|
+
* `fee` at all, with `field` `paymentMethods[<row>].fee`. A `fee` that is not
|
|
147
|
+
* an object, or that carries a key other than those two, is
|
|
148
|
+
* `VALIDATION_FAILED`.
|
|
149
|
+
*
|
|
142
150
|
* Request refusal, `409`:
|
|
143
151
|
* - `WHOLESALE_LIST_REQUIRED` — an `ecommerce` save turns
|
|
144
152
|
* `config.wholesaleRequests` on while the store holds no
|
|
@@ -177,6 +185,7 @@ exports.STORE_PATCH_ERROR_CODES = [
|
|
|
177
185
|
'DISPLAY_CURRENCY_NOT_INVOICEABLE',
|
|
178
186
|
'PRODUCT_CURRENCY_NOT_INVOICEABLE',
|
|
179
187
|
'PRICE_LIST_NOT_FOUND',
|
|
188
|
+
'DELIVERY_FEE_INVALID',
|
|
180
189
|
'WHOLESALE_LIST_REQUIRED',
|
|
181
190
|
'FORBIDDEN',
|
|
182
191
|
'STORE_NOT_FOUND',
|
package/dist/order.d.ts
CHANGED
|
@@ -5,6 +5,32 @@ declare global {
|
|
|
5
5
|
grandTotal: number;
|
|
6
6
|
currency: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* `409 DELIVERY_FEE_CHANGED`'s `data`: the freight the server computed for
|
|
10
|
+
* the chosen delivery method, in the order currency, `0` when the method is
|
|
11
|
+
* unpriced or its fee is waived. Show it and confirm again with it as
|
|
12
|
+
* `StorefrontOrderCreateRequest.expectedFreight`.
|
|
13
|
+
*/
|
|
14
|
+
interface DeliveryFeeChangedData {
|
|
15
|
+
freight: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Why a priced delivery method charged nothing: the goods total met the
|
|
19
|
+
* method's `fee.freeAbove`, or the cart's promotion waives shipping.
|
|
20
|
+
*/
|
|
21
|
+
type OrderFreightWaiver = 'freeAbove' | 'promotion';
|
|
22
|
+
/**
|
|
23
|
+
* Which priced delivery method booked this order's freight line, and why it
|
|
24
|
+
* charged nothing when it did. METADATA only, never money: the charge is the
|
|
25
|
+
* `lineKind: 'freight'` line in `items`, which is what `total`, the payment
|
|
26
|
+
* attempt, the receivable and the voucher all read.
|
|
27
|
+
*/
|
|
28
|
+
interface OrderFreight {
|
|
29
|
+
/** The `Store.deliveryMethods` row id whose `fee` was charged. */
|
|
30
|
+
methodId: number;
|
|
31
|
+
/** Present only when the line booked at 0 because the fee was waived. */
|
|
32
|
+
waivedBy?: OrderFreightWaiver;
|
|
33
|
+
}
|
|
8
34
|
/**
|
|
9
35
|
* A coupon as it was redeemed onto an order — the grant frozen at
|
|
10
36
|
* consumption, plus the money it actually took.
|
|
@@ -1189,6 +1215,13 @@ declare global {
|
|
|
1189
1215
|
* nothing else can tell a second release from a first.
|
|
1190
1216
|
*/
|
|
1191
1217
|
coupons?: OrderCoupon[];
|
|
1218
|
+
/**
|
|
1219
|
+
* Present only on a storefront order placed on a delivery method that
|
|
1220
|
+
* carries a `fee` (`Method.fee`), and then always beside exactly one
|
|
1221
|
+
* `lineKind: 'freight'` line. Server-owned: written by storefront checkout
|
|
1222
|
+
* and by no other writer, and stripped from an operator body.
|
|
1223
|
+
*/
|
|
1224
|
+
freight?: OrderFreight;
|
|
1192
1225
|
orderPrinted?: boolean;
|
|
1193
1226
|
tagPrinted?: boolean;
|
|
1194
1227
|
/**
|
|
@@ -2437,6 +2470,17 @@ declare global {
|
|
|
2437
2470
|
* transaction refuses too.
|
|
2438
2471
|
*/
|
|
2439
2472
|
expectedCartVersion?: number;
|
|
2473
|
+
/**
|
|
2474
|
+
* The freight the storefront showed for `deliveryMethod`, in the order
|
|
2475
|
+
* currency: the row's `fee.amount`, or `0` when `fee.freeAbove` is met by the
|
|
2476
|
+
* cart's `grandTotal` or the cart's promotion waives shipping. Omit it (or
|
|
2477
|
+
* send `0`) for an unpriced method. The server recomputes it and refuses a
|
|
2478
|
+
* different figure `409 DELIVERY_FEE_CHANGED` with `data.freight`
|
|
2479
|
+
* (`DeliveryFeeChangedData`), writing nothing. ⚠️ Omitting it on a method
|
|
2480
|
+
* whose fee comes to more than `0` is refused the same way: the shopper is
|
|
2481
|
+
* never charged a freight they were not shown.
|
|
2482
|
+
*/
|
|
2483
|
+
expectedFreight?: number;
|
|
2440
2484
|
}
|
|
2441
2485
|
interface ZebraTag {
|
|
2442
2486
|
orderId: string;
|
|
@@ -2818,6 +2862,15 @@ export declare const orderFulfilmentProgress: (order: OrderFulfilmentProgressInp
|
|
|
2818
2862
|
* - `DELIVERY_METHOD_NOT_FOUND` · 400 — `deliveryMethod` is not in the store's
|
|
2819
2863
|
* delivery catalogue, including an absent/empty catalogue. `data: {}`;
|
|
2820
2864
|
* refused before reading the cart.
|
|
2865
|
+
* - `DELIVERY_FEE_CURRENCY_UNSUPPORTED` · 409 — the chosen delivery method
|
|
2866
|
+
* carries a `fee` and the cart is not in the store's order currency
|
|
2867
|
+
* (`config.displayCurrency`, pesos when unset), the currency the fee is
|
|
2868
|
+
* stated in. `data: {}`; refused after the re-price.
|
|
2869
|
+
* - `DELIVERY_FEE_CHANGED` · 409 — `expectedFreight` (absent reads as `0`)
|
|
2870
|
+
* differs from the freight the server computes for the chosen delivery
|
|
2871
|
+
* method. `data: DeliveryFeeChangedData` carries the server figure; show it
|
|
2872
|
+
* and confirm again. Refused after the re-price and the minimum purchase,
|
|
2873
|
+
* before any order id, coupon redemption or write.
|
|
2821
2874
|
* - `ORDER_INVALID_CART` · 400 — the normalized cart has no finite numeric
|
|
2822
2875
|
* `totals.grandTotal`. `data: {}`; refused before repricing/allocation.
|
|
2823
2876
|
* - `CART_CHANGED_SINCE_CONFIRM` · 409 — the body sent `expectedCartId` /
|
|
@@ -2970,6 +3023,6 @@ export declare const orderFulfilmentProgress: (order: OrderFulfilmentProgressInp
|
|
|
2970
3023
|
* `SUBSCRIPTION_READONLY`) sit on the order CREATE leg only: an edit is not a new
|
|
2971
3024
|
* order, so `bareOrderPostHandler` routes past `requireMetered` entirely.
|
|
2972
3025
|
*/
|
|
2973
|
-
export declare const ORDER_ERROR_CODES: readonly ["ORDER_COST_DENOMINATION_UNKNOWN", "SERVICE_ORDER_DELIVERY_MANAGED", "ORDER_NOT_FOUND", "ORDER_LOCKED", "ORDER_NOT_READY", "ORDER_DELIVERED_ANOTHER_DAY", "ORDER_DELIVERY_STATE_UNCHANGED", "ORDER_ILLEGAL_TRANSITION", "ORDER_VERSION_CONFLICT", "CUSTOMER_NOT_FOUND", "CUSTOMER_MERGED", "ORDER_HAS_NO_CUSTOMER", "CUSTOMER_ANONYMIZED", "FX_CONVERSION_UNAVAILABLE", "ROLE_FORBIDDEN", "ORDER_CANCELLED", "PAYMENT_SETTLED_ON_ANOTHER_ORDER", "ORDER_HAS_SHIPMENTS", "ORDER_HAS_RETURNS", "SHIPMENT_QUANTITY_EXCEEDED", "SHIPMENT_LINE_MISMATCH", "SHIPMENT_NOT_FOUND", "SHIPMENT_LIMIT_REACHED", "SHIPMENT_TOO_LARGE", "ORDER_FULFILMENT_EXTERNAL", "SHIPMENT_FAILED", "ADMIN_REQUIRED", "IDEMPOTENCY_KEY_REQUIRED", "INVALID_IDEMPOTENCY_KEY", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_IN_PROGRESS", "IDEMPOTENCY_LOCK_CONTENTION", "IDEMPOTENCY_KEY_FAILED", "IDEMPOTENT_RESPONSE_NOT_CACHED", "ORDER_CANCELLATION_NOT_PROTECTED", "ORDER_CANCELLATION_COMMITTED", "ORDER_CANCELLATION_LOCKED", "ORDER_CANCELLATION_TOO_LARGE", "ORDER_CANCELLATION_FAILED", "SALE_LEDGER_RETRACTION_REFUSED", "SALE_LEDGER_ROW_NOT_OWNED", "PRODUCT_NOT_FOUND", "PRODUCT_SALE_LIMIT_EXCEEDED", "PRODUCT_SALE_LIMIT_INVALID", "DEPOSIT_SOURCE_NOT_ALLOWED", "DEPOSIT_CURRENCY_MISMATCH", "DEPOSIT_EXCEEDS_TOTAL", "DEPOSIT_FREEZE_REQUIRES_INVOICE", "DEPOSIT_FREEZE_INVOICE_PENDING", "DEPOSIT_CHARACTERIZATION_CONFLICT", "DEPOSIT_FREEZE_INVOICE_NOT_QUALIFYING", "DEPOSIT_INVOICED_ORDER_MUST_FREEZE", "DEPOSIT_FROZEN_ORDER_MUST_FREEZE", "DEPOSIT_REFERENCE_IS_LINKED_PAYMENT", "DEPOSIT_DUPLICATE_REFERENCE", "TILL_TENDER_REQUIRES_DEPOSIT", "PAYMENT_REFERENCED_BY_DEPOSIT", "ORDER_HAS_UNREFUNDED_DEPOSIT", "ORDER_PRICE_FROZEN", "DEPOSIT_NOT_FOUND", "DEPOSIT_ALREADY_REFUNDED", "UNIT_QUANTITY_NOT_WHOLE", "UNIT_REVISION_STALE", "UNIT_QUANTITY_UNREPRESENTABLE", "KIT_RECIPE_CHANGED", "CART_PROMOTION_UNAVAILABLE", "ORDER_HAS_KIT_LINES", "ORDER_HAS_FREIGHT_LINE", "ORDER_TARGET_REQUIRED", "ORDER_SOURCE_CONFLICT", "ORDER_CUSTOMER_REQUIRED", "BASKET_EMPTY", "BASKET_CHANGED_DURING_CHECKOUT", "CART_VERSION_CREATE_ONLY", "CART_VERSION_REQUIRES_CART_ID", "CART_REVISION_STALE", "CART_CUSTOMER_MISMATCH", "COUNTER_SALE_CREATE_ONLY", "SOLD_AT_CREATE_ONLY", "SOLD_AT_IN_FUTURE", "ORDER_TENDER_CREATE_ONLY", "CREDIT_OVERRIDE_CREATE_ONLY", "ON_ACCOUNT_CREATE_ONLY", "ON_ACCOUNT_WITH_TENDERS", "TENDERS_REQUIRE_COUNTER_SALE", "LINES_REQUIRE_COUNTER_SALE", "PRODUCT_COST_UNKNOWN", "PRICE_CHANGE_DISABLED", "LINE_DISCOUNT_EXCEEDS_MAX", "CUSTOMER_DISABLED", "SHIFT_NOT_AVAILABLE", "SOLD_AT_OUTSIDE_SHIFT", "ORDER_CURRENCY_NOT_SUBSCRIBED", "PAYMENT_METHODS_NOT_CONFIGURED", "PAYMENT_METHOD_NOT_FOUND", "PAYMENT_METHOD_UNAVAILABLE", "CART_PRICES_CHANGED", "ORDER_ID_COLLISION", "DELIVERY_METHOD_NOT_FOUND", "ORDER_BELOW_MINIMUM_PURCHASE", "ORDER_INVALID_CART", "CART_CHANGED_SINCE_CONFIRM", "EMAIL_VERIFICATION_REQUIRED", "ACCOUNT_DISABLED", "CUSTOMER_ACCESS_PENDING", "CUSTOMER_ACCESS_REJECTED", "CURRENCY_MISMATCH", "SHIFT_NOT_OPEN", "ORDER_DISCOUNT_AFTER_INVOICE", "ORDER_DISCOUNT_ON_SERVICE_ORDER", "ORDER_DISCOUNT_ON_MARKETPLACE_ORDER", "ORDER_INVOICE_METHOD_OUTSTANDING_FACTURA", "ORDER_SERVICE_PERIOD_AFTER_INVOICE", "ORDER_ATTEMPT_COMMITTED", "ORDER_ATTEMPT_ABANDONED", "ORDER_ATTEMPT_KEY_EXPIRED", "ORDER_ATTEMPT_KEY_SCOPE_MISMATCH", "ORDER_COMPLETION_ATTEMPT_COMMITTED", "ORDER_COMPLETION_ATTEMPT_ABANDONED"];
|
|
3026
|
+
export declare const ORDER_ERROR_CODES: readonly ["ORDER_COST_DENOMINATION_UNKNOWN", "SERVICE_ORDER_DELIVERY_MANAGED", "ORDER_NOT_FOUND", "ORDER_LOCKED", "ORDER_NOT_READY", "ORDER_DELIVERED_ANOTHER_DAY", "ORDER_DELIVERY_STATE_UNCHANGED", "ORDER_ILLEGAL_TRANSITION", "ORDER_VERSION_CONFLICT", "CUSTOMER_NOT_FOUND", "CUSTOMER_MERGED", "ORDER_HAS_NO_CUSTOMER", "CUSTOMER_ANONYMIZED", "FX_CONVERSION_UNAVAILABLE", "ROLE_FORBIDDEN", "ORDER_CANCELLED", "PAYMENT_SETTLED_ON_ANOTHER_ORDER", "ORDER_HAS_SHIPMENTS", "ORDER_HAS_RETURNS", "SHIPMENT_QUANTITY_EXCEEDED", "SHIPMENT_LINE_MISMATCH", "SHIPMENT_NOT_FOUND", "SHIPMENT_LIMIT_REACHED", "SHIPMENT_TOO_LARGE", "ORDER_FULFILMENT_EXTERNAL", "SHIPMENT_FAILED", "ADMIN_REQUIRED", "IDEMPOTENCY_KEY_REQUIRED", "INVALID_IDEMPOTENCY_KEY", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_IN_PROGRESS", "IDEMPOTENCY_LOCK_CONTENTION", "IDEMPOTENCY_KEY_FAILED", "IDEMPOTENT_RESPONSE_NOT_CACHED", "ORDER_CANCELLATION_NOT_PROTECTED", "ORDER_CANCELLATION_COMMITTED", "ORDER_CANCELLATION_LOCKED", "ORDER_CANCELLATION_TOO_LARGE", "ORDER_CANCELLATION_FAILED", "SALE_LEDGER_RETRACTION_REFUSED", "SALE_LEDGER_ROW_NOT_OWNED", "PRODUCT_NOT_FOUND", "PRODUCT_SALE_LIMIT_EXCEEDED", "PRODUCT_SALE_LIMIT_INVALID", "DEPOSIT_SOURCE_NOT_ALLOWED", "DEPOSIT_CURRENCY_MISMATCH", "DEPOSIT_EXCEEDS_TOTAL", "DEPOSIT_FREEZE_REQUIRES_INVOICE", "DEPOSIT_FREEZE_INVOICE_PENDING", "DEPOSIT_CHARACTERIZATION_CONFLICT", "DEPOSIT_FREEZE_INVOICE_NOT_QUALIFYING", "DEPOSIT_INVOICED_ORDER_MUST_FREEZE", "DEPOSIT_FROZEN_ORDER_MUST_FREEZE", "DEPOSIT_REFERENCE_IS_LINKED_PAYMENT", "DEPOSIT_DUPLICATE_REFERENCE", "TILL_TENDER_REQUIRES_DEPOSIT", "PAYMENT_REFERENCED_BY_DEPOSIT", "ORDER_HAS_UNREFUNDED_DEPOSIT", "ORDER_PRICE_FROZEN", "DEPOSIT_NOT_FOUND", "DEPOSIT_ALREADY_REFUNDED", "UNIT_QUANTITY_NOT_WHOLE", "UNIT_REVISION_STALE", "UNIT_QUANTITY_UNREPRESENTABLE", "KIT_RECIPE_CHANGED", "CART_PROMOTION_UNAVAILABLE", "ORDER_HAS_KIT_LINES", "ORDER_HAS_FREIGHT_LINE", "ORDER_TARGET_REQUIRED", "ORDER_SOURCE_CONFLICT", "ORDER_CUSTOMER_REQUIRED", "BASKET_EMPTY", "BASKET_CHANGED_DURING_CHECKOUT", "CART_VERSION_CREATE_ONLY", "CART_VERSION_REQUIRES_CART_ID", "CART_REVISION_STALE", "CART_CUSTOMER_MISMATCH", "COUNTER_SALE_CREATE_ONLY", "SOLD_AT_CREATE_ONLY", "SOLD_AT_IN_FUTURE", "ORDER_TENDER_CREATE_ONLY", "CREDIT_OVERRIDE_CREATE_ONLY", "ON_ACCOUNT_CREATE_ONLY", "ON_ACCOUNT_WITH_TENDERS", "TENDERS_REQUIRE_COUNTER_SALE", "LINES_REQUIRE_COUNTER_SALE", "PRODUCT_COST_UNKNOWN", "PRICE_CHANGE_DISABLED", "LINE_DISCOUNT_EXCEEDS_MAX", "CUSTOMER_DISABLED", "SHIFT_NOT_AVAILABLE", "SOLD_AT_OUTSIDE_SHIFT", "ORDER_CURRENCY_NOT_SUBSCRIBED", "PAYMENT_METHODS_NOT_CONFIGURED", "PAYMENT_METHOD_NOT_FOUND", "PAYMENT_METHOD_UNAVAILABLE", "CART_PRICES_CHANGED", "ORDER_ID_COLLISION", "DELIVERY_METHOD_NOT_FOUND", "DELIVERY_FEE_CHANGED", "DELIVERY_FEE_CURRENCY_UNSUPPORTED", "ORDER_BELOW_MINIMUM_PURCHASE", "ORDER_INVALID_CART", "CART_CHANGED_SINCE_CONFIRM", "EMAIL_VERIFICATION_REQUIRED", "ACCOUNT_DISABLED", "CUSTOMER_ACCESS_PENDING", "CUSTOMER_ACCESS_REJECTED", "CURRENCY_MISMATCH", "SHIFT_NOT_OPEN", "ORDER_DISCOUNT_AFTER_INVOICE", "ORDER_DISCOUNT_ON_SERVICE_ORDER", "ORDER_DISCOUNT_ON_MARKETPLACE_ORDER", "ORDER_INVOICE_METHOD_OUTSTANDING_FACTURA", "ORDER_SERVICE_PERIOD_AFTER_INVOICE", "ORDER_ATTEMPT_COMMITTED", "ORDER_ATTEMPT_ABANDONED", "ORDER_ATTEMPT_KEY_EXPIRED", "ORDER_ATTEMPT_KEY_SCOPE_MISMATCH", "ORDER_COMPLETION_ATTEMPT_COMMITTED", "ORDER_COMPLETION_ATTEMPT_ABANDONED"];
|
|
2974
3027
|
export type OrderErrorCode = (typeof ORDER_ERROR_CODES)[number];
|
|
2975
3028
|
export {};
|
package/dist/order.js
CHANGED
|
@@ -380,6 +380,15 @@ export const orderFulfilmentProgress = (order) => {
|
|
|
380
380
|
* - `DELIVERY_METHOD_NOT_FOUND` · 400 — `deliveryMethod` is not in the store's
|
|
381
381
|
* delivery catalogue, including an absent/empty catalogue. `data: {}`;
|
|
382
382
|
* refused before reading the cart.
|
|
383
|
+
* - `DELIVERY_FEE_CURRENCY_UNSUPPORTED` · 409 — the chosen delivery method
|
|
384
|
+
* carries a `fee` and the cart is not in the store's order currency
|
|
385
|
+
* (`config.displayCurrency`, pesos when unset), the currency the fee is
|
|
386
|
+
* stated in. `data: {}`; refused after the re-price.
|
|
387
|
+
* - `DELIVERY_FEE_CHANGED` · 409 — `expectedFreight` (absent reads as `0`)
|
|
388
|
+
* differs from the freight the server computes for the chosen delivery
|
|
389
|
+
* method. `data: DeliveryFeeChangedData` carries the server figure; show it
|
|
390
|
+
* and confirm again. Refused after the re-price and the minimum purchase,
|
|
391
|
+
* before any order id, coupon redemption or write.
|
|
383
392
|
* - `ORDER_INVALID_CART` · 400 — the normalized cart has no finite numeric
|
|
384
393
|
* `totals.grandTotal`. `data: {}`; refused before repricing/allocation.
|
|
385
394
|
* - `CART_CHANGED_SINCE_CONFIRM` · 409 — the body sent `expectedCartId` /
|
|
@@ -655,6 +664,10 @@ export const ORDER_ERROR_CODES = [
|
|
|
655
664
|
'CART_PRICES_CHANGED',
|
|
656
665
|
'ORDER_ID_COLLISION',
|
|
657
666
|
'DELIVERY_METHOD_NOT_FOUND',
|
|
667
|
+
// A priced delivery method (`Method.fee`): the freight moved since the shopper
|
|
668
|
+
// saw it, or the cart is not in the store's order currency.
|
|
669
|
+
'DELIVERY_FEE_CHANGED',
|
|
670
|
+
'DELIVERY_FEE_CURRENCY_UNSUPPORTED',
|
|
658
671
|
'ORDER_BELOW_MINIMUM_PURCHASE',
|
|
659
672
|
'ORDER_INVALID_CART',
|
|
660
673
|
// The storefront's confirmed-cart pin (`StorefrontOrderCreateRequest.expectedCartId` / `expectedCartVersion`).
|
package/dist/store.d.ts
CHANGED
|
@@ -1844,6 +1844,45 @@ declare global {
|
|
|
1844
1844
|
* is sent back without `availability`; sending a valid rule replaces it.
|
|
1845
1845
|
*/
|
|
1846
1846
|
availability?: StorefrontDesignVisibility;
|
|
1847
|
+
/**
|
|
1848
|
+
* The price of this DELIVERY method, charged on a storefront order as one
|
|
1849
|
+
* server-owned freight line (`OrderLine.lineKind: 'freight'`). ABSENT means
|
|
1850
|
+
* unpriced: the order books no freight, exactly as before the key existed.
|
|
1851
|
+
* Any delivery row may carry one, the pickup row included. Written by
|
|
1852
|
+
* `POST /store`; carried by every read of a `deliveryMethods` row, the
|
|
1853
|
+
* storefront `GET /store` and the CUSTOMER STORE frame included, because it
|
|
1854
|
+
* is the price the shopper pays.
|
|
1855
|
+
*
|
|
1856
|
+
* DELIVERY rows only. The row type is shared, but `POST /store` refuses a
|
|
1857
|
+
* `fee` on a `paymentMethods` row (`400 DELIVERY_FEE_INVALID`, `data.field`
|
|
1858
|
+
* `paymentMethods[<row>].fee`), and every read drops one a legacy payment
|
|
1859
|
+
* row still holds — nothing charges it there.
|
|
1860
|
+
*/
|
|
1861
|
+
fee?: MethodFee;
|
|
1862
|
+
}
|
|
1863
|
+
/**
|
|
1864
|
+
* A delivery method's price, in the store's order currency
|
|
1865
|
+
* (`config.displayCurrency`, pesos when unset) and IVA-inclusive like every
|
|
1866
|
+
* line price.
|
|
1867
|
+
*
|
|
1868
|
+
* `POST /store` refuses `400 DELIVERY_FEE_INVALID` (with `data.field`) unless
|
|
1869
|
+
* both numbers are finite, at least `0`, and representable at that currency's
|
|
1870
|
+
* ledger scale (2 decimals for every seeded currency). On read, a stored fee
|
|
1871
|
+
* is dropped, never coerced, only when it breaks the SHAPE (a key other than
|
|
1872
|
+
* these two, or an amount that is not a finite number of at least `0`); a
|
|
1873
|
+
* stored amount off the ledger scale is still read, and checkout rounds it to
|
|
1874
|
+
* the scale.
|
|
1875
|
+
*/
|
|
1876
|
+
interface MethodFee {
|
|
1877
|
+
/** What the method charges. `0` books a freight line at `0`. */
|
|
1878
|
+
amount: number;
|
|
1879
|
+
/**
|
|
1880
|
+
* The goods total from which the method is free: when the cart's
|
|
1881
|
+
* `grandTotal` (after every discount, freight never included) is at least
|
|
1882
|
+
* this, the freight line books at `0` with `Order.freight.waivedBy:
|
|
1883
|
+
* 'freeAbove'`. Absent means never free by amount.
|
|
1884
|
+
*/
|
|
1885
|
+
freeAbove?: number;
|
|
1847
1886
|
}
|
|
1848
1887
|
interface FiscalCondition {
|
|
1849
1888
|
CbteTipo: {
|
|
@@ -2444,6 +2483,14 @@ export type StoreModuleRefusalBody = {
|
|
|
2444
2483
|
* entry naming no list of the store, with `data: { field, value }` where
|
|
2445
2484
|
* `field` is `<catalog>[<row>].availability.priceLists[<entry>]`.
|
|
2446
2485
|
*
|
|
2486
|
+
* - `DELIVERY_FEE_INVALID` — `POST /store` only: a delivery row's `fee` carries
|
|
2487
|
+
* an amount or a `freeAbove` that is not a finite number of at least `0` at
|
|
2488
|
+
* the order currency's ledger scale, with `data: { field }` where `field` is
|
|
2489
|
+
* `deliveryMethods[<row>].fee.<key>`; or a `paymentMethods` row carries a
|
|
2490
|
+
* `fee` at all, with `field` `paymentMethods[<row>].fee`. A `fee` that is not
|
|
2491
|
+
* an object, or that carries a key other than those two, is
|
|
2492
|
+
* `VALIDATION_FAILED`.
|
|
2493
|
+
*
|
|
2447
2494
|
* Request refusal, `409`:
|
|
2448
2495
|
* - `WHOLESALE_LIST_REQUIRED` — an `ecommerce` save turns
|
|
2449
2496
|
* `config.wholesaleRequests` on while the store holds no
|
|
@@ -2464,5 +2511,5 @@ export type StoreModuleRefusalBody = {
|
|
|
2464
2511
|
* checks, the display-currency lock, the storefront fence) are not listed
|
|
2465
2512
|
* either. Cross-cutting refusals: check `GATING_ERROR_CODES` as well.
|
|
2466
2513
|
*/
|
|
2467
|
-
export declare const STORE_PATCH_ERROR_CODES: readonly ["STORE_CONFIG_FORBIDDEN", "STORE_ECOMMERCE_FORBIDDEN", "STORE_FISCAL_FIELD_FORBIDDEN", "STORE_JURISDICTION_FORBIDDEN", "AFIP_RELACION_FLAG_FORBIDDEN", "FX_TABLE_FORBIDDEN", "FX_AUTO_UPDATE_FORBIDDEN", "FIELD_NOT_WRITABLE_HERE", "AFIP_POINT_OF_SALE_NOT_CLEARABLE", "CURRENCY_CATALOG_ID_UNKNOWN", "ARS_RATE_MUST_BE_ONE", "CURRENCY_RATE_ABOVE_CEILING", "FX_CATALOG_ID_UNKNOWN", "FX_SOURCE_ID_UNKNOWN", "DISPLAY_CURRENCY_NOT_INVOICEABLE", "PRODUCT_CURRENCY_NOT_INVOICEABLE", "PRICE_LIST_NOT_FOUND", "WHOLESALE_LIST_REQUIRED", "FORBIDDEN", "STORE_NOT_FOUND"];
|
|
2514
|
+
export declare const STORE_PATCH_ERROR_CODES: readonly ["STORE_CONFIG_FORBIDDEN", "STORE_ECOMMERCE_FORBIDDEN", "STORE_FISCAL_FIELD_FORBIDDEN", "STORE_JURISDICTION_FORBIDDEN", "AFIP_RELACION_FLAG_FORBIDDEN", "FX_TABLE_FORBIDDEN", "FX_AUTO_UPDATE_FORBIDDEN", "FIELD_NOT_WRITABLE_HERE", "AFIP_POINT_OF_SALE_NOT_CLEARABLE", "CURRENCY_CATALOG_ID_UNKNOWN", "ARS_RATE_MUST_BE_ONE", "CURRENCY_RATE_ABOVE_CEILING", "FX_CATALOG_ID_UNKNOWN", "FX_SOURCE_ID_UNKNOWN", "DISPLAY_CURRENCY_NOT_INVOICEABLE", "PRODUCT_CURRENCY_NOT_INVOICEABLE", "PRICE_LIST_NOT_FOUND", "DELIVERY_FEE_INVALID", "WHOLESALE_LIST_REQUIRED", "FORBIDDEN", "STORE_NOT_FOUND"];
|
|
2468
2515
|
export type StorePatchErrorCode = (typeof STORE_PATCH_ERROR_CODES)[number];
|
package/dist/store.js
CHANGED
|
@@ -134,6 +134,14 @@ export const STORE_MODULE_ERROR_CODES = [
|
|
|
134
134
|
* entry naming no list of the store, with `data: { field, value }` where
|
|
135
135
|
* `field` is `<catalog>[<row>].availability.priceLists[<entry>]`.
|
|
136
136
|
*
|
|
137
|
+
* - `DELIVERY_FEE_INVALID` — `POST /store` only: a delivery row's `fee` carries
|
|
138
|
+
* an amount or a `freeAbove` that is not a finite number of at least `0` at
|
|
139
|
+
* the order currency's ledger scale, with `data: { field }` where `field` is
|
|
140
|
+
* `deliveryMethods[<row>].fee.<key>`; or a `paymentMethods` row carries a
|
|
141
|
+
* `fee` at all, with `field` `paymentMethods[<row>].fee`. A `fee` that is not
|
|
142
|
+
* an object, or that carries a key other than those two, is
|
|
143
|
+
* `VALIDATION_FAILED`.
|
|
144
|
+
*
|
|
137
145
|
* Request refusal, `409`:
|
|
138
146
|
* - `WHOLESALE_LIST_REQUIRED` — an `ecommerce` save turns
|
|
139
147
|
* `config.wholesaleRequests` on while the store holds no
|
|
@@ -172,6 +180,7 @@ export const STORE_PATCH_ERROR_CODES = [
|
|
|
172
180
|
'DISPLAY_CURRENCY_NOT_INVOICEABLE',
|
|
173
181
|
'PRODUCT_CURRENCY_NOT_INVOICEABLE',
|
|
174
182
|
'PRICE_LIST_NOT_FOUND',
|
|
183
|
+
'DELIVERY_FEE_INVALID',
|
|
175
184
|
'WHOLESALE_LIST_REQUIRED',
|
|
176
185
|
'FORBIDDEN',
|
|
177
186
|
'STORE_NOT_FOUND',
|