@01.software/sdk 0.44.0 → 0.46.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 +366 -2
  2. package/MIGRATION.md +108 -10
  3. package/README.md +486 -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 +2693 -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 +2693 -345
  11. package/dist/client.js.map +1 -1
  12. package/dist/{collection-client-DWooaiTr.d.ts → collection-client-D6kKrYdq.d.ts} +8 -5
  13. package/dist/{collection-client-Dyl-CDcj.d.cts → collection-client-DolMjCoC.d.cts} +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 +2754 -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 +2754 -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 +558 -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 +558 -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 +2343 -437
  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 +2343 -437
  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-C60vHIkY.d.ts} +1134 -509
  54. package/dist/types-D5p7-m1l.d.cts +47 -0
  55. package/dist/{types-Dt9FJisi.d.ts → types-xlqBeW2N.d.cts} +1134 -509
  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 +10 -9
  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,418 @@ 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 CreateCustomPaymentSessionParams = {
2352
+ provider: string;
2353
+ checkoutToken: string;
2354
+ idempotencyKey: string;
2355
+ };
2356
+ type CustomPaymentSession = {
2357
+ id: string;
2358
+ provider: string;
2359
+ providerSessionId: string;
2360
+ money: Money;
2361
+ };
2362
+ type ConfirmCustomPaymentSessionParams = {
2363
+ provider: string;
2364
+ providerSessionId: string;
2365
+ providerPaymentId: string;
2366
+ providerEventId: string;
2367
+ /** Captured amount in the currency's minor unit. */
2368
+ amount: number;
2369
+ currency: string;
2370
+ occurredAt: string;
2371
+ };
2372
+ type ConfirmCustomPaymentSessionResponse = {
2373
+ orderId: string;
2374
+ transactionId: string;
2375
+ status: 'paid';
2376
+ alreadyConfirmed?: boolean;
2377
+ };
2378
+ type CustomPaymentSessionProof = {
2379
+ timestamp: string;
2380
+ signature: string;
2381
+ };
2382
+ type ConfirmCustomPaymentSessionOptions = {
2383
+ /** Receives the exact JSON bytes the SDK will send. Required only where the Console custom-provider policy requires HMAC. */
2384
+ createProof?: (rawBody: string) => CustomPaymentSessionProof | Promise<CustomPaymentSessionProof>;
2385
+ };
2386
+ type PaymentNextAction = {
2387
+ type: 'toss_widget';
2388
+ clientKey: string;
2389
+ paymentMethodVariantKey: string;
2390
+ agreementVariantKey: string;
2391
+ providerOrderId: string;
2392
+ providerCustomerKey: 'ANONYMOUS' | string;
2393
+ orderName: string;
2394
+ customerName?: string;
2395
+ customerEmail?: string;
2396
+ };
2397
+ type PaymentSessionRole = 'active' | 'canonical_candidate' | 'canonical' | 'residual' | 'historical';
2398
+ type PaymentProviderStatus = 'requires_payment_method' | 'requires_action' | 'requires_confirmation' | 'initializing' | 'processing' | 'authorized' | 'canceling' | 'unknown' | 'captured' | 'failed' | 'canceled';
2399
+ 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';
2400
+ type PaymentFailureReason = 'payment_declined' | 'authentication_failed' | 'authorization_expired' | 'payment_method_unavailable' | 'provider_terminal_failure' | 'unknown_provider_terminal_failure';
2401
+ type PublicCaptureEvidence = {
2402
+ amountMinor: number;
2403
+ currency: Uppercase<string>;
2404
+ observedAt: string;
2405
+ };
2406
+ type ReconciliationRequired<Reason extends string> = {
2407
+ status: 'required';
2408
+ reasons: readonly [Reason, ...Reason[]];
2409
+ };
2410
+ type PublicPaymentSessionBase = {
2411
+ id: string;
2412
+ money: Money;
2413
+ expiresAt: string | null;
2414
+ sessionRole: PaymentSessionRole;
2415
+ };
2416
+ type PublicPaymentSessionState<Action extends PaymentNextAction> = ({
2417
+ providerStatus: 'requires_payment_method' | 'requires_action';
2418
+ finalizationStatus: 'not_ready';
2419
+ reconciliation: {
2420
+ status: 'none';
2421
+ };
2422
+ order: null;
2423
+ } & ({
2424
+ sessionRole: 'active';
2425
+ presentationStatus: 'actionable';
2426
+ nextAction: Action;
2427
+ } | {
2428
+ sessionRole: 'residual';
2429
+ presentationStatus: 'suppressed';
2430
+ nextAction?: never;
2431
+ })) | {
2432
+ providerStatus: 'requires_confirmation';
2433
+ sessionRole: 'active' | 'residual';
2434
+ presentationStatus: 'suppressed';
2435
+ finalizationStatus: 'not_ready';
2436
+ nextAction?: never;
2437
+ reconciliation: {
2438
+ status: 'none';
2439
+ };
2440
+ order: null;
2441
+ } | {
2442
+ providerStatus: 'initializing' | 'processing' | 'authorized';
2443
+ sessionRole: 'active' | 'residual';
2444
+ presentationStatus: 'suppressed';
2445
+ finalizationStatus: 'not_ready';
2446
+ nextAction?: never;
2447
+ reconciliation: {
2448
+ status: 'none';
2449
+ };
2450
+ order: null;
2451
+ } | {
2452
+ providerStatus: 'canceling';
2453
+ sessionRole: 'active' | 'residual';
2454
+ presentationStatus: 'suppressed';
2455
+ finalizationStatus: 'not_ready';
2456
+ nextAction?: never;
2457
+ reconciliation: {
2458
+ status: 'none';
2459
+ };
2460
+ order: null;
2461
+ } | {
2462
+ providerStatus: 'unknown';
2463
+ sessionRole: 'active' | 'residual';
2464
+ presentationStatus: 'suppressed';
2465
+ finalizationStatus: 'not_ready';
2466
+ nextAction?: never;
2467
+ reconciliation: ReconciliationRequired<'provider_outcome_unknown'>;
2468
+ order: null;
2469
+ } | {
2470
+ providerStatus: 'captured';
2471
+ sessionRole: 'canonical_candidate' | 'residual';
2472
+ presentationStatus: 'suppressed';
2473
+ finalizationStatus: 'pending';
2474
+ nextAction?: never;
2475
+ reconciliation: {
2476
+ status: 'none';
2477
+ };
2478
+ providerEvidence: PublicCaptureEvidence;
2479
+ order: null;
2480
+ } | {
2481
+ providerStatus: 'captured';
2482
+ sessionRole: 'canonical' | 'historical';
2483
+ presentationStatus: 'suppressed';
2484
+ finalizationStatus: 'committed';
2485
+ nextAction?: never;
2486
+ reconciliation: {
2487
+ status: 'none';
2488
+ };
2489
+ providerEvidence: PublicCaptureEvidence;
2490
+ order: {
2491
+ id: string;
2492
+ orderNumber: string;
2493
+ };
2494
+ } | {
2495
+ providerStatus: 'captured';
2496
+ sessionRole: 'canonical_candidate' | 'residual';
2497
+ presentationStatus: 'suppressed';
2498
+ finalizationStatus: 'pending';
2499
+ nextAction?: never;
2500
+ reconciliation: ReconciliationRequired<'local_commit_ambiguous' | 'amount_mismatch' | 'currency_mismatch' | 'excess_capture_pending_order'>;
2501
+ providerEvidence: PublicCaptureEvidence;
2502
+ order: null;
2503
+ } | {
2504
+ providerStatus: 'captured';
2505
+ sessionRole: 'canonical' | 'residual';
2506
+ presentationStatus: 'suppressed';
2507
+ finalizationStatus: 'committed';
2508
+ nextAction?: never;
2509
+ reconciliation: ReconciliationRequired<'inventory_unavailable' | 'admission_unavailable' | 'amount_mismatch' | 'currency_mismatch' | 'excess_capture' | 'late_capture' | 'cross_checkout_duplicate'>;
2510
+ providerEvidence: PublicCaptureEvidence;
2511
+ order: {
2512
+ id: string;
2513
+ orderNumber: string;
2514
+ };
2515
+ } | {
2516
+ providerStatus: 'failed';
2517
+ sessionRole: 'historical';
2518
+ presentationStatus: 'suppressed';
2519
+ finalizationStatus: 'not_ready';
2520
+ nextAction?: never;
2521
+ providerEvidence?: never;
2522
+ cancellationReason?: never;
2523
+ reconciliation: {
2524
+ status: 'none';
2525
+ };
2526
+ failure: {
2527
+ reason: PaymentFailureReason;
2528
+ message?: string;
2529
+ };
2530
+ order: null;
2531
+ } | {
2532
+ providerStatus: 'canceled';
2533
+ sessionRole: 'historical';
2534
+ presentationStatus: 'suppressed';
2535
+ finalizationStatus: 'not_ready';
2536
+ nextAction?: never;
2537
+ providerEvidence?: never;
2538
+ failure?: never;
2539
+ cancellationReason: 'expired' | 'customer' | 'operator' | 'provider';
2540
+ reconciliation: {
2541
+ status: 'none';
2542
+ };
2543
+ order: null;
2544
+ };
2545
+ type PublicPaymentSession = PublicPaymentSessionBase & {
2546
+ provider: 'toss';
2547
+ } & PublicPaymentSessionState<PaymentNextAction>;
2548
+ declare class PaymentSessionApi extends CustomerScopedApi {
2549
+ private readonly serverTransport;
2550
+ constructor(options: PaymentSessionApiOptions);
2551
+ private post;
2552
+ private paymentSession;
2553
+ create(params: CreatePaymentSessionParams): Promise<PublicPaymentSession>;
2554
+ retrieve(params: RetrieveBrowserPaymentSessionParams | RetrieveServerPaymentSessionParams): Promise<PublicPaymentSession>;
2555
+ cancel(params: CancelBrowserPaymentSessionParams | CancelServerPaymentSessionParams): Promise<PublicPaymentSession>;
2556
+ confirm(params: ConfirmTossPaymentSessionParams): Promise<PublicPaymentSession>;
2557
+ }
2558
+
2065
2559
  interface CommerceClientOptions {
2066
2560
  publishableKey: string;
2067
2561
  apiUrl?: string;
2562
+ market?: string;
2068
2563
  customerToken: () => string | null;
2069
2564
  onUnauthorized?: () => Promise<string | null>;
2070
2565
  onRequestId?: (id: string | null) => void;
2071
2566
  customerAuth: CustomerAuth;
2072
2567
  }
2073
2568
  declare class CommerceClient {
2569
+ private readonly market?;
2074
2570
  readonly product: {
2075
2571
  stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
2076
2572
  stockSnapshot: (params: StockSnapshotParams) => Promise<StockSnapshotResponse>;
@@ -2079,22 +2575,18 @@ declare class CommerceClient {
2079
2575
  listingPage: {
2080
2576
  (params?: ProductListingPageCatalogParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem>>;
2081
2577
  };
2082
- detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
2578
+ detail: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
2083
2579
  detailCatalog: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
2084
2580
  };
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
- }>;
2581
+ readonly carts: {
2582
+ create: (params?: CreateCartParams) => Promise<CreateCartResult>;
2583
+ retrieve: (params: RetrieveCartParams) => Promise<PublicCart>;
2584
+ addItem: (params: AddItemParams) => Promise<CartMutationResult>;
2585
+ updateItem: (params: UpdateItemParams) => Promise<CartMutationResult>;
2586
+ removeItem: (params: RemoveItemParams) => Promise<CartMutationResult>;
2587
+ updateDiscountCodes: (params: UpdateDiscountCodesParams) => Promise<CartMutationResult>;
2588
+ updateAttributes: (params: UpdateCartAttributesParams) => Promise<CartMutationResult>;
2589
+ clear: (params: ClearCartParams) => Promise<CartMutationResult>;
2098
2590
  /**
2099
2591
  * Union/claim a pre-login guest cart into the authenticated customer's cart
2100
2592
  * (customer JWT required). Returns the resolved customer cart's `cartToken`
@@ -2108,9 +2600,17 @@ declare class CommerceClient {
2108
2600
  mine: () => Promise<CartMineResult>;
2109
2601
  };
2110
2602
  readonly orders: {
2111
- checkout: (params: CheckoutParams) => Promise<PublicOrder>;
2112
2603
  listMine: (options?: CustomerOrderListOptions) => Promise<PayloadFindResponse<PublicOrder>>;
2113
2604
  };
2605
+ readonly checkouts: {
2606
+ create: (params: CreateCheckoutParams) => Promise<CreateCheckoutResult>;
2607
+ retrieve: (params: RetrieveCheckoutParams) => Promise<PublicCheckout>;
2608
+ };
2609
+ readonly paymentSessions: {
2610
+ create: (params: CreatePaymentSessionParams) => Promise<PublicPaymentSession>;
2611
+ retrieve: (params: RetrieveBrowserPaymentSessionParams) => Promise<PublicPaymentSession>;
2612
+ cancel: (params: CancelBrowserPaymentSessionParams) => Promise<PublicPaymentSession>;
2613
+ };
2114
2614
  readonly discounts: {
2115
2615
  validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
2116
2616
  };
@@ -2118,6 +2618,8 @@ declare class CommerceClient {
2118
2618
  calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
2119
2619
  };
2120
2620
  constructor(options: CommerceClientOptions);
2621
+ getDefaultMarket(): string | undefined;
2622
+ private withMarket;
2121
2623
  }
2122
2624
 
2123
2625
  type StorefrontContentReference = {
@@ -2203,9 +2705,11 @@ interface ServerCommerceClientOptions {
2203
2705
  publishableKey?: string;
2204
2706
  secretKey: string;
2205
2707
  apiUrl?: string;
2708
+ market?: string;
2206
2709
  onRequestId?: (id: string | null) => void;
2207
2710
  }
2208
2711
  declare class ServerCommerceClient {
2712
+ private readonly market?;
2209
2713
  readonly product: {
2210
2714
  stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
2211
2715
  listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
@@ -2215,37 +2719,24 @@ declare class ServerCommerceClient {
2215
2719
  (params: ProductListingPageParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem> | ProductListingPageResult<ProductListingGroupsItem>>;
2216
2720
  };
2217
2721
  detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
2722
+ detailCatalog: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
2218
2723
  previewDetail: (params: ProductDetailPreviewParams, options: ProductDetailPreviewOptions) => Promise<ProductDetail | null>;
2219
2724
  upsert: (params: ProductUpsertParams) => Promise<ProductUpsertResponse>;
2220
2725
  };
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>;
2726
+ readonly carts: {
2727
+ create: (params?: CreateCartParams) => Promise<CreateCartResult>;
2728
+ retrieve: (params: RetrieveCartParams) => Promise<PublicCart>;
2729
+ addItem: (params: AddItemParams) => Promise<CartMutationResult>;
2730
+ updateItem: (params: UpdateItemParams) => Promise<CartMutationResult>;
2731
+ removeItem: (params: RemoveItemParams) => Promise<CartMutationResult>;
2732
+ updateDiscountCodes: (params: UpdateDiscountCodesParams) => Promise<CartMutationResult>;
2733
+ updateAttributes: (params: UpdateCartAttributesParams) => Promise<CartMutationResult>;
2734
+ clear: (params: ClearCartParams) => Promise<CartMutationResult>;
2735
+ merge: (params: ServerCartMergeParams) => Promise<CartMergeResult>;
2736
+ mine: (params: ServerCartMineParams) => Promise<CartMineResult>;
2241
2737
  };
2242
2738
  readonly orders: {
2243
- checkout: (params: CheckoutParams) => Promise<PublicOrder>;
2244
- create: (params: CreateOrderParams) => Promise<Order>;
2245
2739
  update: (params: UpdateOrderParams) => Promise<Order>;
2246
- updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
2247
- confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
2248
- confirmPaymentReturningOrder: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentWithOrderResult>;
2249
2740
  getByPaymentId: (params: GetOrderByPaymentIdParams) => Promise<OrderByPaymentResult>;
2250
2741
  cancelOrder: (params: CancelOrderParams) => Promise<CancelOrderResponse>;
2251
2742
  resolveCancelRefund: (params: ResolveCancelRefundParams) => Promise<ResolveCancelRefundResponse>;
@@ -2260,6 +2751,21 @@ declare class ServerCommerceClient {
2260
2751
  transaction: Transaction | null;
2261
2752
  }>;
2262
2753
  };
2754
+ readonly checkouts: {
2755
+ create: (params: CreateServerCheckoutParams) => Promise<CreateServerCheckoutResult>;
2756
+ retrieve: (params: RetrieveServerCheckoutParams) => Promise<ServerCheckout>;
2757
+ query: (params?: CheckoutQueryParams) => Promise<CheckoutQueryResult>;
2758
+ };
2759
+ readonly paymentSessions: {
2760
+ create: (params: CreatePaymentSessionParams) => Promise<PublicPaymentSession>;
2761
+ retrieve: (params: RetrieveServerPaymentSessionParams) => Promise<PublicPaymentSession>;
2762
+ cancel: (params: CancelServerPaymentSessionParams) => Promise<PublicPaymentSession>;
2763
+ confirm: (params: ConfirmTossPaymentSessionParams) => Promise<PublicPaymentSession>;
2764
+ custom: {
2765
+ create: (params: CreateCustomPaymentSessionParams) => Promise<CustomPaymentSession>;
2766
+ confirm: (params: ConfirmCustomPaymentSessionParams, options?: ConfirmCustomPaymentSessionOptions) => Promise<ConfirmCustomPaymentSessionResponse>;
2767
+ };
2768
+ };
2263
2769
  readonly discounts: {
2264
2770
  validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
2265
2771
  };
@@ -2267,6 +2773,8 @@ declare class ServerCommerceClient {
2267
2773
  calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
2268
2774
  };
2269
2775
  constructor(options: ServerCommerceClientOptions);
2776
+ getDefaultMarket(): string | undefined;
2777
+ private withMarket;
2270
2778
  }
2271
2779
 
2272
2780
  /**
@@ -2275,6 +2783,7 @@ declare class ServerCommerceClient {
2275
2783
  */
2276
2784
  declare class CustomerNamespace {
2277
2785
  readonly auth: CustomerAuth;
2786
+ readonly oauth?: CustomerOAuth;
2278
2787
  constructor(publishableKey: string, options?: CustomerAuthOptions, apiUrl?: string);
2279
2788
  }
2280
2789
 
@@ -2376,6 +2885,33 @@ interface EventsRangeResponse {
2376
2885
  hasNextPage: boolean;
2377
2886
  hasPrevPage: boolean;
2378
2887
  }
2888
+ interface EventAdmissionAvailabilityParams {
2889
+ occurrence: string;
2890
+ }
2891
+ interface EventAdmissionPricePresentment {
2892
+ amount: number;
2893
+ compareAtPrice: number | null;
2894
+ currency: string | null;
2895
+ marketId: string | null;
2896
+ }
2897
+ interface EventAdmissionAvailabilityType {
2898
+ id: string | number;
2899
+ label?: string | null;
2900
+ description?: string | null;
2901
+ eventId: string | number;
2902
+ occurrenceId: string | number;
2903
+ productId: string | number | null;
2904
+ variantId: string | number | null;
2905
+ price: EventAdmissionPricePresentment | null;
2906
+ remainingCapacityHint: number | null;
2907
+ available: boolean;
2908
+ }
2909
+ interface EventAdmissionAvailabilityResponse {
2910
+ occurrenceId: string | number;
2911
+ eventId: string | number;
2912
+ remainingCapacityHint: number | null;
2913
+ admissionTypes: EventAdmissionAvailabilityType[];
2914
+ }
2379
2915
  interface EventRegistrationAttendeeInput {
2380
2916
  name?: string;
2381
2917
  email?: string;
@@ -2432,13 +2968,81 @@ declare class EventsClient {
2432
2968
  private readonly onRequestId?;
2433
2969
  constructor(options: EventsClientOptions);
2434
2970
  getRange(params: EventsRangeParams): Promise<EventsRangeResponse>;
2971
+ getAdmissionAvailability(params: EventAdmissionAvailabilityParams): Promise<EventAdmissionAvailabilityResponse>;
2435
2972
  register(params: EventRegistrationRegisterParams): Promise<EventRegistrationRegisterResponse>;
2436
2973
  getGuestRegistration(token: string): Promise<EventGuestRegistrationResponse>;
2437
2974
  cancelGuestRegistration(token: string, params?: EventGuestCancelParams): Promise<EventGuestRegistrationResponse>;
2438
2975
  private execute;
2439
2976
  }
2440
2977
 
2978
+ /**
2979
+ * Client-safe market discovery shape (Shopify-like). Structural copy of the
2980
+ * private contracts package's `PublicMarketDTO` — the public SDK must not import
2981
+ * private contracts, so a parity `test-d` keeps the two in lockstep. The
2982
+ * `toMarketDTO` return annotation ties this shape back to the real `PublicMarket`
2983
+ * row (which the parity test alone cannot check).
2984
+ */
2985
+ type MarketDTO = {
2986
+ id: string;
2987
+ handle: string;
2988
+ name: string;
2989
+ countryCode: string;
2990
+ targetCountries: string[];
2991
+ currency: string;
2992
+ isPrimary: boolean;
2993
+ isActive: boolean;
2994
+ };
2995
+ /**
2996
+ * Minimal reader the discovery helper depends on: the shape of
2997
+ * `collections.from('markets').find`. Kept narrow so the helper is
2998
+ * transport-agnostic and unit-testable against a mock.
2999
+ */
3000
+ type MarketRowReader = (options: {
3001
+ where: Where;
3002
+ limit: number;
3003
+ }) => Promise<PayloadFindResponse<PublicMarket>>;
3004
+ interface MarketDiscoveryClient {
3005
+ /** List the tenant's active buyer markets. */
3006
+ list(): Promise<MarketDTO[]>;
3007
+ /** Resolve the tenant's default (active primary) market, or `null`. */
3008
+ default(): Promise<MarketDTO | null>;
3009
+ }
3010
+ /** Read-side helper for public market discovery. */
3011
+ declare class MarketDiscovery implements MarketDiscoveryClient {
3012
+ private readonly read;
3013
+ constructor(read: MarketRowReader);
3014
+ list(): Promise<MarketDTO[]>;
3015
+ default(): Promise<MarketDTO | null>;
3016
+ }
3017
+
2441
3018
  type TenantIntrospectionApiOptions = ServerApiOptions;
3019
+ interface TenantContextInput {
3020
+ includeCounts?: boolean;
3021
+ }
3022
+ interface TenantFieldConfigState {
3023
+ hiddenFields: string[];
3024
+ isHidden: boolean;
3025
+ }
3026
+ interface TenantContextResponse {
3027
+ tenant: {
3028
+ id: string;
3029
+ name: string;
3030
+ plan: string;
3031
+ planSource?: string;
3032
+ authoritative?: boolean;
3033
+ capabilityVersion?: string;
3034
+ };
3035
+ features: string[];
3036
+ collections: {
3037
+ active: string[];
3038
+ inactive: string[];
3039
+ };
3040
+ fieldConfigs: Record<string, TenantFieldConfigState>;
3041
+ counts?: Record<string, number>;
3042
+ config?: {
3043
+ webhookConfigured: boolean;
3044
+ };
3045
+ }
2442
3046
  type TenantFeatureProgressFeature = 'ecommerce';
2443
3047
  interface TenantFeatureProgressInput {
2444
3048
  feature: TenantFeatureProgressFeature;
@@ -2523,11 +3127,13 @@ interface CollectionSchemaResponse {
2523
3127
  };
2524
3128
  }
2525
3129
  interface TenantIntrospectionClient {
3130
+ context: (params?: TenantContextInput) => Promise<TenantContextResponse>;
2526
3131
  collectionSchema: (collection: string) => Promise<CollectionSchemaResponse>;
2527
3132
  featureProgress: (params: TenantFeatureProgressInput) => Promise<TenantFeatureProgressResponse>;
2528
3133
  }
2529
- declare class TenantIntrospectionApi extends BaseApi implements TenantIntrospectionClient {
3134
+ declare class TenantIntrospectionApi extends RawBaseApi implements TenantIntrospectionClient {
2530
3135
  constructor(options: TenantIntrospectionApiOptions);
3136
+ context(params?: TenantContextInput): Promise<TenantContextResponse>;
2531
3137
  collectionSchema(collection: string): Promise<CollectionSchemaResponse>;
2532
3138
  featureProgress(params: TenantFeatureProgressInput): Promise<TenantFeatureProgressResponse>;
2533
3139
  }
@@ -2536,23 +3142,27 @@ declare class TenantIntrospectionApi extends BaseApi implements TenantIntrospect
2536
3142
  * SDK-local hand-declarations of the membership wire contract types.
2537
3143
  *
2538
3144
  * 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.
3145
+ * contract package is private to the workspace and must not be imported at
3146
+ * runtime. These public types are structurally checked by membership
3147
+ * contract-parity type tests.
2541
3148
  */
2542
3149
  type MembershipStatus = 'incomplete' | 'trialing' | 'active' | 'past_due' | 'cancelled' | 'expired';
2543
3150
  /**
2544
3151
  * Parameters for the subscribe endpoint (delegated charge model).
2545
- * The storefront already collected the first payment; this records it and
2546
- * activates the membership.
3152
+ * The storefront already collected the first payment for non-trial plans; this
3153
+ * records it and activates the membership. Trial starts omit pgPaymentId until
3154
+ * the renewal cron sends the first delegated charge.
2547
3155
  */
2548
3156
  type SubscribeMembershipParams = {
2549
3157
  planId: string;
3158
+ priceId: string;
2550
3159
  /** Stable client-generated key used as the deduplication key for this subscription intent. */
2551
3160
  subscribeIntentKey: string;
2552
- pgPaymentId: string;
2553
- amount: number;
2554
- currency: string;
2555
- customerRef?: string;
3161
+ pgPaymentId?: string;
3162
+ /** Internal Console customer document id. */
3163
+ customerId: string;
3164
+ /** Delegated payment provider customer reference. */
3165
+ customerRef: string;
2556
3166
  card?: {
2557
3167
  last4?: string;
2558
3168
  brand?: string;
@@ -2564,8 +3174,9 @@ type SubscribeMembershipResponse = {
2564
3174
  };
2565
3175
  /**
2566
3176
  * 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.
3177
+ * Default (omit `immediate` or pass `false`) sets `cancelAtPeriodEnd`; benefits
3178
+ * persist until the last paid period end and renewals stop. Pass
3179
+ * `immediate=true` to cancel immediately and revoke groups now.
2569
3180
  */
2570
3181
  type CancelMembershipParams = {
2571
3182
  id: string;
@@ -2581,12 +3192,15 @@ type CancelMembershipResponse = {
2581
3192
  type CustomerMembershipView = {
2582
3193
  id: string;
2583
3194
  plan: string;
3195
+ price: string;
2584
3196
  status: MembershipStatus;
2585
3197
  currentPeriodEnd: string;
2586
3198
  nextBillingAt: string | null;
2587
3199
  cancelAtPeriodEnd: boolean;
2588
3200
  amount: number;
2589
3201
  currency: string;
3202
+ billingInterval: 'month' | 'year';
3203
+ intervalCount: number;
2590
3204
  card?: {
2591
3205
  last4?: string;
2592
3206
  brand?: string;
@@ -2597,26 +3211,16 @@ interface ClientConfig {
2597
3211
  publishableKey: string;
2598
3212
  /** API base URL for staging, self-hosted, preview, or proxy deployments. */
2599
3213
  apiUrl?: string;
3214
+ /**
3215
+ * Default commerce market handle/id. Applied to market-aware product and cart
3216
+ * helpers when the individual call does not provide `market`.
3217
+ */
3218
+ market?: string;
2600
3219
  /**
2601
3220
  * Customer authentication options.
2602
3221
  * Used to initialize CustomerAuth on Client.
2603
3222
  */
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
- };
3223
+ customer?: CustomerAuthOptions;
2620
3224
  }
2621
3225
  interface ClientServerConfig extends ClientConfig {
2622
3226
  secretKey: string;
@@ -2656,15 +3260,23 @@ interface PayloadMutationResponse<T = unknown> {
2656
3260
  }
2657
3261
  type Sort = string | string[];
2658
3262
  type Where = Record<string, unknown>;
3263
+ type LocaleOption = 'en' | 'ko';
3264
+ type FallbackLocaleOption = 'en' | 'ko' | 'none' | false;
2659
3265
  /**
2660
3266
  * Do NOT replace with `Pick<FindOptions>` from `payload` or import Payload
2661
3267
  * types here. Payload's generic query types depend on `PayloadTypes` module
2662
3268
  * augmentation; external SDK consumers who only use `createClient` should not
2663
3269
  * install Payload just to type REST query objects. Excluded vs native:
2664
- * Local-API-only fields, `locale`/`fallbackLocale`.
3270
+ * Local-API-only fields.
2665
3271
  */
2666
3272
  interface ApiQueryOptions {
2667
3273
  page?: number;
3274
+ /**
3275
+ * Rows per page. With a browser publishable key, raw collection reads must
3276
+ * request a bounded limit in [1, 100]: `limit: 0`, a `limit` above 100, and
3277
+ * `pagination: false` are rejected (400) rather than returning an entire
3278
+ * collection — use `page` to paginate. Server credentials are not capped.
3279
+ */
2668
3280
  limit?: number;
2669
3281
  sort?: Sort;
2670
3282
  /**
@@ -2719,12 +3331,21 @@ interface ApiQueryOptions {
2719
3331
  where?: Where;
2720
3332
  count?: boolean;
2721
3333
  } | false> | false;
2722
- /** Set to `false` to skip the count query — returns docs without totalDocs/totalPages */
3334
+ /**
3335
+ * Set to `false` to skip the count query — returns docs without
3336
+ * totalDocs/totalPages. With a browser publishable key this is rejected (400)
3337
+ * on raw collection reads (pagination cannot be disabled so the row cap
3338
+ * applies); it takes effect with server credentials.
3339
+ */
2723
3340
  pagination?: boolean;
2724
3341
  /** Include draft versions (access control still applies on the server) */
2725
3342
  draft?: boolean;
2726
3343
  /** Include soft-deleted documents (requires `trash` enabled on the collection) */
2727
3344
  trash?: boolean;
3345
+ /** Resolve localized fields for a specific locale. */
3346
+ locale?: LocaleOption;
3347
+ /** Fallback locale for missing localized values; set false to disable fallback. */
3348
+ fallbackLocale?: FallbackLocaleOption;
2728
3349
  }
2729
3350
  type ApiDeleteOptions = Pick<ApiQueryOptions, 'trash'>;
2730
3351
  type PublicReadQueryOptions = Omit<ApiQueryOptions, 'depth' | 'joins' | 'populate'> & {
@@ -2751,7 +3372,7 @@ interface RetryConfig {
2751
3372
  retryableStatuses?: number[];
2752
3373
  retryDelay?: (attempt: number) => number;
2753
3374
  }
2754
- interface RootQueryLookup<T extends string, Options extends ApiQueryOptions = ApiQueryOptions> {
3375
+ interface RootQueryLookup<T extends Collection, Options extends ApiQueryOptions = ApiQueryOptions> {
2755
3376
  find(options?: Options): Promise<PayloadFindResponse<CollectionType<T>>>;
2756
3377
  findById(id: string | number, options?: Options): Promise<CollectionType<T>>;
2757
3378
  count(options?: Options): Promise<{
@@ -2786,10 +3407,13 @@ interface RootClient {
2786
3407
  events?: EventsClient;
2787
3408
  customer: CustomerNamespace;
2788
3409
  collections: RootCollectionClient;
3410
+ markets: MarketDiscoveryClient;
2789
3411
  memberships: {
2790
3412
  me: () => Promise<CustomerMembershipView | null>;
3413
+ cancel: (params: CancelMembershipParams) => Promise<CancelMembershipResponse>;
2791
3414
  };
2792
3415
  lastRequestId: string | null;
3416
+ withMarket(market: string): RootClientWithEvents;
2793
3417
  getState(): ClientState;
2794
3418
  getConfig(): ClientConfig;
2795
3419
  }
@@ -2799,7 +3423,6 @@ interface RootServerClient {
2799
3423
  memberships: {
2800
3424
  subscribe: (params: SubscribeMembershipParams) => Promise<SubscribeMembershipResponse>;
2801
3425
  cancel: (params: CancelMembershipParams) => Promise<CancelMembershipResponse>;
2802
- me: () => Promise<CustomerMembershipView | null>;
2803
3426
  };
2804
3427
  /** Set on {@link createServerClient} return values; optional for structural mocks. */
2805
3428
  events?: EventsClient;
@@ -2812,7 +3435,9 @@ interface RootServerClient {
2812
3435
  };
2813
3436
  };
2814
3437
  collections: RootServerCollectionClient;
3438
+ markets: MarketDiscoveryClient;
2815
3439
  lastRequestId: string | null;
3440
+ withMarket(market: string): RootServerClientWithEvents;
2816
3441
  getState(): ClientState;
2817
3442
  getConfig(): Omit<ClientServerConfig, 'secretKey'>;
2818
3443
  }
@@ -2827,4 +3452,4 @@ type DeepPartial<T> = {
2827
3452
  };
2828
3453
  type ExtractArrayType<T> = T extends (infer U)[] ? U : never;
2829
3454
 
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 };
3455
+ 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 CreateServerCheckoutParams 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 ConfirmCustomPaymentSessionOptions as aW, type ConfirmCustomPaymentSessionParams as aX, type ConfirmCustomPaymentSessionResponse as aY, type ConfirmTossPaymentSessionParams as aZ, type CreateCustomPaymentSessionParams 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 ProductListingPageCatalogParams as b$, type CreateServerCheckoutResult as b0, type CustomPaymentSession as b1, type CustomPaymentSessionProof as b2, type EventAdmissionAvailabilityParams as b3, type EventAdmissionAvailabilityResponse as b4, type EventAdmissionAvailabilityType as b5, type EventAdmissionPricePresentment as b6, type EventGuestCancelParams as b7, type EventGuestRegistration as b8, type EventGuestRegistrationResponse as b9, type TenantContextResponse as bA, type TenantFeatureProgressEvidenceValue as bB, type TenantFeatureProgressFeature as bC, type TenantFeatureProgressGroup as bD, type TenantFeatureProgressInput as bE, type TenantFeatureProgressItem as bF, type TenantFeatureProgressItemState as bG, type TenantFeatureProgressResponse as bH, type TenantFeatureProgressSeverity as bI, type TenantFeatureProgressStatus as bJ, type TenantFieldConfigState as bK, TenantIntrospectionApi as bL, type TenantIntrospectionApiOptions as bM, type ApiDeleteOptions as bN, type PublicReadQueryOptions as bO, CustomerAuth as bP, type CustomerProfile as bQ, type CustomerAuthResponse as bR, type CustomerLoginData as bS, type CustomerRegisterResponse as bT, type CustomerRegisterData as bU, type CustomerRefreshResponse as bV, type UpdateProfileData as bW, type ProductListingPageParams as bX, type ProductListingPageBaseParams as bY, type ProductDetailParams as bZ, type ProductDetailCatalogResult as b_, type EventRegistrationAnswerInput as ba, type EventRegistrationAttendeeInput as bb, type EventRegistrationPublic as bc, type EventRegistrationRegisterParams as bd, type EventRegistrationRegisterResponse as be, type EventsCalendarItem as bf, type EventsClientOptions as bg, type EventsDateParam as bh, type EventsExternalSource as bi, type EventsLocation as bj, type EventsOccurrenceLocation as bk, type EventsRangeEvent as bl, type EventsRangeOccurrence as bm, type EventsRangeParams as bn, type EventsRangeResponse as bo, type EventsTaxonomyItem as bp, ModerationApi as bq, PaymentSessionApi as br, type PaymentSessionApiOptions as bs, type RetrieveServerCheckoutParams as bt, type RetrieveServerPaymentSessionParams as bu, type RootServerClient as bv, type ServerCartMergeParams as bw, type ServerCartMineParams as bx, type ServerCheckout as by, type TenantContextInput as bz, CustomerNamespace as c, PRODUCT_UPSERT_READONLY_FIELD_REASON as c$, type ProductListingPageResult as c0, type ProductListingGroupsCatalogItem as c1, type ProductListingPageFullParams as c2, type ProductListingGroupsItem as c3, BaseApi as c4, type ProductDetail as c5, type ProductDetailCatalog as c6, type StockSnapshotResponse as c7, type ProductSelectionMediaSource as c8, type ProductDisplayMediaSource as c9, type CompatibilityProductSelectionParamEvent as cA, type CreateFulfillmentParams as cB, type CreateReturnParams as cC, type CustomerAuthOptions as cD, type CustomerAuthorizationUrlInput as cE, type CustomerAuthorizationUrlResult as cF, CustomerOAuth as cG, type CustomerOAuthCallbackResult as cH, type CustomerOAuthConfig as cI, type CustomerOAuthTokenSet as cJ, type CustomerOrderListOptions as cK, DiscountApi as cL, type DiscountApiOptions as cM, type DiscountErrorReasonCode as cN, type FeaturedImagePointerInput as cO, type GetOrderByPaymentIdParams as cP, type LegacyProductSelectionParamEvent as cQ, type ListingGroupsParams as cR, MAX_CART_LINE_ADMISSIONS as cS, type MarketDTO as cT, type MediaValue as cU, type NormalizedOptionSwatch as cV, type NormalizedProductSelection as cW, OrderApi as cX, type OrderApiOptions as cY, type OrderByPaymentResult as cZ, PRODUCT_PLP_FIND_OPTIONS as c_, type ResolveProductSelectionMediaInput as ca, type ResolveProductSelectionMediaResult as cb, type ProductSelectionMediaPointer as cc, type RootClientWithEvents as cd, type BulkImportFulfillmentsParams as ce, type BulkImportFulfillmentsResponse as cf, type CalculateShippingParams as cg, type CalculateShippingResult as ch, type CancelOrderParams as ci, type CancelOrderResponse as cj, type CancelReasonCode as ck, type CartDiscountCode as cl, type CartWarning as cm, type CartWarningCode as cn, type Comment as co, type CommerceClientOptions as cp, type CommunityClientOptions as cq, type CommunityComment as cr, type CommunityCommentListSort as cs, type CommunityPost as ct, type CommunityPostCategory as cu, type CommunityPostListSort as cv, type CommunityPostTag as cw, type CommunityPublicAuthorSnapshot as cx, type CommunityPublicMediaAsset as cy, type CommunityPublicReference as cz, type CustomerMembershipView as d, type ProductSelectionOptionValue as d$, PRODUCT_UPSERT_UNKNOWN_FIELD_REASON as d0, type PrepareFulfillmentOrderParams as d1, type PrepareFulfillmentOrderResponse as d2, ProductApi as d3, type ProductApiOptions as d4, type ProductDetailBrand as d5, type ProductDetailCatalogVariant as d6, type ProductDetailCategory as d7, type ProductDetailImage as d8, type ProductDetailImageMedia as d9, type ProductListingGroupsProduct as dA, type ProductListingGroupsResponse as dB, type ProductListingPageFilters as dC, type ProductListingPageSort as dD, type ProductListingProductShape as dE, type ProductListingSwatch as dF, type ProductLocaleOption as dG, type ProductLocaleReadParams as dH, type ProductLocalizedText as dI, type ProductLocalizedValue as dJ, type ProductMediaResolutionSource as dK, type ProductMoneyRange as dL, type ProductOptionMatrix as dM, type ProductOptionMatrixOption as dN, type ProductOptionMatrixValue as dO, type ProductOptionMatrixVariant as dP, type ProductOptionShape as dQ, type ProductOptionValueShape as dR, type ProductOptionValueSwatch as dS, type ProductOptionValueSwatchInput as dT, type ProductPriceRange as dU, type ProductSelectionAvailableSwatch as dV, type ProductSelectionAvailableValue as dW, type ProductSelectionByOptionValue as dX, ProductSelectionCodecError as dY, type ProductSelectionCodecOptions as dZ, type ProductSelectionInput as d_, type ProductDetailMedia as da, type ProductDetailOption as db, type ProductDetailOptionValue as dc, type ProductDetailResult as dd, type ProductDetailTag as de, type ProductDetailUnavailableReason as df, type ProductDetailVariant as dg, type ProductDetailVariantOptionValue as dh, type ProductDetailVideo as di, type ProductFallbackLocaleOption as dj, type ProductHrefGroup as dk, type ProductHrefOptions as dl, type ProductHrefProduct as dm, type ProductListingCard as dn, type ProductListingCardOptions as dp, type ProductListingCardPriceRange as dq, type ProductListingCardRepresentativeVariant as dr, type ProductListingGroup as ds, type ProductListingGroupCatalogSummary as dt, type ProductListingGroupCatalogVariant as du, type ProductListingGroupProjection as dv, type ProductListingGroupSummary as dw, type ProductListingGroupVariant as dx, type ProductListingGroupsCatalogProduct as dy, type ProductListingGroupsCatalogResponse as dz, type CancelMembershipParams as e, type ProductSelectionResolution as e0, type ProductSelectionResolutionContext as e1, type ProductSelectionUrlEmit as e2, type ProductSelectionVariant$1 as e3, type ProductUpsertFieldValidationErrorBody as e4, type ProductUpsertFieldValidationErrorReason as e5, type ProductVariantShape as e6, type PublicCheckoutBase as e7, type RequestOptions as e8, type ResolveCancelRefundFailedResponse as e9, buildProductListingCard as eA, buildProductListingGroupProjection as eB, buildProductListingGroupsByOption as eC, buildProductOptionMatrix as eD, buildProductOptionMatrixFromDetail as eE, createProductSelectionCodec as eF, getAvailableOptionValues as eG, getProductSelectionImages as eH, getSelectedValueByOptionId as eI, getVariantAvailableForSale as eJ, getVariantAvailableStock as eK, isProductUpsertFieldValidationErrorBody as eL, normalizeProductSelection as eM, normalizeProductSelectionFromMatrix as eN, normalizeSelectedValueIds as eO, parseProductSelection as eP, projectProductToListingShape as eQ, resolveFeaturedImagePointer as eR, resolveProductDisplayMedia as eS, resolveProductSelection as eT, resolveProductSelectionFromMatrix as eU, resolveProductSelectionMedia as eV, resolveVariantForSelection as eW, selectNext as eX, selectedSwatchMediaItemId as eY, stringifyProductSelection as eZ, toShopifyPriceRangeV2 as e_, type ResolveCancelRefundOutcome as ea, type ResolveCancelRefundParams as eb, type ResolveCancelRefundResponse as ec, type ResolveCancelRefundSucceededResponse as ed, type ResolveProductDisplayMediaInput as ee, type ResolveProductDisplayMediaResult as ef, type ResolvedCatalogPrice as eg, type ReturnCancellationReasonCode as eh, type ReturnItem as ei, type ReturnReason as ej, type ReturnWithRefundItem as ek, type ReturnWithRefundParams as el, ShippingApi as em, type ShippingApiOptions as en, type StockCheckParams as eo, type StockCheckResponse as ep, type StockCheckResult as eq, type StockSnapshotItem as er, type StockSnapshotParams as es, type UpdateFulfillmentParams as et, type UpdateOrderParams as eu, type UpdateReturnParams as ev, type ValidateDiscountParams as ew, type ValidateDiscountResult as ex, type WithIdempotencyKey as ey, buildProductHref 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 };