@01.software/sdk 0.44.0 → 0.45.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 (80) hide show
  1. package/CHANGELOG.md +358 -2
  2. package/MIGRATION.md +89 -10
  3. package/README.md +441 -98
  4. package/dist/{server-nXOezi4b.d.cts → catalog-mappers-sIshKNb3.d.cts} +14 -3
  5. package/dist/{server-nXOezi4b.d.ts → catalog-mappers-sIshKNb3.d.ts} +14 -3
  6. package/dist/client.cjs +2680 -345
  7. package/dist/client.cjs.map +1 -1
  8. package/dist/client.d.cts +10 -7
  9. package/dist/client.d.ts +10 -7
  10. package/dist/client.js +2680 -345
  11. package/dist/client.js.map +1 -1
  12. package/dist/{collection-client-Dyl-CDcj.d.cts → collection-client-BSo7VXQE.d.cts} +8 -5
  13. package/dist/{collection-client-DWooaiTr.d.ts → collection-client-Ckfusuee.d.ts} +8 -5
  14. package/dist/{const-pGDnsy0o.d.ts → const-BAG0MH0u.d.cts} +13 -10
  15. package/dist/{const-1vleZ6ov.d.cts → const-CaPq2AE4.d.ts} +13 -10
  16. package/dist/errors.cjs +74 -1
  17. package/dist/errors.cjs.map +1 -1
  18. package/dist/errors.d.cts +38 -1
  19. package/dist/errors.d.ts +38 -1
  20. package/dist/errors.js +74 -1
  21. package/dist/errors.js.map +1 -1
  22. package/dist/{index-DUNySyxV.d.ts → index-BNICJxBL.d.ts} +4 -4
  23. package/dist/{index-a6g7vqAD.d.cts → index-YGrZrxNn.d.cts} +4 -4
  24. package/dist/index.cjs +2741 -368
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +18 -19
  27. package/dist/index.d.ts +18 -19
  28. package/dist/index.js +2741 -368
  29. package/dist/index.js.map +1 -1
  30. package/dist/{payload-types-CDsuOEfM.d.cts → payload-types-CJZuXcgF.d.cts} +6671 -4001
  31. package/dist/{payload-types-CDsuOEfM.d.ts → payload-types-CJZuXcgF.d.ts} +6671 -4001
  32. package/dist/query.cjs +550 -101
  33. package/dist/query.cjs.map +1 -1
  34. package/dist/query.d.cts +43 -45
  35. package/dist/query.d.ts +43 -45
  36. package/dist/query.js +550 -101
  37. package/dist/query.js.map +1 -1
  38. package/dist/realtime.cjs.map +1 -1
  39. package/dist/realtime.d.cts +2 -2
  40. package/dist/realtime.d.ts +2 -2
  41. package/dist/realtime.js.map +1 -1
  42. package/dist/server.cjs +2252 -444
  43. package/dist/server.cjs.map +1 -1
  44. package/dist/server.d.cts +11 -10
  45. package/dist/server.d.ts +11 -10
  46. package/dist/server.js +2252 -444
  47. package/dist/server.js.map +1 -1
  48. package/dist/storefront-cache.cjs +65 -1
  49. package/dist/storefront-cache.cjs.map +1 -1
  50. package/dist/storefront-cache.js +65 -1
  51. package/dist/storefront-cache.js.map +1 -1
  52. package/dist/types-BC6rVmJa.d.ts +47 -0
  53. package/dist/{types-CDND3hzq.d.cts → types-BlOvjoTX.d.ts} +1095 -509
  54. package/dist/{types-Dt9FJisi.d.ts → types-C4WuJfw7.d.cts} +1095 -509
  55. package/dist/types-D5p7-m1l.d.cts +47 -0
  56. package/dist/ui/canvas/server.cjs +244 -2
  57. package/dist/ui/canvas/server.cjs.map +1 -1
  58. package/dist/ui/canvas/server.d.cts +27 -1
  59. package/dist/ui/canvas/server.d.ts +27 -1
  60. package/dist/ui/canvas/server.js +244 -2
  61. package/dist/ui/canvas/server.js.map +1 -1
  62. package/dist/ui/canvas.cjs +419 -103
  63. package/dist/ui/canvas.cjs.map +1 -1
  64. package/dist/ui/canvas.d.cts +19 -7
  65. package/dist/ui/canvas.d.ts +19 -7
  66. package/dist/ui/canvas.js +419 -103
  67. package/dist/ui/canvas.js.map +1 -1
  68. package/dist/ui/form.d.cts +1 -1
  69. package/dist/ui/form.d.ts +1 -1
  70. package/dist/ui/video.d.cts +1 -1
  71. package/dist/ui/video.d.ts +1 -1
  72. package/dist/webhook.cjs +2 -1
  73. package/dist/webhook.cjs.map +1 -1
  74. package/dist/webhook.d.cts +4 -4
  75. package/dist/webhook.d.ts +4 -4
  76. package/dist/webhook.js +2 -1
  77. package/dist/webhook.js.map +1 -1
  78. package/package.json +12 -11
  79. package/dist/types-SoXsbKhj.d.cts +0 -33
  80. package/dist/types-oiae_LMm.d.ts +0 -33
@@ -1,6 +1,34 @@
1
- import { P as PublicCollection, S as ServerCollection } from './const-1vleZ6ov.cjs';
2
- import { C as CollectionType, P as PublicProduct } from './types-SoXsbKhj.cjs';
3
- import { O as Order, m as Transaction, n as Fulfillment, R as Return } from './payload-types-CDsuOEfM.cjs';
1
+ import { P as PublicCollection, C as Collection, S as ServerCollection } from './const-CaPq2AE4.js';
2
+ import { C as CollectionType, a as PublicProduct, P as PublicMarket } from './types-BC6rVmJa.js';
3
+ import { O as Order, k as Transaction, l as Fulfillment, R as Return } from './payload-types-CJZuXcgF.js';
4
+
5
+ declare const operationBrand: unique symbol;
6
+ type HttpOperation = {
7
+ readonly [operationBrand]: true;
8
+ readonly collection: string | null;
9
+ readonly method: 'get' | 'post' | 'patch' | 'delete';
10
+ readonly path: `/${string}`;
11
+ };
12
+
13
+ /**
14
+ * Single source of truth for the commerce HTTP paths the SDK calls.
15
+ *
16
+ * Console exposes these as `slug + Endpoint.path` on collection configs; the SDK
17
+ * has to hardcode the joined `/api/<slug>/<path>` because it cannot import the
18
+ * Console at build time. To stop a Console path change from silently turning into
19
+ * a runtime 404, non-quarantined values are cross-checked against live Console
20
+ * endpoint registration by `apps/console/tests/unit/sdk/endpoint-parity.test.ts`.
21
+ * That test also records canonical Phase 1 operations whose route is absent or
22
+ * whose same-path legacy handler is not yet contract-compatible; registration
23
+ * alone must never be interpreted as transport parity.
24
+ *
25
+ * Keep this internal — it is the transport contract, not public SDK surface.
26
+ */
27
+ type CanonicalCommerceEndpointDescriptor = {
28
+ readonly method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
29
+ readonly path: string;
30
+ };
31
+ type CommerceEndpointDescriptor = CanonicalCommerceEndpointDescriptor | HttpOperation;
4
32
 
5
33
  interface CustomerScopedApiOptions {
6
34
  publishableKey?: string;
@@ -15,14 +43,22 @@ interface CustomerScopedRequestOptions {
15
43
  method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
16
44
  body?: unknown;
17
45
  headers?: Record<string, string>;
46
+ errorFamily?: 'commerce';
18
47
  }
48
+ type EndpointRequestOptions$1 = {
49
+ headers?: Record<string, string>;
50
+ pathParams?: Readonly<Record<string, string>>;
51
+ query?: string | URLSearchParams;
52
+ };
53
+ /** Operation-only base for customer-scoped commerce APIs. */
19
54
  declare class CustomerScopedApi {
20
- private readonly publishableKey;
21
- private readonly secretKey?;
22
- private readonly apiUrl?;
23
- private readonly customerToken?;
24
- private readonly onUnauthorized?;
25
- private readonly onRequestId?;
55
+ private readonly transport;
56
+ constructor(apiName: string, options: CustomerScopedApiOptions);
57
+ protected requestEndpoint<T>(endpoint: CommerceEndpointDescriptor, body?: unknown, options?: EndpointRequestOptions$1): Promise<T>;
58
+ }
59
+ /** Raw transport base reserved for non-commerce customer-scoped APIs. */
60
+ declare class RawCustomerScopedApi {
61
+ private readonly transport;
26
62
  constructor(apiName: string, options: CustomerScopedApiOptions);
27
63
  protected request<T>(endpoint: string, options: CustomerScopedRequestOptions): Promise<T>;
28
64
  }
@@ -167,7 +203,7 @@ type CommunityPostMutationResponse = CommunityPost | RawCommunityPost;
167
203
  type CommunityCommentMutationResponse = CommunityComment | RawCommunityComment;
168
204
  type CommunityReactionMutationResponse = Reaction | RawCommunityReaction;
169
205
  type CommunityBookmarkMutationResponse = Bookmark | RawCommunityBookmark;
170
- declare class CommunityClient extends CustomerScopedApi {
206
+ declare class CommunityClient extends RawCustomerScopedApi {
171
207
  constructor(options: CommunityClientOptions);
172
208
  private buildQuery;
173
209
  private buildPostsListQuery;
@@ -332,8 +368,22 @@ interface ServerApiOptions {
332
368
  interface RequestOptions {
333
369
  method?: 'GET' | 'POST' | 'PATCH' | 'DELETE';
334
370
  headers?: Record<string, string>;
371
+ errorFamily?: 'commerce';
335
372
  }
373
+ type EndpointRequestOptions = {
374
+ headers?: Record<string, string>;
375
+ pathParams?: Readonly<Record<string, string>>;
376
+ query?: string | URLSearchParams;
377
+ };
378
+ /** Operation-only base for commerce APIs. Raw URL execution is intentionally absent. */
336
379
  declare abstract class BaseApi {
380
+ private readonly transport;
381
+ constructor(apiName: string, options: ServerApiOptions);
382
+ protected requestEndpoint<T>(endpoint: CommerceEndpointDescriptor, body: unknown, options?: EndpointRequestOptions): Promise<T>;
383
+ }
384
+ /** Raw transport base reserved for non-commerce APIs with genuinely dynamic URLs. */
385
+ declare abstract class RawBaseApi {
386
+ private readonly transport;
337
387
  protected readonly publishableKey: string;
338
388
  protected readonly secretKey: string;
339
389
  protected readonly apiUrl?: string;
@@ -362,7 +412,7 @@ type BanCustomerParams = {
362
412
  type UnbanCustomerParams = {
363
413
  customerId: string;
364
414
  };
365
- declare class ModerationApi extends BaseApi {
415
+ declare class ModerationApi extends RawBaseApi {
366
416
  constructor(options: ModerationApiOptions);
367
417
  banCustomer(params: BanCustomerParams): Promise<CommunityBan>;
368
418
  unbanCustomer(params: UnbanCustomerParams): Promise<{
@@ -388,6 +438,177 @@ type PublicMediaAsset = string | {
388
438
  sizes?: Record<string, PublicMediaSize>;
389
439
  };
390
440
 
441
+ interface CartApiOptions {
442
+ publishableKey?: string;
443
+ secretKey?: string;
444
+ apiUrl?: string;
445
+ customerToken?: string | (() => string | null);
446
+ onUnauthorized?: () => Promise<string | null>;
447
+ onRequestId?: (id: string | null) => void;
448
+ }
449
+ declare const MAX_CART_LINE_ADMISSIONS = 32;
450
+ type PublicAttribute = {
451
+ key: string;
452
+ value: string;
453
+ };
454
+ type CreateCartParams = {
455
+ market?: string;
456
+ attributes?: PublicAttribute[];
457
+ };
458
+ type PublicCartItemAdmission = {
459
+ eventId: string;
460
+ occurrenceId: string;
461
+ admissionTypeId: string;
462
+ };
463
+ type AddItemParams = {
464
+ cartToken: string;
465
+ expectedRevision: number;
466
+ idempotencyKey: string;
467
+ productId: string;
468
+ variantId: string;
469
+ quantity: number;
470
+ admissions?: readonly [PublicCartItemAdmission, ...PublicCartItemAdmission[]];
471
+ };
472
+ type UpdateItemParams = {
473
+ cartToken: string;
474
+ expectedRevision: number;
475
+ idempotencyKey: string;
476
+ cartItemId: string;
477
+ quantity: number;
478
+ };
479
+ type RemoveItemParams = {
480
+ cartToken: string;
481
+ expectedRevision: number;
482
+ idempotencyKey: string;
483
+ cartItemId: string;
484
+ };
485
+ type UpdateDiscountCodesParams = {
486
+ cartToken: string;
487
+ expectedRevision: number;
488
+ idempotencyKey: string;
489
+ discountCodes: string[];
490
+ };
491
+ type UpdateCartAttributesParams = {
492
+ cartToken: string;
493
+ expectedRevision: number;
494
+ idempotencyKey: string;
495
+ attributes: PublicAttribute[];
496
+ };
497
+ type ClearCartParams = {
498
+ cartToken: string;
499
+ expectedRevision: number;
500
+ idempotencyKey: string;
501
+ };
502
+ type RetrieveCartParams = {
503
+ cartToken: string;
504
+ };
505
+ type CartMineParams = Record<string, never>;
506
+ type ServerCartMineParams = {
507
+ customerToken: string;
508
+ };
509
+ type CartMergeParams = {
510
+ guestCartToken: string;
511
+ idempotencyKey: string;
512
+ };
513
+ type ServerCartMergeParams = CartMergeParams & {
514
+ customerToken: string;
515
+ };
516
+ type CartDiscountCode = {
517
+ code: string;
518
+ applicable: boolean;
519
+ };
520
+ type CartWarningCode = 'DISCOUNT_CODE_NOT_HONOURED' | 'DISCOUNT_CURRENTLY_INACTIVE' | 'DISCOUNT_CUSTOMER_NOT_ELIGIBLE' | 'DISCOUNT_CUSTOMER_USAGE_LIMIT_REACHED' | 'DISCOUNT_ELIGIBLE_CUSTOMER_MISSING' | 'DISCOUNT_NO_ENTITLED_LINE_ITEMS' | 'DISCOUNT_NO_ENTITLED_SHIPPING_LINES' | 'DISCOUNT_NOT_FOUND' | 'DISCOUNT_PURCHASE_NOT_IN_RANGE' | 'DISCOUNT_USAGE_LIMIT_REACHED' | 'MERCHANDISE_NOT_ENOUGH_STOCK' | 'MERCHANDISE_OUT_OF_STOCK';
521
+ type CartWarning = {
522
+ code: CartWarningCode;
523
+ message: string;
524
+ target: string;
525
+ };
526
+ type PublicCartReference = {
527
+ id: string;
528
+ title: string;
529
+ handle: string | null;
530
+ image: PublicMediaAsset | null;
531
+ };
532
+ type PublicCartMarket = {
533
+ id: string;
534
+ handle: string;
535
+ name: string;
536
+ };
537
+ type PublicCartItem = {
538
+ id: string;
539
+ product: PublicCartReference;
540
+ variant: PublicCartReference;
541
+ admissions: PublicCartItemAdmission[];
542
+ quantity: number;
543
+ unitPriceMinor: number;
544
+ discountMinor: number;
545
+ estimatedLineTotalMinor: number;
546
+ requiresShipping: boolean;
547
+ };
548
+ type PublicCart = {
549
+ id: string;
550
+ status: 'active' | 'completed' | 'abandoned';
551
+ revision: number;
552
+ currency: Uppercase<string>;
553
+ market: PublicCartMarket;
554
+ subtotalMinor: number;
555
+ discountMinor: number;
556
+ estimatedTotalMinor: number;
557
+ discountCodes: CartDiscountCode[];
558
+ attributes: PublicAttribute[];
559
+ items: PublicCartItem[];
560
+ expiresAt: string;
561
+ createdAt: string;
562
+ updatedAt: string;
563
+ };
564
+ type CartMutationResult = {
565
+ cart: PublicCart;
566
+ warnings: CartWarning[];
567
+ };
568
+ type CreateCartResult = {
569
+ cart: PublicCart;
570
+ warnings: CartWarning[];
571
+ cartToken: string;
572
+ };
573
+ type CartMergeResultBase = CreateCartResult;
574
+ type CartMergeResult = CartMergeResultBase & ({
575
+ resolution: 'unchanged';
576
+ merged: false;
577
+ claimed: false;
578
+ } | {
579
+ resolution: 'claimed';
580
+ merged: false;
581
+ claimed: true;
582
+ } | {
583
+ resolution: 'merged';
584
+ merged: true;
585
+ claimed: false;
586
+ });
587
+ type CartMineResult = {
588
+ cart: PublicCart;
589
+ cartToken: string;
590
+ } | {
591
+ cart: null;
592
+ cartToken: null;
593
+ };
594
+ declare class CartApi extends CustomerScopedApi {
595
+ private readonly serverTransport;
596
+ constructor(options: CartApiOptions);
597
+ private endpoint;
598
+ private execute;
599
+ create(params?: CreateCartParams): Promise<CreateCartResult>;
600
+ retrieve(params: RetrieveCartParams): Promise<PublicCart>;
601
+ mine(params?: CartMineParams | ServerCartMineParams): Promise<CartMineResult>;
602
+ merge(params: CartMergeParams | ServerCartMergeParams): Promise<CartMergeResult>;
603
+ addItem(params: AddItemParams): Promise<CartMutationResult>;
604
+ private mutate;
605
+ updateItem(params: UpdateItemParams): Promise<CartMutationResult>;
606
+ removeItem(params: RemoveItemParams): Promise<CartMutationResult>;
607
+ clear(params: ClearCartParams): Promise<CartMutationResult>;
608
+ updateDiscountCodes(params: UpdateDiscountCodesParams): Promise<CartMutationResult>;
609
+ updateAttributes(params: UpdateCartAttributesParams): Promise<CartMutationResult>;
610
+ }
611
+
391
612
  type OrderApiOptions = ServerApiOptions;
392
613
  /** Header-only; never sent in the JSON body. */
393
614
  type WithIdempotencyKey<T> = T & {
@@ -397,196 +618,76 @@ type WithIdempotencyKey<T> = T & {
397
618
  */
398
619
  idempotencyKey?: string;
399
620
  };
400
- type CustomerSnapshot = {
401
- name?: string;
402
- email: string;
403
- phone?: string;
404
- };
405
- type CheckoutShippingAddress = {
406
- recipientName: string;
407
- phone: string;
408
- postalCode: string;
409
- address: string;
410
- detailAddress: string;
411
- deliveryMessage?: string;
412
- };
413
- type PublicOrderReference = string | {
414
- id?: string | number | null;
415
- title?: string | null;
416
- name?: string | null;
417
- slug?: string | null;
418
- displayName?: string | null;
419
- handle?: string | null;
420
- color?: string | null;
421
- image?: PublicMediaAsset | null;
422
- thumbnail?: PublicMediaAsset | null;
423
- avatar?: PublicMediaAsset | null;
424
- };
621
+ type PublicOrderReference = PublicCartReference;
425
622
  type PublicOrderItem = {
426
- id?: string | number;
427
- product?: PublicOrderReference;
428
- variant?: PublicOrderReference;
429
- productTitle?: string | null;
430
- variantTitle?: string | null;
431
- sku?: string | null;
432
- quantity?: number | null;
433
- unitPrice?: number | null;
434
- discountedUnitPrice?: number | null;
435
- discountedTotalPrice?: number | null;
436
- totalPrice?: number | null;
437
- options?: unknown;
438
- createdAt?: string | null;
439
- updatedAt?: string | null;
440
- image?: PublicMediaAsset | null;
623
+ id: string;
624
+ product: PublicOrderReference | null;
625
+ variant: PublicOrderReference | null;
626
+ productTitle: string;
627
+ variantTitle: string | null;
628
+ sku: string | null;
629
+ admissions: PublicCartItemAdmission[];
630
+ quantity: number;
631
+ unitPriceMinor: number;
632
+ discountMinor: number;
633
+ lineTotalMinor: number;
634
+ requiresShipping: boolean;
635
+ };
636
+ type PublicOrderAmounts = {
637
+ currency: Uppercase<string>;
638
+ subtotalMinor: number;
639
+ shippingMinor: number;
640
+ discountMinor: number;
641
+ totalMinor: number;
642
+ refundedMinor: number;
643
+ currentTotalMinor: number;
441
644
  };
442
645
  type PublicOrder = {
443
- id?: string | number;
444
- orderNumber?: string | null;
445
- /** @deprecated Read-only compatibility alias. Prefer the independent axes. */
446
- status?: string | null;
447
- /** @deprecated Read-only compatibility alias. Prefer the independent axes. */
448
- displayStatus?: string | null;
449
- primaryDisplayStatus?: string | null;
450
- displayFinancialStatus?: string | null;
451
- displayFulfillmentStatus?: string | null;
452
- returnStatus?: string | null;
453
- returnDisplayStatus?: string | null;
454
- totalAmount?: number | null;
455
- subtotalAmount?: number | null;
456
- shippingAmount?: number | null;
457
- discountAmount?: number | null;
458
- taxAmount?: number | null;
459
- refundedAmount?: number | null;
460
- /** Net order total after refunds (`totalAmount - refundedAmount`, clamped at 0). */
461
- currentTotalAmount?: number | null;
462
- currency?: string | null;
463
- customerNote?: string | null;
464
- createdAt?: string | null;
465
- updatedAt?: string | null;
466
- customerSnapshot?: {
467
- name?: string | null;
468
- email?: string | null;
469
- phone?: string | null;
470
- };
471
- shippingAddress?: {
472
- recipientName?: string | null;
473
- phone?: string | null;
474
- postalCode?: string | null;
475
- address1?: string | null;
476
- address2?: string | null;
477
- jibunAddress?: string | null;
478
- administrativeArea?: string | null;
479
- city?: string | null;
480
- province?: string | null;
481
- country?: string | null;
482
- deliveryMemo?: string | null;
483
- address?: string | null;
484
- detailAddress?: string | null;
485
- deliveryMessage?: string | null;
646
+ id: string;
647
+ orderNumber: string;
648
+ amounts: PublicOrderAmounts;
649
+ market: PublicCartMarket | null;
650
+ customerSnapshot: {
651
+ email: string;
652
+ name?: string;
653
+ phone?: string;
486
654
  };
487
- items?: PublicOrderItem[];
488
- };
489
- type ReturnReason = 'change_of_mind' | 'defective' | 'wrong_delivery' | 'damaged' | 'other';
655
+ shippingAddress: {
656
+ recipientName: string;
657
+ phone: string;
658
+ countryCode?: string;
659
+ regionCode?: string;
660
+ postalCode: string;
661
+ address: string;
662
+ detailAddress: string;
663
+ deliveryMessage?: string;
664
+ } | null;
665
+ attributes: PublicAttribute[];
666
+ items: PublicOrderItem[];
667
+ financialStatus: 'pending' | 'authorized' | 'expired' | 'partially_paid' | 'paid' | 'canceled' | 'partially_refunded' | 'refunded' | 'reconciliation_required';
668
+ fulfillmentStatus: 'unfulfilled' | 'in_progress' | 'on_hold' | 'partially_fulfilled' | 'shipped' | 'fulfilled' | 'canceled';
669
+ returnStatus: 'no_return' | 'return_requested' | 'in_progress' | 'returned';
670
+ confirmationStatus: 'unconfirmed' | 'confirmed';
671
+ primaryDisplayStatus: 'pending' | 'paid' | 'canceled' | 'refunded' | 'preparing' | 'shipped' | 'delivered' | 'confirmed';
672
+ placedAt: string;
673
+ createdAt: string;
674
+ updatedAt: string;
675
+ };
676
+ type ReturnReason = 'change_of_mind' | 'defective' | 'wrong_delivery' | 'damaged' | 'size_too_large' | 'size_too_small' | 'color' | 'style' | 'not_as_described' | 'wrong_item' | 'unknown' | 'other';
677
+ type ReturnRejectionReason = 'window_expired' | 'used_or_damaged' | 'non_returnable' | 'other';
678
+ type ReturnCancellationReasonCode = 'items_not_received' | 'customer_withdrew' | 'merchant_decision' | 'other';
490
679
  type ReturnItem = {
491
680
  orderItem: string | number;
492
681
  quantity: number;
493
682
  restockAction?: RestockAction;
494
683
  restockingFee?: number;
495
684
  };
496
- type OrderCreateEntityID = string | number;
497
- type CreateOrderItem = {
498
- /**
499
- * Compatibility input: the create-order endpoint derives the line's product
500
- * from the variant's parent server-side; storefront items may omit this.
501
- */
502
- product?: OrderCreateEntityID;
503
- variant: OrderCreateEntityID;
504
- /**
505
- * Compatibility input: accepted but unused by the create-order endpoint;
506
- * option selection is snapshotted server-side from the variant.
507
- */
508
- option?: OrderCreateEntityID;
509
- quantity: number;
510
- /**
511
- * Compatibility input: the create-order endpoint accepts this, but the server
512
- * derives authoritative line pricing from the product variant.
513
- */
514
- unitPrice?: number;
515
- /**
516
- * Compatibility input: the create-order endpoint accepts this, but the server
517
- * derives authoritative line totals from the product variant.
518
- */
519
- totalPrice?: number;
520
- };
521
- type CreateOrderLineItemsInput = {
522
- orderItems: CreateOrderItem[];
523
- items?: never;
524
- } | {
525
- /**
526
- * Storefront-facing alias for orderItems. The SDK serializes this to
527
- * orderItems for the existing create-order endpoint.
528
- */
529
- items: CreateOrderItem[];
530
- /**
531
- * @deprecated Use items for storefront-facing create-order inputs.
532
- */
533
- orderItems?: never;
534
- };
535
- type PaymentProviderInput = {
536
- pgPaymentId: string;
537
- pgProvider: string;
538
- } | {
539
- pgPaymentId?: never;
540
- pgProvider?: never;
541
- };
542
- type CreateOrderBodyBase = {
543
- orderNumber: string;
544
- customer?: string;
545
- customerSnapshot: CustomerSnapshot;
546
- shippingAddress?: Order['shippingAddress'];
547
- totalAmount: number;
548
- shippingAmount?: number;
549
- discountCode?: string;
550
- } & PaymentProviderInput;
551
- type CreateOrderParams = WithIdempotencyKey<CreateOrderBodyBase & CreateOrderLineItemsInput>;
552
685
  type UpdateOrderParams = {
553
686
  orderNumber: string;
554
687
  status: 'confirmed';
555
688
  };
556
- type TransactionStatus = 'pending' | 'paid' | 'failed' | 'canceled' | 'refunded';
557
- type UpdateTransactionParams = {
558
- pgPaymentId: string;
559
- status: TransactionStatus;
560
- paymentMethod?: string;
561
- receiptUrl?: string;
562
- paymentKey?: string;
563
- amount?: number;
564
- };
565
- type ConfirmPaymentParams = WithIdempotencyKey<{
566
- orderNumber?: string;
567
- pgPaymentId: string;
568
- pgProvider: string;
569
- pgOrderId?: string;
570
- amount: number;
571
- currency?: string;
572
- paymentMethod?: string;
573
- receiptUrl?: string;
574
- approvedAt?: string;
575
- providerStatus?: string;
576
- /** Provider event id; also used as idempotency key when `idempotencyKey` is omitted. */
577
- providerEventId?: string;
578
- paymentKey?: string;
579
- confirmationSource?: 'provider_webhook' | 'provider_lookup' | 'provider_api_confirm' | 'manual_server';
580
- metadata?: Record<string, unknown>;
581
- }>;
582
- type ConfirmPaymentResponse = {
583
- orderId: string;
584
- transactionId: string;
585
- status: 'paid';
586
- alreadyConfirmed?: boolean;
587
- };
588
689
  type GetOrderByPaymentIdParams = {
589
- /** Payment provider slug, e.g. `toss`, `portone`. */
690
+ /** Payment provider slug, e.g. `toss`. */
590
691
  pgProvider: string;
591
692
  /** Provider payment identifier stored on the payment transaction. */
592
693
  pgPaymentId: string;
@@ -601,18 +702,7 @@ type OrderByPaymentResult = {
601
702
  order: Order;
602
703
  transaction: Transaction | null;
603
704
  };
604
- /**
605
- * Result of {@link OrderApi.confirmPaymentReturningOrder}: the raw
606
- * `confirmPayment` confirmation plus the depth-populated order/transaction
607
- * resolved by the same payment id.
608
- */
609
- type ConfirmPaymentWithOrderResult = ConfirmPaymentResponse & {
610
- order: Order;
611
- transaction: Transaction | null;
612
- };
613
705
  type CancelReasonCode = 'customer' | 'inventory' | 'fraud' | 'declined' | 'staff' | 'other';
614
- type CancelOrderStatus = 'pending' | 'paid' | 'canceled' | 'refunded' | 'preparing' | 'shipped' | 'delivered' | 'confirmed' | 'return_requested' | 'return_processing' | 'returned';
615
- type CancelOrderReconciliationStatus = Exclude<CancelOrderStatus, 'pending' | 'canceled'>;
616
706
  type CancelOrderResponseBase = {
617
707
  orderId: string;
618
708
  };
@@ -626,12 +716,6 @@ type CancelOrderPaidCommittedResponseFields = {
626
716
  providerRefunded: false;
627
717
  refundPending: true;
628
718
  };
629
- type CancelOrderLegacyProviderRefundResponseFields = {
630
- transactionId: string;
631
- refundedAmount: number;
632
- refundSeq: number;
633
- providerRefunded: true;
634
- };
635
719
  type CancelOrderAlreadyCanceledResponseFields = {
636
720
  refundedAmount: number;
637
721
  providerRefunded: false;
@@ -661,13 +745,7 @@ type CancelOrderAlreadyCanceledRefundPendingResponse = CancelOrderResponseBase &
661
745
  cancelCommitted: false;
662
746
  alreadyCanceled: true;
663
747
  };
664
- /** @deprecated Inline PG cancel reconciliation; retained for legacy API consumers. */
665
- type CancelOrderReconciliationResponse = CancelOrderResponseBase & CancelOrderLegacyProviderRefundResponseFields & {
666
- status: CancelOrderReconciliationStatus;
667
- cancelCommitted: false;
668
- reconciliationRequired: true;
669
- };
670
- type CancelOrderResponse = CancelOrderCommittedResponse | CancelOrderAlreadyCanceledResponse | CancelOrderAlreadyCanceledRefundPendingResponse | CancelOrderReconciliationResponse;
748
+ type CancelOrderResponse = CancelOrderCommittedResponse | CancelOrderAlreadyCanceledResponse | CancelOrderAlreadyCanceledRefundPendingResponse;
671
749
  type CancelOrderParams = {
672
750
  orderNumber: string;
673
751
  reasonCode?: CancelReasonCode;
@@ -698,7 +776,7 @@ type ResolveCancelRefundSucceededResponse = {
698
776
  refundTransactionId: string;
699
777
  refundedAmount: number;
700
778
  refundStatus: 'succeeded';
701
- transactionStatus: 'refunded';
779
+ transactionStatus: 'paid' | 'refunded';
702
780
  };
703
781
  type ResolveCancelRefundFailedResponse = {
704
782
  orderId: string;
@@ -729,14 +807,6 @@ type ReturnWithRefundParams = WithIdempotencyKey<{
729
807
  paymentKey?: string;
730
808
  refundReceiptUrl?: string;
731
809
  }>;
732
- type CheckoutParams = WithIdempotencyKey<{
733
- cartId: string;
734
- cartToken?: string;
735
- orderNumber: string;
736
- customerSnapshot: CustomerSnapshot;
737
- shippingAddress?: CheckoutShippingAddress;
738
- discountCode?: string;
739
- } & PaymentProviderInput>;
740
810
  type CreateFulfillmentParams = WithIdempotencyKey<{
741
811
  orderNumber: string;
742
812
  fulfillmentOrderId?: string | number;
@@ -749,7 +819,7 @@ type CreateFulfillmentParams = WithIdempotencyKey<{
749
819
  carrier?: string;
750
820
  trackingNumber?: string;
751
821
  items?: Array<{
752
- orderItem: string;
822
+ orderItem: string | number;
753
823
  quantity: number;
754
824
  }>;
755
825
  }>;
@@ -764,7 +834,7 @@ type PrepareFulfillmentOrderResponse = {
764
834
  }>;
765
835
  };
766
836
  type UpdateFulfillmentParams = {
767
- fulfillmentId: string;
837
+ fulfillmentId: string | number;
768
838
  status?: 'shipped' | 'delivered' | 'failed';
769
839
  carrier?: string;
770
840
  trackingNumber?: string;
@@ -797,39 +867,23 @@ type CreateReturnParams = WithIdempotencyKey<{
797
867
  initialShippingRefundOverrideNote?: string;
798
868
  }>;
799
869
  type UpdateReturnParams = {
800
- returnId: string;
801
- status: 'processing' | 'approved' | 'rejected' | 'completed';
870
+ returnId: string | number;
871
+ status: 'processing' | 'approved' | 'rejected' | 'canceled' | 'completed';
872
+ reasonCode?: ReturnRejectionReason;
873
+ cancellationReasonCode?: ReturnCancellationReasonCode;
874
+ cancellationReasonDetail?: string;
802
875
  };
803
876
  declare class OrderApi extends BaseApi {
804
877
  constructor(options: OrderApiOptions);
805
- createOrder(params: CreateOrderParams): Promise<Order>;
806
878
  updateOrder(params: UpdateOrderParams): Promise<Order>;
807
- updateTransaction(params: UpdateTransactionParams): Promise<Transaction>;
808
- confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse>;
809
879
  /**
810
880
  * Resolve an order + its payment transaction by PG payment id. Replaces raw
811
881
  * `transactions.find({ where: { pgPaymentId } })` + a local file index in
812
882
  * storefronts. Server-only (sk01_) read of the full populated Order.
813
883
  */
814
884
  getByPaymentId(params: GetOrderByPaymentIdParams): Promise<OrderByPaymentResult>;
815
- /**
816
- * Composed facade: confirm a provider payment, then resolve the
817
- * depth-populated order/transaction by the same payment id. `confirmPayment`'s
818
- * wire response carries only IDs (its contract is `.strict()`); this returns
819
- * the populated `Order` so storefronts stop reconstructing order state
820
- * locally. Two round trips by design — the alternative (widening the strict
821
- * confirm-payment wire contract to embed a full Order) is rejected.
822
- */
823
- confirmPaymentReturningOrder(params: ConfirmPaymentParams): Promise<ConfirmPaymentWithOrderResult>;
824
885
  cancelOrder(params: CancelOrderParams): Promise<CancelOrderResponse>;
825
886
  resolveCancelRefund(params: ResolveCancelRefundParams): Promise<ResolveCancelRefundResponse>;
826
- /**
827
- * Returns a `PublicOrder`-compatible shape even when the server backs the
828
- * response with a Checkout (checkout/order separation, #1285). `orderNumber`
829
- * stays the stable cross-window key. A breaking `PublicCheckout` split is a
830
- * deferred follow-up (design D10 / Q3-b); do not change this return type here.
831
- */
832
- checkout(params: CheckoutParams): Promise<PublicOrder>;
833
887
  createFulfillment(params: CreateFulfillmentParams): Promise<Fulfillment>;
834
888
  prepareFulfillmentOrder(params: PrepareFulfillmentOrderParams): Promise<PrepareFulfillmentOrderResponse>;
835
889
  updateFulfillment(params: UpdateFulfillmentParams): Promise<Fulfillment>;
@@ -842,18 +896,88 @@ declare class OrderApi extends BaseApi {
842
896
  updateReturn(params: UpdateReturnParams): Promise<Return>;
843
897
  }
844
898
 
899
+ interface CustomerOAuthConfig {
900
+ clientId: string;
901
+ issuer: string;
902
+ timeout?: number;
903
+ }
904
+ interface CustomerAuthorizationUrlInput {
905
+ redirectUri: string;
906
+ returnTo?: string;
907
+ scopes?: readonly string[];
908
+ }
909
+ interface CustomerAuthorizationUrlResult {
910
+ authorizationUrl: string;
911
+ codeChallenge: string;
912
+ codeVerifier: string;
913
+ nonce: string;
914
+ returnTo: string | null;
915
+ state: string;
916
+ }
917
+ interface CustomerOAuthCallbackResult {
918
+ code: string;
919
+ state: string;
920
+ }
921
+ interface CustomerOAuthTokenSet {
922
+ accessToken: string;
923
+ expiresAt: number;
924
+ expiresIn: number;
925
+ idToken?: string;
926
+ refreshToken: string;
927
+ scope?: string;
928
+ tokenType: 'Bearer';
929
+ }
930
+ declare class CustomerOAuth {
931
+ private readonly clientId;
932
+ private readonly issuer;
933
+ private readonly timeout;
934
+ constructor(config: CustomerOAuthConfig);
935
+ createAuthorizationUrl(input: CustomerAuthorizationUrlInput): Promise<CustomerAuthorizationUrlResult>;
936
+ parseCallback(callbackUrl: string, options: {
937
+ expectedState: string;
938
+ }): CustomerOAuthCallbackResult;
939
+ exchangeCode(input: {
940
+ code: string;
941
+ codeVerifier: string;
942
+ redirectUri: string;
943
+ }): Promise<CustomerOAuthTokenSet>;
944
+ refresh(input: {
945
+ refreshToken: string;
946
+ }): Promise<CustomerOAuthTokenSet>;
947
+ logout(input: {
948
+ postLogoutRedirectUri?: string;
949
+ refreshToken?: string;
950
+ }): Promise<{
951
+ redirectUrl?: string;
952
+ success: boolean;
953
+ }>;
954
+ verifyIdToken(): never;
955
+ private tokenRequest;
956
+ }
957
+
845
958
  interface CustomerAuthResponse {
846
959
  token: string;
960
+ refreshToken?: string;
847
961
  customer: CustomerProfile;
848
962
  }
963
+ type MarketingConsentState = 'not_subscribed' | 'pending' | 'subscribed' | 'unsubscribed';
964
+ type MarketingOptInLevel = 'single_opt_in' | 'confirmed_opt_in' | 'unknown';
849
965
  interface MarketingConsentChannel {
966
+ state?: MarketingConsentState | null;
967
+ optInLevel?: MarketingOptInLevel | null;
968
+ source?: string | null;
969
+ reason?: string | null;
970
+ consentedAt?: string | null;
971
+ consentUpdatedAt?: string | null;
972
+ expiresAt?: string | null;
973
+ unsubscribedAt?: string | null;
974
+ /** Backward-compatible write input; responses use `state`. */
850
975
  isConsented?: boolean;
851
976
  }
852
977
  interface MarketingConsent {
853
978
  email?: MarketingConsentChannel;
854
979
  sms?: MarketingConsentChannel;
855
980
  push?: MarketingConsentChannel;
856
- consentSource?: string;
857
981
  }
858
982
  interface CustomerProfile {
859
983
  id: string;
@@ -881,6 +1005,7 @@ interface CustomerLoginData {
881
1005
  }
882
1006
  interface CustomerRefreshResponse {
883
1007
  token: string;
1008
+ refreshToken?: string;
884
1009
  }
885
1010
  interface UpdateProfileData {
886
1011
  name?: string;
@@ -900,20 +1025,24 @@ interface CustomerAuthOptions {
900
1025
  persist?: boolean | string;
901
1026
  /** Initial token (e.g. from SSR cookie) */
902
1027
  token?: string;
1028
+ /** Initial refresh token, stored separately from the access token */
1029
+ refreshToken?: string;
903
1030
  /** Called when token changes (login/logout) — use to persist in localStorage/cookie */
904
1031
  onTokenChange?: (token: string | null) => void;
1032
+ /** Called when refresh token changes (login/refresh/logout) */
1033
+ onRefreshTokenChange?: (refreshToken: string | null) => void;
1034
+ /** Optional hosted OAuth helper configuration */
1035
+ oauth?: CustomerOAuthConfig;
905
1036
  }
906
1037
 
907
1038
  type CustomerOrderListOptions = {
908
1039
  page?: number;
909
1040
  limit?: number;
910
- displayFinancialStatus?: string;
911
- displayFulfillmentStatus?: string;
912
- returnStatus?: string;
913
- primaryDisplayStatus?: string;
914
- returnDisplayStatus?: string;
915
- /** @deprecated Read-only compatibility alias filter. Prefer independent status axes. */
916
- status?: string;
1041
+ financialStatus?: PublicOrder['financialStatus'];
1042
+ fulfillmentStatus?: PublicOrder['fulfillmentStatus'];
1043
+ returnStatus?: PublicOrder['returnStatus'];
1044
+ confirmationStatus?: PublicOrder['confirmationStatus'];
1045
+ primaryDisplayStatus?: PublicOrder['primaryDisplayStatus'];
917
1046
  };
918
1047
  /**
919
1048
  * Customer authentication client.
@@ -925,7 +1054,9 @@ declare class CustomerAuth {
925
1054
  private publishableKey;
926
1055
  private baseUrl;
927
1056
  private token;
1057
+ private refreshTokenValue;
928
1058
  private onTokenChange?;
1059
+ private onRefreshTokenChange?;
929
1060
  private refreshPromise;
930
1061
  constructor(publishableKey: string, options?: CustomerAuthOptions, apiUrl?: string);
931
1062
  /**
@@ -937,7 +1068,8 @@ declare class CustomerAuth {
937
1068
  */
938
1069
  login(data: CustomerLoginData): Promise<CustomerAuthResponse>;
939
1070
  /**
940
- * Refresh the current token. Requires a valid (non-expired) token.
1071
+ * Refresh the current token. Uses a refresh token when available, otherwise
1072
+ * falls back to the legacy bearer-token compatibility path.
941
1073
  */
942
1074
  refreshToken(): Promise<CustomerRefreshResponse>;
943
1075
  private _doRefreshToken;
@@ -973,10 +1105,18 @@ declare class CustomerAuth {
973
1105
  * Get the current token (or null if not authenticated)
974
1106
  */
975
1107
  getToken(): string | null;
1108
+ /**
1109
+ * Get the current refresh token (or null if unavailable)
1110
+ */
1111
+ getRefreshToken(): string | null;
976
1112
  /**
977
1113
  * Set the token manually (e.g. from SSR)
978
1114
  */
979
1115
  setToken(token: string | null): void;
1116
+ /**
1117
+ * Set the refresh token manually (e.g. from SSR cookie)
1118
+ */
1119
+ setRefreshToken(refreshToken: string | null): void;
980
1120
  /**
981
1121
  * Check if the customer is currently authenticated
982
1122
  */
@@ -988,158 +1128,6 @@ declare class CustomerAuth {
988
1128
  private requestJson;
989
1129
  }
990
1130
 
991
- interface CartApiOptions {
992
- publishableKey?: string;
993
- secretKey?: string;
994
- apiUrl?: string;
995
- customerToken?: string | (() => string | null);
996
- onUnauthorized?: () => Promise<string | null>;
997
- onRequestId?: (id: string | null) => void;
998
- }
999
- type CreateCartParams = Record<string, never>;
1000
- type AddItemParams = {
1001
- cartToken: string;
1002
- product: string;
1003
- variant: string;
1004
- option?: string;
1005
- quantity: number;
1006
- };
1007
- type UpdateItemParams = {
1008
- cartToken: string;
1009
- cartItemId: string;
1010
- quantity: number;
1011
- };
1012
- type RemoveItemParams = {
1013
- cartToken: string;
1014
- cartItemId: string;
1015
- };
1016
- type ApplyDiscountParams = {
1017
- cartToken: string;
1018
- discountCode: string;
1019
- };
1020
- type RemoveDiscountParams = {
1021
- cartToken: string;
1022
- };
1023
- type ClearCartParams = {
1024
- cartToken: string;
1025
- };
1026
- type CartMergeParams = {
1027
- guestCartToken: string;
1028
- };
1029
- type PublicCartReference = string | {
1030
- id?: string | number | null;
1031
- title?: string | null;
1032
- name?: string | null;
1033
- slug?: string | null;
1034
- displayName?: string | null;
1035
- handle?: string | null;
1036
- color?: string | null;
1037
- image?: PublicMediaAsset | null;
1038
- thumbnail?: PublicMediaAsset | null;
1039
- avatar?: PublicMediaAsset | null;
1040
- };
1041
- type PublicCartItem = {
1042
- id?: string | number;
1043
- product?: PublicCartReference;
1044
- variant?: PublicCartReference;
1045
- quantity?: number | null;
1046
- unitPrice?: number | null;
1047
- discountAllocation?: number | null;
1048
- discountedUnitPrice?: number | null;
1049
- discountedTotalPrice?: number | null;
1050
- requiresShipping?: boolean | null;
1051
- createdAt?: string | null;
1052
- updatedAt?: string | null;
1053
- };
1054
- type PublicCart = {
1055
- id?: string | number;
1056
- status?: string | null;
1057
- currency?: string | null;
1058
- subtotalAmount?: number | null;
1059
- shippingAmount?: number | null;
1060
- discountAmount?: number | null;
1061
- totalAmount?: number | null;
1062
- discountCode?: string | null;
1063
- customerNote?: string | null;
1064
- lastActivityAt?: string | null;
1065
- expiresAt?: string | null;
1066
- createdAt?: string | null;
1067
- updatedAt?: string | null;
1068
- shippingAddress?: {
1069
- recipientName?: string | null;
1070
- phone?: string | null;
1071
- postalCode?: string | null;
1072
- address?: string | null;
1073
- detailAddress?: string | null;
1074
- deliveryMessage?: string | null;
1075
- address1?: string | null;
1076
- address2?: string | null;
1077
- jibunAddress?: string | null;
1078
- administrativeArea?: string | null;
1079
- city?: string | null;
1080
- province?: string | null;
1081
- country?: string | null;
1082
- deliveryMemo?: string | null;
1083
- };
1084
- items?: PublicCartItem[];
1085
- };
1086
- /**
1087
- * Create response: the only place the server returns the `cartToken`. Persist
1088
- * it (cookie/storage) and pass it as the handle on every later cart call.
1089
- */
1090
- type CreatedCart = PublicCart & {
1091
- cartToken?: string;
1092
- };
1093
- type CartMergeResult = {
1094
- cart: PublicCart;
1095
- merged: boolean;
1096
- claimed: boolean;
1097
- guestCartId: string | number;
1098
- customerCartId: string | number;
1099
- /**
1100
- * The resolved customer cart's capability handle. Persist it after a merge so
1101
- * the storefront can keep operating the cart when a union moved lines into a
1102
- * different cart row. `null` only if the resolved cart has no token.
1103
- */
1104
- cartToken: string | null;
1105
- };
1106
- /**
1107
- * The authenticated customer's active cart resolved by JWT. `cartToken` is the
1108
- * capability handle returned to the owner; persist it for later token-keyed
1109
- * mutations. Both fields are `null` when the customer has no active cart.
1110
- */
1111
- type CartMineResult = {
1112
- cart: PublicCart | null;
1113
- cartToken: string | null;
1114
- };
1115
- declare class CartApi extends CustomerScopedApi {
1116
- constructor(options: CartApiOptions);
1117
- private execute;
1118
- /**
1119
- * Create a cart and receive its `cartToken`. Store the token and pass it to
1120
- * every subsequent cart operation.
1121
- */
1122
- createCart(params?: CreateCartParams): Promise<CreatedCart>;
1123
- getCart(cartToken: string): Promise<PublicCart>;
1124
- merge(params: CartMergeParams): Promise<CartMergeResult>;
1125
- /**
1126
- * Resolve the authenticated customer's active cart by JWT (no `cartToken`
1127
- * required). Returns the cart and its capability handle, or both `null` when
1128
- * the customer has no active cart. Requires a customer token.
1129
- */
1130
- mine(): Promise<CartMineResult>;
1131
- addItem(params: AddItemParams): Promise<PublicCartItem>;
1132
- updateItem(params: UpdateItemParams): Promise<PublicCartItem>;
1133
- removeItem(params: RemoveItemParams): Promise<{
1134
- success: boolean;
1135
- }>;
1136
- applyDiscount(params: ApplyDiscountParams): Promise<PublicCart>;
1137
- removeDiscount(params: RemoveDiscountParams): Promise<PublicCart>;
1138
- clearCart(params: ClearCartParams): Promise<{
1139
- success: boolean;
1140
- }>;
1141
- }
1142
-
1143
1131
  type NormalizedOptionSwatch<TMedia = unknown> = {
1144
1132
  type: 'color' | 'media' | null;
1145
1133
  color?: string | null;
@@ -1152,7 +1140,7 @@ type ProductSelectionMediaSource = 'variant_media_selected' | 'variant_media_mat
1152
1140
  type ProductDisplayMediaSource = 'featured_image' | 'product_pool' | 'none';
1153
1141
  /** @deprecated Use {@link ProductSelectionMediaSource} or {@link ProductDisplayMediaSource}. */
1154
1142
  type ProductMediaResolutionSource = ProductSelectionMediaSource | ProductDisplayMediaSource;
1155
- type ProductSelectionVariant<TMedia> = {
1143
+ type ProductSelectionVariant$1<TMedia> = {
1156
1144
  id?: string | number | null;
1157
1145
  images?: Array<TMedia | string | number | null | undefined> | null;
1158
1146
  };
@@ -1165,8 +1153,8 @@ type ProductSelectionMediaPointer = string | number | {
1165
1153
  } | null;
1166
1154
  type ResolveProductSelectionMediaInput<TMedia> = {
1167
1155
  productMediaPool?: TMedia[] | null;
1168
- selectedVariant?: ProductSelectionVariant<TMedia> | null;
1169
- matchingVariants?: Array<ProductSelectionVariant<TMedia> | null | undefined> | null;
1156
+ selectedVariant?: ProductSelectionVariant$1<TMedia> | null;
1157
+ matchingVariants?: Array<ProductSelectionVariant$1<TMedia> | null | undefined> | null;
1170
1158
  selectedOptionValues?: Array<ProductSelectionOptionValue | null | undefined> | null;
1171
1159
  };
1172
1160
  type ResolveProductSelectionMediaResult<TMedia> = {
@@ -1193,6 +1181,9 @@ type FeaturedImagePointerInput<TMedia> = {
1193
1181
  };
1194
1182
  declare function resolveFeaturedImagePointer<TMedia>(input: FeaturedImagePointerInput<TMedia>): string | null;
1195
1183
 
1184
+ type ProductSelectionDetail = ProductDetail | ProductDetailCatalog;
1185
+ type ProductSelectionVariant = ProductDetailVariant | ProductDetailCatalog['variants'][number];
1186
+ type ProductSelectionVariantForDetail<TDetail extends ProductSelectionDetail> = TDetail extends ProductDetail ? ProductDetailVariant : ProductDetailCatalog['variants'][number];
1196
1187
  type EntityID = string;
1197
1188
  type RelationshipValue = string | number | null | undefined | {
1198
1189
  id?: string | number | null;
@@ -1229,17 +1220,26 @@ interface ProductVariantShape {
1229
1220
  optionValues?: unknown[] | null;
1230
1221
  price?: number | null;
1231
1222
  compareAtPrice?: number | null;
1223
+ resolvedPrice?: {
1224
+ amount: number;
1225
+ compareAtPrice?: number | null;
1226
+ currency?: string | null;
1227
+ marketId?: string | null;
1228
+ source?: 'fixed' | 'computed';
1229
+ };
1232
1230
  stock?: number | null;
1233
1231
  reservedStock?: number | null;
1234
1232
  isUnlimited?: boolean | null;
1235
1233
  inventoryPolicy?: ('deny' | 'continue') | null;
1236
1234
  isActive?: boolean | null;
1235
+ availableForSale?: boolean | null;
1237
1236
  thumbnail?: MediaValue;
1238
1237
  images?: MediaValue[] | null;
1239
1238
  _order?: string | null;
1240
1239
  }
1241
1240
  interface ProductListingProductShape {
1242
1241
  id?: EntityID;
1242
+ title?: ProductLocalizedText;
1243
1243
  images?: MediaValue[] | null;
1244
1244
  featuredImage?: MediaValue;
1245
1245
  priceRange?: {
@@ -1339,7 +1339,7 @@ type ProductListingCardRepresentativeVariant = ProductListingCardSourceItem['gro
1339
1339
  type ProductListingCard = {
1340
1340
  id: EntityID;
1341
1341
  href: string;
1342
- title: string;
1342
+ title: ProductLocalizedText;
1343
1343
  representativeVariant?: ProductListingCardRepresentativeVariant | null;
1344
1344
  primaryImage: ProductDetailMedia | null;
1345
1345
  priceRange: ProductListingCardPriceRange;
@@ -1382,10 +1382,10 @@ type ProductSelectionCodecOptions = {
1382
1382
  onLegacyOptionIdParam?: (event: LegacyProductSelectionParamEvent) => void;
1383
1383
  };
1384
1384
  type ProductSelectionResolutionContext = {
1385
- detail?: Pick<ProductDetail, 'featuredImage' | 'images' | 'selectedOrFirstAvailableVariant'>;
1386
- featuredImage?: ProductDetail['featuredImage'];
1387
- images?: ProductDetail['images'];
1388
- selectedOrFirstAvailableVariant?: ProductDetail['selectedOrFirstAvailableVariant'];
1385
+ detail?: Pick<ProductSelectionDetail, 'featuredImage' | 'images' | 'selectedOrFirstAvailableVariant'>;
1386
+ featuredImage?: ProductSelectionDetail['featuredImage'];
1387
+ images?: ProductSelectionDetail['images'];
1388
+ selectedOrFirstAvailableVariant?: ProductSelectionDetail['selectedOrFirstAvailableVariant'];
1389
1389
  };
1390
1390
  type ProductSelectionAvailableSwatch = {
1391
1391
  color?: string | null;
@@ -1404,11 +1404,11 @@ type ProductSelectionAvailableValue = {
1404
1404
  availableStock: number | null;
1405
1405
  swatch: ProductOptionValueSwatch;
1406
1406
  };
1407
- type ProductSelectionResolution = {
1407
+ type ProductSelectionResolution<TVariant extends ProductVariantShape = ProductSelectionVariant> = {
1408
1408
  normalizedSelection: NormalizedProductSelection;
1409
- selectedVariant: ProductDetailVariant | null;
1410
- matchingVariants: ProductDetailVariant[];
1411
- partialVariants: ProductDetailVariant[];
1409
+ selectedVariant: TVariant | null;
1410
+ matchingVariants: TVariant[];
1411
+ partialVariants: TVariant[];
1412
1412
  availableValuesByOptionSlug: Record<string, ProductSelectionAvailableValue[]>;
1413
1413
  availableValuesByOptionId: Record<string, ProductSelectionAvailableValue[]>;
1414
1414
  allOptionsSelected: boolean;
@@ -1440,21 +1440,21 @@ declare function buildProductOptionMatrix<TVariant extends ProductVariantShape =
1440
1440
  options: ProductOptionShape[];
1441
1441
  variants?: TVariant[];
1442
1442
  }): ProductOptionMatrix<TVariant>;
1443
- declare function buildProductOptionMatrixFromDetail(detail: ProductDetail): ProductOptionMatrix<ProductDetailVariant>;
1443
+ declare function buildProductOptionMatrixFromDetail<TDetail extends ProductSelectionDetail>(detail: TDetail): ProductOptionMatrix<ProductSelectionVariantForDetail<TDetail>>;
1444
1444
  declare function getSelectedValueByOptionId<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): Map<string, string>;
1445
1445
  declare function normalizeSelectedValueIds<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): string[];
1446
1446
  declare function getAvailableOptionValues<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, optionId: string, selectedValueIds: Iterable<unknown>): ProductOptionMatrixValue[];
1447
1447
  declare function resolveVariantForSelection<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): ProductOptionMatrixVariant<TVariant> | undefined;
1448
- declare function normalizeProductSelection(detail: ProductDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
1449
- declare function normalizeProductSelectionFromMatrix(matrix: ProductOptionMatrix<ProductDetailVariant>, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
1450
- declare function parseProductSelection(detail: ProductDetail, search: string | URLSearchParams | URL | null | undefined, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
1451
- declare function stringifyProductSelection(detail: ProductDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): string;
1452
- declare function createProductSelectionCodec(detail: ProductDetail, options?: ProductSelectionCodecOptions): {
1448
+ declare function normalizeProductSelection(detail: ProductSelectionDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
1449
+ declare function normalizeProductSelectionFromMatrix(matrix: ProductOptionMatrix<ProductSelectionVariant>, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
1450
+ declare function parseProductSelection(detail: ProductSelectionDetail, search: string | URLSearchParams | URL | null | undefined, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
1451
+ declare function stringifyProductSelection(detail: ProductSelectionDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): string;
1452
+ declare function createProductSelectionCodec(detail: ProductSelectionDetail, options?: ProductSelectionCodecOptions): {
1453
1453
  parse: (search: string | URLSearchParams | URL | null | undefined) => NormalizedProductSelection;
1454
1454
  stringify: (selection?: ProductSelectionInput) => string;
1455
1455
  };
1456
- declare function resolveProductSelectionFromMatrix(matrix: ProductOptionMatrix<ProductDetailVariant>, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions, context?: ProductSelectionResolutionContext): ProductSelectionResolution;
1457
- declare function resolveProductSelection(detail: ProductDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): ProductSelectionResolution;
1456
+ declare function resolveProductSelectionFromMatrix(matrix: ProductOptionMatrix<ProductSelectionVariant>, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions, context?: ProductSelectionResolutionContext): ProductSelectionResolution;
1457
+ declare function resolveProductSelection<TDetail extends ProductSelectionDetail>(detail: TDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): ProductSelectionResolution<ProductSelectionVariantForDetail<TDetail>>;
1458
1458
  declare function selectNext(detail: ProductDetail, current: ProductSelectionInput | undefined, optionSlug: string, valueSlug: string, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
1459
1459
  type ProductDetailImageMedia = Extract<ProductDetailMedia, {
1460
1460
  id?: string | number | null;
@@ -1479,8 +1479,8 @@ type ProductHrefGroup = {
1479
1479
  };
1480
1480
  type ProductHrefOptions = {
1481
1481
  basePath?: string;
1482
- detail?: ProductDetail;
1483
- matrix?: ProductOptionMatrix<ProductDetailVariant>;
1482
+ detail?: ProductSelectionDetail;
1483
+ matrix?: ProductOptionMatrix<ProductSelectionVariant>;
1484
1484
  selection?: ProductSelectionInput;
1485
1485
  trailingSlash?: boolean;
1486
1486
  emit?: ProductSelectionUrlEmit;
@@ -1615,6 +1615,11 @@ type VariantInput = {
1615
1615
  externalId?: string | null;
1616
1616
  isActive?: boolean;
1617
1617
  images?: string[];
1618
+ marketPrices?: Array<{
1619
+ market: string;
1620
+ price: number;
1621
+ compareAtPrice?: number | null;
1622
+ }>;
1618
1623
  metadata?: unknown;
1619
1624
  };
1620
1625
  type ProductFieldsInput = {
@@ -1636,6 +1641,7 @@ type ProductFieldsInput = {
1636
1641
  publishedAt?: string | null;
1637
1642
  categories?: string[];
1638
1643
  tags?: string[];
1644
+ markets?: string[] | null;
1639
1645
  seo?: {
1640
1646
  title?: string | null;
1641
1647
  description?: string | null;
@@ -1684,16 +1690,31 @@ type StockCheckResponse = {
1684
1690
  };
1685
1691
  type ListingGroupsParams = {
1686
1692
  productIds: string[];
1693
+ market?: string;
1694
+ locale?: ProductLocaleOption;
1695
+ fallbackLocale?: ProductFallbackLocaleOption;
1687
1696
  };
1688
- type ProductListingGroupVariant = Pick<ProductVariantShape, 'id' | 'optionValues' | 'price' | 'compareAtPrice' | 'stock' | 'isUnlimited' | 'isActive' | 'thumbnail' | 'images' | '_order'>;
1697
+ type ProductListingGroupVariant = Pick<ProductVariantShape, 'id' | 'optionValues' | 'price' | 'compareAtPrice' | 'resolvedPrice' | 'stock' | 'isUnlimited' | 'inventoryPolicy' | 'isActive' | 'thumbnail' | 'images' | '_order'>;
1689
1698
  type ProductListingGroupSummary = ProductListingGroup<ProductListingGroupVariant>;
1690
1699
  type ProductListingGroupCatalogVariant = Omit<ProductListingGroupVariant, 'stock'>;
1691
1700
  type ProductListingGroupCatalogSummary = ProductListingGroup<ProductListingGroupCatalogVariant>;
1692
1701
  type ProductListingGroupsProductVariants = NonNullable<PublicProduct['variants']>;
1693
- type ProductListingGroupsProduct = Omit<PublicProduct, 'createdAt' | 'updatedAt' | 'variants'> & {
1702
+ type ProductListingGroupsProductSeo = Omit<NonNullable<PublicProduct['seo']>, 'title' | 'description' | 'openGraph'> & {
1703
+ title?: ProductLocalizedText | null;
1704
+ description?: ProductLocalizedText | null;
1705
+ openGraph?: Omit<NonNullable<NonNullable<PublicProduct['seo']>['openGraph']>, 'title' | 'description'> & {
1706
+ title?: ProductLocalizedText | null;
1707
+ description?: ProductLocalizedText | null;
1708
+ };
1709
+ };
1710
+ type ProductListingGroupsProduct = Omit<PublicProduct, 'content' | 'createdAt' | 'description' | 'seo' | 'subtitle' | 'title' | 'updatedAt' | 'variants'> & {
1694
1711
  id: string;
1695
1712
  slug: string;
1696
- title: string;
1713
+ title: ProductLocalizedText;
1714
+ subtitle?: ProductLocalizedText | null;
1715
+ description?: ProductLocalizedText | null;
1716
+ content?: ProductLocalizedValue<NonNullable<PublicProduct['content']>> | null;
1717
+ seo?: ProductListingGroupsProductSeo;
1697
1718
  createdAt?: PublicProduct['createdAt'];
1698
1719
  updatedAt?: PublicProduct['updatedAt'];
1699
1720
  featuredImage?: ProductDetailMedia | null;
@@ -1709,7 +1730,7 @@ type ProductListingGroupsCatalogProduct = {
1709
1730
  id: string;
1710
1731
  slug: string;
1711
1732
  handle?: string | null;
1712
- title: string;
1733
+ title: ProductLocalizedText;
1713
1734
  subtitle?: ProductListingGroupsProduct['subtitle'];
1714
1735
  images?: ProductListingGroupsProduct['images'];
1715
1736
  featuredImage?: ProductDetailMedia | null;
@@ -1756,6 +1777,9 @@ type ProductListingPageFilters = {
1756
1777
  availableForSale?: boolean;
1757
1778
  };
1758
1779
  type ProductListingPageBaseParams = {
1780
+ market?: string;
1781
+ locale?: ProductLocaleOption;
1782
+ fallbackLocale?: ProductFallbackLocaleOption;
1759
1783
  page?: number;
1760
1784
  limit?: number;
1761
1785
  search?: string;
@@ -1772,11 +1796,24 @@ type ProductListingPageParams = ProductListingPageCatalogParams | ProductListing
1772
1796
  type ProductListingPageResult<TItem> = PayloadFindResponse<TItem> & {
1773
1797
  cards: ProductListingCard[];
1774
1798
  };
1775
- type ProductDetailParams = {
1799
+ type ProductLocaleOption = 'ko' | 'en' | 'all';
1800
+ type ProductFallbackLocaleOption = 'ko' | 'en' | false;
1801
+ type ProductLocaleReadParams = {
1802
+ locale?: ProductLocaleOption;
1803
+ fallbackLocale?: ProductFallbackLocaleOption;
1804
+ };
1805
+ type ProductLocalizedValue<T> = T | {
1806
+ en?: T | null;
1807
+ ko?: T | null;
1808
+ };
1809
+ type ProductLocalizedText = ProductLocalizedValue<string>;
1810
+ type ProductDetailParams = ({
1776
1811
  slug: string;
1777
1812
  } | {
1778
1813
  id: string;
1779
- };
1814
+ }) & {
1815
+ market?: string;
1816
+ } & ProductLocaleReadParams;
1780
1817
  type ProductDetailPreviewParams = {
1781
1818
  id: string;
1782
1819
  };
@@ -1809,6 +1846,13 @@ type ProductOptionValueMediaSwatch<TMedia = ProductDetailMedia> = {
1809
1846
  };
1810
1847
  type ProductOptionValueSwatch<TMedia = ProductDetailMedia> = ProductOptionValueColorSwatch | ProductOptionValueMediaSwatch<TMedia> | null;
1811
1848
  type ProductDetailSelectionMediaSource = 'variant_media_selected' | 'variant_media_matching' | 'option_swatch' | 'none';
1849
+ interface ResolvedCatalogPrice {
1850
+ amount: number;
1851
+ compareAtPrice?: number | null;
1852
+ currency?: string | null;
1853
+ marketId?: string | null;
1854
+ source?: 'fixed' | 'computed';
1855
+ }
1812
1856
  interface ProductDetailVariant {
1813
1857
  id: string | number;
1814
1858
  optionKey: string;
@@ -1817,6 +1861,7 @@ interface ProductDetailVariant {
1817
1861
  sku?: string | null;
1818
1862
  price: number;
1819
1863
  compareAtPrice?: number | null;
1864
+ resolvedPrice?: ResolvedCatalogPrice;
1820
1865
  stock: number;
1821
1866
  reservedStock: number;
1822
1867
  isUnlimited: boolean;
@@ -1881,7 +1926,9 @@ interface ProductMoneyRange {
1881
1926
  interface ProductPriceRange extends ProductMoneyRange {
1882
1927
  isPriceRange?: boolean | null;
1883
1928
  }
1884
- type ProductDetailCatalogVariant = Omit<ProductDetailVariant, 'stock' | 'reservedStock'>;
1929
+ type ProductDetailCatalogVariant = Omit<ProductDetailVariant, 'stock' | 'reservedStock'> & {
1930
+ availableForSale?: boolean | null;
1931
+ };
1885
1932
  interface ProductDetailCatalog {
1886
1933
  product: Omit<ProductDetail['product'], 'totalInventory'>;
1887
1934
  variants: ProductDetailCatalogVariant[];
@@ -1920,9 +1967,9 @@ interface ProductDetail {
1920
1967
  product: {
1921
1968
  id: string | number;
1922
1969
  slug: string;
1923
- title: string;
1924
- subtitle?: string | null;
1925
- description?: string | null;
1970
+ title: ProductLocalizedText;
1971
+ subtitle?: ProductLocalizedText | null;
1972
+ description?: ProductLocalizedText | null;
1926
1973
  content?: unknown;
1927
1974
  publishedAt?: string | null;
1928
1975
  status: string;
@@ -1964,6 +2011,34 @@ type ProductDetailCatalogResult = {
1964
2011
  found: false;
1965
2012
  reason: ProductDetailUnavailableReason;
1966
2013
  };
2014
+ type ProductUpsertVariantOptionValue = string | {
2015
+ valueSlug?: string;
2016
+ valueId?: string;
2017
+ value?: string;
2018
+ };
2019
+ type ProductUpsertVariantInput = {
2020
+ id?: string;
2021
+ optionValues?: Record<string, ProductUpsertVariantOptionValue> | string[];
2022
+ sku?: string | null;
2023
+ title?: string | null;
2024
+ price: number;
2025
+ compareAtPrice?: number | null;
2026
+ stock?: number;
2027
+ isUnlimited?: boolean;
2028
+ inventoryPolicy?: 'deny' | 'continue';
2029
+ weight?: number | null;
2030
+ requiresShipping?: boolean;
2031
+ barcode?: string | null;
2032
+ externalId?: string | null;
2033
+ isActive?: boolean;
2034
+ images?: string[];
2035
+ marketPrices?: Array<{
2036
+ market: string;
2037
+ price: number;
2038
+ compareAtPrice?: number | null;
2039
+ }>;
2040
+ metadata?: unknown;
2041
+ };
1967
2042
  type ProductUpsertParams = ProductUpsertInput;
1968
2043
  /** Console `POST /api/products/upsert` field allowlist error reasons. */
1969
2044
  declare const PRODUCT_UPSERT_UNKNOWN_FIELD_REASON: "unknown_field";
@@ -2026,8 +2101,14 @@ type DiscountApiOptions = ServerApiOptions;
2026
2101
  type ValidateDiscountParams = {
2027
2102
  code: string;
2028
2103
  orderAmount: number;
2104
+ items?: Array<{
2105
+ product: string | number;
2106
+ totalPrice: number;
2107
+ }>;
2108
+ currency?: string;
2109
+ market?: string;
2029
2110
  };
2030
- type DiscountErrorReasonCode = 'discount_code_not_found' | 'discount_not_started' | 'discount_expired' | 'discount_usage_limit' | 'discount_per_customer_limit' | 'discount_customer_required' | 'discount_first_order_only' | 'discount_customer_not_eligible' | 'discount_customer_excluded' | 'discount_items_required' | 'discount_product_not_eligible' | 'discount_product_excluded' | 'discount_min_order_amount';
2111
+ type DiscountErrorReasonCode = 'discount_code_not_found' | 'discount_not_started' | 'discount_expired' | 'discount_usage_limit' | 'discount_per_customer_limit' | 'discount_customer_required' | 'discount_first_order_only' | 'discount_customer_not_eligible' | 'discount_customer_excluded' | 'discount_items_required' | 'discount_product_not_eligible' | 'discount_product_excluded' | 'discount_min_order_amount' | 'discount_currency_scope_required' | 'discount_allocation_method_unsupported' | 'market_not_found';
2031
2112
  type ValidateDiscountResult = {
2032
2113
  valid: boolean;
2033
2114
  code: string;
@@ -2044,17 +2125,29 @@ declare class DiscountApi extends BaseApi {
2044
2125
 
2045
2126
  type ShippingApiOptions = ServerApiOptions;
2046
2127
  type CalculateShippingParams = {
2047
- shippingPolicyId?: string;
2128
+ shippingPolicyId?: string | number;
2048
2129
  orderAmount: number;
2130
+ countryCode?: string;
2131
+ regionCode?: string;
2049
2132
  postalCode?: string;
2050
2133
  };
2134
+ type ShippingLine = {
2135
+ label: string;
2136
+ lineType: 'base' | 'surcharge' | 'insurance' | 'handling';
2137
+ amount: number;
2138
+ rateId?: string;
2139
+ zoneId?: string;
2140
+ };
2051
2141
  type CalculateShippingResult = {
2052
2142
  shippingAmount: number;
2053
2143
  baseShippingAmount: number;
2054
2144
  extraShippingAmount: number;
2145
+ shippingLines: ShippingLine[];
2055
2146
  freeShipping: boolean;
2056
2147
  freeShippingMinAmount: number | null;
2148
+ /** Prefer shippingLines with zone-scoped rates. */
2057
2149
  isJeju: boolean;
2150
+ /** Prefer shippingLines with zone-scoped rates. */
2058
2151
  isRemoteIsland: boolean;
2059
2152
  };
2060
2153
  declare class ShippingApi extends BaseApi {
@@ -2062,15 +2155,383 @@ declare class ShippingApi extends BaseApi {
2062
2155
  calculate(params: CalculateShippingParams): Promise<CalculateShippingResult>;
2063
2156
  }
2064
2157
 
2158
+ type CheckoutApiOptions = CustomerScopedApiOptions;
2159
+ type CheckoutStatus = 'open' | 'placed' | 'abandoned';
2160
+ type CustomerSnapshot = {
2161
+ email: string;
2162
+ name?: string;
2163
+ phone?: string;
2164
+ };
2165
+ type CheckoutShippingAddress = {
2166
+ recipientName: string;
2167
+ phone: string;
2168
+ countryCode?: string;
2169
+ regionCode?: string;
2170
+ postalCode: string;
2171
+ address: string;
2172
+ detailAddress: string;
2173
+ deliveryMessage?: string;
2174
+ };
2175
+ type PublicCheckoutItem = {
2176
+ id: string;
2177
+ product: PublicCartReference;
2178
+ variant: PublicCartReference;
2179
+ productTitle: string;
2180
+ variantTitle: string | null;
2181
+ sku: string | null;
2182
+ admissions: PublicCartItemAdmission[];
2183
+ quantity: number;
2184
+ unitPriceMinor: number;
2185
+ discountMinor: number;
2186
+ lineTotalMinor: number;
2187
+ requiresShipping: boolean;
2188
+ };
2189
+ type CheckoutAmounts = {
2190
+ currency: Uppercase<string>;
2191
+ subtotalMinor: number;
2192
+ shippingMinor: number;
2193
+ discountMinor: number;
2194
+ totalMinor: number;
2195
+ };
2196
+ type CheckoutPaymentSessionRef = {
2197
+ id: string;
2198
+ provider: 'toss';
2199
+ providerStatus: 'requires_payment_method' | 'requires_action' | 'requires_confirmation' | 'initializing' | 'processing' | 'authorized' | 'canceling' | 'unknown' | 'captured' | 'failed' | 'canceled';
2200
+ };
2201
+ type OpenCheckoutPaymentState = {
2202
+ activePaymentSession: CheckoutPaymentSessionRef | null;
2203
+ };
2204
+ type SpentCheckoutPaymentState = {
2205
+ activePaymentSession: null;
2206
+ };
2207
+ type PublicCheckoutBase = {
2208
+ id: string;
2209
+ amounts: CheckoutAmounts;
2210
+ items: PublicCheckoutItem[];
2211
+ customerSnapshot: CustomerSnapshot;
2212
+ shippingAddress: CheckoutShippingAddress | null;
2213
+ attributes: PublicAttribute[];
2214
+ expiresAt: string;
2215
+ createdAt: string;
2216
+ updatedAt: string;
2217
+ };
2218
+ type CheckoutOrderReference = {
2219
+ id: string;
2220
+ orderNumber: string;
2221
+ };
2222
+ type CheckoutAbandonedReason = 'expired' | 'customer' | 'operator';
2223
+ type PublicCheckout = PublicCheckoutBase & ({
2224
+ status: 'open';
2225
+ paymentState: OpenCheckoutPaymentState;
2226
+ order: null;
2227
+ placedAt?: never;
2228
+ placedVia?: never;
2229
+ abandonedAt?: never;
2230
+ abandonedReason?: never;
2231
+ } | {
2232
+ status: 'placed';
2233
+ placedAt: string;
2234
+ paymentState: SpentCheckoutPaymentState;
2235
+ order: CheckoutOrderReference;
2236
+ placedVia?: never;
2237
+ abandonedAt?: never;
2238
+ abandonedReason?: never;
2239
+ } | {
2240
+ status: 'placed';
2241
+ placedAt: string;
2242
+ placedVia: 'late_capture';
2243
+ abandonedAt: string;
2244
+ abandonedReason: CheckoutAbandonedReason;
2245
+ paymentState: SpentCheckoutPaymentState;
2246
+ order: CheckoutOrderReference;
2247
+ } | {
2248
+ status: 'abandoned';
2249
+ abandonedAt: string;
2250
+ abandonedReason: CheckoutAbandonedReason;
2251
+ paymentState: {
2252
+ activePaymentSession: null;
2253
+ };
2254
+ order: null;
2255
+ placedAt?: never;
2256
+ placedVia?: never;
2257
+ });
2258
+ type ServerCheckout = PublicCheckout & {
2259
+ clientReferenceId: string | null;
2260
+ integrationMetadata: Record<string, string>;
2261
+ };
2262
+ type RetrieveCheckoutParams = {
2263
+ checkoutToken: string;
2264
+ };
2265
+ type RetrieveServerCheckoutParams = {
2266
+ checkoutId: string;
2267
+ };
2268
+ type CreateCheckoutParams = {
2269
+ cartToken: string;
2270
+ customer: CustomerSnapshot;
2271
+ shippingAddress?: CheckoutShippingAddress;
2272
+ idempotencyKey: string;
2273
+ };
2274
+ type CreateServerCheckoutParams = CreateCheckoutParams & {
2275
+ clientReferenceId?: string;
2276
+ integrationMetadata?: Record<string, string>;
2277
+ };
2278
+ type CreateCheckoutResult = {
2279
+ checkout: PublicCheckout;
2280
+ checkoutToken: string;
2281
+ };
2282
+ type CreateServerCheckoutResult = {
2283
+ checkout: ServerCheckout;
2284
+ checkoutToken: string;
2285
+ };
2286
+ type CheckoutQueryParams = {
2287
+ limit?: number;
2288
+ cursor?: string;
2289
+ status?: CheckoutStatus[];
2290
+ createdAtFrom?: string;
2291
+ createdAtTo?: string;
2292
+ clientReferenceId?: string;
2293
+ };
2294
+ type CheckoutListItem = PublicCheckout extends infer Checkout ? Checkout extends unknown ? Omit<Checkout, 'items' | 'shippingAddress' | 'attributes'> & {
2295
+ clientReferenceId: string | null;
2296
+ } : never : never;
2297
+ type CheckoutQueryResult = {
2298
+ data: CheckoutListItem[];
2299
+ hasMore: boolean;
2300
+ nextCursor: string | null;
2301
+ };
2302
+ declare class CheckoutApi extends CustomerScopedApi {
2303
+ constructor(options: CheckoutApiOptions);
2304
+ private post;
2305
+ private publicCheckout;
2306
+ private serverCheckout;
2307
+ private createResult;
2308
+ private createServerResult;
2309
+ create(params: CreateCheckoutParams): Promise<CreateCheckoutResult>;
2310
+ createServer(params: CreateServerCheckoutParams): Promise<CreateServerCheckoutResult>;
2311
+ retrieve(params: RetrieveCheckoutParams): Promise<PublicCheckout>;
2312
+ retrieveServer(params: RetrieveServerCheckoutParams): Promise<ServerCheckout>;
2313
+ query(params?: CheckoutQueryParams): Promise<CheckoutQueryResult>;
2314
+ }
2315
+
2316
+ type PaymentSessionApiOptions = CustomerScopedApiOptions;
2317
+ type Money = {
2318
+ amountMinor: number;
2319
+ currency: Uppercase<string>;
2320
+ };
2321
+ type CreatePaymentSessionParams = {
2322
+ checkoutToken: string;
2323
+ idempotencyKey: string;
2324
+ provider: 'toss';
2325
+ providerOptions: {
2326
+ profile: 'widget_v2';
2327
+ };
2328
+ };
2329
+ type RetrieveBrowserPaymentSessionParams = {
2330
+ paymentSessionId: string;
2331
+ checkoutToken: string;
2332
+ };
2333
+ type RetrieveServerPaymentSessionParams = {
2334
+ paymentSessionId: string;
2335
+ };
2336
+ type CancelBrowserPaymentSessionParams = RetrieveBrowserPaymentSessionParams & {
2337
+ idempotencyKey: string;
2338
+ };
2339
+ type CancelServerPaymentSessionParams = RetrieveServerPaymentSessionParams & {
2340
+ idempotencyKey: string;
2341
+ };
2342
+ type ConfirmTossPaymentSessionParams = {
2343
+ paymentSessionId: string;
2344
+ idempotencyKey: string;
2345
+ action: {
2346
+ type: 'toss_authorization';
2347
+ paymentKey: string;
2348
+ providerOrderId: string;
2349
+ };
2350
+ };
2351
+ type PaymentNextAction = {
2352
+ type: 'toss_widget';
2353
+ clientKey: string;
2354
+ paymentMethodVariantKey: string;
2355
+ agreementVariantKey: string;
2356
+ providerOrderId: string;
2357
+ providerCustomerKey: 'ANONYMOUS' | string;
2358
+ orderName: string;
2359
+ customerName?: string;
2360
+ customerEmail?: string;
2361
+ };
2362
+ type PaymentSessionRole = 'active' | 'canonical_candidate' | 'canonical' | 'residual' | 'historical';
2363
+ type PaymentProviderStatus = 'requires_payment_method' | 'requires_action' | 'requires_confirmation' | 'initializing' | 'processing' | 'authorized' | 'canceling' | 'unknown' | 'captured' | 'failed' | 'canceled';
2364
+ type PaymentReconciliationReason = 'provider_outcome_unknown' | 'local_commit_ambiguous' | 'amount_mismatch' | 'currency_mismatch' | 'excess_capture_pending_order' | 'inventory_unavailable' | 'admission_unavailable' | 'excess_capture' | 'late_capture' | 'cross_checkout_duplicate';
2365
+ type PaymentFailureReason = 'payment_declined' | 'authentication_failed' | 'authorization_expired' | 'payment_method_unavailable' | 'provider_terminal_failure' | 'unknown_provider_terminal_failure';
2366
+ type PublicCaptureEvidence = {
2367
+ amountMinor: number;
2368
+ currency: Uppercase<string>;
2369
+ observedAt: string;
2370
+ };
2371
+ type ReconciliationRequired<Reason extends string> = {
2372
+ status: 'required';
2373
+ reasons: readonly [Reason, ...Reason[]];
2374
+ };
2375
+ type PublicPaymentSessionBase = {
2376
+ id: string;
2377
+ money: Money;
2378
+ expiresAt: string | null;
2379
+ sessionRole: PaymentSessionRole;
2380
+ };
2381
+ type PublicPaymentSessionState<Action extends PaymentNextAction> = ({
2382
+ providerStatus: 'requires_payment_method' | 'requires_action';
2383
+ finalizationStatus: 'not_ready';
2384
+ reconciliation: {
2385
+ status: 'none';
2386
+ };
2387
+ order: null;
2388
+ } & ({
2389
+ sessionRole: 'active';
2390
+ presentationStatus: 'actionable';
2391
+ nextAction: Action;
2392
+ } | {
2393
+ sessionRole: 'residual';
2394
+ presentationStatus: 'suppressed';
2395
+ nextAction?: never;
2396
+ })) | {
2397
+ providerStatus: 'requires_confirmation';
2398
+ sessionRole: 'active' | 'residual';
2399
+ presentationStatus: 'suppressed';
2400
+ finalizationStatus: 'not_ready';
2401
+ nextAction?: never;
2402
+ reconciliation: {
2403
+ status: 'none';
2404
+ };
2405
+ order: null;
2406
+ } | {
2407
+ providerStatus: 'initializing' | 'processing' | 'authorized';
2408
+ sessionRole: 'active' | 'residual';
2409
+ presentationStatus: 'suppressed';
2410
+ finalizationStatus: 'not_ready';
2411
+ nextAction?: never;
2412
+ reconciliation: {
2413
+ status: 'none';
2414
+ };
2415
+ order: null;
2416
+ } | {
2417
+ providerStatus: 'canceling';
2418
+ sessionRole: 'active' | 'residual';
2419
+ presentationStatus: 'suppressed';
2420
+ finalizationStatus: 'not_ready';
2421
+ nextAction?: never;
2422
+ reconciliation: {
2423
+ status: 'none';
2424
+ };
2425
+ order: null;
2426
+ } | {
2427
+ providerStatus: 'unknown';
2428
+ sessionRole: 'active' | 'residual';
2429
+ presentationStatus: 'suppressed';
2430
+ finalizationStatus: 'not_ready';
2431
+ nextAction?: never;
2432
+ reconciliation: ReconciliationRequired<'provider_outcome_unknown'>;
2433
+ order: null;
2434
+ } | {
2435
+ providerStatus: 'captured';
2436
+ sessionRole: 'canonical_candidate' | 'residual';
2437
+ presentationStatus: 'suppressed';
2438
+ finalizationStatus: 'pending';
2439
+ nextAction?: never;
2440
+ reconciliation: {
2441
+ status: 'none';
2442
+ };
2443
+ providerEvidence: PublicCaptureEvidence;
2444
+ order: null;
2445
+ } | {
2446
+ providerStatus: 'captured';
2447
+ sessionRole: 'canonical' | 'historical';
2448
+ presentationStatus: 'suppressed';
2449
+ finalizationStatus: 'committed';
2450
+ nextAction?: never;
2451
+ reconciliation: {
2452
+ status: 'none';
2453
+ };
2454
+ providerEvidence: PublicCaptureEvidence;
2455
+ order: {
2456
+ id: string;
2457
+ orderNumber: string;
2458
+ };
2459
+ } | {
2460
+ providerStatus: 'captured';
2461
+ sessionRole: 'canonical_candidate' | 'residual';
2462
+ presentationStatus: 'suppressed';
2463
+ finalizationStatus: 'pending';
2464
+ nextAction?: never;
2465
+ reconciliation: ReconciliationRequired<'local_commit_ambiguous' | 'amount_mismatch' | 'currency_mismatch' | 'excess_capture_pending_order'>;
2466
+ providerEvidence: PublicCaptureEvidence;
2467
+ order: null;
2468
+ } | {
2469
+ providerStatus: 'captured';
2470
+ sessionRole: 'canonical' | 'residual';
2471
+ presentationStatus: 'suppressed';
2472
+ finalizationStatus: 'committed';
2473
+ nextAction?: never;
2474
+ reconciliation: ReconciliationRequired<'inventory_unavailable' | 'admission_unavailable' | 'amount_mismatch' | 'currency_mismatch' | 'excess_capture' | 'late_capture' | 'cross_checkout_duplicate'>;
2475
+ providerEvidence: PublicCaptureEvidence;
2476
+ order: {
2477
+ id: string;
2478
+ orderNumber: string;
2479
+ };
2480
+ } | {
2481
+ providerStatus: 'failed';
2482
+ sessionRole: 'historical';
2483
+ presentationStatus: 'suppressed';
2484
+ finalizationStatus: 'not_ready';
2485
+ nextAction?: never;
2486
+ providerEvidence?: never;
2487
+ cancellationReason?: never;
2488
+ reconciliation: {
2489
+ status: 'none';
2490
+ };
2491
+ failure: {
2492
+ reason: PaymentFailureReason;
2493
+ message?: string;
2494
+ };
2495
+ order: null;
2496
+ } | {
2497
+ providerStatus: 'canceled';
2498
+ sessionRole: 'historical';
2499
+ presentationStatus: 'suppressed';
2500
+ finalizationStatus: 'not_ready';
2501
+ nextAction?: never;
2502
+ providerEvidence?: never;
2503
+ failure?: never;
2504
+ cancellationReason: 'expired' | 'customer' | 'operator' | 'provider';
2505
+ reconciliation: {
2506
+ status: 'none';
2507
+ };
2508
+ order: null;
2509
+ };
2510
+ type PublicPaymentSession = PublicPaymentSessionBase & {
2511
+ provider: 'toss';
2512
+ } & PublicPaymentSessionState<PaymentNextAction>;
2513
+ declare class PaymentSessionApi extends CustomerScopedApi {
2514
+ private readonly serverTransport;
2515
+ constructor(options: PaymentSessionApiOptions);
2516
+ private post;
2517
+ private paymentSession;
2518
+ create(params: CreatePaymentSessionParams): Promise<PublicPaymentSession>;
2519
+ retrieve(params: RetrieveBrowserPaymentSessionParams | RetrieveServerPaymentSessionParams): Promise<PublicPaymentSession>;
2520
+ cancel(params: CancelBrowserPaymentSessionParams | CancelServerPaymentSessionParams): Promise<PublicPaymentSession>;
2521
+ confirm(params: ConfirmTossPaymentSessionParams): Promise<PublicPaymentSession>;
2522
+ }
2523
+
2065
2524
  interface CommerceClientOptions {
2066
2525
  publishableKey: string;
2067
2526
  apiUrl?: string;
2527
+ market?: string;
2068
2528
  customerToken: () => string | null;
2069
2529
  onUnauthorized?: () => Promise<string | null>;
2070
2530
  onRequestId?: (id: string | null) => void;
2071
2531
  customerAuth: CustomerAuth;
2072
2532
  }
2073
2533
  declare class CommerceClient {
2534
+ private readonly market?;
2074
2535
  readonly product: {
2075
2536
  stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
2076
2537
  stockSnapshot: (params: StockSnapshotParams) => Promise<StockSnapshotResponse>;
@@ -2079,22 +2540,18 @@ declare class CommerceClient {
2079
2540
  listingPage: {
2080
2541
  (params?: ProductListingPageCatalogParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem>>;
2081
2542
  };
2082
- detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
2543
+ detail: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
2083
2544
  detailCatalog: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
2084
2545
  };
2085
- readonly cart: {
2086
- create: (params?: CreateCartParams) => Promise<CreatedCart>;
2087
- get: (cartToken: string) => Promise<PublicCart>;
2088
- addItem: (params: AddItemParams) => Promise<PublicCartItem>;
2089
- updateItem: (params: UpdateItemParams) => Promise<PublicCartItem>;
2090
- removeItem: (params: RemoveItemParams) => Promise<{
2091
- success: boolean;
2092
- }>;
2093
- applyDiscount: (params: ApplyDiscountParams) => Promise<PublicCart>;
2094
- removeDiscount: (params: RemoveDiscountParams) => Promise<PublicCart>;
2095
- clear: (params: ClearCartParams) => Promise<{
2096
- success: boolean;
2097
- }>;
2546
+ readonly carts: {
2547
+ create: (params?: CreateCartParams) => Promise<CreateCartResult>;
2548
+ retrieve: (params: RetrieveCartParams) => Promise<PublicCart>;
2549
+ addItem: (params: AddItemParams) => Promise<CartMutationResult>;
2550
+ updateItem: (params: UpdateItemParams) => Promise<CartMutationResult>;
2551
+ removeItem: (params: RemoveItemParams) => Promise<CartMutationResult>;
2552
+ updateDiscountCodes: (params: UpdateDiscountCodesParams) => Promise<CartMutationResult>;
2553
+ updateAttributes: (params: UpdateCartAttributesParams) => Promise<CartMutationResult>;
2554
+ clear: (params: ClearCartParams) => Promise<CartMutationResult>;
2098
2555
  /**
2099
2556
  * Union/claim a pre-login guest cart into the authenticated customer's cart
2100
2557
  * (customer JWT required). Returns the resolved customer cart's `cartToken`
@@ -2108,9 +2565,17 @@ declare class CommerceClient {
2108
2565
  mine: () => Promise<CartMineResult>;
2109
2566
  };
2110
2567
  readonly orders: {
2111
- checkout: (params: CheckoutParams) => Promise<PublicOrder>;
2112
2568
  listMine: (options?: CustomerOrderListOptions) => Promise<PayloadFindResponse<PublicOrder>>;
2113
2569
  };
2570
+ readonly checkouts: {
2571
+ create: (params: CreateCheckoutParams) => Promise<CreateCheckoutResult>;
2572
+ retrieve: (params: RetrieveCheckoutParams) => Promise<PublicCheckout>;
2573
+ };
2574
+ readonly paymentSessions: {
2575
+ create: (params: CreatePaymentSessionParams) => Promise<PublicPaymentSession>;
2576
+ retrieve: (params: RetrieveBrowserPaymentSessionParams) => Promise<PublicPaymentSession>;
2577
+ cancel: (params: CancelBrowserPaymentSessionParams) => Promise<PublicPaymentSession>;
2578
+ };
2114
2579
  readonly discounts: {
2115
2580
  validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
2116
2581
  };
@@ -2118,6 +2583,8 @@ declare class CommerceClient {
2118
2583
  calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
2119
2584
  };
2120
2585
  constructor(options: CommerceClientOptions);
2586
+ getDefaultMarket(): string | undefined;
2587
+ private withMarket;
2121
2588
  }
2122
2589
 
2123
2590
  type StorefrontContentReference = {
@@ -2203,9 +2670,11 @@ interface ServerCommerceClientOptions {
2203
2670
  publishableKey?: string;
2204
2671
  secretKey: string;
2205
2672
  apiUrl?: string;
2673
+ market?: string;
2206
2674
  onRequestId?: (id: string | null) => void;
2207
2675
  }
2208
2676
  declare class ServerCommerceClient {
2677
+ private readonly market?;
2209
2678
  readonly product: {
2210
2679
  stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
2211
2680
  listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
@@ -2215,37 +2684,24 @@ declare class ServerCommerceClient {
2215
2684
  (params: ProductListingPageParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem> | ProductListingPageResult<ProductListingGroupsItem>>;
2216
2685
  };
2217
2686
  detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
2687
+ detailCatalog: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
2218
2688
  previewDetail: (params: ProductDetailPreviewParams, options: ProductDetailPreviewOptions) => Promise<ProductDetail | null>;
2219
2689
  upsert: (params: ProductUpsertParams) => Promise<ProductUpsertResponse>;
2220
2690
  };
2221
- readonly cart: {
2222
- create: (params?: CreateCartParams) => Promise<CreatedCart>;
2223
- get: (cartToken: string) => Promise<PublicCart>;
2224
- addItem: (params: AddItemParams) => Promise<PublicCartItem>;
2225
- updateItem: (params: UpdateItemParams) => Promise<PublicCartItem>;
2226
- removeItem: (params: RemoveItemParams) => Promise<{
2227
- success: boolean;
2228
- }>;
2229
- applyDiscount: (params: ApplyDiscountParams) => Promise<PublicCart>;
2230
- removeDiscount: (params: RemoveDiscountParams) => Promise<PublicCart>;
2231
- clear: (params: ClearCartParams) => Promise<{
2232
- success: boolean;
2233
- }>;
2234
- /**
2235
- * Union/claim a guest cart into a customer's cart. Customer-bound resolution
2236
- * requires a customer JWT; a secret-key caller has no customer session.
2237
- */
2238
- merge: (params: CartMergeParams) => Promise<CartMergeResult>;
2239
- /** Load the authenticated customer's active cart by JWT. */
2240
- mine: () => Promise<CartMineResult>;
2691
+ readonly carts: {
2692
+ create: (params?: CreateCartParams) => Promise<CreateCartResult>;
2693
+ retrieve: (params: RetrieveCartParams) => Promise<PublicCart>;
2694
+ addItem: (params: AddItemParams) => Promise<CartMutationResult>;
2695
+ updateItem: (params: UpdateItemParams) => Promise<CartMutationResult>;
2696
+ removeItem: (params: RemoveItemParams) => Promise<CartMutationResult>;
2697
+ updateDiscountCodes: (params: UpdateDiscountCodesParams) => Promise<CartMutationResult>;
2698
+ updateAttributes: (params: UpdateCartAttributesParams) => Promise<CartMutationResult>;
2699
+ clear: (params: ClearCartParams) => Promise<CartMutationResult>;
2700
+ merge: (params: ServerCartMergeParams) => Promise<CartMergeResult>;
2701
+ mine: (params: ServerCartMineParams) => Promise<CartMineResult>;
2241
2702
  };
2242
2703
  readonly orders: {
2243
- checkout: (params: CheckoutParams) => Promise<PublicOrder>;
2244
- create: (params: CreateOrderParams) => Promise<Order>;
2245
2704
  update: (params: UpdateOrderParams) => Promise<Order>;
2246
- updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
2247
- confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
2248
- confirmPaymentReturningOrder: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentWithOrderResult>;
2249
2705
  getByPaymentId: (params: GetOrderByPaymentIdParams) => Promise<OrderByPaymentResult>;
2250
2706
  cancelOrder: (params: CancelOrderParams) => Promise<CancelOrderResponse>;
2251
2707
  resolveCancelRefund: (params: ResolveCancelRefundParams) => Promise<ResolveCancelRefundResponse>;
@@ -2260,6 +2716,17 @@ declare class ServerCommerceClient {
2260
2716
  transaction: Transaction | null;
2261
2717
  }>;
2262
2718
  };
2719
+ readonly checkouts: {
2720
+ create: (params: CreateServerCheckoutParams) => Promise<CreateServerCheckoutResult>;
2721
+ retrieve: (params: RetrieveServerCheckoutParams) => Promise<ServerCheckout>;
2722
+ query: (params?: CheckoutQueryParams) => Promise<CheckoutQueryResult>;
2723
+ };
2724
+ readonly paymentSessions: {
2725
+ create: (params: CreatePaymentSessionParams) => Promise<PublicPaymentSession>;
2726
+ retrieve: (params: RetrieveServerPaymentSessionParams) => Promise<PublicPaymentSession>;
2727
+ cancel: (params: CancelServerPaymentSessionParams) => Promise<PublicPaymentSession>;
2728
+ confirm: (params: ConfirmTossPaymentSessionParams) => Promise<PublicPaymentSession>;
2729
+ };
2263
2730
  readonly discounts: {
2264
2731
  validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
2265
2732
  };
@@ -2267,6 +2734,8 @@ declare class ServerCommerceClient {
2267
2734
  calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
2268
2735
  };
2269
2736
  constructor(options: ServerCommerceClientOptions);
2737
+ getDefaultMarket(): string | undefined;
2738
+ private withMarket;
2270
2739
  }
2271
2740
 
2272
2741
  /**
@@ -2275,6 +2744,7 @@ declare class ServerCommerceClient {
2275
2744
  */
2276
2745
  declare class CustomerNamespace {
2277
2746
  readonly auth: CustomerAuth;
2747
+ readonly oauth?: CustomerOAuth;
2278
2748
  constructor(publishableKey: string, options?: CustomerAuthOptions, apiUrl?: string);
2279
2749
  }
2280
2750
 
@@ -2376,6 +2846,33 @@ interface EventsRangeResponse {
2376
2846
  hasNextPage: boolean;
2377
2847
  hasPrevPage: boolean;
2378
2848
  }
2849
+ interface EventAdmissionAvailabilityParams {
2850
+ occurrence: string;
2851
+ }
2852
+ interface EventAdmissionPricePresentment {
2853
+ amount: number;
2854
+ compareAtPrice: number | null;
2855
+ currency: string | null;
2856
+ marketId: string | null;
2857
+ }
2858
+ interface EventAdmissionAvailabilityType {
2859
+ id: string | number;
2860
+ label?: string | null;
2861
+ description?: string | null;
2862
+ eventId: string | number;
2863
+ occurrenceId: string | number;
2864
+ productId: string | number | null;
2865
+ variantId: string | number | null;
2866
+ price: EventAdmissionPricePresentment | null;
2867
+ remainingCapacityHint: number | null;
2868
+ available: boolean;
2869
+ }
2870
+ interface EventAdmissionAvailabilityResponse {
2871
+ occurrenceId: string | number;
2872
+ eventId: string | number;
2873
+ remainingCapacityHint: number | null;
2874
+ admissionTypes: EventAdmissionAvailabilityType[];
2875
+ }
2379
2876
  interface EventRegistrationAttendeeInput {
2380
2877
  name?: string;
2381
2878
  email?: string;
@@ -2432,13 +2929,81 @@ declare class EventsClient {
2432
2929
  private readonly onRequestId?;
2433
2930
  constructor(options: EventsClientOptions);
2434
2931
  getRange(params: EventsRangeParams): Promise<EventsRangeResponse>;
2932
+ getAdmissionAvailability(params: EventAdmissionAvailabilityParams): Promise<EventAdmissionAvailabilityResponse>;
2435
2933
  register(params: EventRegistrationRegisterParams): Promise<EventRegistrationRegisterResponse>;
2436
2934
  getGuestRegistration(token: string): Promise<EventGuestRegistrationResponse>;
2437
2935
  cancelGuestRegistration(token: string, params?: EventGuestCancelParams): Promise<EventGuestRegistrationResponse>;
2438
2936
  private execute;
2439
2937
  }
2440
2938
 
2939
+ /**
2940
+ * Client-safe market discovery shape (Shopify-like). Structural copy of the
2941
+ * private contracts package's `PublicMarketDTO` — the public SDK must not import
2942
+ * private contracts, so a parity `test-d` keeps the two in lockstep. The
2943
+ * `toMarketDTO` return annotation ties this shape back to the real `PublicMarket`
2944
+ * row (which the parity test alone cannot check).
2945
+ */
2946
+ type MarketDTO = {
2947
+ id: string;
2948
+ handle: string;
2949
+ name: string;
2950
+ countryCode: string;
2951
+ targetCountries: string[];
2952
+ currency: string;
2953
+ isPrimary: boolean;
2954
+ isActive: boolean;
2955
+ };
2956
+ /**
2957
+ * Minimal reader the discovery helper depends on: the shape of
2958
+ * `collections.from('markets').find`. Kept narrow so the helper is
2959
+ * transport-agnostic and unit-testable against a mock.
2960
+ */
2961
+ type MarketRowReader = (options: {
2962
+ where: Where;
2963
+ limit: number;
2964
+ }) => Promise<PayloadFindResponse<PublicMarket>>;
2965
+ interface MarketDiscoveryClient {
2966
+ /** List the tenant's active buyer markets. */
2967
+ list(): Promise<MarketDTO[]>;
2968
+ /** Resolve the tenant's default (active primary) market, or `null`. */
2969
+ default(): Promise<MarketDTO | null>;
2970
+ }
2971
+ /** Read-side helper for public market discovery. */
2972
+ declare class MarketDiscovery implements MarketDiscoveryClient {
2973
+ private readonly read;
2974
+ constructor(read: MarketRowReader);
2975
+ list(): Promise<MarketDTO[]>;
2976
+ default(): Promise<MarketDTO | null>;
2977
+ }
2978
+
2441
2979
  type TenantIntrospectionApiOptions = ServerApiOptions;
2980
+ interface TenantContextInput {
2981
+ includeCounts?: boolean;
2982
+ }
2983
+ interface TenantFieldConfigState {
2984
+ hiddenFields: string[];
2985
+ isHidden: boolean;
2986
+ }
2987
+ interface TenantContextResponse {
2988
+ tenant: {
2989
+ id: string;
2990
+ name: string;
2991
+ plan: string;
2992
+ planSource?: string;
2993
+ authoritative?: boolean;
2994
+ capabilityVersion?: string;
2995
+ };
2996
+ features: string[];
2997
+ collections: {
2998
+ active: string[];
2999
+ inactive: string[];
3000
+ };
3001
+ fieldConfigs: Record<string, TenantFieldConfigState>;
3002
+ counts?: Record<string, number>;
3003
+ config?: {
3004
+ webhookConfigured: boolean;
3005
+ };
3006
+ }
2442
3007
  type TenantFeatureProgressFeature = 'ecommerce';
2443
3008
  interface TenantFeatureProgressInput {
2444
3009
  feature: TenantFeatureProgressFeature;
@@ -2523,11 +3088,13 @@ interface CollectionSchemaResponse {
2523
3088
  };
2524
3089
  }
2525
3090
  interface TenantIntrospectionClient {
3091
+ context: (params?: TenantContextInput) => Promise<TenantContextResponse>;
2526
3092
  collectionSchema: (collection: string) => Promise<CollectionSchemaResponse>;
2527
3093
  featureProgress: (params: TenantFeatureProgressInput) => Promise<TenantFeatureProgressResponse>;
2528
3094
  }
2529
- declare class TenantIntrospectionApi extends BaseApi implements TenantIntrospectionClient {
3095
+ declare class TenantIntrospectionApi extends RawBaseApi implements TenantIntrospectionClient {
2530
3096
  constructor(options: TenantIntrospectionApiOptions);
3097
+ context(params?: TenantContextInput): Promise<TenantContextResponse>;
2531
3098
  collectionSchema(collection: string): Promise<CollectionSchemaResponse>;
2532
3099
  featureProgress(params: TenantFeatureProgressInput): Promise<TenantFeatureProgressResponse>;
2533
3100
  }
@@ -2536,23 +3103,27 @@ declare class TenantIntrospectionApi extends BaseApi implements TenantIntrospect
2536
3103
  * SDK-local hand-declarations of the membership wire contract types.
2537
3104
  *
2538
3105
  * The public SDK must keep these types local because the canonical membership
2539
- * contract package is private to the workspace. These public types are
2540
- * structurally checked by membership contract-parity type tests.
3106
+ * contract package is private to the workspace and must not be imported at
3107
+ * runtime. These public types are structurally checked by membership
3108
+ * contract-parity type tests.
2541
3109
  */
2542
3110
  type MembershipStatus = 'incomplete' | 'trialing' | 'active' | 'past_due' | 'cancelled' | 'expired';
2543
3111
  /**
2544
3112
  * Parameters for the subscribe endpoint (delegated charge model).
2545
- * The storefront already collected the first payment; this records it and
2546
- * activates the membership.
3113
+ * The storefront already collected the first payment for non-trial plans; this
3114
+ * records it and activates the membership. Trial starts omit pgPaymentId until
3115
+ * the renewal cron sends the first delegated charge.
2547
3116
  */
2548
3117
  type SubscribeMembershipParams = {
2549
3118
  planId: string;
3119
+ priceId: string;
2550
3120
  /** Stable client-generated key used as the deduplication key for this subscription intent. */
2551
3121
  subscribeIntentKey: string;
2552
- pgPaymentId: string;
2553
- amount: number;
2554
- currency: string;
2555
- customerRef?: string;
3122
+ pgPaymentId?: string;
3123
+ /** Internal Console customer document id. */
3124
+ customerId: string;
3125
+ /** Delegated payment provider customer reference. */
3126
+ customerRef: string;
2556
3127
  card?: {
2557
3128
  last4?: string;
2558
3129
  brand?: string;
@@ -2564,8 +3135,9 @@ type SubscribeMembershipResponse = {
2564
3135
  };
2565
3136
  /**
2566
3137
  * Parameters for cancelling a membership.
2567
- * `immediate=false` (default) sets `cancelAtPeriodEnd`; benefits persist to
2568
- * the last paid period. `immediate=true` cancels immediately and revokes groups.
3138
+ * Default (omit `immediate` or pass `false`) sets `cancelAtPeriodEnd`; benefits
3139
+ * persist until the last paid period end and renewals stop. Pass
3140
+ * `immediate=true` to cancel immediately and revoke groups now.
2569
3141
  */
2570
3142
  type CancelMembershipParams = {
2571
3143
  id: string;
@@ -2581,12 +3153,15 @@ type CancelMembershipResponse = {
2581
3153
  type CustomerMembershipView = {
2582
3154
  id: string;
2583
3155
  plan: string;
3156
+ price: string;
2584
3157
  status: MembershipStatus;
2585
3158
  currentPeriodEnd: string;
2586
3159
  nextBillingAt: string | null;
2587
3160
  cancelAtPeriodEnd: boolean;
2588
3161
  amount: number;
2589
3162
  currency: string;
3163
+ billingInterval: 'month' | 'year';
3164
+ intervalCount: number;
2590
3165
  card?: {
2591
3166
  last4?: string;
2592
3167
  brand?: string;
@@ -2597,26 +3172,16 @@ interface ClientConfig {
2597
3172
  publishableKey: string;
2598
3173
  /** API base URL for staging, self-hosted, preview, or proxy deployments. */
2599
3174
  apiUrl?: string;
3175
+ /**
3176
+ * Default commerce market handle/id. Applied to market-aware product and cart
3177
+ * helpers when the individual call does not provide `market`.
3178
+ */
3179
+ market?: string;
2600
3180
  /**
2601
3181
  * Customer authentication options.
2602
3182
  * Used to initialize CustomerAuth on Client.
2603
3183
  */
2604
- customer?: {
2605
- /**
2606
- * Persist token in localStorage. Defaults to `true`.
2607
- * - `true` (default): uses key `'customer-token'`
2608
- * - `string`: uses the given string as localStorage key
2609
- * - `false`: disables persistence (token/onTokenChange used instead)
2610
- *
2611
- * Handles SSR safely (no-op on server).
2612
- * When enabled, `token` and `onTokenChange` are ignored.
2613
- */
2614
- persist?: boolean | string;
2615
- /** Initial token (e.g. from SSR cookie) */
2616
- token?: string;
2617
- /** Called when token changes (login/logout) — use to persist in localStorage/cookie */
2618
- onTokenChange?: (token: string | null) => void;
2619
- };
3184
+ customer?: CustomerAuthOptions;
2620
3185
  }
2621
3186
  interface ClientServerConfig extends ClientConfig {
2622
3187
  secretKey: string;
@@ -2656,15 +3221,23 @@ interface PayloadMutationResponse<T = unknown> {
2656
3221
  }
2657
3222
  type Sort = string | string[];
2658
3223
  type Where = Record<string, unknown>;
3224
+ type LocaleOption = 'en' | 'ko';
3225
+ type FallbackLocaleOption = 'en' | 'ko' | 'none' | false;
2659
3226
  /**
2660
3227
  * Do NOT replace with `Pick<FindOptions>` from `payload` or import Payload
2661
3228
  * types here. Payload's generic query types depend on `PayloadTypes` module
2662
3229
  * augmentation; external SDK consumers who only use `createClient` should not
2663
3230
  * install Payload just to type REST query objects. Excluded vs native:
2664
- * Local-API-only fields, `locale`/`fallbackLocale`.
3231
+ * Local-API-only fields.
2665
3232
  */
2666
3233
  interface ApiQueryOptions {
2667
3234
  page?: number;
3235
+ /**
3236
+ * Rows per page. With a browser publishable key, raw collection reads must
3237
+ * request a bounded limit in [1, 100]: `limit: 0`, a `limit` above 100, and
3238
+ * `pagination: false` are rejected (400) rather than returning an entire
3239
+ * collection — use `page` to paginate. Server credentials are not capped.
3240
+ */
2668
3241
  limit?: number;
2669
3242
  sort?: Sort;
2670
3243
  /**
@@ -2719,12 +3292,21 @@ interface ApiQueryOptions {
2719
3292
  where?: Where;
2720
3293
  count?: boolean;
2721
3294
  } | false> | false;
2722
- /** Set to `false` to skip the count query — returns docs without totalDocs/totalPages */
3295
+ /**
3296
+ * Set to `false` to skip the count query — returns docs without
3297
+ * totalDocs/totalPages. With a browser publishable key this is rejected (400)
3298
+ * on raw collection reads (pagination cannot be disabled so the row cap
3299
+ * applies); it takes effect with server credentials.
3300
+ */
2723
3301
  pagination?: boolean;
2724
3302
  /** Include draft versions (access control still applies on the server) */
2725
3303
  draft?: boolean;
2726
3304
  /** Include soft-deleted documents (requires `trash` enabled on the collection) */
2727
3305
  trash?: boolean;
3306
+ /** Resolve localized fields for a specific locale. */
3307
+ locale?: LocaleOption;
3308
+ /** Fallback locale for missing localized values; set false to disable fallback. */
3309
+ fallbackLocale?: FallbackLocaleOption;
2728
3310
  }
2729
3311
  type ApiDeleteOptions = Pick<ApiQueryOptions, 'trash'>;
2730
3312
  type PublicReadQueryOptions = Omit<ApiQueryOptions, 'depth' | 'joins' | 'populate'> & {
@@ -2751,7 +3333,7 @@ interface RetryConfig {
2751
3333
  retryableStatuses?: number[];
2752
3334
  retryDelay?: (attempt: number) => number;
2753
3335
  }
2754
- interface RootQueryLookup<T extends string, Options extends ApiQueryOptions = ApiQueryOptions> {
3336
+ interface RootQueryLookup<T extends Collection, Options extends ApiQueryOptions = ApiQueryOptions> {
2755
3337
  find(options?: Options): Promise<PayloadFindResponse<CollectionType<T>>>;
2756
3338
  findById(id: string | number, options?: Options): Promise<CollectionType<T>>;
2757
3339
  count(options?: Options): Promise<{
@@ -2786,10 +3368,13 @@ interface RootClient {
2786
3368
  events?: EventsClient;
2787
3369
  customer: CustomerNamespace;
2788
3370
  collections: RootCollectionClient;
3371
+ markets: MarketDiscoveryClient;
2789
3372
  memberships: {
2790
3373
  me: () => Promise<CustomerMembershipView | null>;
3374
+ cancel: (params: CancelMembershipParams) => Promise<CancelMembershipResponse>;
2791
3375
  };
2792
3376
  lastRequestId: string | null;
3377
+ withMarket(market: string): RootClientWithEvents;
2793
3378
  getState(): ClientState;
2794
3379
  getConfig(): ClientConfig;
2795
3380
  }
@@ -2799,7 +3384,6 @@ interface RootServerClient {
2799
3384
  memberships: {
2800
3385
  subscribe: (params: SubscribeMembershipParams) => Promise<SubscribeMembershipResponse>;
2801
3386
  cancel: (params: CancelMembershipParams) => Promise<CancelMembershipResponse>;
2802
- me: () => Promise<CustomerMembershipView | null>;
2803
3387
  };
2804
3388
  /** Set on {@link createServerClient} return values; optional for structural mocks. */
2805
3389
  events?: EventsClient;
@@ -2812,7 +3396,9 @@ interface RootServerClient {
2812
3396
  };
2813
3397
  };
2814
3398
  collections: RootServerCollectionClient;
3399
+ markets: MarketDiscoveryClient;
2815
3400
  lastRequestId: string | null;
3401
+ withMarket(market: string): RootServerClientWithEvents;
2816
3402
  getState(): ClientState;
2817
3403
  getConfig(): Omit<ClientServerConfig, 'secretKey'>;
2818
3404
  }
@@ -2827,4 +3413,4 @@ type DeepPartial<T> = {
2827
3413
  };
2828
3414
  type ExtractArrayType<T> = T extends (infer U)[] ? U : never;
2829
3415
 
2830
- export { type BanCustomerParams as $, type AddItemParams as A, type RootCollectionClient as B, CommerceClient as C, type DebugConfig as D, EventsClient as E, type RootReadOnlyQueryBuilder as F, type StorefrontContentListOptions as G, type StorefrontContentReference as H, type StorefrontGalleryItem as I, type StorefrontGalleryItemsListOptions as J, type StorefrontGalleryItemsSort as K, type StorefrontLink as L, type StorefrontLinksListOptions as M, type StorefrontLinksSort as N, BaseApi as O, type PayloadFindResponse as P, type ServerApiOptions as Q, type RemoveDiscountParams as R, type Sort as S, ServerCommerceClient as T, type UpdateItemParams as U, type TenantIntrospectionClient as V, type Where as W, type SubscribeMembershipParams as X, type SubscribeMembershipResponse as Y, type CancelMembershipParams as Z, type CancelMembershipResponse as _, CommunityClient as a, type ResolveProductSelectionMediaResult as a$, type CommunityBan as a0, type UnbanCustomerParams as a1, type ClientServerConfig as a2, type RootServerClientWithEvents as a3, type CollectionFieldSchema as a4, type CollectionSchemaResponse as a5, type EventGuestCancelParams as a6, type EventGuestRegistration as a7, type EventGuestRegistrationResponse as a8, type EventRegistrationAnswerInput as a9, TenantIntrospectionApi as aA, type TenantIntrospectionApiOptions as aB, type ApiDeleteOptions as aC, type PublicReadQueryOptions as aD, CustomerAuth as aE, type CustomerProfile as aF, type CustomerAuthResponse as aG, type CustomerLoginData as aH, type CustomerRegisterResponse as aI, type CustomerRegisterData as aJ, type CustomerRefreshResponse as aK, type UpdateProfileData as aL, type ProductListingPageBaseParams as aM, type ProductListingPageParams as aN, type ProductDetailParams as aO, type ProductDetailResult as aP, type ProductListingPageCatalogParams as aQ, type ProductListingPageResult as aR, type ProductListingGroupsCatalogItem as aS, type ProductListingPageFullParams as aT, type ProductListingGroupsItem as aU, type ProductDetail as aV, type ProductDetailCatalog as aW, type StockSnapshotResponse as aX, type ProductSelectionMediaSource as aY, type ProductDisplayMediaSource as aZ, type ResolveProductSelectionMediaInput as a_, type EventRegistrationAttendeeInput as aa, type EventRegistrationPublic as ab, type EventRegistrationRegisterParams as ac, type EventRegistrationRegisterResponse as ad, type EventsCalendarItem as ae, type EventsClientOptions as af, type EventsDateParam as ag, type EventsExternalSource as ah, type EventsLocation as ai, type EventsOccurrenceLocation as aj, type EventsRangeEvent as ak, type EventsRangeOccurrence as al, type EventsRangeParams as am, type EventsRangeResponse as an, type EventsTaxonomyItem as ao, ModerationApi as ap, type RootServerClient as aq, type TenantFeatureProgressEvidenceValue as ar, type TenantFeatureProgressFeature as as, type TenantFeatureProgressGroup as at, type TenantFeatureProgressInput as au, type TenantFeatureProgressItem as av, type TenantFeatureProgressItemState as aw, type TenantFeatureProgressResponse as ax, type TenantFeatureProgressSeverity as ay, type TenantFeatureProgressStatus as az, ContentClient as b, type ProductDetailImage as b$, type ProductSelectionMediaPointer as b0, type RootClientWithEvents as b1, type BulkImportFulfillmentsParams as b2, type BulkImportFulfillmentsResponse as b3, type CalculateShippingParams as b4, type CalculateShippingResult as b5, type CancelOrderParams as b6, type CancelOrderReconciliationStatus as b7, type CancelOrderResponse as b8, type CancelReasonCode as b9, type CustomerOrderListOptions as bA, type CustomerSnapshot as bB, DiscountApi as bC, type DiscountApiOptions as bD, type DiscountErrorReasonCode as bE, type FeaturedImagePointerInput as bF, type GetOrderByPaymentIdParams as bG, type LegacyProductSelectionParamEvent as bH, type ListingGroupsParams as bI, type MediaValue as bJ, type MembershipStatus as bK, type NormalizedOptionSwatch as bL, type NormalizedProductSelection as bM, OrderApi as bN, type OrderApiOptions as bO, type OrderByPaymentResult as bP, PRODUCT_PLP_FIND_OPTIONS as bQ, PRODUCT_UPSERT_READONLY_FIELD_REASON as bR, PRODUCT_UPSERT_UNKNOWN_FIELD_REASON as bS, type PrepareFulfillmentOrderParams as bT, type PrepareFulfillmentOrderResponse as bU, ProductApi as bV, type ProductApiOptions as bW, type ProductDetailBrand as bX, type ProductDetailCatalogResult as bY, type ProductDetailCatalogVariant as bZ, type ProductDetailCategory as b_, CartApi as ba, type CartApiOptions as bb, type CartMergeParams as bc, type CartMergeResult as bd, type CartMineResult as be, type Comment as bf, type CommerceClientOptions as bg, type CommunityClientOptions as bh, type CommunityComment as bi, type CommunityCommentListSort as bj, type CommunityPost as bk, type CommunityPostCategory as bl, type CommunityPostListSort as bm, type CommunityPostTag as bn, type CommunityPublicAuthorSnapshot as bo, type CommunityPublicMediaAsset as bp, type CommunityPublicReference as bq, type CompatibilityProductSelectionParamEvent as br, type ConfirmPaymentParams as bs, type ConfirmPaymentResponse as bt, type ConfirmPaymentWithOrderResult as bu, type CreateFulfillmentParams as bv, type CreateOrderItem as bw, type CreateOrderParams as bx, type CreateReturnParams as by, type CustomerAuthOptions as bz, CustomerNamespace as c, type ReturnItem as c$, type ProductDetailImageMedia as c0, type ProductDetailMedia as c1, type ProductDetailOption as c2, type ProductDetailOptionValue as c3, type ProductDetailTag as c4, type ProductDetailUnavailableReason as c5, type ProductDetailVariant as c6, type ProductDetailVariantOptionValue as c7, type ProductDetailVideo as c8, type ProductHrefGroup as c9, type ProductOptionShape as cA, type ProductOptionValueShape as cB, type ProductOptionValueSwatch as cC, type ProductOptionValueSwatchInput as cD, type ProductPriceRange as cE, type ProductSelectionAvailableSwatch as cF, type ProductSelectionAvailableValue as cG, type ProductSelectionByOptionValue as cH, ProductSelectionCodecError as cI, type ProductSelectionCodecOptions as cJ, type ProductSelectionInput as cK, type ProductSelectionOptionValue as cL, type ProductSelectionResolution as cM, type ProductSelectionResolutionContext as cN, type ProductSelectionUrlEmit as cO, type ProductSelectionVariant as cP, type ProductUpsertFieldValidationErrorBody as cQ, type ProductUpsertFieldValidationErrorReason as cR, type ProductVariantShape as cS, type RequestOptions as cT, type ResolveCancelRefundFailedResponse as cU, type ResolveCancelRefundOutcome as cV, type ResolveCancelRefundParams as cW, type ResolveCancelRefundResponse as cX, type ResolveCancelRefundSucceededResponse as cY, type ResolveProductDisplayMediaInput as cZ, type ResolveProductDisplayMediaResult as c_, type ProductHrefOptions as ca, type ProductHrefProduct as cb, type ProductListingCard as cc, type ProductListingCardOptions as cd, type ProductListingCardPriceRange as ce, type ProductListingCardRepresentativeVariant as cf, type ProductListingGroup as cg, type ProductListingGroupCatalogSummary as ch, type ProductListingGroupCatalogVariant as ci, type ProductListingGroupProjection as cj, type ProductListingGroupSummary as ck, type ProductListingGroupVariant as cl, type ProductListingGroupsCatalogProduct as cm, type ProductListingGroupsCatalogResponse as cn, type ProductListingGroupsProduct as co, type ProductListingGroupsResponse as cp, type ProductListingPageFilters as cq, type ProductListingPageSort as cr, type ProductListingProductShape as cs, type ProductListingSwatch as ct, type ProductMediaResolutionSource as cu, type ProductMoneyRange as cv, type ProductOptionMatrix as cw, type ProductOptionMatrixOption as cx, type ProductOptionMatrixValue as cy, type ProductOptionMatrixVariant as cz, type CustomerMembershipView as d, type ReturnReason as d0, type ReturnWithRefundItem as d1, type ReturnWithRefundParams as d2, ShippingApi as d3, type ShippingApiOptions as d4, type StockCheckParams as d5, type StockCheckResponse as d6, type StockCheckResult as d7, type StockSnapshotItem as d8, type StockSnapshotParams as d9, projectProductToListingShape as dA, resolveFeaturedImagePointer as dB, resolveProductDisplayMedia as dC, resolveProductSelection as dD, resolveProductSelectionFromMatrix as dE, resolveProductSelectionMedia as dF, resolveVariantForSelection as dG, selectNext as dH, selectedSwatchMediaItemId as dI, stringifyProductSelection as dJ, toShopifyPriceRangeV2 as dK, type TransactionStatus as da, type UpdateFulfillmentParams as db, type UpdateOrderParams as dc, type UpdateReturnParams as dd, type UpdateTransactionParams as de, type ValidateDiscountParams as df, type ValidateDiscountResult as dg, type WithIdempotencyKey as dh, buildProductHref as di, buildProductListingCard as dj, buildProductListingGroupProjection as dk, buildProductListingGroupsByOption as dl, buildProductOptionMatrix as dm, buildProductOptionMatrixFromDetail as dn, createProductSelectionCodec as dp, getAvailableOptionValues as dq, getProductSelectionImages as dr, getSelectedValueByOptionId as ds, getVariantAvailableForSale as dt, getVariantAvailableStock as du, isProductUpsertFieldValidationErrorBody as dv, normalizeProductSelection as dw, normalizeProductSelectionFromMatrix as dx, normalizeSelectedValueIds as dy, parseProductSelection as dz, type ClientState as e, type ClientConfig as f, type ApiQueryOptions as g, type ApplyDiscountParams as h, type CheckoutParams as i, type ClearCartParams as j, type ClientMetadata as k, type ContentClientOptions as l, type DeepPartial as m, type ExtractArrayType as n, type PayloadMutationResponse as o, type PublicCart as p, type PublicCartItem as q, type PublicCartReference as r, type PublicMediaAsset as s, type PublicMediaSize as t, type PublicOrder as u, type PublicOrderItem as v, type PublicOrderReference as w, type RemoveItemParams as x, type RetryConfig as y, type RootClient as z };
3416
+ export { type PublicCartItemAdmission as $, type AddItemParams as A, type CreatePaymentSessionParams as B, CommerceClient as C, type CustomerSnapshot as D, EventsClient as E, type DebugConfig as F, type DeepPartial as G, type ExtractArrayType as H, type MembershipStatus as I, type Money as J, type PayloadMutationResponse as K, type PaymentFailureReason as L, MarketDiscovery as M, type PaymentNextAction as N, type OpenCheckoutPaymentState as O, type PayloadFindResponse as P, type PaymentProviderStatus as Q, type PaymentReconciliationReason as R, type PaymentSessionRole as S, type ProductUpsertInput as T, type ProductUpsertParams as U, type ProductUpsertResponse as V, type ProductUpsertVariantInput as W, type PublicAttribute as X, type PublicCaptureEvidence as Y, type PublicCart as Z, type PublicCartItem as _, CommunityClient as a, type EventAdmissionAvailabilityType as a$, type PublicCartMarket as a0, type PublicCartReference as a1, type PublicCheckout as a2, type PublicCheckoutItem as a3, type PublicMediaAsset as a4, type PublicMediaSize as a5, type PublicOrder as a6, type PublicOrderAmounts as a7, type PublicOrderItem as a8, type PublicOrderReference as a9, RawBaseApi as aA, type ServerApiOptions as aB, ServerCommerceClient as aC, type TenantIntrospectionClient as aD, type SubscribeMembershipParams as aE, type SubscribeMembershipResponse as aF, type BanCustomerParams as aG, type CommunityBan as aH, type UnbanCustomerParams as aI, type ClientServerConfig as aJ, type RootServerClientWithEvents as aK, type CancelServerPaymentSessionParams as aL, CartApi as aM, type CartApiOptions as aN, CheckoutApi as aO, type CheckoutApiOptions as aP, type CheckoutListItem as aQ, type CheckoutQueryParams as aR, type CheckoutQueryResult as aS, type CheckoutStatus as aT, type CollectionFieldSchema as aU, type CollectionSchemaResponse as aV, type ConfirmTossPaymentSessionParams as aW, type CreateServerCheckoutParams as aX, type CreateServerCheckoutResult as aY, type EventAdmissionAvailabilityParams as aZ, type EventAdmissionAvailabilityResponse as a_, type PublicPaymentSession as aa, type ReconciliationRequired as ab, type RemoveItemParams as ac, type RetrieveBrowserPaymentSessionParams as ad, type RetrieveCartParams as ae, type RetrieveCheckoutParams as af, type RetryConfig as ag, type RootClient as ah, type RootCollectionClient as ai, type RootReadOnlyQueryBuilder as aj, type ShippingLine as ak, type Sort as al, type SpentCheckoutPaymentState as am, type StorefrontContentListOptions as an, type StorefrontContentReference as ao, type StorefrontGalleryItem as ap, type StorefrontGalleryItemsListOptions as aq, type StorefrontGalleryItemsSort as ar, type StorefrontLink as as, type StorefrontLinksListOptions as at, type StorefrontLinksSort as au, type UpdateCartAttributesParams as av, type UpdateDiscountCodesParams as aw, type UpdateItemParams as ax, type VariantInput as ay, type Where as az, ContentClient as b, type ProductDetail as b$, type EventAdmissionPricePresentment as b0, type EventGuestCancelParams as b1, type EventGuestRegistration as b2, type EventGuestRegistrationResponse as b3, type EventRegistrationAnswerInput as b4, type EventRegistrationAttendeeInput as b5, type EventRegistrationPublic as b6, type EventRegistrationRegisterParams as b7, type EventRegistrationRegisterResponse as b8, type EventsCalendarItem as b9, type TenantFeatureProgressItemState as bA, type TenantFeatureProgressResponse as bB, type TenantFeatureProgressSeverity as bC, type TenantFeatureProgressStatus as bD, type TenantFieldConfigState as bE, TenantIntrospectionApi as bF, type TenantIntrospectionApiOptions as bG, type ApiDeleteOptions as bH, type PublicReadQueryOptions as bI, CustomerAuth as bJ, type CustomerProfile as bK, type CustomerAuthResponse as bL, type CustomerLoginData as bM, type CustomerRegisterResponse as bN, type CustomerRegisterData as bO, type CustomerRefreshResponse as bP, type UpdateProfileData as bQ, type ProductListingPageParams as bR, type ProductListingPageBaseParams as bS, type ProductDetailParams as bT, type ProductDetailCatalogResult as bU, type ProductListingPageCatalogParams as bV, type ProductListingPageResult as bW, type ProductListingGroupsCatalogItem as bX, type ProductListingPageFullParams as bY, type ProductListingGroupsItem as bZ, BaseApi as b_, type EventsClientOptions as ba, type EventsDateParam as bb, type EventsExternalSource as bc, type EventsLocation as bd, type EventsOccurrenceLocation as be, type EventsRangeEvent as bf, type EventsRangeOccurrence as bg, type EventsRangeParams as bh, type EventsRangeResponse as bi, type EventsTaxonomyItem as bj, ModerationApi as bk, PaymentSessionApi as bl, type PaymentSessionApiOptions as bm, type RetrieveServerCheckoutParams as bn, type RetrieveServerPaymentSessionParams as bo, type RootServerClient as bp, type ServerCartMergeParams as bq, type ServerCartMineParams as br, type ServerCheckout as bs, type TenantContextInput as bt, type TenantContextResponse as bu, type TenantFeatureProgressEvidenceValue as bv, type TenantFeatureProgressFeature as bw, type TenantFeatureProgressGroup as bx, type TenantFeatureProgressInput as by, type TenantFeatureProgressItem as bz, CustomerNamespace as c, type ProductDetailBrand as c$, type ProductDetailCatalog as c0, type StockSnapshotResponse as c1, type ProductSelectionMediaSource as c2, type ProductDisplayMediaSource as c3, type ResolveProductSelectionMediaInput as c4, type ResolveProductSelectionMediaResult as c5, type ProductSelectionMediaPointer as c6, type RootClientWithEvents as c7, type BulkImportFulfillmentsParams as c8, type BulkImportFulfillmentsResponse as c9, CustomerOAuth as cA, type CustomerOAuthCallbackResult as cB, type CustomerOAuthConfig as cC, type CustomerOAuthTokenSet as cD, type CustomerOrderListOptions as cE, DiscountApi as cF, type DiscountApiOptions as cG, type DiscountErrorReasonCode as cH, type FeaturedImagePointerInput as cI, type GetOrderByPaymentIdParams as cJ, type LegacyProductSelectionParamEvent as cK, type ListingGroupsParams as cL, MAX_CART_LINE_ADMISSIONS as cM, type MarketDTO as cN, type MediaValue as cO, type NormalizedOptionSwatch as cP, type NormalizedProductSelection as cQ, OrderApi as cR, type OrderApiOptions as cS, type OrderByPaymentResult as cT, PRODUCT_PLP_FIND_OPTIONS as cU, PRODUCT_UPSERT_READONLY_FIELD_REASON as cV, PRODUCT_UPSERT_UNKNOWN_FIELD_REASON as cW, type PrepareFulfillmentOrderParams as cX, type PrepareFulfillmentOrderResponse as cY, ProductApi as cZ, type ProductApiOptions as c_, type CalculateShippingParams as ca, type CalculateShippingResult as cb, type CancelOrderParams as cc, type CancelOrderResponse as cd, type CancelReasonCode as ce, type CartDiscountCode as cf, type CartWarning as cg, type CartWarningCode as ch, type Comment as ci, type CommerceClientOptions as cj, type CommunityClientOptions as ck, type CommunityComment as cl, type CommunityCommentListSort as cm, type CommunityPost as cn, type CommunityPostCategory as co, type CommunityPostListSort as cp, type CommunityPostTag as cq, type CommunityPublicAuthorSnapshot as cr, type CommunityPublicMediaAsset as cs, type CommunityPublicReference as ct, type CompatibilityProductSelectionParamEvent as cu, type CreateFulfillmentParams as cv, type CreateReturnParams as cw, type CustomerAuthOptions as cx, type CustomerAuthorizationUrlInput as cy, type CustomerAuthorizationUrlResult as cz, type CustomerMembershipView as d, type ProductUpsertFieldValidationErrorReason as d$, type ProductDetailCatalogVariant as d0, type ProductDetailCategory as d1, type ProductDetailImage as d2, type ProductDetailImageMedia as d3, type ProductDetailMedia as d4, type ProductDetailOption as d5, type ProductDetailOptionValue as d6, type ProductDetailResult as d7, type ProductDetailTag as d8, type ProductDetailUnavailableReason as d9, type ProductLocaleOption as dA, type ProductLocaleReadParams as dB, type ProductLocalizedText as dC, type ProductLocalizedValue as dD, type ProductMediaResolutionSource as dE, type ProductMoneyRange as dF, type ProductOptionMatrix as dG, type ProductOptionMatrixOption as dH, type ProductOptionMatrixValue as dI, type ProductOptionMatrixVariant as dJ, type ProductOptionShape as dK, type ProductOptionValueShape as dL, type ProductOptionValueSwatch as dM, type ProductOptionValueSwatchInput as dN, type ProductPriceRange as dO, type ProductSelectionAvailableSwatch as dP, type ProductSelectionAvailableValue as dQ, type ProductSelectionByOptionValue as dR, ProductSelectionCodecError as dS, type ProductSelectionCodecOptions as dT, type ProductSelectionInput as dU, type ProductSelectionOptionValue as dV, type ProductSelectionResolution as dW, type ProductSelectionResolutionContext as dX, type ProductSelectionUrlEmit as dY, type ProductSelectionVariant$1 as dZ, type ProductUpsertFieldValidationErrorBody as d_, type ProductDetailVariant as da, type ProductDetailVariantOptionValue as db, type ProductDetailVideo as dc, type ProductFallbackLocaleOption as dd, type ProductHrefGroup as de, type ProductHrefOptions as df, type ProductHrefProduct as dg, type ProductListingCard as dh, type ProductListingCardOptions as di, type ProductListingCardPriceRange as dj, type ProductListingCardRepresentativeVariant as dk, type ProductListingGroup as dl, type ProductListingGroupCatalogSummary as dm, type ProductListingGroupCatalogVariant as dn, type ProductListingGroupProjection as dp, type ProductListingGroupSummary as dq, type ProductListingGroupVariant as dr, type ProductListingGroupsCatalogProduct as ds, type ProductListingGroupsCatalogResponse as dt, type ProductListingGroupsProduct as du, type ProductListingGroupsResponse as dv, type ProductListingPageFilters as dw, type ProductListingPageSort as dx, type ProductListingProductShape as dy, type ProductListingSwatch as dz, type CancelMembershipParams as e, type ProductVariantShape as e0, type PublicCheckoutBase as e1, type RequestOptions as e2, type ResolveCancelRefundFailedResponse as e3, type ResolveCancelRefundOutcome as e4, type ResolveCancelRefundParams as e5, type ResolveCancelRefundResponse as e6, type ResolveCancelRefundSucceededResponse as e7, type ResolveProductDisplayMediaInput as e8, type ResolveProductDisplayMediaResult as e9, getAvailableOptionValues as eA, getProductSelectionImages as eB, getSelectedValueByOptionId as eC, getVariantAvailableForSale as eD, getVariantAvailableStock as eE, isProductUpsertFieldValidationErrorBody as eF, normalizeProductSelection as eG, normalizeProductSelectionFromMatrix as eH, normalizeSelectedValueIds as eI, parseProductSelection as eJ, projectProductToListingShape as eK, resolveFeaturedImagePointer as eL, resolveProductDisplayMedia as eM, resolveProductSelection as eN, resolveProductSelectionFromMatrix as eO, resolveProductSelectionMedia as eP, resolveVariantForSelection as eQ, selectNext as eR, selectedSwatchMediaItemId as eS, stringifyProductSelection as eT, toShopifyPriceRangeV2 as eU, type ResolvedCatalogPrice as ea, type ReturnCancellationReasonCode as eb, type ReturnItem as ec, type ReturnReason as ed, type ReturnWithRefundItem as ee, type ReturnWithRefundParams as ef, ShippingApi as eg, type ShippingApiOptions as eh, type StockCheckParams as ei, type StockCheckResponse as ej, type StockCheckResult as ek, type StockSnapshotItem as el, type StockSnapshotParams as em, type UpdateFulfillmentParams as en, type UpdateOrderParams as eo, type UpdateReturnParams as ep, type ValidateDiscountParams as eq, type ValidateDiscountResult as er, type WithIdempotencyKey as es, buildProductHref as et, buildProductListingCard as eu, buildProductListingGroupProjection as ev, buildProductListingGroupsByOption as ew, buildProductOptionMatrix as ex, buildProductOptionMatrixFromDetail as ey, createProductSelectionCodec as ez, type CancelMembershipResponse as f, type ClientState as g, type ClientConfig as h, type ApiQueryOptions as i, type CancelBrowserPaymentSessionParams as j, type CartMergeParams as k, type CartMergeResult as l, type CartMineResult as m, type CartMutationResult as n, type CheckoutAbandonedReason as o, type CheckoutAmounts as p, type CheckoutOrderReference as q, type CheckoutPaymentSessionRef as r, type CheckoutShippingAddress as s, type ClearCartParams as t, type ClientMetadata as u, type ContentClientOptions as v, type CreateCartParams as w, type CreateCartResult as x, type CreateCheckoutParams as y, type CreateCheckoutResult as z };