@asstio-dev/storefront 0.14.0 → 0.16.1
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/README.md +18 -7
- package/dist/checkout/browser.js +1 -1
- package/dist/checkout/controllers.d.ts +7 -2
- package/dist/checkout/controllers.js +18 -5
- package/dist/schema.d.ts +159 -1
- package/package.json +1 -1
- package/src/schema.d.ts +159 -1
package/README.md
CHANGED
|
@@ -360,8 +360,8 @@ answers the converted cart's completed attempt) with the same token, navigate to
|
|
|
360
360
|
`order`, and clear the cookie only once the confirmation page holds the access token.
|
|
361
361
|
|
|
362
362
|
**Copy and CSP.** The `pending` state ("awaiting payment approval") is your copy. Each provider's widget needs its
|
|
363
|
-
domains in your CSP: Qliro One `*.qliro.com` (`pago.qit.nu` in the sandbox),
|
|
364
|
-
|
|
363
|
+
domains in your CSP: Qliro One `*.qliro.com` (`pago.qit.nu` in the sandbox), Kustom `*.kustom.co` (verified, see
|
|
364
|
+
below), Walley `*.walleypay.com`, plus their `frame-src`/`script-src`/`connect-src` — the provider's
|
|
365
365
|
integration guide lists the exact hosts.
|
|
366
366
|
|
|
367
367
|
Problem codes you will meet here: `CART_EMPTY`, `CHECKOUT_CART_CHANGED` (with `cart`), `CHECKOUT_PREVIEW_KEY`,
|
|
@@ -375,8 +375,10 @@ Problem codes you will meet here: `CART_EMPTY`, `CHECKOUT_CART_CHANGED` (with `c
|
|
|
375
375
|
- The widget is Qliro's HTML snippet; `mountCheckout` re-creates its scripts so they run.
|
|
376
376
|
- After every cart change, `handle.sync(update)` locks the widget (`q1.lock()`), and resumes it through
|
|
377
377
|
`q1.onOrderUpdated`, which makes the iframe re-read the order. The widget unlocks only when Qliro's order shows the
|
|
378
|
-
confirmed total
|
|
379
|
-
|
|
378
|
+
confirmed total, or echoes the confirmed cart version (`MerchantUpdateVersion`, which the backend sends on a market
|
|
379
|
+
with shipping, where Qliro's total includes the fee). If it does neither within 10 seconds, or the change came before
|
|
380
|
+
Qliro's script had loaded, the widget is re-rendered from the confirmed checkout instead; it is never unlocked before
|
|
381
|
+
Qliro shows the confirmed total or version.
|
|
380
382
|
- When our validation declines a purchase (the cart moved on, the attempt expired, a line is out of stock), Qliro shows
|
|
381
383
|
its out-of-stock message and fires `q1.onPaymentDeclined`; the SDK then syncs by itself and remounts or resumes.
|
|
382
384
|
|
|
@@ -397,9 +399,18 @@ Problem codes you will meet here: `CART_EMPTY`, `CHECKOUT_CART_CHANGED` (with `c
|
|
|
397
399
|
server's; the page does nothing for them.
|
|
398
400
|
- The checkout page needs a `checkoutPath` and a `termsPath` in the market's checkout block (Purchase refuses a Kustom
|
|
399
401
|
option without them).
|
|
400
|
-
-
|
|
401
|
-
|
|
402
|
-
`
|
|
402
|
+
- Never bind `can_not_complete_order` yourself through `window._klarnaCheckout(api => api.on(...))`. Kustom's `api.on`
|
|
403
|
+
replaces the listener per event instead of adding one, so yours and the SDK's would replace each other. Use
|
|
404
|
+
`onProblem`. Listeners for other events are not affected.
|
|
405
|
+
- **CSP hosts** (K-C10, `docs/ops/kustom-playground-checks.md`, 2026-10-09: a card with 3-D Secure and the default
|
|
406
|
+
method, no blocked request). The checkout page itself loads only Kustom's script host. Everything else
|
|
407
|
+
(`kco.assets.kustomcdn.co`, Klarna, Stripe, hCaptcha, Google Pay, Amazon Pay) loads inside Kustom's iframe under
|
|
408
|
+
Kustom's own policy. Allow:
|
|
409
|
+
- `script-src 'unsafe-inline' https://*.kustom.co`;
|
|
410
|
+
- `frame-src https://*.kustom.co`;
|
|
411
|
+
- `connect-src https://*.kustom.co`.
|
|
412
|
+
|
|
413
|
+
`https://*.kustom.co` covers the playground (`js.playground.kustom.co`) and production (`js.kustom.co`).
|
|
403
414
|
|
|
404
415
|
## Headers
|
|
405
416
|
|
package/dist/checkout/browser.js
CHANGED
|
@@ -357,7 +357,7 @@ export function mountCheckout(container, checkout, options) {
|
|
|
357
357
|
// until its own answer *(plan review 2 #11)*. The provider unlocks once its view shows `dto.cart`; if it
|
|
358
358
|
// never does, the widget is re-rendered from this answer *(plan review 1 #3)*.
|
|
359
359
|
if (active <= 1)
|
|
360
|
-
resume({ cart: dto.cart, onUnsynced: () => { if (alive(gen))
|
|
360
|
+
resume({ cart: dto.cart, cartVersion: Number(dto.cartVersion), onUnsynced: () => { if (alive(gen))
|
|
361
361
|
remount(dto); } });
|
|
362
362
|
}
|
|
363
363
|
else {
|
|
@@ -37,6 +37,9 @@ export interface ResumeTarget {
|
|
|
37
37
|
cart: {
|
|
38
38
|
grandTotalInc: string;
|
|
39
39
|
};
|
|
40
|
+
/** The confirmed answer's cart version. On a shipping market Qliro's PUT carries it as `MerchantUpdateVersion`, so its
|
|
41
|
+
* echo in Qliro's order also shows the update landed (carriers 1b ruling R-S3-K1). */
|
|
42
|
+
cartVersion?: number;
|
|
40
43
|
/** The provider never showed `cart` before its deadline: the handle re-renders the widget from the confirmed answer. */
|
|
41
44
|
onUnsynced(): void;
|
|
42
45
|
}
|
|
@@ -66,7 +69,9 @@ export type ControllerFactory = (win: ProviderWindow, timer: ControllerTimer) =>
|
|
|
66
69
|
* re-rendered, never unlocked blindly *(plan review 1 #3)*. */
|
|
67
70
|
export declare const QLIRO_SYNC_DEADLINE_MS = 10000;
|
|
68
71
|
/** Qliro's check before `unlock()` (*Update order*: "Verify that the total amount of the order = total amount in the
|
|
69
|
-
* shopping cart"), in öre
|
|
70
|
-
|
|
72
|
+
* shopping cart"), in öre, **or** the `MerchantUpdateVersion` our PUT sent (carriers 1b ruling R-S3-K1: on a shipping
|
|
73
|
+
* market Qliro's total includes the fee, so the total alone never matches). The echo is a string in Qliro's schema; its
|
|
74
|
+
* name is read case-insensitively (VQ-8 records the real one). */
|
|
75
|
+
export declare function qliroOrderMatches(order: unknown, target: Pick<ResumeTarget, "cart" | "cartVersion">): boolean;
|
|
71
76
|
export declare const controllers: Record<"qliro-q1" | "klarna-kco" | "walley", ControllerFactory>;
|
|
72
77
|
export declare function controllerFor(name: string, win: ProviderWindow, timer?: ControllerTimer): CheckoutController;
|
|
@@ -5,10 +5,23 @@ export const KLARNA_READY_POLL_MS = 100;
|
|
|
5
5
|
export const QLIRO_SYNC_DEADLINE_MS = 10_000;
|
|
6
6
|
const ore = (v) => Math.round(Number(v) * 100);
|
|
7
7
|
/** Qliro's check before `unlock()` (*Update order*: "Verify that the total amount of the order = total amount in the
|
|
8
|
-
* shopping cart"), in öre
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
* shopping cart"), in öre, **or** the `MerchantUpdateVersion` our PUT sent (carriers 1b ruling R-S3-K1: on a shipping
|
|
9
|
+
* market Qliro's total includes the fee, so the total alone never matches). The echo is a string in Qliro's schema; its
|
|
10
|
+
* name is read case-insensitively (VQ-8 records the real one). */
|
|
11
|
+
export function qliroOrderMatches(order, target) {
|
|
12
|
+
const o = order;
|
|
13
|
+
const total = o?.totalPrice;
|
|
14
|
+
if ((typeof total === "number" || typeof total === "string") && ore(total) === ore(target.cart.grandTotalInc))
|
|
15
|
+
return true;
|
|
16
|
+
if (target.cartVersion === undefined || !o)
|
|
17
|
+
return false;
|
|
18
|
+
const key = Object.keys(o).find((k) => k.toLowerCase() === "merchantupdateversion");
|
|
19
|
+
const raw = key === undefined ? undefined : o[key];
|
|
20
|
+
// Only a number or a non-blank string is an echo: `Number("")` and `Number(null)` are 0, which must not match version 0.
|
|
21
|
+
if (!(typeof raw === "number" || (typeof raw === "string" && raw.trim() !== "")))
|
|
22
|
+
return false;
|
|
23
|
+
const echoed = Number(raw);
|
|
24
|
+
return Number.isFinite(echoed) && echoed === Number(target.cartVersion);
|
|
12
25
|
}
|
|
13
26
|
export const controllers = {
|
|
14
27
|
"qliro-q1": (win, timer) => {
|
|
@@ -42,7 +55,7 @@ export const controllers = {
|
|
|
42
55
|
}
|
|
43
56
|
if (missedLock)
|
|
44
57
|
q1.lock(); // onOrderUpdated "requires q1.lock() to have been called first"
|
|
45
|
-
q1.onOrderUpdated((order) => { if (qliroOrderMatches(order, target
|
|
58
|
+
q1.onOrderUpdated((order) => { if (qliroOrderMatches(order, target))
|
|
46
59
|
unlock(); });
|
|
47
60
|
// Never unlocked blindly: past the deadline the handle re-renders the widget from the confirmed answer
|
|
48
61
|
// *(plan review 1 #3)*.
|
package/dist/schema.d.ts
CHANGED
|
@@ -102,6 +102,22 @@ export interface paths {
|
|
|
102
102
|
patch?: never;
|
|
103
103
|
trace?: never;
|
|
104
104
|
};
|
|
105
|
+
"/v1/cart/shipping-estimate": {
|
|
106
|
+
parameters: {
|
|
107
|
+
query?: never;
|
|
108
|
+
header?: never;
|
|
109
|
+
path?: never;
|
|
110
|
+
cookie?: never;
|
|
111
|
+
};
|
|
112
|
+
get: operations["GetShippingEstimate"];
|
|
113
|
+
put?: never;
|
|
114
|
+
post?: never;
|
|
115
|
+
delete?: never;
|
|
116
|
+
options?: never;
|
|
117
|
+
head?: never;
|
|
118
|
+
patch?: never;
|
|
119
|
+
trace?: never;
|
|
120
|
+
};
|
|
105
121
|
"/v1/categories": {
|
|
106
122
|
parameters: {
|
|
107
123
|
query?: never;
|
|
@@ -624,6 +640,14 @@ export interface components {
|
|
|
624
640
|
/** Format: int32 */
|
|
625
641
|
min: number;
|
|
626
642
|
};
|
|
643
|
+
DeliveryTimeDto: {
|
|
644
|
+
/** Format: int32 */
|
|
645
|
+
maxDays: number | null | string;
|
|
646
|
+
/** Format: int32 */
|
|
647
|
+
minDays: number | null | string;
|
|
648
|
+
mode: string;
|
|
649
|
+
text: null | string;
|
|
650
|
+
};
|
|
627
651
|
DescriptionDto: {
|
|
628
652
|
html: string;
|
|
629
653
|
text: string;
|
|
@@ -662,6 +686,11 @@ export interface components {
|
|
|
662
686
|
facet: string;
|
|
663
687
|
values: components["schemas"]["FacetValueDto"][];
|
|
664
688
|
};
|
|
689
|
+
FreeShippingDto: {
|
|
690
|
+
free: boolean;
|
|
691
|
+
remaining: null | string;
|
|
692
|
+
threshold: null | string;
|
|
693
|
+
};
|
|
665
694
|
/** @enum {unknown} */
|
|
666
695
|
LineAvailability: "backorder" | "inStock";
|
|
667
696
|
ListingResponse: {
|
|
@@ -791,6 +820,7 @@ export interface components {
|
|
|
791
820
|
placedAt: string;
|
|
792
821
|
promisedDelivery: null | components["schemas"]["DeliveryRangeDto"];
|
|
793
822
|
reference: string;
|
|
823
|
+
shipping: null | components["schemas"]["OrderShippingDto"];
|
|
794
824
|
status: components["schemas"]["OrderStatusDto"];
|
|
795
825
|
test: boolean;
|
|
796
826
|
totals: components["schemas"]["OrderTotalsDto"];
|
|
@@ -812,6 +842,21 @@ export interface components {
|
|
|
812
842
|
variantId: null | string;
|
|
813
843
|
vatRate: string;
|
|
814
844
|
};
|
|
845
|
+
OrderShippingDto: {
|
|
846
|
+
carrier: string;
|
|
847
|
+
deliveryTime: null | components["schemas"]["DeliveryTimeDto"];
|
|
848
|
+
deliveryType: string;
|
|
849
|
+
fee: string;
|
|
850
|
+
name: string;
|
|
851
|
+
option: string;
|
|
852
|
+
point: null | components["schemas"]["OrderShippingPointDto"];
|
|
853
|
+
};
|
|
854
|
+
OrderShippingPointDto: {
|
|
855
|
+
city: null | string;
|
|
856
|
+
name: string;
|
|
857
|
+
postalCode: null | string;
|
|
858
|
+
street: null | string;
|
|
859
|
+
};
|
|
815
860
|
OrderStatusDto: {
|
|
816
861
|
fulfilment: string;
|
|
817
862
|
order: string;
|
|
@@ -924,6 +969,27 @@ export interface components {
|
|
|
924
969
|
SetCartMarketRequest: {
|
|
925
970
|
market: string;
|
|
926
971
|
};
|
|
972
|
+
ShippingEstimateDto: {
|
|
973
|
+
available: boolean;
|
|
974
|
+
freeShipping: null | components["schemas"]["FreeShippingDto"];
|
|
975
|
+
options: components["schemas"]["ShippingEstimateOptionDto"][];
|
|
976
|
+
reason: null | string;
|
|
977
|
+
};
|
|
978
|
+
ShippingEstimateOptionDto: {
|
|
979
|
+
deliveryType: string;
|
|
980
|
+
fee: string;
|
|
981
|
+
key: string;
|
|
982
|
+
labels: components["schemas"]["ShippingLabelDto"][];
|
|
983
|
+
name: string;
|
|
984
|
+
pointsAtCheckout: boolean;
|
|
985
|
+
preselected: boolean;
|
|
986
|
+
regularFee: null | string;
|
|
987
|
+
};
|
|
988
|
+
ShippingLabelDto: {
|
|
989
|
+
color: string;
|
|
990
|
+
icon: null | string;
|
|
991
|
+
name: string;
|
|
992
|
+
};
|
|
927
993
|
SiteDto: {
|
|
928
994
|
code: string;
|
|
929
995
|
configVersion: string;
|
|
@@ -1859,6 +1925,98 @@ export interface operations {
|
|
|
1859
1925
|
};
|
|
1860
1926
|
};
|
|
1861
1927
|
};
|
|
1928
|
+
GetShippingEstimate: {
|
|
1929
|
+
parameters: {
|
|
1930
|
+
query?: never;
|
|
1931
|
+
header: {
|
|
1932
|
+
/** @description Publishable, preview or secret site key. Required on every request; secret keys are server-side only. */
|
|
1933
|
+
"X-Site-Key": string;
|
|
1934
|
+
/** @description Market code (e.g. "se"). Omit for the site's default market. */
|
|
1935
|
+
"X-Market"?: string;
|
|
1936
|
+
/** @description BCP-47 language tag. Omit to use the market's language. */
|
|
1937
|
+
"Accept-Language"?: string;
|
|
1938
|
+
/** @description The bearer token returned by POST /v1/cart. Identifies which cart this request reads or mutates. */
|
|
1939
|
+
"X-Cart-Token": string;
|
|
1940
|
+
};
|
|
1941
|
+
path?: never;
|
|
1942
|
+
cookie?: never;
|
|
1943
|
+
};
|
|
1944
|
+
requestBody?: never;
|
|
1945
|
+
responses: {
|
|
1946
|
+
/** @description OK */
|
|
1947
|
+
200: {
|
|
1948
|
+
headers: {
|
|
1949
|
+
[name: string]: unknown;
|
|
1950
|
+
};
|
|
1951
|
+
content: {
|
|
1952
|
+
"application/json": components["schemas"]["ShippingEstimateDto"];
|
|
1953
|
+
};
|
|
1954
|
+
};
|
|
1955
|
+
/** @description problem+json. NOT_FOUND (X-Cart-Token missing). */
|
|
1956
|
+
400: {
|
|
1957
|
+
headers: {
|
|
1958
|
+
[name: string]: unknown;
|
|
1959
|
+
};
|
|
1960
|
+
content: {
|
|
1961
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
1962
|
+
};
|
|
1963
|
+
};
|
|
1964
|
+
/** @description problem+json. SITE_KEY_MISSING or SITE_KEY_INVALID. */
|
|
1965
|
+
401: {
|
|
1966
|
+
headers: {
|
|
1967
|
+
[name: string]: unknown;
|
|
1968
|
+
};
|
|
1969
|
+
content: {
|
|
1970
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
1971
|
+
};
|
|
1972
|
+
};
|
|
1973
|
+
/** @description problem+json. SECRET_KEY_FROM_BROWSER: a secret key was sent from a browser. */
|
|
1974
|
+
403: {
|
|
1975
|
+
headers: {
|
|
1976
|
+
[name: string]: unknown;
|
|
1977
|
+
};
|
|
1978
|
+
content: {
|
|
1979
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
1980
|
+
};
|
|
1981
|
+
};
|
|
1982
|
+
/** @description problem+json. SITE_INACTIVE, or NOT_FOUND for an unrouted path. */
|
|
1983
|
+
404: {
|
|
1984
|
+
headers: {
|
|
1985
|
+
[name: string]: unknown;
|
|
1986
|
+
};
|
|
1987
|
+
content: {
|
|
1988
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
1989
|
+
};
|
|
1990
|
+
};
|
|
1991
|
+
/** @description problem+json. CART_EXPIRED: this cart token belongs to an expired cart. */
|
|
1992
|
+
410: {
|
|
1993
|
+
headers: {
|
|
1994
|
+
[name: string]: unknown;
|
|
1995
|
+
};
|
|
1996
|
+
content: {
|
|
1997
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
1998
|
+
};
|
|
1999
|
+
};
|
|
2000
|
+
/** @description problem+json. RATE_LIMITED; retryAfterSeconds and the Retry-After header say how long to wait. */
|
|
2001
|
+
429: {
|
|
2002
|
+
headers: {
|
|
2003
|
+
[name: string]: unknown;
|
|
2004
|
+
};
|
|
2005
|
+
content: {
|
|
2006
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
2007
|
+
};
|
|
2008
|
+
};
|
|
2009
|
+
/** @description problem+json. SITE_REGISTRY_WARMING or INDEX_UNAVAILABLE — retry, the request was not wrong. */
|
|
2010
|
+
503: {
|
|
2011
|
+
headers: {
|
|
2012
|
+
[name: string]: unknown;
|
|
2013
|
+
};
|
|
2014
|
+
content: {
|
|
2015
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
2016
|
+
};
|
|
2017
|
+
};
|
|
2018
|
+
};
|
|
2019
|
+
};
|
|
1862
2020
|
GetCategories: {
|
|
1863
2021
|
parameters: {
|
|
1864
2022
|
query?: never;
|
|
@@ -2043,7 +2201,7 @@ export interface operations {
|
|
|
2043
2201
|
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
2044
2202
|
};
|
|
2045
2203
|
};
|
|
2046
|
-
/** @description problem+json. CHECKOUT_UNAVAILABLE or CHECKOUT_PROVIDER_UNAVAILABLE (Retry-After); SITE_REGISTRY_WARMING. */
|
|
2204
|
+
/** @description problem+json. CHECKOUT_UNAVAILABLE, SHIPPING_UNAVAILABLE (the market's shipping configuration cannot be served) or CHECKOUT_PROVIDER_UNAVAILABLE (Retry-After); SITE_REGISTRY_WARMING. */
|
|
2047
2205
|
503: {
|
|
2048
2206
|
headers: {
|
|
2049
2207
|
[name: string]: unknown;
|
package/package.json
CHANGED
package/src/schema.d.ts
CHANGED
|
@@ -102,6 +102,22 @@ export interface paths {
|
|
|
102
102
|
patch?: never;
|
|
103
103
|
trace?: never;
|
|
104
104
|
};
|
|
105
|
+
"/v1/cart/shipping-estimate": {
|
|
106
|
+
parameters: {
|
|
107
|
+
query?: never;
|
|
108
|
+
header?: never;
|
|
109
|
+
path?: never;
|
|
110
|
+
cookie?: never;
|
|
111
|
+
};
|
|
112
|
+
get: operations["GetShippingEstimate"];
|
|
113
|
+
put?: never;
|
|
114
|
+
post?: never;
|
|
115
|
+
delete?: never;
|
|
116
|
+
options?: never;
|
|
117
|
+
head?: never;
|
|
118
|
+
patch?: never;
|
|
119
|
+
trace?: never;
|
|
120
|
+
};
|
|
105
121
|
"/v1/categories": {
|
|
106
122
|
parameters: {
|
|
107
123
|
query?: never;
|
|
@@ -624,6 +640,14 @@ export interface components {
|
|
|
624
640
|
/** Format: int32 */
|
|
625
641
|
min: number;
|
|
626
642
|
};
|
|
643
|
+
DeliveryTimeDto: {
|
|
644
|
+
/** Format: int32 */
|
|
645
|
+
maxDays: number | null | string;
|
|
646
|
+
/** Format: int32 */
|
|
647
|
+
minDays: number | null | string;
|
|
648
|
+
mode: string;
|
|
649
|
+
text: null | string;
|
|
650
|
+
};
|
|
627
651
|
DescriptionDto: {
|
|
628
652
|
html: string;
|
|
629
653
|
text: string;
|
|
@@ -662,6 +686,11 @@ export interface components {
|
|
|
662
686
|
facet: string;
|
|
663
687
|
values: components["schemas"]["FacetValueDto"][];
|
|
664
688
|
};
|
|
689
|
+
FreeShippingDto: {
|
|
690
|
+
free: boolean;
|
|
691
|
+
remaining: null | string;
|
|
692
|
+
threshold: null | string;
|
|
693
|
+
};
|
|
665
694
|
/** @enum {unknown} */
|
|
666
695
|
LineAvailability: "backorder" | "inStock";
|
|
667
696
|
ListingResponse: {
|
|
@@ -791,6 +820,7 @@ export interface components {
|
|
|
791
820
|
placedAt: string;
|
|
792
821
|
promisedDelivery: null | components["schemas"]["DeliveryRangeDto"];
|
|
793
822
|
reference: string;
|
|
823
|
+
shipping: null | components["schemas"]["OrderShippingDto"];
|
|
794
824
|
status: components["schemas"]["OrderStatusDto"];
|
|
795
825
|
test: boolean;
|
|
796
826
|
totals: components["schemas"]["OrderTotalsDto"];
|
|
@@ -812,6 +842,21 @@ export interface components {
|
|
|
812
842
|
variantId: null | string;
|
|
813
843
|
vatRate: string;
|
|
814
844
|
};
|
|
845
|
+
OrderShippingDto: {
|
|
846
|
+
carrier: string;
|
|
847
|
+
deliveryTime: null | components["schemas"]["DeliveryTimeDto"];
|
|
848
|
+
deliveryType: string;
|
|
849
|
+
fee: string;
|
|
850
|
+
name: string;
|
|
851
|
+
option: string;
|
|
852
|
+
point: null | components["schemas"]["OrderShippingPointDto"];
|
|
853
|
+
};
|
|
854
|
+
OrderShippingPointDto: {
|
|
855
|
+
city: null | string;
|
|
856
|
+
name: string;
|
|
857
|
+
postalCode: null | string;
|
|
858
|
+
street: null | string;
|
|
859
|
+
};
|
|
815
860
|
OrderStatusDto: {
|
|
816
861
|
fulfilment: string;
|
|
817
862
|
order: string;
|
|
@@ -924,6 +969,27 @@ export interface components {
|
|
|
924
969
|
SetCartMarketRequest: {
|
|
925
970
|
market: string;
|
|
926
971
|
};
|
|
972
|
+
ShippingEstimateDto: {
|
|
973
|
+
available: boolean;
|
|
974
|
+
freeShipping: null | components["schemas"]["FreeShippingDto"];
|
|
975
|
+
options: components["schemas"]["ShippingEstimateOptionDto"][];
|
|
976
|
+
reason: null | string;
|
|
977
|
+
};
|
|
978
|
+
ShippingEstimateOptionDto: {
|
|
979
|
+
deliveryType: string;
|
|
980
|
+
fee: string;
|
|
981
|
+
key: string;
|
|
982
|
+
labels: components["schemas"]["ShippingLabelDto"][];
|
|
983
|
+
name: string;
|
|
984
|
+
pointsAtCheckout: boolean;
|
|
985
|
+
preselected: boolean;
|
|
986
|
+
regularFee: null | string;
|
|
987
|
+
};
|
|
988
|
+
ShippingLabelDto: {
|
|
989
|
+
color: string;
|
|
990
|
+
icon: null | string;
|
|
991
|
+
name: string;
|
|
992
|
+
};
|
|
927
993
|
SiteDto: {
|
|
928
994
|
code: string;
|
|
929
995
|
configVersion: string;
|
|
@@ -1859,6 +1925,98 @@ export interface operations {
|
|
|
1859
1925
|
};
|
|
1860
1926
|
};
|
|
1861
1927
|
};
|
|
1928
|
+
GetShippingEstimate: {
|
|
1929
|
+
parameters: {
|
|
1930
|
+
query?: never;
|
|
1931
|
+
header: {
|
|
1932
|
+
/** @description Publishable, preview or secret site key. Required on every request; secret keys are server-side only. */
|
|
1933
|
+
"X-Site-Key": string;
|
|
1934
|
+
/** @description Market code (e.g. "se"). Omit for the site's default market. */
|
|
1935
|
+
"X-Market"?: string;
|
|
1936
|
+
/** @description BCP-47 language tag. Omit to use the market's language. */
|
|
1937
|
+
"Accept-Language"?: string;
|
|
1938
|
+
/** @description The bearer token returned by POST /v1/cart. Identifies which cart this request reads or mutates. */
|
|
1939
|
+
"X-Cart-Token": string;
|
|
1940
|
+
};
|
|
1941
|
+
path?: never;
|
|
1942
|
+
cookie?: never;
|
|
1943
|
+
};
|
|
1944
|
+
requestBody?: never;
|
|
1945
|
+
responses: {
|
|
1946
|
+
/** @description OK */
|
|
1947
|
+
200: {
|
|
1948
|
+
headers: {
|
|
1949
|
+
[name: string]: unknown;
|
|
1950
|
+
};
|
|
1951
|
+
content: {
|
|
1952
|
+
"application/json": components["schemas"]["ShippingEstimateDto"];
|
|
1953
|
+
};
|
|
1954
|
+
};
|
|
1955
|
+
/** @description problem+json. NOT_FOUND (X-Cart-Token missing). */
|
|
1956
|
+
400: {
|
|
1957
|
+
headers: {
|
|
1958
|
+
[name: string]: unknown;
|
|
1959
|
+
};
|
|
1960
|
+
content: {
|
|
1961
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
1962
|
+
};
|
|
1963
|
+
};
|
|
1964
|
+
/** @description problem+json. SITE_KEY_MISSING or SITE_KEY_INVALID. */
|
|
1965
|
+
401: {
|
|
1966
|
+
headers: {
|
|
1967
|
+
[name: string]: unknown;
|
|
1968
|
+
};
|
|
1969
|
+
content: {
|
|
1970
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
1971
|
+
};
|
|
1972
|
+
};
|
|
1973
|
+
/** @description problem+json. SECRET_KEY_FROM_BROWSER: a secret key was sent from a browser. */
|
|
1974
|
+
403: {
|
|
1975
|
+
headers: {
|
|
1976
|
+
[name: string]: unknown;
|
|
1977
|
+
};
|
|
1978
|
+
content: {
|
|
1979
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
1980
|
+
};
|
|
1981
|
+
};
|
|
1982
|
+
/** @description problem+json. SITE_INACTIVE, or NOT_FOUND for an unrouted path. */
|
|
1983
|
+
404: {
|
|
1984
|
+
headers: {
|
|
1985
|
+
[name: string]: unknown;
|
|
1986
|
+
};
|
|
1987
|
+
content: {
|
|
1988
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
1989
|
+
};
|
|
1990
|
+
};
|
|
1991
|
+
/** @description problem+json. CART_EXPIRED: this cart token belongs to an expired cart. */
|
|
1992
|
+
410: {
|
|
1993
|
+
headers: {
|
|
1994
|
+
[name: string]: unknown;
|
|
1995
|
+
};
|
|
1996
|
+
content: {
|
|
1997
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
1998
|
+
};
|
|
1999
|
+
};
|
|
2000
|
+
/** @description problem+json. RATE_LIMITED; retryAfterSeconds and the Retry-After header say how long to wait. */
|
|
2001
|
+
429: {
|
|
2002
|
+
headers: {
|
|
2003
|
+
[name: string]: unknown;
|
|
2004
|
+
};
|
|
2005
|
+
content: {
|
|
2006
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
2007
|
+
};
|
|
2008
|
+
};
|
|
2009
|
+
/** @description problem+json. SITE_REGISTRY_WARMING or INDEX_UNAVAILABLE — retry, the request was not wrong. */
|
|
2010
|
+
503: {
|
|
2011
|
+
headers: {
|
|
2012
|
+
[name: string]: unknown;
|
|
2013
|
+
};
|
|
2014
|
+
content: {
|
|
2015
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
2016
|
+
};
|
|
2017
|
+
};
|
|
2018
|
+
};
|
|
2019
|
+
};
|
|
1862
2020
|
GetCategories: {
|
|
1863
2021
|
parameters: {
|
|
1864
2022
|
query?: never;
|
|
@@ -2043,7 +2201,7 @@ export interface operations {
|
|
|
2043
2201
|
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
2044
2202
|
};
|
|
2045
2203
|
};
|
|
2046
|
-
/** @description problem+json. CHECKOUT_UNAVAILABLE or CHECKOUT_PROVIDER_UNAVAILABLE (Retry-After); SITE_REGISTRY_WARMING. */
|
|
2204
|
+
/** @description problem+json. CHECKOUT_UNAVAILABLE, SHIPPING_UNAVAILABLE (the market's shipping configuration cannot be served) or CHECKOUT_PROVIDER_UNAVAILABLE (Retry-After); SITE_REGISTRY_WARMING. */
|
|
2047
2205
|
503: {
|
|
2048
2206
|
headers: {
|
|
2049
2207
|
[name: string]: unknown;
|