@omni-commerce/sdk 0.21.0 → 0.22.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.
package/dist/index.d.cts CHANGED
@@ -2009,6 +2009,10 @@ interface paths {
2009
2009
  * ### Stock and variants
2010
2010
  *
2011
2011
  * Rows are in `items`. Read catalog stock from `items[].stockQuantity`: parent rows already aggregate their non-deleted variants, and virtual bundles use component availability with any manual cap. Null means unknown, not zero. A row with `variantCount` above 0 has variants; fetch them from `GET /api/v1/products/{productId}`. List rows do not contain `inventoryQuantity`, `inventory.quantity`, or an embedded `variants` array.
2012
+ *
2013
+ * ### Duplicate discovery and merge
2014
+ *
2015
+ * Use status=duplicates, duplicateType=sku and detail=full for exact-SKU candidates. Each root row includes duplicateMatches with peer productIds, names, SKUs and match reasons. Follow pagination; detail=summary omits this evidence. Start or refresh the saved scan with products.scanDuplicates and inspect products.getDuplicateScan. Combine each root ID with its exact_sku peer IDs, deduplicate, then call products.previewDuplicateMerge with 2–20 productIds. Inspect every group's masterSelections: a sole allowed product must stay master; multiple allowed products leave the content/price/stock choice to the seller. Preview again with masterProductIds, review all listings, then call products.mergeDuplicates with the reviewed expectedGroups. Content similarity alone is not permission to merge. See /guides/merge-marketplace-listings for CLI and SDK examples.
2012
2016
  */
2013
2017
  get: operations["get_v1_products"];
2014
2018
  put?: never;
@@ -2454,6 +2458,98 @@ interface paths {
2454
2458
  patch?: never;
2455
2459
  trace?: never;
2456
2460
  };
2461
+ "/api/v1/products/duplicates/merge": {
2462
+ parameters: {
2463
+ query?: never;
2464
+ header?: never;
2465
+ path?: never;
2466
+ cookie?: never;
2467
+ };
2468
+ get?: never;
2469
+ put?: never;
2470
+ /**
2471
+ * Merge Duplicate Products
2472
+ * @description Merge exact-SKU duplicate products into one master product per group. The master keeps its content, images, price and stock; the group's other products are archived into it, and orders, reviews, promotions and other catalog references move to the master.
2473
+ *
2474
+ * All marketplace listings move to the master, including listings in other stores of the same marketplace. Different listing identities in the same store block the group. No marketplace listing is delisted, rewritten or republished.
2475
+ *
2476
+ * Each group commits independently; the response lists every group's outcome. Sources with inventory history or immutable order composition snapshots must be reconciled before archiving so returns and stock replays keep their targets.
2477
+ *
2478
+ * Supports every OmniCommerce marketplace. Variant families, bundles and products in different currencies cannot be merged. A stock-connected product may be kept as master; it cannot be archived into another product. Use preview masterSelections to choose an allowed master.
2479
+ *
2480
+ * ### Authorization
2481
+ *
2482
+ * Requires `catalog:write`. This is a catalog operation with no remote marketplace writes.
2483
+ *
2484
+ * ### Limits
2485
+ *
2486
+ * 2–20 products and up to 10 groups per request. Pin a reviewed preview with `expectedGroups` to refuse groups that changed since.
2487
+ *
2488
+ * Set dryRun=true to simulate the same transaction and roll it back. The response has data.dryRun=true; succeededCount/failedCount count validation outcomes, mergedProductIds is empty and wouldMergeProductIds lists the planned sources. No product update events or duplicate scan refreshes are emitted. A successful simulation is not a saved merge; real execution validates current data again.
2489
+ */
2490
+ post: operations["post_v1_products_duplicates_merge"];
2491
+ delete?: never;
2492
+ options?: never;
2493
+ head?: never;
2494
+ patch?: never;
2495
+ trace?: never;
2496
+ };
2497
+ "/api/v1/products/duplicates/merge-preview": {
2498
+ parameters: {
2499
+ query?: never;
2500
+ header?: never;
2501
+ path?: never;
2502
+ cookie?: never;
2503
+ };
2504
+ get?: never;
2505
+ put?: never;
2506
+ /**
2507
+ * Preview Duplicate Product Merge
2508
+ * @description Read-only preview of merging duplicate catalog products into one master product. Uses the same contract and rules as `POST /api/v1/products/duplicates/merge` and the assistant's Fix Listing Duplicates tool.
2509
+ *
2510
+ * Products are grouped by exact SKU. Each group shows its master (first in `productIds`), every product's marketplace listings per store with live status. A blocked group reports its `error`; nothing is changed.
2511
+ *
2512
+ * Supports every OmniCommerce marketplace. All marketplace listings are preserved. Different listing identities in the same store block that group; the merge never delists listings.
2513
+ *
2514
+ * Discover candidates with `GET /api/v1/products?status=duplicates&duplicateType=sku&detail=full`. Refresh the saved scan through `POST /api/v1/products/duplicates/scan` when needed. Each group's `masterSelections[]` contains productId, allowed and a seller-facing note, matching the UI's enabled/disabled master choices. A sole allowed choice must be master to retain stock connections. No allowed choices means the group cannot merge. Several allowed choices require deciding which product's content, price and stock to keep; no universal best master is inferred.
2515
+ *
2516
+ * A preview can return HTTP 200 with ok=false and still provide usable groups/masterSelections. For stock_source_requires_master, choose an allowed master and preview again. Once every selected group succeeds, pass the reviewed groups' productIds (master first) and sku as expectedGroups to merge. Preview is read-only and does not publish to marketplaces.
2517
+ *
2518
+ * ### Authorization
2519
+ *
2520
+ * Requires `catalog:read`.
2521
+ */
2522
+ post: operations["post_v1_products_duplicates_merge_preview"];
2523
+ delete?: never;
2524
+ options?: never;
2525
+ head?: never;
2526
+ patch?: never;
2527
+ trace?: never;
2528
+ };
2529
+ "/api/v1/products/duplicates/scan": {
2530
+ parameters: {
2531
+ query?: never;
2532
+ header?: never;
2533
+ path?: never;
2534
+ cookie?: never;
2535
+ };
2536
+ /**
2537
+ * Get Duplicate Scan
2538
+ * @description Read the same organization-scoped duplicate scan status as Products → Check duplicates. Requires catalog:read. queued/running means the durable scan is still in progress; failed includes errorMessage. completed exposes computedAt and the number of duplicate products. Results are read through products.list with status=duplicates and detail=full. The shared UI scan currently examines at most the 5,000 most recently updated non-archived root products; a completed scan is not proof that a larger catalog has been fully examined.
2539
+ */
2540
+ get: operations["get_v1_products_duplicates_scan"];
2541
+ put?: never;
2542
+ /**
2543
+ * Scan Duplicate Products
2544
+ * @description Start the existing durable organization duplicate scan, equivalent to Products → Check duplicates. Requires catalog:write. An already queued/running scan is reused. This only refreshes duplicate evidence; it does not merge, publish or delist products. Read completion with products.getDuplicateScan, then list status=duplicates, duplicateType=sku, detail=full and page all matching results before previewing a merge. Uses the same 5,000-candidate scan limit as the UI.
2545
+ */
2546
+ post: operations["post_v1_products_duplicates_scan"];
2547
+ delete?: never;
2548
+ options?: never;
2549
+ head?: never;
2550
+ patch?: never;
2551
+ trace?: never;
2552
+ };
2457
2553
  "/api/v1/products/enrich": {
2458
2554
  parameters: {
2459
2555
  query?: never;
@@ -19995,6 +20091,82 @@ interface operations {
19995
20091
  createdAt?: string | null;
19996
20092
  updatedAt?: string | null;
19997
20093
  publishedAt?: string | null;
20094
+ /** @description Duplicate peers and evidence on status=duplicates with detail=full. Combine the root id with peer productIds, deduplicate, and review exact-SKU targets through the merge preview. Content/variant matches alone do not establish merge compatibility. Follow pagination for every result in the selected scope. */
20095
+ duplicateMatches?: {
20096
+ productId: string;
20097
+ name: string;
20098
+ sku: string | null;
20099
+ score: number;
20100
+ reasons: string[];
20101
+ liveOnSameStore?: boolean;
20102
+ imageUrl?: string | null;
20103
+ matchedViaProductName?: string;
20104
+ product?: {
20105
+ /** Format: uuid */
20106
+ id: string;
20107
+ name: string;
20108
+ sku: string | null;
20109
+ /** Format: uuid */
20110
+ parentId: string | null;
20111
+ isVariant: boolean;
20112
+ /** @description Catalog stock in whole units, matching the Products page. Parent rows aggregate non-deleted variants in the same organization; virtual bundles derive stock from components and any manual cap. Null means unknown: never substitute zero for missing or null stock. This is not a sum of marketplace inventory mirrors or a per-location available-to-promise balance. */
20113
+ stockQuantity: number | null;
20114
+ /** @description Number of non-deleted variants; greater than 0 means the product has variants. A parent row's stockQuantity already includes their stock. Read the variants themselves from `GET /api/v1/products/{productId}`. */
20115
+ variantCount: number;
20116
+ status?: string;
20117
+ /** @description Read-only product-wide state. Lifecycle status and derived quality/error signals are independent; this field is recalculated from current product, marketplace QC, and review flags. */
20118
+ statusFacets?: {
20119
+ /** @enum {string} */
20120
+ lifecycle:
20121
+ | "draft"
20122
+ | "active"
20123
+ | "archived"
20124
+ | "deleted"
20125
+ | "unknown";
20126
+ derived: (
20127
+ | "flagged"
20128
+ | "errors"
20129
+ | "qc_pending"
20130
+ | "qc_rejected"
20131
+ )[];
20132
+ zaloraQualityControl?: Record<string, never>;
20133
+ };
20134
+ currency?: string | null;
20135
+ price?: number | null;
20136
+ priceMax?: number | null;
20137
+ salePrice?: number | null;
20138
+ marketplacePricing?: {
20139
+ ranges?: {
20140
+ currency: string;
20141
+ min: number;
20142
+ max: number;
20143
+ }[];
20144
+ channels?: {
20145
+ key?: string;
20146
+ platform?: string;
20147
+ storeId?: string | null;
20148
+ country?: string | null;
20149
+ currency?: string;
20150
+ min?: number | null;
20151
+ max?: number | null;
20152
+ /** @enum {string} */
20153
+ source?: "price_book" | "canonical";
20154
+ error?: string | null;
20155
+ }[];
20156
+ };
20157
+ marketplaces?: {
20158
+ marketplace?: string;
20159
+ country?: string | null;
20160
+ storeId?: string | null;
20161
+ published?: boolean;
20162
+ itemId?: string | null;
20163
+ listingUrl?: string | null;
20164
+ }[];
20165
+ createdAt?: string | null;
20166
+ updatedAt?: string | null;
20167
+ publishedAt?: string | null;
20168
+ };
20169
+ }[];
19998
20170
  }[];
19999
20171
  hasMore?: boolean;
20000
20172
  nextOffset?: number;
@@ -20859,6 +21031,82 @@ interface operations {
20859
21031
  createdAt?: string | null;
20860
21032
  updatedAt?: string | null;
20861
21033
  publishedAt?: string | null;
21034
+ /** @description Duplicate peers and evidence on status=duplicates with detail=full. Combine the root id with peer productIds, deduplicate, and review exact-SKU targets through the merge preview. Content/variant matches alone do not establish merge compatibility. Follow pagination for every result in the selected scope. */
21035
+ duplicateMatches?: {
21036
+ productId: string;
21037
+ name: string;
21038
+ sku: string | null;
21039
+ score: number;
21040
+ reasons: string[];
21041
+ liveOnSameStore?: boolean;
21042
+ imageUrl?: string | null;
21043
+ matchedViaProductName?: string;
21044
+ product?: {
21045
+ /** Format: uuid */
21046
+ id: string;
21047
+ name: string;
21048
+ sku: string | null;
21049
+ /** Format: uuid */
21050
+ parentId: string | null;
21051
+ isVariant: boolean;
21052
+ /** @description Catalog stock in whole units, matching the Products page. Parent rows aggregate non-deleted variants in the same organization; virtual bundles derive stock from components and any manual cap. Null means unknown: never substitute zero for missing or null stock. This is not a sum of marketplace inventory mirrors or a per-location available-to-promise balance. */
21053
+ stockQuantity: number | null;
21054
+ /** @description Number of non-deleted variants; greater than 0 means the product has variants. A parent row's stockQuantity already includes their stock. Read the variants themselves from `GET /api/v1/products/{productId}`. */
21055
+ variantCount: number;
21056
+ status?: string;
21057
+ /** @description Read-only product-wide state. Lifecycle status and derived quality/error signals are independent; this field is recalculated from current product, marketplace QC, and review flags. */
21058
+ statusFacets?: {
21059
+ /** @enum {string} */
21060
+ lifecycle:
21061
+ | "draft"
21062
+ | "active"
21063
+ | "archived"
21064
+ | "deleted"
21065
+ | "unknown";
21066
+ derived: (
21067
+ | "flagged"
21068
+ | "errors"
21069
+ | "qc_pending"
21070
+ | "qc_rejected"
21071
+ )[];
21072
+ zaloraQualityControl?: Record<string, never>;
21073
+ };
21074
+ currency?: string | null;
21075
+ price?: number | null;
21076
+ priceMax?: number | null;
21077
+ salePrice?: number | null;
21078
+ marketplacePricing?: {
21079
+ ranges?: {
21080
+ currency: string;
21081
+ min: number;
21082
+ max: number;
21083
+ }[];
21084
+ channels?: {
21085
+ key?: string;
21086
+ platform?: string;
21087
+ storeId?: string | null;
21088
+ country?: string | null;
21089
+ currency?: string;
21090
+ min?: number | null;
21091
+ max?: number | null;
21092
+ /** @enum {string} */
21093
+ source?: "price_book" | "canonical";
21094
+ error?: string | null;
21095
+ }[];
21096
+ };
21097
+ marketplaces?: {
21098
+ marketplace?: string;
21099
+ country?: string | null;
21100
+ storeId?: string | null;
21101
+ published?: boolean;
21102
+ itemId?: string | null;
21103
+ listingUrl?: string | null;
21104
+ }[];
21105
+ createdAt?: string | null;
21106
+ updatedAt?: string | null;
21107
+ publishedAt?: string | null;
21108
+ };
21109
+ }[];
20862
21110
  } & {
20863
21111
  /** @description Option values that identify the variant, for example `{ "Color": "Navy", "Size": "M" }`. */
20864
21112
  variationAttributes?: {
@@ -23435,6 +23683,460 @@ interface operations {
23435
23683
  };
23436
23684
  };
23437
23685
  };
23686
+ post_v1_products_duplicates_merge: {
23687
+ parameters: {
23688
+ query?: never;
23689
+ header?: never;
23690
+ path?: never;
23691
+ cookie?: never;
23692
+ };
23693
+ requestBody: {
23694
+ content: {
23695
+ /**
23696
+ * @example {
23697
+ * "productIds": [
23698
+ * "4d3c2b1a-0000-4000-8000-000000000001",
23699
+ * "4d3c2b1a-0000-4000-8000-000000000002"
23700
+ * ],
23701
+ * "masterProductIds": [
23702
+ * "4d3c2b1a-0000-4000-8000-000000000002"
23703
+ * ]
23704
+ * }
23705
+ */
23706
+ "application/json": {
23707
+ /** @description True runs the same merge transaction and rolls it back, including database reference/constraint validation. No product changes are saved, no mutation events or duplicate refreshes run, and marketplace listings stay unchanged. Requires catalog:write. Omitted/false performs the reviewed merge. This differs from CLI --dry-run, which only prints a request. */
23708
+ dryRun?: boolean;
23709
+ /** @description Required only for session-authenticated calls. API credentials use their own organization. */
23710
+ organizationId?: string;
23711
+ /** @description Ordered standalone catalog product IDs. Products are grouped by exact SKU; each group merges into one master. */
23712
+ productIds: string[];
23713
+ /** @description Optional master per SKU group, chosen from productIds; at most one per group. Defaults to the first requested product of each group. The master keeps its content, images, price and stock. */
23714
+ masterProductIds?: string[];
23715
+ /** @description Optional groups from a preview to pin: membership, master (first product) and SKU. Groups that changed or are omitted are not merged. */
23716
+ expectedGroups?: {
23717
+ productIds: string[];
23718
+ sku: string;
23719
+ }[];
23720
+ explanation?: string;
23721
+ };
23722
+ };
23723
+ };
23724
+ responses: {
23725
+ /** @description Batch processed. `data` holds `groups[]` (with `survivingProductId`, `mergedProductIds`, `error`), ordered per-product `items[]`, `succeededCount` and `failedCount`. `ok` is true only when every group merged. */
23726
+ 200: {
23727
+ headers: {
23728
+ [name: string]: unknown;
23729
+ };
23730
+ content: {
23731
+ "application/json": {
23732
+ ok: boolean;
23733
+ apiVersion: string;
23734
+ operationId: string;
23735
+ /** @enum {string} */
23736
+ status: "accepted" | "completed" | "failed";
23737
+ data: {
23738
+ success: boolean;
23739
+ dryRun?: boolean;
23740
+ productIds: string[];
23741
+ survivingProductId?: string;
23742
+ survivingProductIds?: string[];
23743
+ mergedProductIds?: string[];
23744
+ wouldMergeProductIds?: string[];
23745
+ groups?: {
23746
+ productIds: string[];
23747
+ success: boolean;
23748
+ survivingProductId?: string;
23749
+ mergedProductIds?: string[];
23750
+ wouldMergeProductIds?: string[];
23751
+ error?: string;
23752
+ }[];
23753
+ succeededCount: number;
23754
+ failedCount: number;
23755
+ items: {
23756
+ productId: string;
23757
+ success: boolean;
23758
+ survivingProductId?: string;
23759
+ /** @enum {string} */
23760
+ disposition?: "survivor" | "merged";
23761
+ error?: string;
23762
+ }[];
23763
+ message?: string;
23764
+ error?: string;
23765
+ explanation?: string;
23766
+ };
23767
+ error?: string;
23768
+ warnings: string[];
23769
+ recommendations: string[];
23770
+ links: {
23771
+ [key: string]: string;
23772
+ };
23773
+ };
23774
+ };
23775
+ };
23776
+ /** @description Invalid payload. */
23777
+ 400: {
23778
+ headers: {
23779
+ [name: string]: unknown;
23780
+ };
23781
+ content?: never;
23782
+ };
23783
+ /** @description Unauthorized */
23784
+ 401: {
23785
+ headers: {
23786
+ [name: string]: unknown;
23787
+ };
23788
+ content?: never;
23789
+ };
23790
+ /** @description Credential lacks catalog:write. */
23791
+ 403: {
23792
+ headers: {
23793
+ [name: string]: unknown;
23794
+ };
23795
+ content?: never;
23796
+ };
23797
+ /** @description Internal Server Error */
23798
+ 500: {
23799
+ headers: {
23800
+ [name: string]: unknown;
23801
+ };
23802
+ content?: never;
23803
+ };
23804
+ };
23805
+ };
23806
+ post_v1_products_duplicates_merge_preview: {
23807
+ parameters: {
23808
+ query?: never;
23809
+ header?: never;
23810
+ path?: never;
23811
+ cookie?: never;
23812
+ };
23813
+ requestBody: {
23814
+ content: {
23815
+ /**
23816
+ * @example {
23817
+ * "productIds": [
23818
+ * "4d3c2b1a-0000-4000-8000-000000000001",
23819
+ * "4d3c2b1a-0000-4000-8000-000000000002"
23820
+ * ],
23821
+ * "masterProductIds": [
23822
+ * "4d3c2b1a-0000-4000-8000-000000000002"
23823
+ * ]
23824
+ * }
23825
+ */
23826
+ "application/json": {
23827
+ /** @description True runs the same merge transaction and rolls it back, including database reference/constraint validation. No product changes are saved, no mutation events or duplicate refreshes run, and marketplace listings stay unchanged. Requires catalog:write. Omitted/false performs the reviewed merge. This differs from CLI --dry-run, which only prints a request. */
23828
+ dryRun?: boolean;
23829
+ /** @description Required only for session-authenticated calls. API credentials use their own organization. */
23830
+ organizationId?: string;
23831
+ /** @description Ordered standalone catalog product IDs. Products are grouped by exact SKU; each group merges into one master. */
23832
+ productIds: string[];
23833
+ /** @description Optional master per SKU group, chosen from productIds; at most one per group. Defaults to the first requested product of each group. The master keeps its content, images, price and stock. */
23834
+ masterProductIds?: string[];
23835
+ /** @description Optional groups from a preview to pin: membership, master (first product) and SKU. Groups that changed or are omitted are not merged. */
23836
+ expectedGroups?: {
23837
+ productIds: string[];
23838
+ sku: string;
23839
+ }[];
23840
+ explanation?: string;
23841
+ };
23842
+ };
23843
+ };
23844
+ responses: {
23845
+ /** @description Read-only preview, including product details, per-store listings and structured master eligibility. ok=false is a domain-level block; inspect data.groups even then. */
23846
+ 200: {
23847
+ headers: {
23848
+ [name: string]: unknown;
23849
+ };
23850
+ content: {
23851
+ "application/json": {
23852
+ ok: boolean;
23853
+ apiVersion: string;
23854
+ operationId: string;
23855
+ /** @enum {string} */
23856
+ status: "accepted" | "completed" | "failed";
23857
+ data: {
23858
+ success: boolean;
23859
+ productIds: string[];
23860
+ survivingProductId: string | null;
23861
+ products: {
23862
+ productId: string;
23863
+ name: string;
23864
+ sku: string | null;
23865
+ imageUrl: string | null;
23866
+ price: string | null;
23867
+ currency: string | null;
23868
+ inventoryQuantity: number | null;
23869
+ marketplaces: {
23870
+ /** @enum {string} */
23871
+ platform:
23872
+ | "shopee"
23873
+ | "lazada"
23874
+ | "tiktok"
23875
+ | "shopify"
23876
+ | "whatsapp"
23877
+ | "zalora"
23878
+ | "amazon"
23879
+ | "ebay";
23880
+ storeId: string | null;
23881
+ itemId: string | null;
23882
+ live: boolean;
23883
+ }[];
23884
+ }[];
23885
+ error?: string;
23886
+ groups: {
23887
+ success: boolean;
23888
+ productIds: string[];
23889
+ survivingProductId: string | null;
23890
+ products: {
23891
+ productId: string;
23892
+ name: string;
23893
+ sku: string | null;
23894
+ imageUrl: string | null;
23895
+ price: string | null;
23896
+ currency: string | null;
23897
+ inventoryQuantity: number | null;
23898
+ marketplaces: {
23899
+ /** @enum {string} */
23900
+ platform:
23901
+ | "shopee"
23902
+ | "lazada"
23903
+ | "tiktok"
23904
+ | "shopify"
23905
+ | "whatsapp"
23906
+ | "zalora"
23907
+ | "amazon"
23908
+ | "ebay";
23909
+ storeId: string | null;
23910
+ itemId: string | null;
23911
+ live: boolean;
23912
+ }[];
23913
+ }[];
23914
+ error?: string;
23915
+ sku: string | null;
23916
+ masterSelections?: {
23917
+ productId: string;
23918
+ allowed: boolean;
23919
+ note: string | null;
23920
+ }[];
23921
+ /** @constant */
23922
+ errorCode?: "stock_source_requires_master";
23923
+ }[];
23924
+ };
23925
+ error?: string;
23926
+ warnings: string[];
23927
+ recommendations: string[];
23928
+ links: {
23929
+ [key: string]: string;
23930
+ };
23931
+ };
23932
+ };
23933
+ };
23934
+ /** @description Invalid payload. */
23935
+ 400: {
23936
+ headers: {
23937
+ [name: string]: unknown;
23938
+ };
23939
+ content?: never;
23940
+ };
23941
+ /** @description Unauthorized */
23942
+ 401: {
23943
+ headers: {
23944
+ [name: string]: unknown;
23945
+ };
23946
+ content?: never;
23947
+ };
23948
+ /** @description Credential lacks catalog:read. */
23949
+ 403: {
23950
+ headers: {
23951
+ [name: string]: unknown;
23952
+ };
23953
+ content?: never;
23954
+ };
23955
+ /** @description Internal Server Error */
23956
+ 500: {
23957
+ headers: {
23958
+ [name: string]: unknown;
23959
+ };
23960
+ content?: never;
23961
+ };
23962
+ };
23963
+ };
23964
+ get_v1_products_duplicates_scan: {
23965
+ parameters: {
23966
+ query?: {
23967
+ /** @description Session-authenticated scope only; API credentials use their own organization. */
23968
+ organizationId?: string;
23969
+ };
23970
+ header?: never;
23971
+ path?: never;
23972
+ cookie?: never;
23973
+ };
23974
+ requestBody?: never;
23975
+ responses: {
23976
+ /** @description Current saved scan status. */
23977
+ 200: {
23978
+ headers: {
23979
+ [name: string]: unknown;
23980
+ };
23981
+ content: {
23982
+ "application/json": {
23983
+ ok: boolean;
23984
+ apiVersion: string;
23985
+ operationId: string;
23986
+ /** @enum {string} */
23987
+ status: "accepted" | "completed" | "failed";
23988
+ data: {
23989
+ /** @enum {string} */
23990
+ status: "idle" | "queued" | "running" | "completed" | "failed";
23991
+ productCount: number;
23992
+ computedAt: string | null;
23993
+ requestedAt: string | null;
23994
+ errorMessage: string | null;
23995
+ };
23996
+ error?: string;
23997
+ warnings: string[];
23998
+ recommendations: string[];
23999
+ links: {
24000
+ [key: string]: string;
24001
+ };
24002
+ };
24003
+ };
24004
+ };
24005
+ /** @description Invalid request. */
24006
+ 400: {
24007
+ headers: {
24008
+ [name: string]: unknown;
24009
+ };
24010
+ content?: never;
24011
+ };
24012
+ /** @description Unauthorized */
24013
+ 401: {
24014
+ headers: {
24015
+ [name: string]: unknown;
24016
+ };
24017
+ content?: never;
24018
+ };
24019
+ /** @description Credential lacks catalog:read. */
24020
+ 403: {
24021
+ headers: {
24022
+ [name: string]: unknown;
24023
+ };
24024
+ content?: never;
24025
+ };
24026
+ /** @description Could not read scan status. */
24027
+ 500: {
24028
+ headers: {
24029
+ [name: string]: unknown;
24030
+ };
24031
+ content?: never;
24032
+ };
24033
+ };
24034
+ };
24035
+ post_v1_products_duplicates_scan: {
24036
+ parameters: {
24037
+ query?: never;
24038
+ header?: never;
24039
+ path?: never;
24040
+ cookie?: never;
24041
+ };
24042
+ requestBody: {
24043
+ content: {
24044
+ /** @example {} */
24045
+ "application/json": {
24046
+ /** @description Required for session authentication; API credentials use their own organization. */
24047
+ organizationId?: string;
24048
+ };
24049
+ };
24050
+ };
24051
+ responses: {
24052
+ /** @description Scan status. */
24053
+ 200: {
24054
+ headers: {
24055
+ [name: string]: unknown;
24056
+ };
24057
+ content: {
24058
+ "application/json": {
24059
+ ok: boolean;
24060
+ apiVersion: string;
24061
+ operationId: string;
24062
+ /** @enum {string} */
24063
+ status: "accepted" | "completed" | "failed";
24064
+ data: {
24065
+ /** @enum {string} */
24066
+ status: "idle" | "queued" | "running" | "completed" | "failed";
24067
+ productCount: number;
24068
+ computedAt: string | null;
24069
+ requestedAt: string | null;
24070
+ errorMessage: string | null;
24071
+ };
24072
+ error?: string;
24073
+ warnings: string[];
24074
+ recommendations: string[];
24075
+ links: {
24076
+ [key: string]: string;
24077
+ };
24078
+ };
24079
+ };
24080
+ };
24081
+ /** @description Durable scan queued or already running. */
24082
+ 202: {
24083
+ headers: {
24084
+ [name: string]: unknown;
24085
+ };
24086
+ content: {
24087
+ "application/json": {
24088
+ ok: boolean;
24089
+ apiVersion: string;
24090
+ operationId: string;
24091
+ /** @enum {string} */
24092
+ status: "accepted" | "completed" | "failed";
24093
+ data: {
24094
+ /** @enum {string} */
24095
+ status: "idle" | "queued" | "running" | "completed" | "failed";
24096
+ productCount: number;
24097
+ computedAt: string | null;
24098
+ requestedAt: string | null;
24099
+ errorMessage: string | null;
24100
+ };
24101
+ error?: string;
24102
+ warnings: string[];
24103
+ recommendations: string[];
24104
+ links: {
24105
+ [key: string]: string;
24106
+ };
24107
+ };
24108
+ };
24109
+ };
24110
+ /** @description Invalid request. */
24111
+ 400: {
24112
+ headers: {
24113
+ [name: string]: unknown;
24114
+ };
24115
+ content?: never;
24116
+ };
24117
+ /** @description Unauthorized */
24118
+ 401: {
24119
+ headers: {
24120
+ [name: string]: unknown;
24121
+ };
24122
+ content?: never;
24123
+ };
24124
+ /** @description Credential lacks catalog:write. */
24125
+ 403: {
24126
+ headers: {
24127
+ [name: string]: unknown;
24128
+ };
24129
+ content?: never;
24130
+ };
24131
+ /** @description Could not queue the scan. */
24132
+ 500: {
24133
+ headers: {
24134
+ [name: string]: unknown;
24135
+ };
24136
+ content?: never;
24137
+ };
24138
+ };
24139
+ };
23438
24140
  post_v1_products_enrich: {
23439
24141
  parameters: {
23440
24142
  query?: never;
@@ -31501,6 +32203,10 @@ declare class ProductsClient {
31501
32203
  ### Stock and variants
31502
32204
 
31503
32205
  Rows are in `items`. Read catalog stock from `items[].stockQuantity`: parent rows already aggregate their non-deleted variants, and virtual bundles use component availability with any manual cap. Null means unknown, not zero. A row with `variantCount` above 0 has variants; fetch them from `GET /api/v1/products/{productId}`. List rows do not contain `inventoryQuantity`, `inventory.quantity`, or an embedded `variants` array.
32206
+
32207
+ ### Duplicate discovery and merge
32208
+
32209
+ Use status=duplicates, duplicateType=sku and detail=full for exact-SKU candidates. Each root ro
31504
32210
  *
31505
32211
  * `GET /api/v1/products`
31506
32212
  */
@@ -31752,6 +32458,50 @@ declare class ProductsClient {
31752
32458
  * `GET /api/v1/products/count`
31753
32459
  */
31754
32460
  count(request?: OperationQuery<operations["get_v1_products_count"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["get_v1_products_count"]>>;
32461
+ /**
32462
+ * Merge Duplicate Products
32463
+ *
32464
+ * Merge exact-SKU duplicate products into one master product per group. The master keeps its content, images, price and stock; the group's other products are archived into it, and orders, reviews, promotions and other catalog references move to the master.
32465
+
32466
+ All marketplace listings move to the master, including listings in other stores of the same marketplace. Different listing identities in the same store block the group. No marketplace listing is delisted, rewritten or republished.
32467
+
32468
+ Each group commits independently; the response lists every group's outcome. Sources with inventory history or immutable order composition snapshots must be reconciled before archiving so returns and stock replays keep their targets.
32469
+
32470
+ Supports every OmniCommerce marketplace. Variant families, bundles and product
32471
+ *
32472
+ * `POST /api/v1/products/duplicates/merge`
32473
+ */
32474
+ mergeDuplicates(request: OperationBody<operations["post_v1_products_duplicates_merge"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_products_duplicates_merge"]>>;
32475
+ /**
32476
+ * Preview Duplicate Product Merge
32477
+ *
32478
+ * Read-only preview of merging duplicate catalog products into one master product. Uses the same contract and rules as `POST /api/v1/products/duplicates/merge` and the assistant's Fix Listing Duplicates tool.
32479
+
32480
+ Products are grouped by exact SKU. Each group shows its master (first in `productIds`), every product's marketplace listings per store with live status. A blocked group reports its `error`; nothing is changed.
32481
+
32482
+ Supports every OmniCommerce marketplace. All marketplace listings are preserved. Different listing identities in the same store block that group; the merge never delists listings.
32483
+
32484
+ Discover candidates with `GET /api/v1/products?status=duplicates&duplicateType=sku&detail=full`. Refresh the saved scan through `POST /api/v1/products/duplicates/scan` when needed. Each group's `maste
32485
+ *
32486
+ * `POST /api/v1/products/duplicates/merge-preview`
32487
+ */
32488
+ previewDuplicateMerge(request: OperationBody<operations["post_v1_products_duplicates_merge_preview"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_products_duplicates_merge_preview"]>>;
32489
+ /**
32490
+ * Get Duplicate Scan
32491
+ *
32492
+ * Read the same organization-scoped duplicate scan status as Products → Check duplicates. Requires catalog:read. queued/running means the durable scan is still in progress; failed includes errorMessage. completed exposes computedAt and the number of duplicate products. Results are read through products.list with status=duplicates and detail=full. The shared UI scan currently examines at most the 5,000 most recently updated non-archived root products; a completed scan is not proof that a larger catalog has been fully examined.
32493
+ *
32494
+ * `GET /api/v1/products/duplicates/scan`
32495
+ */
32496
+ getDuplicateScan(request?: OperationQuery<operations["get_v1_products_duplicates_scan"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["get_v1_products_duplicates_scan"]>>;
32497
+ /**
32498
+ * Scan Duplicate Products
32499
+ *
32500
+ * Start the existing durable organization duplicate scan, equivalent to Products → Check duplicates. Requires catalog:write. An already queued/running scan is reused. This only refreshes duplicate evidence; it does not merge, publish or delist products. Read completion with products.getDuplicateScan, then list status=duplicates, duplicateType=sku, detail=full and page all matching results before previewing a merge. Uses the same 5,000-candidate scan limit as the UI.
32501
+ *
32502
+ * `POST /api/v1/products/duplicates/scan`
32503
+ */
32504
+ scanDuplicates(request: OperationBody<operations["post_v1_products_duplicates_scan"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_products_duplicates_scan"]>>;
31755
32505
  /**
31756
32506
  * Queue Product Enrichment
31757
32507
  *
@@ -32540,7 +33290,7 @@ declare function constructEvent(payload: string | Uint8Array, headers: WebhookHe
32540
33290
  toleranceInSeconds?: number;
32541
33291
  }): Promise<ConstructedWebhookEvent>;
32542
33292
 
32543
- declare const SDK_VERSION = "0.21.0";
33293
+ declare const SDK_VERSION = "0.22.0";
32544
33294
 
32545
33295
  type ProductCreatedWebhookEvent = components["schemas"]["ProductCreatedWebhookEvent"];
32546
33296
  type ProductUpdatedWebhookEvent = components["schemas"]["ProductUpdatedWebhookEvent"];