palbase 0.73.1 → 0.75.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 (65) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai-sdk/index.js +2 -2
  3. package/dist/backend/engine.js +2 -2
  4. package/dist/backend/env.js +1 -1
  5. package/dist/backend/index.js +3 -3
  6. package/dist/backend/stack.js +1 -1
  7. package/dist/backend/test.js +2 -2
  8. package/dist/chunks/{HYPCFC4K.js → 2SVWIAAD.js} +1 -1
  9. package/dist/chunks/3GR5ZPYK.js +18 -0
  10. package/dist/chunks/{SQNAPFXW.js → 5NZNKECX.js} +2 -2
  11. package/dist/chunks/{DNSLYLU6.js → 7BSFT4SH.js} +1 -1
  12. package/dist/chunks/{4E4ABCSD.js → 7R5TMAGP.js} +2 -2
  13. package/dist/chunks/{SS2RVI27.js → EFDYHDIB.js} +1 -1
  14. package/dist/chunks/{5N5GHLUU.js → FJVUDV4I.js} +2 -2
  15. package/dist/chunks/{HRWVZ4PC.js → G37YLKYL.js} +2 -2
  16. package/dist/chunks/{3KCV4F4F.js → GMCROKBB.js} +2 -2
  17. package/dist/chunks/{5N6QKGPA.js → GSY2E764.js} +2 -2
  18. package/dist/chunks/HT6TR6AZ.js +2 -0
  19. package/dist/chunks/{MB7MHOQO.js → KWVOOFCB.js} +1 -1
  20. package/dist/chunks/{2TKZTIMD.js → LGXI36R6.js} +2 -2
  21. package/dist/chunks/MT22R56P.js +2 -0
  22. package/dist/chunks/P6LK5BD6.js +23 -0
  23. package/dist/chunks/{AXANFT2A.js → POURMU7G.js} +2 -2
  24. package/dist/chunks/{U3H6HER3.js → RBZI2C7M.js} +1 -1
  25. package/dist/chunks/{GWWU2FJ7.js → SPMFD3LH.js} +2 -2
  26. package/dist/chunks/{GTKPHG5F.js → UKONQ2R4.js} +2 -2
  27. package/dist/chunks/{YU3GFTZV.js → UPJGT3BN.js} +1 -1
  28. package/dist/chunks/{W2KD2I4Q.js → XUEBLD7V.js} +1 -1
  29. package/dist/chunks/{UOJVMV42.js → XZSXLA3N.js} +2 -2
  30. package/dist/chunks/{IVJOWYRE.js → YEZCBT5I.js} +2 -2
  31. package/dist/chunks/{MFSC4OJV.js → ZWASHVNO.js} +2 -2
  32. package/dist/cli.js +162 -162
  33. package/dist/cloud/index.js +2 -2
  34. package/dist/refuse/ai-sdk.js +1 -1
  35. package/dist/refuse/ai.js +1 -1
  36. package/dist/refuse/backend.js +1 -1
  37. package/dist/refuse/cloud.js +1 -1
  38. package/dist/refuse/server.js +1 -1
  39. package/dist/server/index.js +2 -2
  40. package/dist/server/testing.js +2 -2
  41. package/dist/web/index.js +2 -2
  42. package/dist/web/message.js +2 -2
  43. package/dist/web/palbe.js +2 -2
  44. package/dist/web/payments-ui.js +2 -2
  45. package/dist/web/paywall.js +2 -2
  46. package/dist/web/push-sw.js +1 -1
  47. package/dist/web/ssr.js +2 -2
  48. package/dist/web/vite.js +2 -2
  49. package/package.json +2 -2
  50. package/types/ai/src/index.d.ts +1 -1
  51. package/types/ai/src/tools.d.ts +18 -0
  52. package/types/cloud/src/generated/project.d.ts +1 -1
  53. package/types/internal/src/modules/ai.d.ts +8 -0
  54. package/types/internal/src/modules/commerce.d.ts +2810 -533
  55. package/types/internal/src/modules/events.d.ts +2 -2
  56. package/types/server/src/commerce.d.ts +172 -3
  57. package/types/server/src/index.d.ts +1 -1
  58. package/types/web/src/commerce.d.ts +460 -20
  59. package/types/web/src/index.d.ts +1 -1
  60. package/types/web/src/session.d.ts +15 -1
  61. package/types/web/src/ssr.d.ts +1 -1
  62. package/dist/chunks/SEICTPQP.js +0 -2
  63. package/dist/chunks/TR2IPX2A.js +0 -23
  64. package/dist/chunks/UXHNXE3J.js +0 -2
  65. package/dist/chunks/VCL3SAQL.js +0 -18
@@ -490,6 +490,18 @@ export type CommerceCartAbandonedEvent = {
490
490
  * ISO 4217 currency.
491
491
  */
492
492
  currency?: string;
493
+ /**
494
+ * Seller store UUID for store-scoped recovery journeys.
495
+ */
496
+ store_id?: string | null;
497
+ /**
498
+ * Number of units left in cart for this store.
499
+ */
500
+ item_count?: number;
501
+ /**
502
+ * Cart subtotal in minor units for this store.
503
+ */
504
+ subtotal_amount?: number;
493
505
  [key: string]: unknown;
494
506
  };
495
507
  /**
@@ -726,6 +738,48 @@ export type CommerceReturnEvent = {
726
738
  refund_total_amount?: number;
727
739
  [key: string]: unknown;
728
740
  };
741
+ /**
742
+ * Payload for commerce.review.created.
743
+ */
744
+ export type CommerceReviewCreatedEvent = {
745
+ /**
746
+ * product or store.
747
+ */
748
+ review_kind?: string;
749
+ /**
750
+ * Review UUID.
751
+ */
752
+ review_id?: string;
753
+ /**
754
+ * Product UUID.
755
+ */
756
+ product_id?: string | null;
757
+ /**
758
+ * Attributed store UUID.
759
+ */
760
+ store_id?: string | null;
761
+ /**
762
+ * Authoring customer ID.
763
+ */
764
+ customer_id?: string;
765
+ /**
766
+ * Star rating (1..5).
767
+ */
768
+ rating?: number;
769
+ /**
770
+ * Whether backed by a paid purchase.
771
+ */
772
+ verified_purchase?: boolean;
773
+ /**
774
+ * Number of photo/video attachments.
775
+ */
776
+ media_count?: number;
777
+ /**
778
+ * Initial moderation status.
779
+ */
780
+ status?: string;
781
+ [key: string]: unknown;
782
+ };
729
783
  /**
730
784
  * Project-level commerce defaults and marketplace configuration.
731
785
  */
@@ -774,6 +828,18 @@ export type CommerceSettings = {
774
828
  * Last settings update timestamp.
775
829
  */
776
830
  updated_at?: string;
831
+ /**
832
+ * When true, newly submitted reviews start in pending_moderation until approved.
833
+ */
834
+ reviews_require_moderation?: boolean;
835
+ /**
836
+ * When true, only customers with a paid purchase of the product or store may submit reviews.
837
+ */
838
+ reviews_require_verified_purchase?: boolean;
839
+ /**
840
+ * The ways a buyer may check out with nothing paid yet: `cod` (on delivery), `bank_transfer`. None until the project names them; the project's server (its secret key) checks a cart out with any, and with `net_terms`.
841
+ */
842
+ offline_payment_methods?: ("cod" | "bank_transfer")[];
777
843
  [key: string]: unknown;
778
844
  };
779
845
  /**
@@ -956,7 +1022,7 @@ export type HookView = {
956
1022
  */
957
1023
  id?: string;
958
1024
  /**
959
- * buybox.rank, shipping.quote, tax.quote, checkout.validate, or fulfillment.label.
1025
+ * buybox.rank, discovery.rank, shipping.calculate, tax.calculate, or checkout.validate.
960
1026
  */
961
1027
  hook_point?: string;
962
1028
  /**
@@ -1553,6 +1619,14 @@ export type Product = {
1553
1619
  * Last update timestamp.
1554
1620
  */
1555
1621
  updated_at?: string;
1622
+ /**
1623
+ * Aggregate rating in bps.
1624
+ */
1625
+ rating_avg_bps?: number | null;
1626
+ /**
1627
+ * Published review count.
1628
+ */
1629
+ rating_count?: number;
1556
1630
  [key: string]: unknown;
1557
1631
  };
1558
1632
  /**
@@ -1575,272 +1649,286 @@ export type ProductDetail = {
1575
1649
  [key: string]: unknown;
1576
1650
  };
1577
1651
  /**
1578
- * Paged list of products.
1652
+ * Facet value counts for one attribute key.
1579
1653
  */
1580
- export type ProductList = {
1581
- /**
1582
- * Products.
1583
- */
1584
- products: Product[];
1585
- /**
1586
- * Cursor for next page.
1587
- */
1588
- next_cursor?: string;
1654
+ export type AttributeFacetBucketList = TermFacetBucket[];
1655
+ /**
1656
+ * Facet value buckets keyed by attribute name.
1657
+ */
1658
+ export type AttributeFacetMap = {
1659
+ [key: string]: AttributeFacetBucketList;
1589
1660
  };
1590
1661
  /**
1591
- * Redeemable coupon or referral code.
1662
+ * Brand facet bucket with product count.
1592
1663
  */
1593
- export type PromotionCode = {
1664
+ export type BrandFacetBucket = {
1594
1665
  /**
1595
- * Code UUID.
1666
+ * Brand UUID.
1596
1667
  */
1597
- id?: string;
1668
+ id: string;
1598
1669
  /**
1599
- * Promotion rule UUID.
1670
+ * Brand slug.
1600
1671
  */
1601
- rule_id?: string;
1672
+ slug: string;
1602
1673
  /**
1603
- * Uppercase promo code.
1674
+ * Brand name.
1604
1675
  */
1605
- code?: string;
1676
+ name: string;
1606
1677
  /**
1607
- * active, exhausted, expired, or revoked.
1678
+ * Matching product count.
1608
1679
  */
1609
- status?: string;
1680
+ count: number;
1681
+ };
1682
+ /**
1683
+ * Compact brand summary embedded in search hits.
1684
+ */
1685
+ export type BrandSummary = ({
1610
1686
  /**
1611
- * Max uses for this code.
1687
+ * Brand UUID.
1612
1688
  */
1613
- max_uses?: number | null;
1689
+ id: string;
1614
1690
  /**
1615
- * Current committed uses.
1691
+ * Brand slug.
1616
1692
  */
1617
- uses_count?: number;
1693
+ slug: string;
1618
1694
  /**
1619
- * Optional restricted user ID.
1695
+ * Brand name.
1620
1696
  */
1621
- assigned_user_id?: string | null;
1697
+ name: string;
1622
1698
  /**
1623
- * Referrer customer ID.
1699
+ * Brand logo URL.
1624
1700
  */
1625
- referrer_customer_id?: string | null;
1701
+ logo_url?: string;
1702
+ }) | null;
1703
+ /**
1704
+ * Materialized winning Buy Box offer for a product.
1705
+ */
1706
+ export type BuyBoxSummary = ({
1626
1707
  /**
1627
- * Code expiry.
1708
+ * Winning listing UUID.
1628
1709
  */
1629
- expires_at?: string | null;
1710
+ listing_id?: string;
1630
1711
  /**
1631
- * Creation timestamp.
1712
+ * Winning seller store UUID.
1632
1713
  */
1633
- created_at?: string;
1634
- [key: string]: unknown;
1635
- };
1636
- /**
1637
- * Generated batch of single-use promotion codes.
1638
- */
1639
- export type PromotionCodeBatch = {
1714
+ store_id?: string;
1640
1715
  /**
1641
- * Generated codes.
1716
+ * Winning seller store slug.
1642
1717
  */
1643
- codes: PromotionCode[];
1718
+ store_slug?: string;
1644
1719
  /**
1645
- * Number of codes created.
1720
+ * Winning seller store name.
1646
1721
  */
1647
- count: number;
1648
- };
1649
- /**
1650
- * List of promotion codes.
1651
- */
1652
- export type PromotionCodeList = {
1722
+ store_name?: string;
1653
1723
  /**
1654
- * Codes.
1724
+ * Winning variant UUID.
1655
1725
  */
1656
- codes: PromotionCode[];
1657
- };
1658
- /**
1659
- * Deterministic promotion evaluation result with Hamilton per-line adjustments.
1660
- */
1661
- export type PromotionEvalResult = {
1726
+ variant_id?: string;
1662
1727
  /**
1663
- * Total item discount.
1728
+ * Seller quality score (0..1000).
1664
1729
  */
1665
- total_discount_amount?: number;
1730
+ seller_score?: number;
1666
1731
  /**
1667
- * Total shipping discount.
1732
+ * Buy Box unit price in minor units.
1668
1733
  */
1669
- shipping_discount_amount?: number;
1734
+ unit_amount?: number;
1670
1735
  /**
1671
- * Total wallet cashback earned.
1736
+ * Original compare-at price in minor units.
1672
1737
  */
1673
- wallet_cashback_amount?: number;
1738
+ compare_at_amount?: number | null;
1674
1739
  /**
1675
- * Applied rules.
1740
+ * ISO 4217 currency code.
1676
1741
  */
1677
- applied_rules?: GenericPayload[];
1742
+ currency?: string;
1678
1743
  /**
1679
- * Per-line and per-store adjustments.
1744
+ * Offer condition.
1680
1745
  */
1681
- adjustments?: GenericPayload[];
1746
+ condition?: string;
1682
1747
  /**
1683
- * Rejected promo codes with reasons.
1748
+ * Available sellable stock for the winning offer.
1684
1749
  */
1685
- rejected_codes?: GenericPayload[];
1686
- [key: string]: unknown;
1687
- };
1688
- /**
1689
- * Created standalone promotion holds and evaluation snapshot.
1690
- */
1691
- export type PromotionHoldResponse = {
1692
- evaluation?: PromotionEvalResult;
1750
+ available_stock?: number;
1693
1751
  /**
1694
- * Created holds.
1752
+ * Inventory tracking policy (none, track_deny, track_continue).
1695
1753
  */
1696
- holds?: GenericPayload[];
1754
+ inventory_policy?: string;
1697
1755
  [key: string]: unknown;
1698
- };
1756
+ }) | null;
1699
1757
  /**
1700
- * Committed or reversed promotion redemption record.
1758
+ * Category facet bucket with product count.
1701
1759
  */
1702
- export type PromotionRedemption = {
1760
+ export type CategoryFacetBucket = {
1703
1761
  /**
1704
- * Redemption UUID.
1762
+ * Category UUID.
1705
1763
  */
1706
- id?: string;
1764
+ id: string;
1707
1765
  /**
1708
- * Rule UUID.
1766
+ * Category slug.
1709
1767
  */
1710
- rule_id?: string;
1768
+ slug: string;
1711
1769
  /**
1712
- * Code UUID.
1770
+ * Category name.
1713
1771
  */
1714
- code_id?: string | null;
1772
+ name: string;
1715
1773
  /**
1716
- * Customer ID.
1774
+ * Matching product count.
1717
1775
  */
1718
- customer_id?: string | null;
1776
+ count: number;
1777
+ };
1778
+ /**
1779
+ * Compact category summary embedded in search hits.
1780
+ */
1781
+ export type CategorySummary = ({
1719
1782
  /**
1720
- * commerce_order or external.
1783
+ * Category UUID.
1721
1784
  */
1722
- reference_type?: string;
1785
+ id: string;
1723
1786
  /**
1724
- * External reference UUID.
1787
+ * Parent category UUID.
1725
1788
  */
1726
- reference_id?: string;
1789
+ parent_id?: string | null;
1727
1790
  /**
1728
- * ISO 4217 currency.
1791
+ * Category slug.
1729
1792
  */
1730
- currency?: string;
1793
+ slug: string;
1731
1794
  /**
1732
- * Total discount committed.
1795
+ * Category name.
1733
1796
  */
1734
- discount_amount?: number;
1797
+ name: string;
1798
+ }) | null;
1799
+ /**
1800
+ * Minimum and maximum unit prices across matching products.
1801
+ */
1802
+ export type PriceRangeFacet = {
1735
1803
  /**
1736
- * committed or reversed.
1804
+ * Minimum price in minor units.
1737
1805
  */
1738
- status?: string;
1806
+ min_amount: number;
1739
1807
  /**
1740
- * Creation timestamp.
1808
+ * Maximum price in minor units.
1741
1809
  */
1742
- created_at?: string;
1743
- [key: string]: unknown;
1744
- };
1745
- /**
1746
- * List of promotion redemptions.
1747
- */
1748
- export type PromotionRedemptionList = {
1810
+ max_amount: number;
1749
1811
  /**
1750
- * Redemptions.
1812
+ * ISO 4217 currency code.
1751
1813
  */
1752
- redemptions: PromotionRedemption[];
1814
+ currency: string;
1753
1815
  };
1754
1816
  /**
1755
- * Promotion rule with recursive condition tree, effect, stacking, and funding split.
1817
+ * Primary product media preview.
1756
1818
  */
1757
- export type PromotionRule = {
1819
+ export type PrimaryMedia = ({
1758
1820
  /**
1759
- * Rule UUID.
1821
+ * Media asset UUID.
1760
1822
  */
1761
1823
  id?: string;
1762
1824
  /**
1763
- * Unique rule slug.
1825
+ * Storage bucket name.
1764
1826
  */
1765
- key?: string;
1827
+ storage_bucket?: string;
1766
1828
  /**
1767
- * Rule name.
1829
+ * Storage object key.
1768
1830
  */
1769
- name?: string;
1831
+ storage_key?: string;
1770
1832
  /**
1771
- * Owning store UUID for seller promos.
1833
+ * MIME type.
1772
1834
  */
1773
- owner_store_id?: string | null;
1835
+ mime_type?: string;
1774
1836
  /**
1775
- * automatic, code, or referral.
1837
+ * Alt text.
1776
1838
  */
1777
- trigger_kind?: string;
1839
+ alt_text?: string;
1778
1840
  /**
1779
- * draft, active, paused, or archived.
1841
+ * Thumbhash placeholder.
1780
1842
  */
1781
- status?: string;
1843
+ thumbhash?: string;
1782
1844
  /**
1783
- * platform, seller, or shared.
1845
+ * Width in pixels.
1784
1846
  */
1785
- funded_by?: string;
1847
+ width?: number | null;
1786
1848
  /**
1787
- * Platform funding share in bps (0..10000).
1849
+ * Height in pixels.
1788
1850
  */
1789
- platform_share_bps?: number;
1851
+ height?: number | null;
1790
1852
  /**
1791
- * percent_off, fixed_off, free_shipping, bxgy, or wallet_cashback.
1853
+ * Media URL.
1792
1854
  */
1793
- effect_kind?: string;
1855
+ url?: string;
1856
+ [key: string]: unknown;
1857
+ }) | null;
1858
+ /**
1859
+ * Enriched product search hit including Buy Box price, stock availability, offer count, primary media, brand, and category.
1860
+ */
1861
+ export type ProductSearchHit = {
1794
1862
  /**
1795
- * Effect JSON parameters.
1863
+ * Product UUID.
1796
1864
  */
1797
- effect?: {
1798
- [key: string]: unknown;
1799
- };
1865
+ id?: string;
1800
1866
  /**
1801
- * Recursive all/any/not condition tree.
1867
+ * Store UUID when store-owned.
1802
1868
  */
1803
- conditions?: {
1804
- [key: string]: unknown;
1805
- };
1869
+ owner_store_id?: string | null;
1806
1870
  /**
1807
- * Stacking group.
1871
+ * Brand UUID.
1808
1872
  */
1809
- stack_group?: string;
1873
+ brand_id?: string | null;
1810
1874
  /**
1811
- * Combinable stack groups.
1875
+ * Category UUID.
1812
1876
  */
1813
- combinable_with?: string[];
1877
+ category_id?: string | null;
1814
1878
  /**
1815
- * Evaluation priority (lower runs first).
1879
+ * URL-friendly product handle.
1816
1880
  */
1817
- priority?: number;
1881
+ handle?: string;
1818
1882
  /**
1819
- * proportional, forfeit_if_below_min, or keep.
1883
+ * Product title.
1820
1884
  */
1821
- partial_return_policy?: string;
1885
+ title?: string;
1822
1886
  /**
1823
- * Require signed-in customer.
1887
+ * Product subtitle.
1824
1888
  */
1825
- signed_in_only?: boolean;
1889
+ subtitle?: string;
1826
1890
  /**
1827
- * Global usage cap.
1891
+ * Product description.
1828
1892
  */
1829
- max_total_uses?: number | null;
1893
+ description?: string;
1830
1894
  /**
1831
- * Per-customer usage cap.
1895
+ * Product kind (physical, digital, service, bundle).
1832
1896
  */
1833
- max_uses_per_customer?: number | null;
1897
+ kind?: string;
1834
1898
  /**
1835
- * Start timestamp.
1899
+ * draft, active, or archived.
1836
1900
  */
1837
- starts_at?: string | null;
1901
+ status?: string;
1838
1902
  /**
1839
- * End timestamp.
1903
+ * pending_review, approved, changes_requested, or rejected.
1840
1904
  */
1841
- ends_at?: string | null;
1905
+ approval_status?: string;
1842
1906
  /**
1843
- * Custom metadata.
1907
+ * Tax category slug.
1908
+ */
1909
+ tax_category?: string;
1910
+ /**
1911
+ * Aggregate rating in basis points (10000..50000).
1912
+ */
1913
+ rating_avg_bps?: number | null;
1914
+ /**
1915
+ * Published review count.
1916
+ */
1917
+ rating_count?: number;
1918
+ /**
1919
+ * Localized product fields.
1920
+ */
1921
+ locales?: {
1922
+ [key: string]: unknown;
1923
+ };
1924
+ /**
1925
+ * Structured product attributes.
1926
+ */
1927
+ attributes?: {
1928
+ [key: string]: unknown;
1929
+ };
1930
+ /**
1931
+ * Custom product metadata.
1844
1932
  */
1845
1933
  metadata?: {
1846
1934
  [key: string]: unknown;
@@ -1853,655 +1941,2440 @@ export type PromotionRule = {
1853
1941
  * Last update timestamp.
1854
1942
  */
1855
1943
  updated_at?: string;
1856
- [key: string]: unknown;
1857
- };
1858
- /**
1859
- * Paged list of promotion rules.
1860
- */
1861
- export type PromotionRuleList = {
1944
+ buybox?: BuyBoxSummary;
1862
1945
  /**
1863
- * Promotion rules.
1946
+ * Minimum active offer price in minor units.
1864
1947
  */
1865
- rules: PromotionRule[];
1948
+ min_price_amount?: number | null;
1866
1949
  /**
1867
- * Cursor for next page.
1950
+ * Maximum active offer price in minor units.
1868
1951
  */
1869
- next_cursor?: string;
1870
- };
1871
- /**
1872
- * Payload for promotions.rule.created.
1873
- */
1874
- export type PromotionsRuleCreatedEvent = {
1952
+ max_price_amount?: number | null;
1875
1953
  /**
1876
- * Rule UUID.
1954
+ * Resolved ISO 4217 currency code.
1877
1955
  */
1878
- rule_id?: string;
1956
+ currency?: string;
1879
1957
  /**
1880
- * Rule key.
1958
+ * Whether at least one sellable offer is in stock.
1881
1959
  */
1882
- key?: string;
1960
+ in_stock?: boolean;
1883
1961
  /**
1884
- * Effect kind.
1962
+ * Total available tracked stock across active offers.
1885
1963
  */
1886
- effect_kind?: string;
1964
+ available_stock?: number;
1887
1965
  /**
1888
- * platform, seller, or shared.
1966
+ * Count of active sellable offers.
1889
1967
  */
1890
- funded_by?: string;
1891
- [key: string]: unknown;
1892
- };
1893
- /**
1894
- * Result of single-call quick product + variant + listing + price + stock creation.
1895
- */
1896
- export type QuickProductResponse = {
1897
- product?: Product;
1898
- variant?: Variant;
1899
- listing?: Listing;
1968
+ offer_count?: number;
1969
+ primary_media?: PrimaryMedia;
1970
+ brand?: BrandSummary;
1971
+ category?: CategorySummary;
1972
+ /**
1973
+ * Relevance score when a search query is provided.
1974
+ */
1975
+ score?: number | null;
1900
1976
  [key: string]: unknown;
1901
1977
  };
1902
1978
  /**
1903
- * Sales region defining currency, tax mode, and supported countries.
1979
+ * Structured storefront search request supporting nested/multi-value attributes, sorting, pagination, and facets.
1904
1980
  */
1905
- export type Region = {
1981
+ export type ProductSearchRequest = {
1906
1982
  /**
1907
- * Region UUID.
1983
+ * Typo-tolerant full-text and trigram query.
1908
1984
  */
1909
- id?: string;
1985
+ q?: string;
1910
1986
  /**
1911
- * Unique region slug.
1987
+ * Category UUID filter.
1912
1988
  */
1913
- key?: string;
1989
+ category_id?: string;
1914
1990
  /**
1915
- * Display name.
1991
+ * Multiple category UUIDs.
1916
1992
  */
1917
- name?: string;
1993
+ category_ids?: string[];
1918
1994
  /**
1919
- * ISO 4217 currency code.
1995
+ * Brand UUID filter.
1920
1996
  */
1921
- currency?: string;
1997
+ brand_id?: string;
1922
1998
  /**
1923
- * ISO 3166-1 alpha-2 country codes.
1999
+ * Multiple brand UUIDs.
1924
2000
  */
1925
- countries?: string[];
2001
+ brand_ids?: string[];
1926
2002
  /**
1927
- * Whether prices are tax-inclusive.
2003
+ * Store UUID filter.
1928
2004
  */
1929
- tax_included?: boolean;
2005
+ store_id?: string;
1930
2006
  /**
1931
- * Whether region is active.
2007
+ * Collection UUID filter.
1932
2008
  */
1933
- active?: boolean;
2009
+ collection_id?: string;
1934
2010
  /**
1935
- * Creation timestamp.
2011
+ * Sales channel key.
1936
2012
  */
1937
- created_at?: string;
1938
- [key: string]: unknown;
1939
- };
1940
- /**
1941
- * List of sales regions.
1942
- */
1943
- export type RegionList = {
2013
+ channel?: string;
1944
2014
  /**
1945
- * Regions.
2015
+ * Region key.
1946
2016
  */
1947
- regions: Region[];
1948
- };
1949
- /**
1950
- * List of returns.
1951
- */
1952
- export type ReturnList = {
2017
+ region?: string;
1953
2018
  /**
1954
- * Returns.
2019
+ * ISO 4217 currency code.
1955
2020
  */
1956
- returns: ReturnRecord[];
1957
- };
1958
- /**
1959
- * RMA return or partial-refund record.
1960
- */
1961
- export type ReturnRecord = {
2021
+ currency?: string;
1962
2022
  /**
1963
- * Return UUID.
2023
+ * Product kind (physical, digital, service, bundle).
1964
2024
  */
1965
- id?: string;
2025
+ kind?: string;
1966
2026
  /**
1967
- * Sequential RMA number.
2027
+ * Offer condition (new, open_box, refurbished, used).
1968
2028
  */
1969
- rma_number?: string;
2029
+ condition?: string;
1970
2030
  /**
1971
- * Store order UUID.
2031
+ * Minimum price in minor units.
1972
2032
  */
1973
- store_order_id?: string;
2033
+ min_price?: number | null;
1974
2034
  /**
1975
- * Store UUID.
2035
+ * Maximum price in minor units.
1976
2036
  */
1977
- store_id?: string;
2037
+ max_price?: number | null;
1978
2038
  /**
1979
- * requested, approved, received, refunded, or rejected.
2039
+ * Stock availability filter.
1980
2040
  */
1981
- status?: string;
2041
+ in_stock?: boolean | null;
1982
2042
  /**
1983
- * Total refund amount.
2043
+ * Minimum star rating (0..5).
1984
2044
  */
1985
- refund_total_amount?: number;
2045
+ min_rating?: number | null;
1986
2046
  /**
1987
- * Creation timestamp.
2047
+ * Structured attribute filter map (scalar exact, array OR-within-key, or nested objects).
1988
2048
  */
1989
- created_at?: string;
1990
- [key: string]: unknown;
1991
- };
1992
- /**
1993
- * Deduplicated seller payout settlement statement.
1994
- */
1995
- export type Settlement = {
2049
+ attributes?: {
2050
+ [key: string]: unknown;
2051
+ };
1996
2052
  /**
1997
- * Settlement UUID.
2053
+ * Sort mode (relevance, newest, price_asc, price_desc, rating_desc, bestsellers, trending).
1998
2054
  */
1999
- id?: string;
2055
+ sort?: string;
2000
2056
  /**
2001
- * Store UUID.
2057
+ * Discovery strategy identifier.
2002
2058
  */
2003
- store_id?: string;
2059
+ strategy?: string;
2004
2060
  /**
2005
- * ISO 4217 currency.
2061
+ * Requested facet groups.
2006
2062
  */
2007
- currency?: string;
2063
+ facets?: string[];
2008
2064
  /**
2009
- * draft, scheduled, or paid.
2065
+ * Whether to compute dynamic facets.
2010
2066
  */
2011
- status?: string;
2067
+ include_facets?: boolean;
2012
2068
  /**
2013
- * Gross sales.
2069
+ * Maximum number of items per page (default 50, values >200 are clamped to 200).
2014
2070
  */
2015
- gross_amount?: number;
2071
+ limit?: number;
2016
2072
  /**
2017
- * Platform commissions.
2073
+ * Opaque sort-aware composite pagination cursor.
2018
2074
  */
2019
- commission_amount?: number;
2075
+ cursor?: string;
2076
+ };
2077
+ /**
2078
+ * Enriched paged product search response with optional dynamic facets and total count.
2079
+ */
2080
+ export type ProductSearchResponse = {
2020
2081
  /**
2021
- * Withholding tax.
2082
+ * Enriched product search hits.
2022
2083
  */
2023
- withholding_tax_amount?: number;
2084
+ products: ProductSearchHit[];
2085
+ facets?: SearchFacets;
2024
2086
  /**
2025
- * Net payout amount.
2087
+ * Total matching product count.
2026
2088
  */
2027
- net_payout_amount?: number;
2089
+ total?: number;
2028
2090
  /**
2029
- * Period start.
2091
+ * Composite cursor for next page; absent on the last page.
2030
2092
  */
2031
- period_start_at?: string;
2093
+ next_cursor?: string;
2032
2094
  /**
2033
- * Period end.
2095
+ * Active ranking strategy.
2034
2096
  */
2035
- period_end_at?: string;
2036
- [key: string]: unknown;
2097
+ strategy?: string;
2098
+ /**
2099
+ * Merchandising rules that matched and modified the response.
2100
+ */
2101
+ applied_rules?: AppliedRuleSummary[];
2102
+ /**
2103
+ * Optional redirect URL triggered by a merchandising rule.
2104
+ */
2105
+ redirect_url?: string;
2106
+ experiment?: ExperimentAssignment;
2037
2107
  };
2038
2108
  /**
2039
- * List of settlements.
2109
+ * Star rating threshold facet bucket.
2040
2110
  */
2041
- export type SettlementList = {
2111
+ export type RatingFacetBucket = {
2042
2112
  /**
2043
- * Settlements.
2113
+ * Minimum whole-star threshold (1..4).
2044
2114
  */
2045
- settlements: Settlement[];
2115
+ min_rating: number;
2116
+ /**
2117
+ * Matching product count.
2118
+ */
2119
+ count: number;
2046
2120
  };
2047
2121
  /**
2048
- * Flat-rate, threshold-free, or external carrier shipping option.
2122
+ * Dynamic facet counts computed across matching products.
2049
2123
  */
2050
- export type ShippingOption = {
2124
+ export type SearchFacets = ({
2051
2125
  /**
2052
- * Shipping option UUID.
2126
+ * Brand buckets.
2053
2127
  */
2054
- id?: string;
2128
+ brands: BrandFacetBucket[];
2055
2129
  /**
2056
- * Optional store UUID.
2130
+ * Category buckets.
2057
2131
  */
2058
- store_id?: string | null;
2132
+ categories: CategoryFacetBucket[];
2133
+ price_range: PriceRangeFacet;
2059
2134
  /**
2060
- * Shipping method name.
2135
+ * Count of matching in-stock products.
2061
2136
  */
2062
- name?: string;
2137
+ in_stock_count: number;
2063
2138
  /**
2064
- * ISO 4217 currency.
2139
+ * Star rating buckets.
2065
2140
  */
2066
- currency?: string;
2141
+ rating_buckets: RatingFacetBucket[];
2067
2142
  /**
2068
- * Shipping cost in minor units.
2143
+ * Offer condition buckets.
2069
2144
  */
2070
- amount?: number;
2145
+ conditions: TermFacetBucket[];
2146
+ attributes: AttributeFacetMap;
2147
+ }) | null;
2148
+ /**
2149
+ * Compact autocomplete product hit.
2150
+ */
2151
+ export type SuggestProductHit = {
2071
2152
  /**
2072
- * Free shipping threshold.
2153
+ * Product UUID.
2073
2154
  */
2074
- free_over_amount?: number | null;
2155
+ id?: string;
2075
2156
  /**
2076
- * seller or platform.
2157
+ * Product handle.
2077
2158
  */
2078
- shipping_recipient?: string;
2159
+ handle?: string;
2079
2160
  /**
2080
- * Whether active.
2161
+ * Product title.
2081
2162
  */
2082
- active?: boolean;
2083
- [key: string]: unknown;
2084
- };
2085
- /**
2086
- * List of shipping options.
2087
- */
2088
- export type ShippingOptionList = {
2163
+ title?: string;
2089
2164
  /**
2090
- * Options.
2165
+ * Product subtitle.
2091
2166
  */
2092
- shipping_options: ShippingOption[];
2093
- };
2094
- /**
2095
- * Shipping profile grouping products with similar shipping rules.
2096
- */
2097
- export type ShippingProfile = {
2167
+ subtitle?: string;
2098
2168
  /**
2099
- * Shipping profile UUID.
2169
+ * Winning Buy Box price in minor units.
2100
2170
  */
2101
- id?: string;
2171
+ buybox_unit_amount?: number | null;
2102
2172
  /**
2103
- * Unique key.
2173
+ * ISO 4217 currency code.
2104
2174
  */
2105
- key?: string;
2175
+ currency?: string;
2106
2176
  /**
2107
- * Display name.
2177
+ * Whether product is in stock.
2108
2178
  */
2109
- name?: string;
2110
- [key: string]: unknown;
2111
- };
2112
- /**
2113
- * List of shipping profiles.
2114
- */
2115
- export type ShippingProfileList = {
2179
+ in_stock?: boolean;
2180
+ primary_media?: PrimaryMedia;
2116
2181
  /**
2117
- * Profiles.
2182
+ * Brand name.
2118
2183
  */
2119
- shipping_profiles: ShippingProfile[];
2184
+ brand_name?: string;
2185
+ /**
2186
+ * Category name.
2187
+ */
2188
+ category_name?: string;
2189
+ [key: string]: unknown;
2120
2190
  };
2121
2191
  /**
2122
- * Warehouse, branch, or store fulfillment location.
2192
+ * Autocomplete suggestions across query completions, products, categories, and brands.
2123
2193
  */
2124
- export type StockLocation = {
2125
- /**
2126
- * Location UUID.
2127
- */
2128
- id?: string;
2194
+ export type SuggestResponse = {
2129
2195
  /**
2130
- * Owning store UUID.
2196
+ * Echoed query string.
2131
2197
  */
2132
- store_id?: string;
2198
+ query: string;
2133
2199
  /**
2134
- * Location code.
2200
+ * Deduplicated query completion suggestions.
2135
2201
  */
2136
- code?: string;
2202
+ suggestions: string[];
2137
2203
  /**
2138
- * Location display name.
2204
+ * Top matching product hits.
2139
2205
  */
2140
- name?: string;
2206
+ products: SuggestProductHit[];
2141
2207
  /**
2142
- * Allocation priority.
2208
+ * Top matching categories.
2143
2209
  */
2144
- priority?: number;
2210
+ categories: Category[];
2145
2211
  /**
2146
- * Whether active.
2212
+ * Top matching brands.
2147
2213
  */
2148
- active?: boolean;
2149
- [key: string]: unknown;
2214
+ brands: Brand[];
2150
2215
  };
2151
2216
  /**
2152
- * List of stock locations.
2217
+ * Term value facet bucket with product count.
2153
2218
  */
2154
- export type StockLocationList = {
2219
+ export type TermFacetBucket = {
2155
2220
  /**
2156
- * Stock locations.
2221
+ * Facet value.
2157
2222
  */
2158
- locations: StockLocation[];
2223
+ value: string;
2224
+ /**
2225
+ * Matching product count.
2226
+ */
2227
+ count: number;
2159
2228
  };
2160
2229
  /**
2161
- * First-party or third-party marketplace seller store.
2230
+ * Customer product review with verified-purchase store attribution, seller reply, and media.
2162
2231
  */
2163
- export type Store = {
2232
+ export type ProductReview = {
2164
2233
  /**
2165
- * Store UUID.
2234
+ * Review UUID.
2166
2235
  */
2167
2236
  id?: string;
2168
2237
  /**
2169
- * Unique store slug.
2238
+ * Reviewed product UUID.
2170
2239
  */
2171
- slug?: string;
2240
+ product_id?: string;
2172
2241
  /**
2173
- * Store display name.
2242
+ * Product title.
2174
2243
  */
2175
- name?: string;
2244
+ product_title?: string;
2176
2245
  /**
2177
- * first_party or third_party.
2246
+ * Product handle.
2178
2247
  */
2179
- kind?: string;
2248
+ product_handle?: string;
2180
2249
  /**
2181
- * pending, active, suspended, or closed.
2250
+ * Purchased variant UUID.
2182
2251
  */
2183
- status?: string;
2252
+ variant_id?: string | null;
2184
2253
  /**
2185
- * Whether store is temporarily paused.
2254
+ * Purchased variant title.
2186
2255
  */
2187
- vacation_mode?: boolean;
2256
+ variant_title?: string;
2257
+ /**
2258
+ * Purchased listing UUID.
2259
+ */
2260
+ listing_id?: string | null;
2261
+ /**
2262
+ * Purchased-from seller store UUID.
2263
+ */
2264
+ store_id?: string | null;
2265
+ /**
2266
+ * Purchased-from seller store display name.
2267
+ */
2268
+ store_name?: string;
2269
+ /**
2270
+ * Purchased-from seller store slug.
2271
+ */
2272
+ store_slug?: string;
2273
+ /**
2274
+ * Backing store order UUID.
2275
+ */
2276
+ store_order_id?: string | null;
2277
+ /**
2278
+ * Backing order line UUID.
2279
+ */
2280
+ order_line_id?: string | null;
2281
+ /**
2282
+ * Author customer ID.
2283
+ */
2284
+ customer_id?: string;
2285
+ /**
2286
+ * Public display name.
2287
+ */
2288
+ author_name?: string;
2289
+ /**
2290
+ * Whether anonymous.
2291
+ */
2292
+ anonymous?: boolean;
2293
+ /**
2294
+ * True when backed by paid order.
2295
+ */
2296
+ verified_purchase?: boolean;
2297
+ /**
2298
+ * Star rating (1..5).
2299
+ */
2300
+ rating?: number;
2301
+ /**
2302
+ * Optional review headline.
2303
+ */
2304
+ title?: string;
2305
+ /**
2306
+ * Review body text.
2307
+ */
2308
+ body?: string;
2309
+ /**
2310
+ * Moderation status.
2311
+ */
2312
+ status?: string;
2313
+ /**
2314
+ * Helpful votes count.
2315
+ */
2316
+ helpful_count?: number;
2317
+ /**
2318
+ * Not-helpful votes count.
2319
+ */
2320
+ not_helpful_count?: number;
2321
+ /**
2322
+ * Official seller reply.
2323
+ */
2324
+ seller_reply?: string | null;
2325
+ /**
2326
+ * Seller reply timestamp.
2327
+ */
2328
+ seller_replied_at?: string | null;
2329
+ /**
2330
+ * Photo and video attachments.
2331
+ */
2332
+ media?: ReviewMedia[];
2333
+ /**
2334
+ * Custom metadata.
2335
+ */
2336
+ metadata?: {
2337
+ [key: string]: unknown;
2338
+ };
2339
+ /**
2340
+ * Creation timestamp.
2341
+ */
2342
+ created_at?: string;
2343
+ /**
2344
+ * Last update timestamp.
2345
+ */
2346
+ updated_at?: string;
2347
+ [key: string]: unknown;
2348
+ };
2349
+ /**
2350
+ * Product review summary and filtered list.
2351
+ */
2352
+ export type ProductReviewListResponse = {
2353
+ /**
2354
+ * Product UUID.
2355
+ */
2356
+ product_id: string;
2357
+ summary: ProductReviewSummary;
2358
+ /**
2359
+ * Published product reviews.
2360
+ */
2361
+ reviews: ProductReview[];
2362
+ /**
2363
+ * Cursor for next page, absent on the last page.
2364
+ */
2365
+ next_cursor?: string;
2366
+ };
2367
+ /**
2368
+ * Aggregated rating summary and star histogram for a product.
2369
+ */
2370
+ export type ProductReviewSummary = {
2371
+ /**
2372
+ * Average star rating (0..5).
2373
+ */
2374
+ average_rating?: number;
2375
+ /**
2376
+ * Average rating in bps.
2377
+ */
2378
+ rating_avg_bps?: number | null;
2379
+ /**
2380
+ * Total published review count.
2381
+ */
2382
+ total_count?: number;
2383
+ /**
2384
+ * Verified purchase count.
2385
+ */
2386
+ verified_count?: number;
2387
+ /**
2388
+ * Reviews with media.
2389
+ */
2390
+ with_media_count?: number;
2391
+ /**
2392
+ * Reviews with photos.
2393
+ */
2394
+ with_photos_count?: number;
2395
+ /**
2396
+ * Reviews with videos.
2397
+ */
2398
+ with_videos_count?: number;
2399
+ /**
2400
+ * Star histogram (1..5).
2401
+ */
2402
+ histogram?: {
2403
+ [key: string]: unknown;
2404
+ };
2405
+ [key: string]: unknown;
2406
+ };
2407
+ /**
2408
+ * Redeemable coupon or referral code.
2409
+ */
2410
+ export type PromotionCode = {
2411
+ /**
2412
+ * Code UUID.
2413
+ */
2414
+ id?: string;
2415
+ /**
2416
+ * Promotion rule UUID.
2417
+ */
2418
+ rule_id?: string;
2419
+ /**
2420
+ * Uppercase promo code.
2421
+ */
2422
+ code?: string;
2423
+ /**
2424
+ * active, exhausted, expired, or revoked.
2425
+ */
2426
+ status?: string;
2427
+ /**
2428
+ * Max uses for this code.
2429
+ */
2430
+ max_uses?: number | null;
2431
+ /**
2432
+ * Current committed uses.
2433
+ */
2434
+ uses_count?: number;
2435
+ /**
2436
+ * Optional restricted user ID.
2437
+ */
2438
+ assigned_user_id?: string | null;
2439
+ /**
2440
+ * Referrer customer ID.
2441
+ */
2442
+ referrer_customer_id?: string | null;
2443
+ /**
2444
+ * Code expiry.
2445
+ */
2446
+ expires_at?: string | null;
2447
+ /**
2448
+ * Creation timestamp.
2449
+ */
2450
+ created_at?: string;
2451
+ [key: string]: unknown;
2452
+ };
2453
+ /**
2454
+ * Generated batch of single-use promotion codes.
2455
+ */
2456
+ export type PromotionCodeBatch = {
2457
+ /**
2458
+ * Generated codes.
2459
+ */
2460
+ codes: PromotionCode[];
2461
+ /**
2462
+ * Number of codes created.
2463
+ */
2464
+ count: number;
2465
+ };
2466
+ /**
2467
+ * List of promotion codes.
2468
+ */
2469
+ export type PromotionCodeList = {
2470
+ /**
2471
+ * Codes.
2472
+ */
2473
+ codes: PromotionCode[];
2474
+ };
2475
+ /**
2476
+ * Deterministic promotion evaluation result with penny-accurate per-line adjustments.
2477
+ */
2478
+ export type PromotionEvalResult = {
2479
+ /**
2480
+ * Total item discount.
2481
+ */
2482
+ total_discount_amount?: number;
2483
+ /**
2484
+ * Total shipping discount.
2485
+ */
2486
+ shipping_discount_amount?: number;
2487
+ /**
2488
+ * Total wallet cashback earned.
2489
+ */
2490
+ wallet_cashback_amount?: number;
2491
+ /**
2492
+ * Applied rules.
2493
+ */
2494
+ applied_rules?: GenericPayload[];
2495
+ /**
2496
+ * Per-line and per-store adjustments.
2497
+ */
2498
+ adjustments?: GenericPayload[];
2499
+ /**
2500
+ * Rejected promo codes with reasons.
2501
+ */
2502
+ rejected_codes?: GenericPayload[];
2503
+ [key: string]: unknown;
2504
+ };
2505
+ /**
2506
+ * Created standalone promotion holds and evaluation snapshot.
2507
+ */
2508
+ export type PromotionHoldResponse = {
2509
+ evaluation?: PromotionEvalResult;
2510
+ /**
2511
+ * Created holds.
2512
+ */
2513
+ holds?: GenericPayload[];
2514
+ [key: string]: unknown;
2515
+ };
2516
+ /**
2517
+ * Committed or reversed promotion redemption record.
2518
+ */
2519
+ export type PromotionRedemption = {
2520
+ /**
2521
+ * Redemption UUID.
2522
+ */
2523
+ id?: string;
2524
+ /**
2525
+ * Rule UUID.
2526
+ */
2527
+ rule_id?: string;
2528
+ /**
2529
+ * Code UUID.
2530
+ */
2531
+ code_id?: string | null;
2532
+ /**
2533
+ * Customer ID.
2534
+ */
2535
+ customer_id?: string | null;
2536
+ /**
2537
+ * commerce_order or external.
2538
+ */
2539
+ reference_type?: string;
2540
+ /**
2541
+ * External reference UUID.
2542
+ */
2543
+ reference_id?: string;
2544
+ /**
2545
+ * ISO 4217 currency.
2546
+ */
2547
+ currency?: string;
2548
+ /**
2549
+ * Total discount committed.
2550
+ */
2551
+ discount_amount?: number;
2552
+ /**
2553
+ * committed or reversed.
2554
+ */
2555
+ status?: string;
2556
+ /**
2557
+ * Creation timestamp.
2558
+ */
2559
+ created_at?: string;
2560
+ [key: string]: unknown;
2561
+ };
2562
+ /**
2563
+ * List of promotion redemptions.
2564
+ */
2565
+ export type PromotionRedemptionList = {
2566
+ /**
2567
+ * Redemptions.
2568
+ */
2569
+ redemptions: PromotionRedemption[];
2570
+ };
2571
+ /**
2572
+ * Promotion rule with recursive condition tree, effect, stacking, and funding split.
2573
+ */
2574
+ export type PromotionRule = {
2575
+ /**
2576
+ * Rule UUID.
2577
+ */
2578
+ id?: string;
2579
+ /**
2580
+ * Unique rule slug.
2581
+ */
2582
+ key?: string;
2583
+ /**
2584
+ * Rule name.
2585
+ */
2586
+ name?: string;
2587
+ /**
2588
+ * Owning store UUID for seller promos.
2589
+ */
2590
+ owner_store_id?: string | null;
2591
+ /**
2592
+ * automatic, code, or referral.
2593
+ */
2594
+ trigger_kind?: string;
2595
+ /**
2596
+ * draft, active, paused, or archived.
2597
+ */
2598
+ status?: string;
2599
+ /**
2600
+ * platform, seller, or shared.
2601
+ */
2602
+ funded_by?: string;
2603
+ /**
2604
+ * Platform funding share in bps (0..10000).
2605
+ */
2606
+ platform_share_bps?: number;
2607
+ /**
2608
+ * percent_off, fixed_off, free_shipping, bxgy, or wallet_cashback.
2609
+ */
2610
+ effect_kind?: string;
2611
+ /**
2612
+ * Effect JSON parameters.
2613
+ */
2614
+ effect?: {
2615
+ [key: string]: unknown;
2616
+ };
2617
+ /**
2618
+ * Recursive all/any/not condition tree.
2619
+ */
2620
+ conditions?: {
2621
+ [key: string]: unknown;
2622
+ };
2623
+ /**
2624
+ * Stacking group.
2625
+ */
2626
+ stack_group?: string;
2627
+ /**
2628
+ * Combinable stack groups.
2629
+ */
2630
+ combinable_with?: string[];
2631
+ /**
2632
+ * Evaluation priority (lower runs first).
2633
+ */
2634
+ priority?: number;
2635
+ /**
2636
+ * proportional, forfeit_if_below_min, or keep.
2637
+ */
2638
+ partial_return_policy?: string;
2639
+ /**
2640
+ * Require signed-in customer.
2641
+ */
2642
+ signed_in_only?: boolean;
2643
+ /**
2644
+ * Global usage cap.
2645
+ */
2646
+ max_total_uses?: number | null;
2647
+ /**
2648
+ * Per-customer usage cap.
2649
+ */
2650
+ max_uses_per_customer?: number | null;
2651
+ /**
2652
+ * Start timestamp.
2653
+ */
2654
+ starts_at?: string | null;
2655
+ /**
2656
+ * End timestamp.
2657
+ */
2658
+ ends_at?: string | null;
2659
+ /**
2660
+ * Custom metadata.
2661
+ */
2662
+ metadata?: {
2663
+ [key: string]: unknown;
2664
+ };
2665
+ /**
2666
+ * Creation timestamp.
2667
+ */
2668
+ created_at?: string;
2669
+ /**
2670
+ * Last update timestamp.
2671
+ */
2672
+ updated_at?: string;
2673
+ [key: string]: unknown;
2674
+ };
2675
+ /**
2676
+ * Paged list of promotion rules.
2677
+ */
2678
+ export type PromotionRuleList = {
2679
+ /**
2680
+ * Promotion rules.
2681
+ */
2682
+ rules: PromotionRule[];
2683
+ /**
2684
+ * Cursor for next page.
2685
+ */
2686
+ next_cursor?: string;
2687
+ };
2688
+ /**
2689
+ * Payload for promotions.rule.created.
2690
+ */
2691
+ export type PromotionsRuleCreatedEvent = {
2692
+ /**
2693
+ * Rule UUID.
2694
+ */
2695
+ rule_id?: string;
2696
+ /**
2697
+ * Rule key.
2698
+ */
2699
+ key?: string;
2700
+ /**
2701
+ * Effect kind.
2702
+ */
2703
+ effect_kind?: string;
2704
+ /**
2705
+ * platform, seller, or shared.
2706
+ */
2707
+ funded_by?: string;
2708
+ [key: string]: unknown;
2709
+ };
2710
+ /**
2711
+ * Result of single-call quick product + variant + listing + price + stock creation.
2712
+ */
2713
+ export type QuickProductResponse = {
2714
+ product?: Product;
2715
+ variant?: Variant;
2716
+ listing?: Listing;
2717
+ [key: string]: unknown;
2718
+ };
2719
+ /**
2720
+ * Sales region defining currency, tax mode, and supported countries.
2721
+ */
2722
+ export type Region = {
2723
+ /**
2724
+ * Region UUID.
2725
+ */
2726
+ id?: string;
2727
+ /**
2728
+ * Unique region slug.
2729
+ */
2730
+ key?: string;
2731
+ /**
2732
+ * Display name.
2733
+ */
2734
+ name?: string;
2735
+ /**
2736
+ * ISO 4217 currency code.
2737
+ */
2738
+ currency?: string;
2739
+ /**
2740
+ * ISO 3166-1 alpha-2 country codes.
2741
+ */
2742
+ countries?: string[];
2743
+ /**
2744
+ * Whether prices are tax-inclusive.
2745
+ */
2746
+ tax_included?: boolean;
2747
+ /**
2748
+ * Whether region is active.
2749
+ */
2750
+ active?: boolean;
2751
+ /**
2752
+ * Creation timestamp.
2753
+ */
2754
+ created_at?: string;
2755
+ [key: string]: unknown;
2756
+ };
2757
+ /**
2758
+ * List of sales regions.
2759
+ */
2760
+ export type RegionList = {
2761
+ /**
2762
+ * Regions.
2763
+ */
2764
+ regions: Region[];
2765
+ };
2766
+ /**
2767
+ * List of returns.
2768
+ */
2769
+ export type ReturnList = {
2770
+ /**
2771
+ * Returns.
2772
+ */
2773
+ returns: ReturnRecord[];
2774
+ };
2775
+ /**
2776
+ * RMA return or partial-refund record.
2777
+ */
2778
+ export type ReturnRecord = {
2779
+ /**
2780
+ * Return UUID.
2781
+ */
2782
+ id?: string;
2783
+ /**
2784
+ * Sequential RMA number.
2785
+ */
2786
+ rma_number?: string;
2787
+ /**
2788
+ * Store order UUID.
2789
+ */
2790
+ store_order_id?: string;
2791
+ /**
2792
+ * Store UUID.
2793
+ */
2794
+ store_id?: string;
2795
+ /**
2796
+ * requested, approved, received, refunded, or rejected.
2797
+ */
2798
+ status?: string;
2799
+ /**
2800
+ * Total refund amount.
2801
+ */
2802
+ refund_total_amount?: number;
2803
+ /**
2804
+ * Creation timestamp.
2805
+ */
2806
+ created_at?: string;
2807
+ [key: string]: unknown;
2808
+ };
2809
+ /**
2810
+ * Review deletion confirmation.
2811
+ */
2812
+ export type ReviewDeleteResponse = {
2813
+ /**
2814
+ * True when deleted.
2815
+ */
2816
+ deleted?: boolean;
2817
+ /**
2818
+ * Deleted review UUID.
2819
+ */
2820
+ id?: string;
2821
+ [key: string]: unknown;
2822
+ };
2823
+ /**
2824
+ * Photo or video attachment belonging to a product or store review.
2825
+ */
2826
+ export type ReviewMedia = {
2827
+ /**
2828
+ * Media attachment UUID.
2829
+ */
2830
+ id?: string;
2831
+ /**
2832
+ * image or video.
2833
+ */
2834
+ media_kind?: string;
2835
+ /**
2836
+ * Palbase Storage bucket name.
2837
+ */
2838
+ storage_bucket?: string | null;
2839
+ /**
2840
+ * Palbase Storage object key.
2841
+ */
2842
+ storage_key?: string | null;
2843
+ /**
2844
+ * Fresh signed read URL or external URL.
2845
+ */
2846
+ url?: string;
2847
+ /**
2848
+ * Optional poster/thumbnail URL.
2849
+ */
2850
+ thumbnail_url?: string;
2851
+ /**
2852
+ * MIME type.
2853
+ */
2854
+ mime_type?: string;
2855
+ /**
2856
+ * File size in bytes.
2857
+ */
2858
+ size_bytes?: number;
2859
+ /**
2860
+ * Width in pixels.
2861
+ */
2862
+ width?: number | null;
2863
+ /**
2864
+ * Height in pixels.
2865
+ */
2866
+ height?: number | null;
2867
+ /**
2868
+ * Video duration in ms.
2869
+ */
2870
+ duration_ms?: number | null;
2871
+ /**
2872
+ * Display order index.
2873
+ */
2874
+ position?: number;
2875
+ /**
2876
+ * Signed URL expiration.
2877
+ */
2878
+ expires_at?: string | null;
2879
+ [key: string]: unknown;
2880
+ };
2881
+ /**
2882
+ * Moderation update response.
2883
+ */
2884
+ export type ReviewModerationResponse = {
2885
+ /**
2886
+ * Review UUID.
2887
+ */
2888
+ id?: string;
2889
+ /**
2890
+ * product or store.
2891
+ */
2892
+ review_kind?: string;
2893
+ /**
2894
+ * Updated status.
2895
+ */
2896
+ status?: string;
2897
+ [key: string]: unknown;
2898
+ };
2899
+ /**
2900
+ * Saved seller reply metadata.
2901
+ */
2902
+ export type ReviewReplyResponse = {
2903
+ /**
2904
+ * Review UUID.
2905
+ */
2906
+ review_id?: string;
2907
+ /**
2908
+ * product or store.
2909
+ */
2910
+ review_kind?: string;
2911
+ /**
2912
+ * Published reply text.
2913
+ */
2914
+ seller_reply?: string;
2915
+ /**
2916
+ * Reply timestamp.
2917
+ */
2918
+ seller_replied_at?: string;
2919
+ [key: string]: unknown;
2920
+ };
2921
+ /**
2922
+ * Direct-to-Storage signed PUT upload URL for review photo or video.
2923
+ */
2924
+ export type ReviewUploadURLResponse = {
2925
+ /**
2926
+ * Signed PUT URL.
2927
+ */
2928
+ upload_url?: string;
2929
+ /**
2930
+ * Storage bucket name (_commerce).
2931
+ */
2932
+ storage_bucket?: string;
2933
+ /**
2934
+ * Object key.
2935
+ */
2936
+ storage_key?: string;
2937
+ /**
2938
+ * image or video.
2939
+ */
2940
+ media_kind?: string;
2941
+ /**
2942
+ * Validated MIME type.
2943
+ */
2944
+ mime_type?: string;
2945
+ /**
2946
+ * Maximum upload size.
2947
+ */
2948
+ max_bytes?: number;
2949
+ /**
2950
+ * Expiration timestamp.
2951
+ */
2952
+ expires_at?: string;
2953
+ [key: string]: unknown;
2954
+ };
2955
+ /**
2956
+ * Updated review helpfulness vote counters.
2957
+ */
2958
+ export type ReviewVoteResponse = {
2959
+ /**
2960
+ * Review UUID.
2961
+ */
2962
+ review_id?: string;
2963
+ /**
2964
+ * product or store.
2965
+ */
2966
+ review_kind?: string;
2967
+ /**
2968
+ * Recorded vote.
2969
+ */
2970
+ helpful?: boolean;
2971
+ /**
2972
+ * Total helpful votes.
2973
+ */
2974
+ helpful_count?: number;
2975
+ /**
2976
+ * Total not-helpful votes.
2977
+ */
2978
+ not_helpful_count?: number;
2979
+ [key: string]: unknown;
2980
+ };
2981
+ /**
2982
+ * Combined product and store reviews list.
2983
+ */
2984
+ export type ReviewsBundle = {
2985
+ /**
2986
+ * Product reviews.
2987
+ */
2988
+ product_reviews: ProductReview[];
2989
+ /**
2990
+ * Store reviews.
2991
+ */
2992
+ store_reviews: StoreReview[];
2993
+ /**
2994
+ * Cursor for next page, absent on the last page.
2995
+ */
2996
+ next_cursor?: string;
2997
+ };
2998
+ /**
2999
+ * Deduplicated seller payout settlement statement.
3000
+ */
3001
+ export type Settlement = {
3002
+ /**
3003
+ * Settlement UUID.
3004
+ */
3005
+ id?: string;
3006
+ /**
3007
+ * Store UUID.
3008
+ */
3009
+ store_id?: string;
3010
+ /**
3011
+ * ISO 4217 currency.
3012
+ */
3013
+ currency?: string;
3014
+ /**
3015
+ * draft, scheduled, or paid.
3016
+ */
3017
+ status?: string;
3018
+ /**
3019
+ * Gross sales.
3020
+ */
3021
+ gross_amount?: number;
3022
+ /**
3023
+ * Platform commissions.
3024
+ */
3025
+ commission_amount?: number;
3026
+ /**
3027
+ * Withholding tax.
3028
+ */
3029
+ withholding_tax_amount?: number;
3030
+ /**
3031
+ * Net payout amount.
3032
+ */
3033
+ net_payout_amount?: number;
3034
+ /**
3035
+ * Period start.
3036
+ */
3037
+ period_start_at?: string;
3038
+ /**
3039
+ * Period end.
3040
+ */
3041
+ period_end_at?: string;
3042
+ [key: string]: unknown;
3043
+ };
3044
+ /**
3045
+ * List of settlements.
3046
+ */
3047
+ export type SettlementList = {
3048
+ /**
3049
+ * Settlements.
3050
+ */
3051
+ settlements: Settlement[];
3052
+ };
3053
+ /**
3054
+ * Flat-rate, threshold-free, or external carrier shipping option.
3055
+ */
3056
+ export type ShippingOption = {
3057
+ /**
3058
+ * Shipping option UUID.
3059
+ */
3060
+ id?: string;
3061
+ /**
3062
+ * Optional store UUID.
3063
+ */
3064
+ store_id?: string | null;
3065
+ /**
3066
+ * Shipping method name.
3067
+ */
3068
+ name?: string;
3069
+ /**
3070
+ * ISO 4217 currency.
3071
+ */
3072
+ currency?: string;
3073
+ /**
3074
+ * Shipping cost in minor units.
3075
+ */
3076
+ amount?: number;
3077
+ /**
3078
+ * Free shipping threshold.
3079
+ */
3080
+ free_over_amount?: number | null;
3081
+ /**
3082
+ * seller or platform.
3083
+ */
3084
+ shipping_recipient?: string;
3085
+ /**
3086
+ * Whether active.
3087
+ */
3088
+ active?: boolean;
3089
+ [key: string]: unknown;
3090
+ };
3091
+ /**
3092
+ * List of shipping options.
3093
+ */
3094
+ export type ShippingOptionList = {
3095
+ /**
3096
+ * Options.
3097
+ */
3098
+ shipping_options: ShippingOption[];
3099
+ };
3100
+ /**
3101
+ * Shipping profile grouping products with similar shipping rules.
3102
+ */
3103
+ export type ShippingProfile = {
3104
+ /**
3105
+ * Shipping profile UUID.
3106
+ */
3107
+ id?: string;
3108
+ /**
3109
+ * Unique key.
3110
+ */
3111
+ key?: string;
3112
+ /**
3113
+ * Display name.
3114
+ */
3115
+ name?: string;
3116
+ [key: string]: unknown;
3117
+ };
3118
+ /**
3119
+ * List of shipping profiles.
3120
+ */
3121
+ export type ShippingProfileList = {
3122
+ /**
3123
+ * Profiles.
3124
+ */
3125
+ shipping_profiles: ShippingProfile[];
3126
+ };
3127
+ /**
3128
+ * Warehouse, branch, or store fulfillment location.
3129
+ */
3130
+ export type StockLocation = {
3131
+ /**
3132
+ * Location UUID.
3133
+ */
3134
+ id?: string;
3135
+ /**
3136
+ * Owning store UUID.
3137
+ */
3138
+ store_id?: string;
3139
+ /**
3140
+ * Location code.
3141
+ */
3142
+ code?: string;
3143
+ /**
3144
+ * Location display name.
3145
+ */
3146
+ name?: string;
3147
+ /**
3148
+ * Allocation priority.
3149
+ */
3150
+ priority?: number;
3151
+ /**
3152
+ * Whether active.
3153
+ */
3154
+ active?: boolean;
3155
+ [key: string]: unknown;
3156
+ };
3157
+ /**
3158
+ * List of stock locations.
3159
+ */
3160
+ export type StockLocationList = {
3161
+ /**
3162
+ * Stock locations.
3163
+ */
3164
+ locations: StockLocation[];
3165
+ };
3166
+ /**
3167
+ * First-party or third-party marketplace seller store.
3168
+ */
3169
+ export type Store = {
3170
+ /**
3171
+ * Store UUID.
3172
+ */
3173
+ id?: string;
3174
+ /**
3175
+ * Unique store slug.
3176
+ */
3177
+ slug?: string;
3178
+ /**
3179
+ * Store display name.
3180
+ */
3181
+ name?: string;
3182
+ /**
3183
+ * first_party or third_party.
3184
+ */
3185
+ kind?: string;
3186
+ /**
3187
+ * pending, active, suspended, or closed.
3188
+ */
3189
+ status?: string;
3190
+ /**
3191
+ * Whether store is temporarily paused.
3192
+ */
3193
+ vacation_mode?: boolean;
2188
3194
  /**
2189
3195
  * Store-level commission override in bps.
2190
3196
  */
2191
- commission_bps?: number | null;
3197
+ commission_bps?: number | null;
3198
+ /**
3199
+ * Store-level withholding tax override in bps.
3200
+ */
3201
+ withholding_bps?: number | null;
3202
+ /**
3203
+ * Store-level escrow release days override.
3204
+ */
3205
+ escrow_release_days?: number | null;
3206
+ /**
3207
+ * Custom store metadata.
3208
+ */
3209
+ metadata?: {
3210
+ [key: string]: unknown;
3211
+ };
3212
+ /**
3213
+ * Creation timestamp.
3214
+ */
3215
+ created_at?: string;
3216
+ /**
3217
+ * Last update timestamp.
3218
+ */
3219
+ updated_at?: string;
3220
+ /**
3221
+ * Aggregate rating in bps.
3222
+ */
3223
+ rating_avg_bps?: number | null;
3224
+ /**
3225
+ * Published review count.
3226
+ */
3227
+ rating_count?: number;
3228
+ [key: string]: unknown;
3229
+ };
3230
+ /**
3231
+ * Paged list of stores.
3232
+ */
3233
+ export type StoreList = {
3234
+ /**
3235
+ * Stores.
3236
+ */
3237
+ stores: Store[];
3238
+ /**
3239
+ * Cursor for next page.
3240
+ */
3241
+ next_cursor?: string;
3242
+ };
3243
+ /**
3244
+ * Seller portal team member assignment.
3245
+ */
3246
+ export type StoreMember = {
3247
+ /**
3248
+ * Store UUID.
3249
+ */
3250
+ store_id?: string;
3251
+ /**
3252
+ * Auth user ID.
3253
+ */
3254
+ user_id?: string;
3255
+ /**
3256
+ * viewer, fulfillment, manager, or owner.
3257
+ */
3258
+ role?: string;
3259
+ [key: string]: unknown;
3260
+ };
3261
+ /**
3262
+ * Seller quality and Buy Box metrics.
3263
+ */
3264
+ export type StoreMetrics = {
3265
+ /**
3266
+ * Store UUID.
3267
+ */
3268
+ store_id?: string;
3269
+ /**
3270
+ * Composite quality score (0..1000).
3271
+ */
3272
+ seller_score?: number;
3273
+ /**
3274
+ * On-time dispatch rate in bps.
3275
+ */
3276
+ on_time_dispatch_bps?: number;
3277
+ /**
3278
+ * Seller-fault cancellation rate in bps.
3279
+ */
3280
+ cancellation_rate_bps?: number;
3281
+ /**
3282
+ * Return rate in bps.
3283
+ */
3284
+ return_rate_bps?: number;
3285
+ /**
3286
+ * Total paid store orders.
3287
+ */
3288
+ total_orders?: number;
3289
+ /**
3290
+ * Last update timestamp.
3291
+ */
3292
+ updated_at?: string;
3293
+ [key: string]: unknown;
3294
+ };
3295
+ /**
3296
+ * Per-seller split order with marketplace financial breakdown.
3297
+ */
3298
+ export type StoreOrder = {
3299
+ /**
3300
+ * Store order UUID.
3301
+ */
3302
+ id?: string;
3303
+ /**
3304
+ * Parent order UUID.
3305
+ */
3306
+ order_id?: string;
3307
+ /**
3308
+ * Store UUID.
3309
+ */
3310
+ store_id?: string;
3311
+ /**
3312
+ * Per-store order number.
3313
+ */
3314
+ store_order_number?: string;
3315
+ /**
3316
+ * ISO 4217 currency.
3317
+ */
3318
+ currency?: string;
3319
+ /**
3320
+ * Store order status.
3321
+ */
3322
+ status?: string;
3323
+ /**
3324
+ * Store subtotal.
3325
+ */
3326
+ subtotal_amount?: number;
3327
+ /**
3328
+ * Seller-funded discount.
3329
+ */
3330
+ seller_discount_amount?: number;
3331
+ /**
3332
+ * Platform-funded discount.
3333
+ */
3334
+ platform_discount_amount?: number;
3335
+ /**
3336
+ * Store shipping.
3337
+ */
3338
+ shipping_amount?: number;
3339
+ /**
3340
+ * Buyer principal allocated to this store.
3341
+ */
3342
+ buyer_paid_principal_amount?: number;
3343
+ /**
3344
+ * Platform marketplace commission.
3345
+ */
3346
+ platform_commission_amount?: number;
3347
+ /**
3348
+ * E-commerce withholding tax (stopaj).
3349
+ */
3350
+ withholding_tax_amount?: number;
3351
+ /**
3352
+ * Net seller payout.
3353
+ */
3354
+ seller_net_amount?: number;
3355
+ /**
3356
+ * none, held, partial, released, or disputed.
3357
+ */
3358
+ escrow_status?: string;
3359
+ /**
3360
+ * Creation timestamp.
3361
+ */
3362
+ created_at?: string;
3363
+ [key: string]: unknown;
3364
+ };
3365
+ /**
3366
+ * Store order with its line items.
3367
+ */
3368
+ export type StoreOrderDetail = {
3369
+ store_order?: StoreOrder;
3370
+ /**
3371
+ * Store order lines.
3372
+ */
3373
+ lines?: OrderLine[];
3374
+ [key: string]: unknown;
3375
+ };
3376
+ /**
3377
+ * Paged list of store orders.
3378
+ */
3379
+ export type StoreOrderList = {
3380
+ /**
3381
+ * Store orders.
3382
+ */
3383
+ store_orders: StoreOrder[];
3384
+ /**
3385
+ * Cursor for next page.
3386
+ */
3387
+ next_cursor?: string;
3388
+ };
3389
+ /**
3390
+ * Customer seller store review with multi-dimensional ratings and media.
3391
+ */
3392
+ export type StoreReview = {
3393
+ /**
3394
+ * Review UUID.
3395
+ */
3396
+ id?: string;
3397
+ /**
3398
+ * Store UUID.
3399
+ */
3400
+ store_id?: string;
3401
+ /**
3402
+ * Store display name.
3403
+ */
3404
+ store_name?: string;
3405
+ /**
3406
+ * Store slug.
3407
+ */
3408
+ store_slug?: string;
3409
+ /**
3410
+ * Backing store order UUID.
3411
+ */
3412
+ store_order_id?: string | null;
3413
+ /**
3414
+ * Author customer ID.
3415
+ */
3416
+ customer_id?: string;
3417
+ /**
3418
+ * Public display name.
3419
+ */
3420
+ author_name?: string;
3421
+ /**
3422
+ * Whether anonymous.
3423
+ */
3424
+ anonymous?: boolean;
3425
+ /**
3426
+ * True when linked to paid order.
3427
+ */
3428
+ verified_purchase?: boolean;
3429
+ /**
3430
+ * Overall rating (1..5).
3431
+ */
3432
+ overall_rating?: number;
3433
+ /**
3434
+ * Shipping rating.
3435
+ */
3436
+ shipping_rating?: number | null;
3437
+ /**
3438
+ * Packaging rating.
3439
+ */
3440
+ packaging_rating?: number | null;
3441
+ /**
3442
+ * Communication rating.
3443
+ */
3444
+ communication_rating?: number | null;
3445
+ /**
3446
+ * Optional headline.
3447
+ */
3448
+ title?: string;
3449
+ /**
3450
+ * Review text.
3451
+ */
3452
+ body?: string;
3453
+ /**
3454
+ * Moderation status.
3455
+ */
3456
+ status?: string;
3457
+ /**
3458
+ * Helpful votes count.
3459
+ */
3460
+ helpful_count?: number;
3461
+ /**
3462
+ * Not-helpful votes count.
3463
+ */
3464
+ not_helpful_count?: number;
3465
+ /**
3466
+ * Official seller reply.
3467
+ */
3468
+ seller_reply?: string | null;
3469
+ /**
3470
+ * Seller reply timestamp.
3471
+ */
3472
+ seller_replied_at?: string | null;
3473
+ /**
3474
+ * Photo and video attachments.
3475
+ */
3476
+ media?: ReviewMedia[];
3477
+ /**
3478
+ * Custom metadata.
3479
+ */
3480
+ metadata?: {
3481
+ [key: string]: unknown;
3482
+ };
3483
+ /**
3484
+ * Creation timestamp.
3485
+ */
3486
+ created_at?: string;
3487
+ /**
3488
+ * Last update timestamp.
3489
+ */
3490
+ updated_at?: string;
3491
+ [key: string]: unknown;
3492
+ };
3493
+ /**
3494
+ * Store review summary and list.
3495
+ */
3496
+ export type StoreReviewListResponse = {
3497
+ /**
3498
+ * Store UUID.
3499
+ */
3500
+ store_id: string;
3501
+ summary: StoreReviewSummary;
3502
+ /**
3503
+ * Published store reviews.
3504
+ */
3505
+ reviews: StoreReview[];
3506
+ /**
3507
+ * Cursor for next page, absent on the last page.
3508
+ */
3509
+ next_cursor?: string;
3510
+ };
3511
+ /**
3512
+ * Aggregated multi-dimensional store rating summary.
3513
+ */
3514
+ export type StoreReviewSummary = {
3515
+ /**
3516
+ * Overall average.
3517
+ */
3518
+ overall_avg?: number;
3519
+ /**
3520
+ * Overall average in bps.
3521
+ */
3522
+ rating_avg_bps?: number | null;
3523
+ /**
3524
+ * Average shipping rating.
3525
+ */
3526
+ shipping_avg?: number;
3527
+ /**
3528
+ * Average packaging rating.
3529
+ */
3530
+ packaging_avg?: number;
3531
+ /**
3532
+ * Average communication rating.
3533
+ */
3534
+ communication_avg?: number;
3535
+ /**
3536
+ * Total published store reviews.
3537
+ */
3538
+ total_count?: number;
3539
+ /**
3540
+ * Verified count.
3541
+ */
3542
+ verified_count?: number;
3543
+ /**
3544
+ * Reviews with media.
3545
+ */
3546
+ with_media_count?: number;
3547
+ /**
3548
+ * Star histogram (1..5).
3549
+ */
3550
+ histogram?: {
3551
+ [key: string]: unknown;
3552
+ };
3553
+ [key: string]: unknown;
3554
+ };
3555
+ /**
3556
+ * Synced PSP sub-merchant account for a store.
3557
+ */
3558
+ export type SubMerchantAccount = {
3559
+ /**
3560
+ * Payments sub-merchant UUID.
3561
+ */
3562
+ id?: string;
3563
+ /**
3564
+ * Payment channel slug.
3565
+ */
3566
+ channel_key?: string;
3567
+ /**
3568
+ * Commerce store UUID.
3569
+ */
3570
+ seller_ref?: string;
3571
+ /**
3572
+ * Provider name (stripe or iyzico).
3573
+ */
3574
+ provider?: string;
3575
+ /**
3576
+ * Provider sub-merchant ID.
3577
+ */
3578
+ external_id?: string;
3579
+ /**
3580
+ * personal, private_company, or limited_or_joint_stock.
3581
+ */
3582
+ sub_merchant_type?: string;
3583
+ /**
3584
+ * Onboarding status.
3585
+ */
3586
+ status?: string;
3587
+ /**
3588
+ * Whether charges are enabled.
3589
+ */
3590
+ charges_enabled?: boolean;
3591
+ /**
3592
+ * Whether payouts are enabled.
3593
+ */
3594
+ payouts_enabled?: boolean;
3595
+ [key: string]: unknown;
3596
+ };
3597
+ /**
3598
+ * Jurisdiction tax rate in basis points.
3599
+ */
3600
+ export type TaxRate = {
3601
+ /**
3602
+ * Tax rate UUID.
3603
+ */
3604
+ id?: string;
3605
+ /**
3606
+ * ISO country code.
3607
+ */
3608
+ country?: string;
3609
+ /**
3610
+ * Optional state/province code.
3611
+ */
3612
+ region_code?: string;
3613
+ /**
3614
+ * Tax category slug.
3615
+ */
3616
+ tax_category?: string;
3617
+ /**
3618
+ * Tax rate in basis points (2000 = 20%).
3619
+ */
3620
+ rate_bps?: number;
3621
+ /**
3622
+ * Tax label (e.g. KDV %20).
3623
+ */
3624
+ name?: string;
3625
+ [key: string]: unknown;
3626
+ };
3627
+ /**
3628
+ * List of tax rates.
3629
+ */
3630
+ export type TaxRateList = {
3631
+ /**
3632
+ * Tax rates.
3633
+ */
3634
+ tax_rates: TaxRate[];
3635
+ };
3636
+ /**
3637
+ * Sellable product variant (physical, digital, service, bundle, or IAP-bridged).
3638
+ */
3639
+ export type Variant = {
3640
+ /**
3641
+ * Variant UUID.
3642
+ */
3643
+ id?: string;
3644
+ /**
3645
+ * Product UUID.
3646
+ */
3647
+ product_id?: string;
3648
+ /**
3649
+ * Variant title.
3650
+ */
3651
+ title?: string;
3652
+ /**
3653
+ * Canonical SKU.
3654
+ */
3655
+ sku?: string;
3656
+ /**
3657
+ * GTIN/EAN/UPC barcode.
3658
+ */
3659
+ barcode?: string;
3660
+ /**
3661
+ * physical, digital, service, or external.
3662
+ */
3663
+ fulfillment_kind?: string;
3664
+ /**
3665
+ * Whether this variant explodes into bundle child lines.
3666
+ */
3667
+ is_bundle?: boolean;
3668
+ /**
3669
+ * IAP entitlement slug granted automatically when paid.
3670
+ */
3671
+ grants_entitlement_key?: string | null;
3672
+ /**
3673
+ * ISO 8601 duration for granted entitlement (empty for lifetime).
3674
+ */
3675
+ grants_entitlement_duration?: string | null;
3676
+ /**
3677
+ * Current winning Buy Box listing UUID.
3678
+ */
3679
+ buybox_listing_id?: string | null;
3680
+ /**
3681
+ * Creation timestamp.
3682
+ */
3683
+ created_at?: string;
3684
+ [key: string]: unknown;
3685
+ };
3686
+ /**
3687
+ * Summary of a merchandising rule applied to a search or recommendation response.
3688
+ */
3689
+ export type AppliedRuleSummary = {
3690
+ /**
3691
+ * Rule UUID.
3692
+ */
3693
+ id: string;
3694
+ /**
3695
+ * Rule key.
3696
+ */
3697
+ key: string;
3698
+ /**
3699
+ * Rule display name.
3700
+ */
3701
+ name: string;
3702
+ /**
3703
+ * Action types applied by this rule.
3704
+ */
3705
+ actions: string[];
3706
+ };
3707
+ /**
3708
+ * Active experiment variant assigned for the discovery strategy.
3709
+ */
3710
+ export type ExperimentAssignment = ({
3711
+ /**
3712
+ * Experiment flag key.
3713
+ */
3714
+ key: string;
3715
+ /**
3716
+ * Assigned variant key.
3717
+ */
3718
+ variant: string;
3719
+ }) | null;
3720
+ /**
3721
+ * Declarative non-negative finite ranking weights for custom discovery strategies.
3722
+ */
3723
+ export type DiscoveryWeights = {
3724
+ /**
3725
+ * Lexical text relevance weight.
3726
+ */
3727
+ w_text?: number;
3728
+ /**
3729
+ * 7-day engagement/trending popularity weight.
3730
+ */
3731
+ w_popularity?: number;
3732
+ /**
3733
+ * Conversion rate and bestseller velocity weight.
3734
+ */
3735
+ w_conversion?: number;
3736
+ /**
3737
+ * Product review rating weight.
3738
+ */
3739
+ w_rating?: number;
3740
+ /**
3741
+ * Product publication recency weight.
3742
+ */
3743
+ w_freshness?: number;
3744
+ /**
3745
+ * Price attractiveness weight (positive favors lower price).
3746
+ */
3747
+ w_price?: number;
3748
+ /**
3749
+ * Winning seller quality score weight.
3750
+ */
3751
+ w_seller_score?: number;
3752
+ /**
3753
+ * Consent-gated user affinity weight.
3754
+ */
3755
+ w_personalization?: number;
3756
+ /**
3757
+ * Additive score bonus for in-stock products.
3758
+ */
3759
+ in_stock_boost?: number;
3760
+ };
3761
+ /**
3762
+ * Structured filter constraints used by strategy default_filters or rule inject_filter actions.
3763
+ */
3764
+ export type DiscoveryFilterSpec = ({
3765
+ /**
3766
+ * Category UUID.
3767
+ */
3768
+ category_id?: string;
3769
+ /**
3770
+ * Category UUIDs.
3771
+ */
3772
+ category_ids?: string[];
3773
+ /**
3774
+ * Brand UUID.
3775
+ */
3776
+ brand_id?: string;
3777
+ /**
3778
+ * Brand UUIDs.
3779
+ */
3780
+ brand_ids?: string[];
3781
+ /**
3782
+ * Store UUID.
3783
+ */
3784
+ store_id?: string;
3785
+ /**
3786
+ * Collection UUID.
3787
+ */
3788
+ collection_id?: string;
3789
+ /**
3790
+ * Channel key.
3791
+ */
3792
+ channel?: string;
3793
+ /**
3794
+ * Region key.
3795
+ */
3796
+ region?: string;
3797
+ /**
3798
+ * Currency code.
3799
+ */
3800
+ currency?: string;
3801
+ /**
3802
+ * Product kind.
3803
+ */
3804
+ kind?: string;
3805
+ /**
3806
+ * Offer condition.
3807
+ */
3808
+ condition?: string;
3809
+ /**
3810
+ * Minimum price in minor units.
3811
+ */
3812
+ min_price?: number;
3813
+ /**
3814
+ * Maximum price in minor units.
3815
+ */
3816
+ max_price?: number;
3817
+ /**
3818
+ * In-stock filter.
3819
+ */
3820
+ in_stock?: boolean;
3821
+ /**
3822
+ * Minimum star rating (0..5).
3823
+ */
3824
+ min_rating?: number;
3825
+ /**
3826
+ * Attribute JSONB filter pairs.
3827
+ */
3828
+ attributes?: {
3829
+ [key: string]: unknown;
3830
+ };
3831
+ }) | null;
3832
+ /**
3833
+ * Explicit 0-based position pin entry.
3834
+ */
3835
+ export type DiscoveryPinItem = {
3836
+ /**
3837
+ * Product UUID to pin.
3838
+ */
3839
+ product_id: string;
3840
+ /**
3841
+ * Zero-based target position.
3842
+ */
3843
+ position: number;
3844
+ };
3845
+ /**
3846
+ * Merchandising rule action (pin, hide, boost, bury, inject_filter, or redirect).
3847
+ */
3848
+ export type MerchandisingRuleAction = {
3849
+ /**
3850
+ * Action type: pin, hide, boost, bury, inject_filter, or redirect.
3851
+ */
3852
+ type: string;
3853
+ /**
3854
+ * Target URL for redirect action.
3855
+ */
3856
+ url?: string;
3857
+ /**
3858
+ * Target product UUIDs.
3859
+ */
3860
+ product_ids?: string[];
3861
+ /**
3862
+ * Target brand UUIDs.
3863
+ */
3864
+ brand_ids?: string[];
3865
+ /**
3866
+ * Target category UUIDs.
3867
+ */
3868
+ category_ids?: string[];
3869
+ /**
3870
+ * Starting 0-based pin position.
3871
+ */
3872
+ position?: number;
3873
+ /**
3874
+ * Explicit per-product pin positions.
3875
+ */
3876
+ pins?: DiscoveryPinItem[];
3877
+ /**
3878
+ * Multiplicative boost/bury factor.
3879
+ */
3880
+ factor?: number;
3881
+ /**
3882
+ * Additive score delta for boost/bury.
3883
+ */
3884
+ delta?: number;
3885
+ filters?: DiscoveryFilterSpec;
3886
+ [key: string]: unknown;
3887
+ };
3888
+ /**
3889
+ * Structured storefront product recommendation request.
3890
+ */
3891
+ export type RecommendRequest = {
3892
+ /**
3893
+ * Built-in or custom strategy key.
3894
+ */
3895
+ strategy?: string;
3896
+ /**
3897
+ * Anchor product UUID or handle (for similar/fbt).
3898
+ */
3899
+ product_id?: string;
3900
+ /**
3901
+ * Authorized cart UUID (for cart_complementary).
3902
+ */
3903
+ cart_id?: string;
3904
+ /**
3905
+ * Explicit seed product UUIDs.
3906
+ */
3907
+ product_ids?: string[];
3908
+ /**
3909
+ * Optional contextual category UUID.
3910
+ */
3911
+ category_id?: string;
3912
+ /**
3913
+ * Optional contextual brand UUID.
3914
+ */
3915
+ brand_id?: string;
3916
+ /**
3917
+ * Optional contextual store UUID.
3918
+ */
3919
+ store_id?: string;
3920
+ /**
3921
+ * Optional sales channel key.
3922
+ */
3923
+ channel?: string;
2192
3924
  /**
2193
- * Store-level withholding tax override in bps.
3925
+ * Optional region key.
2194
3926
  */
2195
- withholding_bps?: number | null;
3927
+ region?: string;
2196
3928
  /**
2197
- * Store-level escrow release days override.
3929
+ * Optional ISO 4217 currency code.
2198
3930
  */
2199
- escrow_release_days?: number | null;
3931
+ currency?: string;
2200
3932
  /**
2201
- * Custom store metadata.
3933
+ * Maximum recommendations to return (default 12, values >100 are clamped to 100).
2202
3934
  */
2203
- metadata?: {
2204
- [key: string]: unknown;
2205
- };
3935
+ limit?: number;
2206
3936
  /**
2207
- * Creation timestamp.
3937
+ * Product UUIDs to exclude from recommendations.
2208
3938
  */
2209
- created_at?: string;
3939
+ exclude_product_ids?: string[];
2210
3940
  /**
2211
- * Last update timestamp.
3941
+ * Restrict recommendations to in-stock products.
2212
3942
  */
2213
- updated_at?: string;
2214
- [key: string]: unknown;
3943
+ in_stock?: boolean;
3944
+ /**
3945
+ * Additional strategy-specific parameters.
3946
+ */
3947
+ params?: {
3948
+ [key: string]: unknown;
3949
+ };
2215
3950
  };
2216
3951
  /**
2217
- * Paged list of stores.
3952
+ * Product recommendation response with personalization and experiment metadata.
2218
3953
  */
2219
- export type StoreList = {
3954
+ export type RecommendResponse = {
2220
3955
  /**
2221
- * Stores.
3956
+ * Recommended enriched products.
2222
3957
  */
2223
- stores: Store[];
3958
+ products: ProductSearchHit[];
2224
3959
  /**
2225
- * Cursor for next page.
3960
+ * Executed strategy key.
2226
3961
  */
2227
- next_cursor?: string;
3962
+ strategy: string;
3963
+ /**
3964
+ * Whether user personalization signals were applied.
3965
+ */
3966
+ personalized: boolean;
3967
+ /**
3968
+ * Whether a fallback strategy filled or replaced recommendations.
3969
+ */
3970
+ fallback_used?: boolean;
3971
+ /**
3972
+ * Merchandising rules applied.
3973
+ */
3974
+ applied_rules?: AppliedRuleSummary[];
3975
+ experiment?: ExperimentAssignment;
2228
3976
  };
2229
3977
  /**
2230
- * Seller portal team member assignment.
3978
+ * Custom or hybrid discovery ranking strategy.
2231
3979
  */
2232
- export type StoreMember = {
3980
+ export type DiscoveryStrategy = {
2233
3981
  /**
2234
- * Store UUID.
3982
+ * Strategy UUID.
2235
3983
  */
2236
- store_id?: string;
3984
+ id: string;
2237
3985
  /**
2238
- * Auth user ID.
3986
+ * Unique strategy key.
2239
3987
  */
2240
- user_id?: string;
3988
+ key: string;
2241
3989
  /**
2242
- * viewer, fulfillment, manager, or owner.
3990
+ * Display name.
2243
3991
  */
2244
- role?: string;
2245
- [key: string]: unknown;
3992
+ name: string;
3993
+ /**
3994
+ * Strategy description.
3995
+ */
3996
+ description?: string;
3997
+ /**
3998
+ * Base algorithm (relevance, trending, bestsellers, new_arrivals, top_rated, similar, fbt, cart_complementary, personalized, hybrid).
3999
+ */
4000
+ base_algorithm: string;
4001
+ weights: DiscoveryWeights;
4002
+ default_filters?: DiscoveryFilterSpec;
4003
+ /**
4004
+ * Bound merchandising rule UUIDs.
4005
+ */
4006
+ rule_ids: string[];
4007
+ /**
4008
+ * Optional discovery.rank hook UUID.
4009
+ */
4010
+ hook_id?: string | null;
4011
+ /**
4012
+ * Optional flags experiment key.
4013
+ */
4014
+ experiment_flag_key?: string | null;
4015
+ /**
4016
+ * Whether strategy is active.
4017
+ */
4018
+ enabled: boolean;
4019
+ /**
4020
+ * Creation timestamp.
4021
+ */
4022
+ created_at: string;
4023
+ /**
4024
+ * Last update timestamp.
4025
+ */
4026
+ updated_at: string;
2246
4027
  };
2247
4028
  /**
2248
- * Seller quality and Buy Box metrics.
4029
+ * List of discovery strategies.
2249
4030
  */
2250
- export type StoreMetrics = {
4031
+ export type DiscoveryStrategyList = {
2251
4032
  /**
2252
- * Store UUID.
4033
+ * Discovery strategies.
2253
4034
  */
2254
- store_id?: string;
4035
+ strategies: DiscoveryStrategy[];
4036
+ };
4037
+ /**
4038
+ * Request to create a custom discovery strategy.
4039
+ */
4040
+ export type CreateDiscoveryStrategyRequest = {
2255
4041
  /**
2256
- * Composite quality score (0..1000).
4042
+ * Optional unique key (derived from name if omitted).
2257
4043
  */
2258
- seller_score?: number;
4044
+ key?: string;
2259
4045
  /**
2260
- * On-time dispatch rate in bps.
4046
+ * Strategy name.
2261
4047
  */
2262
- on_time_dispatch_bps?: number;
4048
+ name: string;
2263
4049
  /**
2264
- * Seller-fault cancellation rate in bps.
4050
+ * Strategy description.
2265
4051
  */
2266
- cancellation_rate_bps?: number;
4052
+ description?: string;
2267
4053
  /**
2268
- * Return rate in bps.
4054
+ * Base algorithm.
2269
4055
  */
2270
- return_rate_bps?: number;
4056
+ base_algorithm?: string;
4057
+ weights?: DiscoveryWeights;
4058
+ default_filters?: DiscoveryFilterSpec;
2271
4059
  /**
2272
- * Total paid store orders.
4060
+ * Bound merchandising rule UUIDs.
2273
4061
  */
2274
- total_orders?: number;
4062
+ rule_ids?: string[];
2275
4063
  /**
2276
- * Last update timestamp.
4064
+ * Optional discovery.rank hook UUID.
2277
4065
  */
2278
- updated_at?: string;
2279
- [key: string]: unknown;
4066
+ hook_id?: string | null;
4067
+ /**
4068
+ * Optional flags experiment key.
4069
+ */
4070
+ experiment_flag_key?: string | null;
4071
+ /**
4072
+ * Whether active (default true).
4073
+ */
4074
+ enabled?: boolean;
2280
4075
  };
2281
4076
  /**
2282
- * Per-seller split order with marketplace financial breakdown.
4077
+ * Partial update for a custom discovery strategy.
2283
4078
  */
2284
- export type StoreOrder = {
4079
+ export type UpdateDiscoveryStrategyRequest = {
2285
4080
  /**
2286
- * Store order UUID.
4081
+ * Strategy name.
2287
4082
  */
2288
- id?: string;
4083
+ name?: string;
2289
4084
  /**
2290
- * Parent order UUID.
4085
+ * Strategy description.
2291
4086
  */
2292
- order_id?: string;
4087
+ description?: string;
2293
4088
  /**
2294
- * Store UUID.
4089
+ * Base algorithm.
2295
4090
  */
2296
- store_id?: string;
4091
+ base_algorithm?: string;
4092
+ weights?: DiscoveryWeights;
4093
+ default_filters?: DiscoveryFilterSpec;
2297
4094
  /**
2298
- * Per-store order number.
4095
+ * Bound merchandising rule UUIDs.
2299
4096
  */
2300
- store_order_number?: string;
4097
+ rule_ids?: string[];
2301
4098
  /**
2302
- * ISO 4217 currency.
4099
+ * Optional discovery.rank hook UUID.
2303
4100
  */
2304
- currency?: string;
4101
+ hook_id?: string | null;
2305
4102
  /**
2306
- * Store order status.
4103
+ * Optional flags experiment key.
2307
4104
  */
2308
- status?: string;
4105
+ experiment_flag_key?: string | null;
2309
4106
  /**
2310
- * Store subtotal.
4107
+ * Whether active.
2311
4108
  */
2312
- subtotal_amount?: number;
4109
+ enabled?: boolean;
4110
+ };
4111
+ /**
4112
+ * Discovery merchandising rule.
4113
+ */
4114
+ export type MerchandisingRule = {
2313
4115
  /**
2314
- * Seller-funded discount.
4116
+ * Rule UUID.
2315
4117
  */
2316
- seller_discount_amount?: number;
4118
+ id: string;
2317
4119
  /**
2318
- * Platform-funded discount.
4120
+ * Unique rule key.
2319
4121
  */
2320
- platform_discount_amount?: number;
4122
+ key: string;
2321
4123
  /**
2322
- * Store shipping.
4124
+ * Rule display name.
2323
4125
  */
2324
- shipping_amount?: number;
4126
+ name: string;
2325
4127
  /**
2326
- * Buyer principal allocated to this store.
4128
+ * Rule description.
2327
4129
  */
2328
- buyer_paid_principal_amount?: number;
4130
+ description?: string;
2329
4131
  /**
2330
- * Platform marketplace commission.
4132
+ * Optional target strategy key.
2331
4133
  */
2332
- platform_commission_amount?: number;
4134
+ strategy_key?: string | null;
2333
4135
  /**
2334
- * E-commerce withholding tax (stopaj).
4136
+ * Recursive ConditionTree JSON.
2335
4137
  */
2336
- withholding_tax_amount?: number;
4138
+ conditions: {
4139
+ [key: string]: unknown;
4140
+ };
2337
4141
  /**
2338
- * Net seller payout.
4142
+ * Ordered merchandising actions.
2339
4143
  */
2340
- seller_net_amount?: number;
4144
+ actions: MerchandisingRuleAction[];
2341
4145
  /**
2342
- * none, held, partial, released, or disputed.
4146
+ * Evaluation priority (lower runs first).
2343
4147
  */
2344
- escrow_status?: string;
4148
+ priority: number;
4149
+ /**
4150
+ * Optional start timestamp.
4151
+ */
4152
+ starts_at?: string | null;
4153
+ /**
4154
+ * Optional end timestamp.
4155
+ */
4156
+ ends_at?: string | null;
4157
+ /**
4158
+ * Whether rule is active.
4159
+ */
4160
+ enabled: boolean;
4161
+ /**
4162
+ * Rule metadata.
4163
+ */
4164
+ metadata?: {
4165
+ [key: string]: unknown;
4166
+ };
2345
4167
  /**
2346
4168
  * Creation timestamp.
2347
4169
  */
2348
- created_at?: string;
2349
- [key: string]: unknown;
4170
+ created_at: string;
4171
+ /**
4172
+ * Last update timestamp.
4173
+ */
4174
+ updated_at: string;
2350
4175
  };
2351
4176
  /**
2352
- * Store order with its line items.
4177
+ * List of merchandising rules.
2353
4178
  */
2354
- export type StoreOrderDetail = {
2355
- store_order?: StoreOrder;
4179
+ export type MerchandisingRuleList = {
2356
4180
  /**
2357
- * Store order lines.
4181
+ * Merchandising rules.
2358
4182
  */
2359
- lines?: OrderLine[];
2360
- [key: string]: unknown;
4183
+ rules: MerchandisingRule[];
2361
4184
  };
2362
4185
  /**
2363
- * Paged list of store orders.
4186
+ * Request to create a merchandising rule.
2364
4187
  */
2365
- export type StoreOrderList = {
4188
+ export type CreateMerchandisingRuleRequest = {
2366
4189
  /**
2367
- * Store orders.
4190
+ * Optional unique key (derived from name if omitted).
2368
4191
  */
2369
- store_orders: StoreOrder[];
4192
+ key?: string;
2370
4193
  /**
2371
- * Cursor for next page.
4194
+ * Rule display name.
2372
4195
  */
2373
- next_cursor?: string;
2374
- };
2375
- /**
2376
- * Synced PSP sub-merchant account for a store.
2377
- */
2378
- export type SubMerchantAccount = {
4196
+ name: string;
2379
4197
  /**
2380
- * Payments sub-merchant UUID.
4198
+ * Rule description.
2381
4199
  */
2382
- id?: string;
4200
+ description?: string;
2383
4201
  /**
2384
- * Payment channel slug.
4202
+ * Optional target strategy key.
2385
4203
  */
2386
- channel_key?: string;
4204
+ strategy_key?: string | null;
2387
4205
  /**
2388
- * Commerce store UUID.
4206
+ * Recursive ConditionTree JSON.
2389
4207
  */
2390
- seller_ref?: string;
4208
+ conditions?: {
4209
+ [key: string]: unknown;
4210
+ };
2391
4211
  /**
2392
- * Provider name (stripe or iyzico).
4212
+ * Ordered merchandising actions.
2393
4213
  */
2394
- provider?: string;
4214
+ actions: MerchandisingRuleAction[];
2395
4215
  /**
2396
- * Provider sub-merchant ID.
4216
+ * Evaluation priority (default 100).
2397
4217
  */
2398
- external_id?: string;
4218
+ priority?: number;
2399
4219
  /**
2400
- * personal, private_company, or limited_or_joint_stock.
4220
+ * Optional start timestamp.
2401
4221
  */
2402
- sub_merchant_type?: string;
4222
+ starts_at?: string | null;
2403
4223
  /**
2404
- * Onboarding status.
4224
+ * Optional end timestamp.
2405
4225
  */
2406
- status?: string;
4226
+ ends_at?: string | null;
2407
4227
  /**
2408
- * Whether charges are enabled.
4228
+ * Whether active (default true).
2409
4229
  */
2410
- charges_enabled?: boolean;
4230
+ enabled?: boolean;
2411
4231
  /**
2412
- * Whether payouts are enabled.
4232
+ * Rule metadata.
2413
4233
  */
2414
- payouts_enabled?: boolean;
2415
- [key: string]: unknown;
4234
+ metadata?: {
4235
+ [key: string]: unknown;
4236
+ };
2416
4237
  };
2417
4238
  /**
2418
- * Jurisdiction tax rate in basis points.
4239
+ * Partial update for a merchandising rule.
2419
4240
  */
2420
- export type TaxRate = {
4241
+ export type UpdateMerchandisingRuleRequest = {
2421
4242
  /**
2422
- * Tax rate UUID.
4243
+ * Rule display name.
2423
4244
  */
2424
- id?: string;
4245
+ name?: string;
2425
4246
  /**
2426
- * ISO country code.
4247
+ * Rule description.
2427
4248
  */
2428
- country?: string;
4249
+ description?: string;
2429
4250
  /**
2430
- * Optional state/province code.
4251
+ * Optional target strategy key.
2431
4252
  */
2432
- region_code?: string;
4253
+ strategy_key?: string | null;
2433
4254
  /**
2434
- * Tax category slug.
4255
+ * Recursive ConditionTree JSON.
2435
4256
  */
2436
- tax_category?: string;
4257
+ conditions?: {
4258
+ [key: string]: unknown;
4259
+ };
2437
4260
  /**
2438
- * Tax rate in basis points (2000 = 20%).
4261
+ * Ordered merchandising actions.
2439
4262
  */
2440
- rate_bps?: number;
4263
+ actions?: MerchandisingRuleAction[];
2441
4264
  /**
2442
- * Tax label (e.g. KDV %20).
4265
+ * Evaluation priority.
2443
4266
  */
2444
- name?: string;
2445
- [key: string]: unknown;
2446
- };
2447
- /**
2448
- * List of tax rates.
2449
- */
2450
- export type TaxRateList = {
4267
+ priority?: number;
2451
4268
  /**
2452
- * Tax rates.
4269
+ * Optional start timestamp.
2453
4270
  */
2454
- tax_rates: TaxRate[];
4271
+ starts_at?: string | null;
4272
+ /**
4273
+ * Optional end timestamp.
4274
+ */
4275
+ ends_at?: string | null;
4276
+ /**
4277
+ * Whether active.
4278
+ */
4279
+ enabled?: boolean;
4280
+ /**
4281
+ * Rule metadata.
4282
+ */
4283
+ metadata?: {
4284
+ [key: string]: unknown;
4285
+ };
2455
4286
  };
2456
4287
  /**
2457
- * Sellable product variant (physical, digital, service, bundle, or IAP-bridged).
4288
+ * One-way or two-way search synonym group.
2458
4289
  */
2459
- export type Variant = {
4290
+ export type SearchSynonym = {
4291
+ /**
4292
+ * Synonym UUID.
4293
+ */
4294
+ id: string;
4295
+ /**
4296
+ * two_way or one_way.
4297
+ */
4298
+ kind: string;
4299
+ /**
4300
+ * Source term.
4301
+ */
4302
+ source_term: string;
4303
+ /**
4304
+ * Normalized source term.
4305
+ */
4306
+ source_term_norm: string;
4307
+ /**
4308
+ * Target expansion terms.
4309
+ */
4310
+ target_terms: string[];
4311
+ /**
4312
+ * Normalized target expansion terms.
4313
+ */
4314
+ target_terms_norm: string[];
2460
4315
  /**
2461
- * Variant UUID.
4316
+ * Whether synonym is active.
2462
4317
  */
2463
- id?: string;
4318
+ enabled: boolean;
2464
4319
  /**
2465
- * Product UUID.
4320
+ * Creation timestamp.
2466
4321
  */
2467
- product_id?: string;
4322
+ created_at: string;
2468
4323
  /**
2469
- * Variant title.
4324
+ * Last update timestamp.
2470
4325
  */
2471
- title?: string;
4326
+ updated_at: string;
4327
+ };
4328
+ /**
4329
+ * List of search synonyms.
4330
+ */
4331
+ export type SearchSynonymList = {
2472
4332
  /**
2473
- * Canonical SKU.
4333
+ * Search synonyms.
2474
4334
  */
2475
- sku?: string;
4335
+ synonyms: SearchSynonym[];
4336
+ };
4337
+ /**
4338
+ * Request to create or update a search synonym.
4339
+ */
4340
+ export type CreateSearchSynonymRequest = {
2476
4341
  /**
2477
- * GTIN/EAN/UPC barcode.
4342
+ * two_way (default) or one_way.
2478
4343
  */
2479
- barcode?: string;
4344
+ kind?: string;
2480
4345
  /**
2481
- * physical, digital, service, or external.
4346
+ * Source search term.
2482
4347
  */
2483
- fulfillment_kind?: string;
4348
+ source_term: string;
2484
4349
  /**
2485
- * Whether this variant explodes into bundle child lines.
4350
+ * Target expansion terms.
2486
4351
  */
2487
- is_bundle?: boolean;
4352
+ target_terms: string[];
2488
4353
  /**
2489
- * IAP entitlement slug granted automatically when paid.
4354
+ * Whether active (default true).
2490
4355
  */
2491
- grants_entitlement_key?: string | null;
4356
+ enabled?: boolean;
4357
+ };
4358
+ /**
4359
+ * Summary of behavioral signal and co-occurrence recomputation.
4360
+ */
4361
+ export type DiscoverySignalRefreshResponse = {
2492
4362
  /**
2493
- * ISO 8601 duration for granted entitlement (empty for lifetime).
4363
+ * Number of products whose signals were updated.
2494
4364
  */
2495
- grants_entitlement_duration?: string | null;
4365
+ products_updated: number;
2496
4366
  /**
2497
- * Current winning Buy Box listing UUID.
4367
+ * Number of symmetric co-occurrence pairs computed.
2498
4368
  */
2499
- buybox_listing_id?: string | null;
4369
+ cooccurrence_pairs: number;
2500
4370
  /**
2501
- * Creation timestamp.
4371
+ * Whether ClickHouse behavioral events were merged.
2502
4372
  */
2503
- created_at?: string;
2504
- [key: string]: unknown;
4373
+ clickhouse_merged: boolean;
4374
+ /**
4375
+ * Timestamp of signal refresh.
4376
+ */
4377
+ updated_at: string;
2505
4378
  };
2506
4379
  /** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
2507
4380
  export interface Events {
@@ -2553,6 +4426,10 @@ export interface Events {
2553
4426
  * A buyer or operator requested an RMA return.
2554
4427
  */
2555
4428
  "commerce.return.requested": CommerceReturnEvent;
4429
+ /**
4430
+ * A customer submitted a product or store review.
4431
+ */
4432
+ "commerce.review.created": CommerceReviewCreatedEvent;
2556
4433
  /**
2557
4434
  * A first-party or third-party marketplace store was created.
2558
4435
  */
@@ -2620,7 +4497,7 @@ export declare function client(t: Transport): {
2620
4497
  /**
2621
4498
  * Execute single-TX checkout with stock/promo holds and marketplace payment intent
2622
4499
  *
2623
- * Execute single-TX checkout with stock/promo holds and marketplace payment intent
4500
+ * Execute single-TX checkout with stock/promo holds and marketplace payment intent. `payment_method` is `card` (the default) or `wallet`, paid through a payment channel, or — with nothing paid yet — `cod` or `bank_transfer`, which a buyer picks only where the project's settings name them (`offline_payment_methods`; 403 `payment_method_not_allowed` otherwise), and `net_terms`, which the project's server (its secret key) alone checks out with. Any other name is refused (400 `invalid_payment_method`).
2624
4501
  */
2625
4502
  checkoutCart(input: {
2626
4503
  path: {
@@ -2632,7 +4509,7 @@ export declare function client(t: Transport): {
2632
4509
  /**
2633
4510
  * Add listing item to cart
2634
4511
  *
2635
- * Add listing item to cart
4512
+ * Add listing item to cart. The quantity goes onto the cart's line of the listing, or makes one, at the listing's price. A line whose unit price the project's server set (its secret key) is a line of its own: a buyer's add never goes onto it, and a buyer who sends a price is refused (403 custom_price_forbidden). The listing's most per order and its stock count every line of it in the cart.
2636
4513
  */
2637
4514
  addCartItem(input: {
2638
4515
  path: {
@@ -2656,7 +4533,7 @@ export declare function client(t: Transport): {
2656
4533
  /**
2657
4534
  * Update cart item quantity or selection
2658
4535
  *
2659
- * Update cart item quantity or selection
4536
+ * Update cart item quantity or selection; a quantity of 0 takes the line out. The quantity of a line whose unit price the project's server set (its secret key) is the server's to change: a buyer's change of it is refused (403 custom_price_forbidden), taking the line out or changing its selection is not. The listing's most per order and its stock count every line of it in the cart.
2660
4537
  */
2661
4538
  updateCartItem(input: {
2662
4539
  path: {
@@ -2669,7 +4546,7 @@ export declare function client(t: Transport): {
2669
4546
  /**
2670
4547
  * Merge guest cart into signed-in customer cart
2671
4548
  *
2672
- * Merge guest cart into signed-in customer cart
4549
+ * Merge guest cart into signed-in customer cart. Only an open cart (status active) is merged: one being checked out, checked out or merged already is refused (409 cart_not_active).
2673
4550
  */
2674
4551
  mergeGuestCart(input: {
2675
4552
  path: {
@@ -2747,23 +4624,90 @@ export declare function client(t: Transport): {
2747
4624
  signal?: AbortSignal;
2748
4625
  }): Promise<Reply<200, CollectionList>>;
2749
4626
  /**
2750
- * List active storefront products
4627
+ * List and search active storefront products
2751
4628
  *
2752
- * List active storefront products
4629
+ * List, search, filter, sort, and facet active storefront products with materialized Buy Box price, stock availability, offer count, media, brand, and category in a single query.
2753
4630
  */
2754
4631
  storefrontListProducts(input?: {
2755
4632
  query?: {
2756
- limit?: number; /** Opaque keyset pagination cursor. */
2757
- cursor?: string; /** Full-text or trigram search query. */
2758
- q?: string; /** Filter by category UUID. */
2759
- category_id?: string; /** Filter by brand UUID. */
2760
- brand_id?: string; /** Filter by store UUID. */
4633
+ limit?: number; /** Opaque sort-aware composite pagination cursor. */
4634
+ cursor?: string; /** Typo-tolerant full-text and trigram search query. */
4635
+ q?: string; /** Filter by category UUID (includes descendant categories). */
4636
+ category_id?: string; /** Filter by one or more category UUIDs. */
4637
+ category_ids?: string[]; /** Filter by brand UUID. */
4638
+ brand_id?: string; /** Filter by one or more brand UUIDs. */
4639
+ brand_ids?: string[]; /** Filter by store UUID. */
2761
4640
  store_id?: string; /** Filter by collection UUID. */
2762
- collection_id?: string; /** Channel key. */
2763
- channel?: string;
4641
+ collection_id?: string; /** Filter by sales channel key. */
4642
+ channel?: string; /** Region key for Buy Box and currency resolution. */
4643
+ region?: string; /** ISO 4217 currency code. */
4644
+ currency?: string; /** Filter by product kind. */
4645
+ kind?: "physical" | "digital" | "service" | "bundle"; /** Filter by offer condition. */
4646
+ condition?: "new" | "open_box" | "refurbished" | "used"; /** Minimum unit price in minor units. */
4647
+ min_price?: number; /** Maximum unit price in minor units. */
4648
+ max_price?: number; /** Filter by stock availability. */
4649
+ in_stock?: boolean; /** Minimum average star rating (0..5). */
4650
+ min_rating?: number; /** JSON-encoded attribute filter map. */
4651
+ attributes?: string; /** Sort mode. */
4652
+ sort?: "relevance" | "newest" | "price_asc" | "price_desc" | "rating_desc" | "bestsellers" | "trending"; /** Discovery strategy identifier. */
4653
+ strategy?: string; /** Facet groups to aggregate in the response. */
4654
+ facets?: string[]; /** Whether to compute dynamic facet counts. */
4655
+ include_facets?: boolean;
4656
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4657
+ signal?: AbortSignal;
4658
+ }): Promise<Reply<200, ProductSearchResponse>>;
4659
+ /**
4660
+ * Structured storefront product search with dynamic facets
4661
+ *
4662
+ * Execute a structured typo-tolerant product search with nested/multi-value attribute filters, sorting, composite cursor pagination, and dynamic single-CTE facets.
4663
+ */
4664
+ storefrontSearchProducts(input: {
4665
+ body: ProductSearchRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4666
+ signal?: AbortSignal;
4667
+ }): Promise<Reply<200, ProductSearchResponse>>;
4668
+ /**
4669
+ * Autocomplete suggestions for products, categories, and brands
4670
+ *
4671
+ * Return fast prefix and trigram autocomplete suggestions across active products (with Buy Box price and primary media), categories, and brands.
4672
+ */
4673
+ storefrontSuggest(input?: {
4674
+ query?: {
4675
+ q?: string; /** Maximum number of suggestions per group (default 8, values <=0 default to 8, values >20 are clamped to 20). */
4676
+ max_results?: number; /** Optional sales channel key. */
4677
+ channel?: string; /** Optional region key. */
4678
+ region?: string; /** Optional ISO 4217 currency code. */
4679
+ currency?: string;
4680
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4681
+ signal?: AbortSignal;
4682
+ }): Promise<Reply<200, SuggestResponse>>;
4683
+ /**
4684
+ * Generate storefront product recommendations using built-in or custom strategies
4685
+ *
4686
+ * Return ranked product recommendations for built-in strategies (relevance, trending, bestsellers, new_arrivals, top_rated, similar, fbt, cart_complementary, personalized) or custom project strategies, with merchandising rules and optional discovery.rank hook.
4687
+ */
4688
+ storefrontRecommendProducts(input: {
4689
+ body: RecommendRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4690
+ signal?: AbortSignal;
4691
+ }): Promise<Reply<200, RecommendResponse>>;
4692
+ /**
4693
+ * Get product recommendations for a given product
4694
+ *
4695
+ * Return similar, frequently bought together, or custom strategy recommendations for a product by UUID or handle.
4696
+ */
4697
+ storefrontProductRecommendations(input: {
4698
+ path: {
4699
+ product_id_or_handle: string;
4700
+ };
4701
+ query?: {
4702
+ strategy?: string; /** Maximum recommendations to return (1..50, default 8). */
4703
+ max_results?: number; /** Optional sales channel key. */
4704
+ channel?: string; /** Optional region key. */
4705
+ region?: string; /** Optional ISO 4217 currency code. */
4706
+ currency?: string; /** Filter recommendations to in-stock products only. */
4707
+ in_stock?: boolean;
2764
4708
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2765
4709
  signal?: AbortSignal;
2766
- }): Promise<Reply<200, ProductList>>;
4710
+ }): Promise<Reply<200, RecommendResponse>>;
2767
4711
  /**
2768
4712
  * Get storefront product with variants and Buy Box offers
2769
4713
  *
@@ -2775,6 +4719,27 @@ export declare function client(t: Transport): {
2775
4719
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2776
4720
  signal?: AbortSignal;
2777
4721
  }): Promise<Reply<200, ProductDetail>>;
4722
+ /**
4723
+ * List published product reviews with rating summary and media
4724
+ *
4725
+ * List published reviews for a product with star histogram, purchased-from store attribution, signed photo/video media URLs, and filters.
4726
+ */
4727
+ storefrontListProductReviews(input: {
4728
+ path: {
4729
+ product_id_or_handle: string;
4730
+ };
4731
+ query?: {
4732
+ rating?: number; /** Filter reviews by purchased-from store UUID or slug. */
4733
+ store_id?: string; /** Return only reviews with photo or video attachments. */
4734
+ with_media?: boolean; /** Filter by media attachment type (image or video). */
4735
+ media_kind?: string; /** Return only verified purchase reviews. */
4736
+ verified_only?: boolean; /** Sort order: newest, highest, lowest, or most_helpful. */
4737
+ sort?: string; /** Page size (default 50, max 200). */
4738
+ limit?: number; /** Pagination cursor from previous response. */
4739
+ cursor?: string;
4740
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4741
+ signal?: AbortSignal;
4742
+ }): Promise<Reply<200, ProductReviewListResponse>>;
2778
4743
  /**
2779
4744
  * List active sales regions
2780
4745
  *
@@ -2806,6 +4771,21 @@ export declare function client(t: Transport): {
2806
4771
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2807
4772
  signal?: AbortSignal;
2808
4773
  }): Promise<Reply<200, Store>>;
4774
+ /**
4775
+ * List published store reviews with multi-dimensional rating summary
4776
+ *
4777
+ * List published store reviews with overall, shipping, packaging, and communication rating averages and signed media URLs.
4778
+ */
4779
+ storefrontListStoreReviews(input: {
4780
+ path: {
4781
+ store_id_or_slug: string;
4782
+ };
4783
+ query?: {
4784
+ limit?: number; /** Pagination cursor from previous response. */
4785
+ cursor?: string;
4786
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4787
+ signal?: AbortSignal;
4788
+ }): Promise<Reply<200, StoreReviewListResponse>>;
2809
4789
  /**
2810
4790
  * List categories
2811
4791
  *
@@ -2950,6 +4930,144 @@ export declare function client(t: Transport): {
2950
4930
  body: GenericPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2951
4931
  signal?: AbortSignal;
2952
4932
  }): Promise<Reply<201, ActionResult>>;
4933
+ /**
4934
+ * List custom discovery strategies
4935
+ *
4936
+ * List declarative and hybrid discovery ranking strategies configured for the project.
4937
+ */
4938
+ listDiscoveryStrategies(input?: {
4939
+ signal?: AbortSignal;
4940
+ }): Promise<Reply<200, DiscoveryStrategyList>>;
4941
+ /**
4942
+ * Create a custom discovery strategy
4943
+ *
4944
+ * Create a declarative weighted discovery strategy with optional default filters, rule references, discovery.rank hook, and flags experiment key.
4945
+ */
4946
+ createDiscoveryStrategy(input: {
4947
+ body: CreateDiscoveryStrategyRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4948
+ signal?: AbortSignal;
4949
+ }): Promise<Reply<201, DiscoveryStrategy>>;
4950
+ /**
4951
+ * Get a custom discovery strategy
4952
+ *
4953
+ * Retrieve a custom discovery strategy by UUID.
4954
+ */
4955
+ getDiscoveryStrategy(input: {
4956
+ path: {
4957
+ strategy_id: string;
4958
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4959
+ signal?: AbortSignal;
4960
+ }): Promise<Reply<200, DiscoveryStrategy>>;
4961
+ /**
4962
+ * Delete a custom discovery strategy
4963
+ *
4964
+ * Delete a custom discovery strategy by UUID.
4965
+ */
4966
+ deleteDiscoveryStrategy(input: {
4967
+ path: {
4968
+ strategy_id: string;
4969
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4970
+ signal?: AbortSignal;
4971
+ }): Promise<Reply<200, ActionResult>>;
4972
+ /**
4973
+ * Update a custom discovery strategy
4974
+ *
4975
+ * Update weights, default filters, rule bindings, hook, experiment flag key, or enabled state of a discovery strategy.
4976
+ */
4977
+ updateDiscoveryStrategy(input: {
4978
+ path: {
4979
+ strategy_id: string;
4980
+ };
4981
+ body: UpdateDiscoveryStrategyRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4982
+ signal?: AbortSignal;
4983
+ }): Promise<Reply<200, DiscoveryStrategy>>;
4984
+ /**
4985
+ * List merchandising rules
4986
+ *
4987
+ * List all discovery merchandising rules ordered by priority.
4988
+ */
4989
+ listMerchandisingRules(input?: {
4990
+ signal?: AbortSignal;
4991
+ }): Promise<Reply<200, MerchandisingRuleList>>;
4992
+ /**
4993
+ * Create a merchandising rule
4994
+ *
4995
+ * Create a merchandising rule with ConditionTree triggers (fail-closed audience_id validation) and pin/hide/boost/bury/inject_filter/redirect actions.
4996
+ */
4997
+ createMerchandisingRule(input: {
4998
+ body: CreateMerchandisingRuleRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4999
+ signal?: AbortSignal;
5000
+ }): Promise<Reply<201, MerchandisingRule>>;
5001
+ /**
5002
+ * Get a merchandising rule
5003
+ *
5004
+ * Retrieve a merchandising rule by UUID.
5005
+ */
5006
+ getMerchandisingRule(input: {
5007
+ path: {
5008
+ rule_id: string;
5009
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5010
+ signal?: AbortSignal;
5011
+ }): Promise<Reply<200, MerchandisingRule>>;
5012
+ /**
5013
+ * Delete a merchandising rule
5014
+ *
5015
+ * Delete a merchandising rule by UUID.
5016
+ */
5017
+ deleteMerchandisingRule(input: {
5018
+ path: {
5019
+ rule_id: string;
5020
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5021
+ signal?: AbortSignal;
5022
+ }): Promise<Reply<200, ActionResult>>;
5023
+ /**
5024
+ * Update a merchandising rule
5025
+ *
5026
+ * Update conditions, actions, priority, schedule, or enabled status of a merchandising rule.
5027
+ */
5028
+ updateMerchandisingRule(input: {
5029
+ path: {
5030
+ rule_id: string;
5031
+ };
5032
+ body: UpdateMerchandisingRuleRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5033
+ signal?: AbortSignal;
5034
+ }): Promise<Reply<200, MerchandisingRule>>;
5035
+ /**
5036
+ * List search synonyms
5037
+ *
5038
+ * List one-way and two-way search synonyms configured for the project.
5039
+ */
5040
+ listSearchSynonyms(input?: {
5041
+ signal?: AbortSignal;
5042
+ }): Promise<Reply<200, SearchSynonymList>>;
5043
+ /**
5044
+ * Create or update a search synonym
5045
+ *
5046
+ * Upsert a one-way or two-way search synonym group with Turkish-safe text normalization.
5047
+ */
5048
+ createSearchSynonym(input: {
5049
+ body: CreateSearchSynonymRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5050
+ signal?: AbortSignal;
5051
+ }): Promise<Reply<201, SearchSynonym>>;
5052
+ /**
5053
+ * Delete a search synonym
5054
+ *
5055
+ * Delete a search synonym by UUID.
5056
+ */
5057
+ deleteSearchSynonym(input: {
5058
+ path: {
5059
+ synonym_id: string;
5060
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5061
+ signal?: AbortSignal;
5062
+ }): Promise<Reply<200, ActionResult>>;
5063
+ /**
5064
+ * Recompute behavioral signals, co-occurrence, and search summaries
5065
+ *
5066
+ * Aggregate Postgres order/cart signals and optional ClickHouse behavioral events into product_signals, product_cooccurrence, and product_search_summaries.
5067
+ */
5068
+ refreshDiscoverySignals(input?: {
5069
+ signal?: AbortSignal;
5070
+ }): Promise<Reply<200, DiscoverySignalRefreshResponse>>;
2953
5071
  /**
2954
5072
  * List configured blocking extension hooks
2955
5073
  *
@@ -3140,6 +5258,18 @@ export declare function client(t: Transport): {
3140
5258
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3141
5259
  signal?: AbortSignal;
3142
5260
  }): Promise<Reply<200, OrderDownloads>>;
5261
+ /**
5262
+ * Submit a product review with verified store attribution and optional photo/video media
5263
+ *
5264
+ * Submit a customer review for a product. Automatically links to the buyer's paid order line and purchased-from seller store when present.
5265
+ */
5266
+ createProductReview(input: {
5267
+ path: {
5268
+ product_id_or_handle: string;
5269
+ };
5270
+ body: GenericPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5271
+ signal?: AbortSignal;
5272
+ }): Promise<Reply<201, ProductReview>>;
3143
5273
  /**
3144
5274
  * List signed-in customer returns
3145
5275
  *
@@ -3149,9 +5279,52 @@ export declare function client(t: Transport): {
3149
5279
  signal?: AbortSignal;
3150
5280
  }): Promise<Reply<200, ReturnList>>;
3151
5281
  /**
3152
- * Request RMA return for a store order
5282
+ * List reviews submitted by the signed-in customer
5283
+ *
5284
+ * List product and store reviews authored by the signed-in customer.
5285
+ */
5286
+ listMyReviews(input?: {
5287
+ signal?: AbortSignal;
5288
+ }): Promise<Reply<200, ReviewsBundle>>;
5289
+ /**
5290
+ * Mint signed Storage upload URL for review photo or video
5291
+ *
5292
+ * Mint a short-lived direct-to-Storage PUT URL for uploading a customer review image (up to 10 MiB) or video (up to 50 MiB).
5293
+ */
5294
+ mintReviewUploadUrl(input: {
5295
+ body: GenericPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5296
+ signal?: AbortSignal;
5297
+ }): Promise<Reply<201, ReviewUploadURLResponse>>;
5298
+ /**
5299
+ * Delete a review authored by the signed-in customer
5300
+ *
5301
+ * Delete a product or store review owned by the signed-in customer and recompute aggregate ratings.
5302
+ */
5303
+ deleteMyReview(input: {
5304
+ path: {
5305
+ review_id: string;
5306
+ };
5307
+ query?: {
5308
+ kind?: string;
5309
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5310
+ signal?: AbortSignal;
5311
+ }): Promise<Reply<200, ReviewDeleteResponse>>;
5312
+ /**
5313
+ * Vote a review helpful or not helpful
3153
5314
  *
5315
+ * Record or update the signed-in customer's helpfulness vote on a published product or store review.
5316
+ */
5317
+ voteReview(input: {
5318
+ path: {
5319
+ review_id: string;
5320
+ };
5321
+ body: GenericPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5322
+ signal?: AbortSignal;
5323
+ }): Promise<Reply<200, ReviewVoteResponse>>;
5324
+ /**
3154
5325
  * Request RMA return for a store order
5326
+ *
5327
+ * Request RMA return for a store order. A return is of an order that was paid, and an order's returns together give back no more than it was paid: a line's amounts within the line's total, `refund_shipping_amount` within the shipping the buyer paid (409 `refund_exceeds_paid`). A return's fees, deductions and exchange difference are the store's to set, not the buyer's (403 `return_amounts_forbidden`).
3155
5328
  */
3156
5329
  requestMyReturn(input: {
3157
5330
  path: {
@@ -3160,6 +5333,18 @@ export declare function client(t: Transport): {
3160
5333
  body: GenericPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3161
5334
  signal?: AbortSignal;
3162
5335
  }): Promise<Reply<201, ReturnRecord>>;
5336
+ /**
5337
+ * Submit a seller store review with multi-dimensional ratings
5338
+ *
5339
+ * Submit a customer review for a marketplace store with overall, shipping, packaging, and communication scores.
5340
+ */
5341
+ createStoreReview(input: {
5342
+ path: {
5343
+ store_id_or_slug: string;
5344
+ };
5345
+ body: GenericPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5346
+ signal?: AbortSignal;
5347
+ }): Promise<Reply<201, StoreReview>>;
3163
5348
  /**
3164
5349
  * Attach media asset to product, variant, or listing
3165
5350
  *
@@ -3245,10 +5430,25 @@ export declare function client(t: Transport): {
3245
5430
  cursor?: string; /** Search query. */
3246
5431
  q?: string; /** Filter by status. */
3247
5432
  status?: string; /** Filter by approval status. */
3248
- approval_status?: string;
5433
+ approval_status?: string; /** Filter by category UUID. */
5434
+ category_id?: string; /** Filter by brand UUID. */
5435
+ brand_id?: string; /** Filter by store UUID. */
5436
+ store_id?: string; /** Filter by collection UUID. */
5437
+ collection_id?: string; /** Filter by sales channel key. */
5438
+ channel?: string; /** Region key. */
5439
+ region?: string; /** ISO 4217 currency code. */
5440
+ currency?: string; /** Filter by product kind. */
5441
+ kind?: string; /** Filter by stock availability. */
5442
+ in_stock?: boolean; /** Minimum unit price. */
5443
+ min_price?: number; /** Maximum unit price. */
5444
+ max_price?: number; /** Minimum average rating (0..5). */
5445
+ min_rating?: number; /** JSON-encoded attribute filter map. */
5446
+ attributes?: string; /** Sort mode. */
5447
+ sort?: string; /** Whether to compute dynamic facets. */
5448
+ include_facets?: boolean;
3249
5449
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3250
5450
  signal?: AbortSignal;
3251
- }): Promise<Reply<200, ProductList>>;
5451
+ }): Promise<Reply<200, ProductSearchResponse>>;
3252
5452
  /**
3253
5453
  * Create catalog product
3254
5454
  *
@@ -3403,6 +5603,47 @@ export declare function client(t: Transport): {
3403
5603
  body: GenericPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3404
5604
  signal?: AbortSignal;
3405
5605
  }): Promise<Reply<200, ReturnRecord>>;
5606
+ /**
5607
+ * List all product and store reviews for moderation
5608
+ *
5609
+ * List product and store reviews across the project with status, product, and store filters.
5610
+ */
5611
+ adminListReviews(input?: {
5612
+ query?: {
5613
+ status?: string; /** Filter product reviews by product UUID. */
5614
+ product_id?: string; /** Filter reviews by store UUID. */
5615
+ store_id?: string; /** Page size (default 50, max 200). */
5616
+ limit?: number; /** Pagination cursor from previous response. */
5617
+ cursor?: string;
5618
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5619
+ signal?: AbortSignal;
5620
+ }): Promise<Reply<200, ReviewsBundle>>;
5621
+ /**
5622
+ * Delete a product or store review as platform admin
5623
+ *
5624
+ * Permanently delete a product or store review and recompute aggregate ratings.
5625
+ */
5626
+ adminDeleteReview(input: {
5627
+ path: {
5628
+ review_id: string;
5629
+ };
5630
+ query?: {
5631
+ kind?: string;
5632
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5633
+ signal?: AbortSignal;
5634
+ }): Promise<Reply<200, ReviewDeleteResponse>>;
5635
+ /**
5636
+ * Moderate a product or store review status
5637
+ *
5638
+ * Approve, reject, or hide a customer product or store review and recompute aggregate ratings.
5639
+ */
5640
+ adminModerateReview(input: {
5641
+ path: {
5642
+ review_id: string;
5643
+ };
5644
+ body: GenericPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
5645
+ signal?: AbortSignal;
5646
+ }): Promise<Reply<200, ReviewModerationResponse>>;
3406
5647
  /**
3407
5648
  * Get project commerce settings
3408
5649
  *
@@ -3558,7 +5799,7 @@ export declare function client(t: Transport): {
3558
5799
  /**
3559
5800
  * Create RMA return or partial-refund request
3560
5801
  *
3561
- * Create RMA return or partial-refund request
5802
+ * Create RMA return or partial-refund request. A return is of an order that was paid, and an order's returns together give back no more than it was paid: a line's amounts within the line's total, `refund_shipping_amount` within the shipping the buyer paid (409 `refund_exceeds_paid`). A return's fees, deductions and exchange difference are the store's to set, not the buyer's (403 `return_amounts_forbidden`).
3562
5803
  */
3563
5804
  createReturn(input: {
3564
5805
  path: {
@@ -3850,7 +6091,7 @@ export declare function client(t: Transport): {
3850
6091
  /**
3851
6092
  * Onboard store PSP sub-merchant account
3852
6093
  *
3853
- * Onboard store PSP sub-merchant account
6094
+ * Onboard store PSP sub-merchant account. Not an environment token's: where a store is paid outlives the token.
3854
6095
  */
3855
6096
  onboardStorePaymentAccount(input: {
3856
6097
  path: {
@@ -3862,7 +6103,7 @@ export declare function client(t: Transport): {
3862
6103
  /**
3863
6104
  * Onboard seller PSP sub-merchant account
3864
6105
  *
3865
- * Onboard seller PSP sub-merchant account
6106
+ * Onboard seller PSP sub-merchant account. Not an environment token's: where a store is paid outlives the token.
3866
6107
  */
3867
6108
  sellerOnboardPayouts(input: {
3868
6109
  path: {
@@ -3874,7 +6115,7 @@ export declare function client(t: Transport): {
3874
6115
  /**
3875
6116
  * Create temporary PSP sub-merchant onboarding link
3876
6117
  *
3877
- * Create temporary PSP sub-merchant onboarding link
6118
+ * Create temporary PSP sub-merchant onboarding link. Not an environment token's: where a store is paid outlives the token.
3878
6119
  */
3879
6120
  sellerOnboardingLink(input: {
3880
6121
  path: {
@@ -3895,10 +6136,18 @@ export declare function client(t: Transport): {
3895
6136
  query?: {
3896
6137
  limit?: number; /** Opaque keyset pagination cursor. */
3897
6138
  cursor?: string; /** Search query. */
3898
- q?: string;
6139
+ q?: string; /** Filter by status. */
6140
+ status?: string; /** Filter by approval status. */
6141
+ approval_status?: string; /** Filter by category UUID. */
6142
+ category_id?: string; /** Filter by brand UUID. */
6143
+ brand_id?: string; /** Sort mode. */
6144
+ sort?: string; /** ISO 4217 currency code. */
6145
+ currency?: string; /** Region key. */
6146
+ region?: string; /** Filter by stock availability. */
6147
+ in_stock?: boolean;
3899
6148
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3900
6149
  signal?: AbortSignal;
3901
- }): Promise<Reply<200, ProductList>>;
6150
+ }): Promise<Reply<200, ProductSearchResponse>>;
3902
6151
  /**
3903
6152
  * Create seller catalog product
3904
6153
  *
@@ -3985,6 +6234,34 @@ export declare function client(t: Transport): {
3985
6234
  body: GenericPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3986
6235
  signal?: AbortSignal;
3987
6236
  }): Promise<Reply<200, ReturnRecord>>;
6237
+ /**
6238
+ * List product and store reviews attributed to a seller store
6239
+ *
6240
+ * List customer product reviews purchased from this store and store-level reviews for seller portal management.
6241
+ */
6242
+ sellerListReviews(input: {
6243
+ path: {
6244
+ store_id: string;
6245
+ };
6246
+ query?: {
6247
+ limit?: number; /** Pagination cursor from previous response. */
6248
+ cursor?: string;
6249
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
6250
+ signal?: AbortSignal;
6251
+ }): Promise<Reply<200, ReviewsBundle>>;
6252
+ /**
6253
+ * Publish an official seller reply to a review attributed to this store
6254
+ *
6255
+ * Publish or update an official seller response on a product or store review attributed to this store.
6256
+ */
6257
+ sellerReplyReview(input: {
6258
+ path: {
6259
+ store_id: string; /** Path parameter review_id. */
6260
+ review_id: string;
6261
+ };
6262
+ body: GenericPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
6263
+ signal?: AbortSignal;
6264
+ }): Promise<Reply<200, ReviewReplyResponse>>;
3988
6265
  /**
3989
6266
  * List seller settlement statements
3990
6267
  *