@wix/auto_sdk_pricing-plans_orders 1.0.63 → 1.0.65

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.
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  /**
2
4
  * An order object includes all of the details related to the purchase of a Pricing Plan.
3
5
  * You can manage existing orders, create offline orders, and preview orders not yet purchased.
@@ -1482,6 +1484,293 @@ interface SetSubmissionResponse {
1482
1484
  /** Order with submission id */
1483
1485
  order?: Order;
1484
1486
  }
1487
+ type CreateOnlineOrderApplicationErrors = {
1488
+ code?: 'MEMBER_REQUIRED';
1489
+ description?: string;
1490
+ data?: Record<string, any>;
1491
+ } | {
1492
+ code?: 'archived_plan';
1493
+ description?: string;
1494
+ data?: Record<string, any>;
1495
+ } | {
1496
+ code?: 'member_not_found';
1497
+ description?: string;
1498
+ data?: Record<string, any>;
1499
+ } | {
1500
+ code?: 'purchases_limit_reached';
1501
+ description?: string;
1502
+ data?: Record<string, any>;
1503
+ } | {
1504
+ code?: 'buyer_can_not_pick_future_start_date';
1505
+ description?: string;
1506
+ data?: Record<string, any>;
1507
+ } | {
1508
+ code?: 'invalid_start_date';
1509
+ description?: string;
1510
+ data?: Record<string, any>;
1511
+ } | {
1512
+ code?: 'accept_payment_feature_missing';
1513
+ description?: string;
1514
+ data?: Record<string, any>;
1515
+ } | {
1516
+ code?: 'meta_site_id_missing';
1517
+ description?: string;
1518
+ data?: Record<string, any>;
1519
+ } | {
1520
+ code?: 'ERROR_COUPON_IS_DISABLED';
1521
+ description?: string;
1522
+ data?: CouponsError;
1523
+ } | {
1524
+ code?: 'ERROR_COUPON_USAGE_EXCEEDED';
1525
+ description?: string;
1526
+ data?: CouponsError;
1527
+ } | {
1528
+ code?: 'ERROR_COUPON_LIMIT_PER_CUSTOMER_EXCEEDED';
1529
+ description?: string;
1530
+ data?: CouponsError;
1531
+ } | {
1532
+ code?: 'ERROR_COUPON_IS_NOT_ACTIVE_YET';
1533
+ description?: string;
1534
+ data?: CouponsError;
1535
+ } | {
1536
+ code?: 'ERROR_COUPON_HAS_EXPIRED';
1537
+ description?: string;
1538
+ data?: CouponsError;
1539
+ } | {
1540
+ code?: 'ERROR_COUPON_DOES_NOT_EXIST';
1541
+ description?: string;
1542
+ data?: CouponsError;
1543
+ } | {
1544
+ code?: 'ERROR_COUPON_NOT_APPLICABLE_FOR_PLAN';
1545
+ description?: string;
1546
+ data?: CouponsError;
1547
+ } | {
1548
+ code?: 'ERROR_INVALID_SUBTOTAL';
1549
+ description?: string;
1550
+ data?: CouponsError;
1551
+ } | {
1552
+ code?: 'undefined_not_allowed';
1553
+ description?: string;
1554
+ data?: Record<string, any>;
1555
+ } | {
1556
+ code?: 'MISSING_BUSINESS_ADDRESS_COUNTRY';
1557
+ description?: string;
1558
+ data?: Record<string, any>;
1559
+ } | {
1560
+ code?: 'MISSING_BUSINESS_ADDRESS_STATE';
1561
+ description?: string;
1562
+ data?: Record<string, any>;
1563
+ };
1564
+ type CreateOnlineOrderValidationErrors = {
1565
+ ruleName?: 'UNKNOWN_ORDER_METHOD';
1566
+ } | {
1567
+ ruleName?: 'RECURRING_POS_UNSUPPORTED';
1568
+ } | {
1569
+ ruleName?: 'invalid_sort_field';
1570
+ };
1571
+ type CreateOfflineOrderApplicationErrors = {
1572
+ code?: 'PRICING_PLANS_NOT_INSTALLED';
1573
+ description?: string;
1574
+ data?: Record<string, any>;
1575
+ } | {
1576
+ code?: 'meta_site_id_missing';
1577
+ description?: string;
1578
+ data?: Record<string, any>;
1579
+ } | {
1580
+ code?: 'ERROR_COUPON_IS_DISABLED';
1581
+ description?: string;
1582
+ data?: CouponsError;
1583
+ } | {
1584
+ code?: 'ERROR_COUPON_USAGE_EXCEEDED';
1585
+ description?: string;
1586
+ data?: CouponsError;
1587
+ } | {
1588
+ code?: 'ERROR_COUPON_LIMIT_PER_CUSTOMER_EXCEEDED';
1589
+ description?: string;
1590
+ data?: CouponsError;
1591
+ } | {
1592
+ code?: 'ERROR_COUPON_IS_NOT_ACTIVE_YET';
1593
+ description?: string;
1594
+ data?: CouponsError;
1595
+ } | {
1596
+ code?: 'ERROR_COUPON_HAS_EXPIRED';
1597
+ description?: string;
1598
+ data?: CouponsError;
1599
+ } | {
1600
+ code?: 'ERROR_COUPON_DOES_NOT_EXIST';
1601
+ description?: string;
1602
+ data?: CouponsError;
1603
+ } | {
1604
+ code?: 'ERROR_COUPON_NOT_APPLICABLE_FOR_PLAN';
1605
+ description?: string;
1606
+ data?: CouponsError;
1607
+ } | {
1608
+ code?: 'ERROR_INVALID_SUBTOTAL';
1609
+ description?: string;
1610
+ data?: CouponsError;
1611
+ } | {
1612
+ code?: 'undefined_not_allowed';
1613
+ description?: string;
1614
+ data?: Record<string, any>;
1615
+ } | {
1616
+ code?: 'MISSING_BUSINESS_ADDRESS_COUNTRY';
1617
+ description?: string;
1618
+ data?: Record<string, any>;
1619
+ } | {
1620
+ code?: 'MISSING_BUSINESS_ADDRESS_STATE';
1621
+ description?: string;
1622
+ data?: Record<string, any>;
1623
+ };
1624
+ type CreateOfflineOrderValidationErrors = {
1625
+ ruleName?: 'MEMBER_DOESNT_EXIST';
1626
+ } | {
1627
+ ruleName?: 'invalid_sort_field';
1628
+ };
1629
+ type GetOnlineOrderPreviewApplicationErrors = {
1630
+ code?: 'PRICING_PLANS_NOT_INSTALLED';
1631
+ description?: string;
1632
+ data?: Record<string, any>;
1633
+ } | {
1634
+ code?: 'ERROR_COUPON_IS_DISABLED';
1635
+ description?: string;
1636
+ data?: CouponsError;
1637
+ } | {
1638
+ code?: 'ERROR_COUPON_USAGE_EXCEEDED';
1639
+ description?: string;
1640
+ data?: CouponsError;
1641
+ } | {
1642
+ code?: 'ERROR_COUPON_LIMIT_PER_CUSTOMER_EXCEEDED';
1643
+ description?: string;
1644
+ data?: CouponsError;
1645
+ } | {
1646
+ code?: 'ERROR_COUPON_IS_NOT_ACTIVE_YET';
1647
+ description?: string;
1648
+ data?: CouponsError;
1649
+ } | {
1650
+ code?: 'ERROR_COUPON_HAS_EXPIRED';
1651
+ description?: string;
1652
+ data?: CouponsError;
1653
+ } | {
1654
+ code?: 'ERROR_COUPON_DOES_NOT_EXIST';
1655
+ description?: string;
1656
+ data?: CouponsError;
1657
+ } | {
1658
+ code?: 'ERROR_COUPON_NOT_APPLICABLE_FOR_PLAN';
1659
+ description?: string;
1660
+ data?: CouponsError;
1661
+ } | {
1662
+ code?: 'ERROR_INVALID_SUBTOTAL';
1663
+ description?: string;
1664
+ data?: CouponsError;
1665
+ } | {
1666
+ code?: 'undefined_not_allowed';
1667
+ description?: string;
1668
+ data?: Record<string, any>;
1669
+ } | {
1670
+ code?: 'MISSING_BUSINESS_ADDRESS_COUNTRY';
1671
+ description?: string;
1672
+ data?: Record<string, any>;
1673
+ } | {
1674
+ code?: 'MISSING_BUSINESS_ADDRESS_STATE';
1675
+ description?: string;
1676
+ data?: Record<string, any>;
1677
+ };
1678
+ type GetOnlineOrderPreviewValidationErrors = {
1679
+ ruleName?: 'invalid_sort_field';
1680
+ };
1681
+ type GetOfflineOrderPreviewApplicationErrors = {
1682
+ code?: 'PRICING_PLANS_NOT_INSTALLED';
1683
+ description?: string;
1684
+ data?: Record<string, any>;
1685
+ } | {
1686
+ code?: 'ERROR_COUPON_IS_DISABLED';
1687
+ description?: string;
1688
+ data?: CouponsError;
1689
+ } | {
1690
+ code?: 'ERROR_COUPON_USAGE_EXCEEDED';
1691
+ description?: string;
1692
+ data?: CouponsError;
1693
+ } | {
1694
+ code?: 'ERROR_COUPON_LIMIT_PER_CUSTOMER_EXCEEDED';
1695
+ description?: string;
1696
+ data?: CouponsError;
1697
+ } | {
1698
+ code?: 'ERROR_COUPON_IS_NOT_ACTIVE_YET';
1699
+ description?: string;
1700
+ data?: CouponsError;
1701
+ } | {
1702
+ code?: 'ERROR_COUPON_HAS_EXPIRED';
1703
+ description?: string;
1704
+ data?: CouponsError;
1705
+ } | {
1706
+ code?: 'ERROR_COUPON_DOES_NOT_EXIST';
1707
+ description?: string;
1708
+ data?: CouponsError;
1709
+ } | {
1710
+ code?: 'ERROR_COUPON_NOT_APPLICABLE_FOR_PLAN';
1711
+ description?: string;
1712
+ data?: CouponsError;
1713
+ } | {
1714
+ code?: 'ERROR_INVALID_SUBTOTAL';
1715
+ description?: string;
1716
+ data?: CouponsError;
1717
+ } | {
1718
+ code?: 'undefined_not_allowed';
1719
+ description?: string;
1720
+ data?: Record<string, any>;
1721
+ } | {
1722
+ code?: 'MISSING_BUSINESS_ADDRESS_COUNTRY';
1723
+ description?: string;
1724
+ data?: Record<string, any>;
1725
+ } | {
1726
+ code?: 'MISSING_BUSINESS_ADDRESS_STATE';
1727
+ description?: string;
1728
+ data?: Record<string, any>;
1729
+ };
1730
+ type GetOfflineOrderPreviewValidationErrors = {
1731
+ ruleName?: 'invalid_sort_field';
1732
+ };
1733
+ type GetPricePreviewApplicationErrors = {
1734
+ code?: 'ERROR_COUPON_IS_DISABLED';
1735
+ description?: string;
1736
+ data?: CouponsError;
1737
+ } | {
1738
+ code?: 'ERROR_COUPON_USAGE_EXCEEDED';
1739
+ description?: string;
1740
+ data?: CouponsError;
1741
+ } | {
1742
+ code?: 'ERROR_COUPON_LIMIT_PER_CUSTOMER_EXCEEDED';
1743
+ description?: string;
1744
+ data?: CouponsError;
1745
+ } | {
1746
+ code?: 'ERROR_COUPON_IS_NOT_ACTIVE_YET';
1747
+ description?: string;
1748
+ data?: CouponsError;
1749
+ } | {
1750
+ code?: 'ERROR_COUPON_HAS_EXPIRED';
1751
+ description?: string;
1752
+ data?: CouponsError;
1753
+ } | {
1754
+ code?: 'ERROR_COUPON_DOES_NOT_EXIST';
1755
+ description?: string;
1756
+ data?: CouponsError;
1757
+ } | {
1758
+ code?: 'ERROR_COUPON_NOT_APPLICABLE_FOR_PLAN';
1759
+ description?: string;
1760
+ data?: CouponsError;
1761
+ } | {
1762
+ code?: 'ERROR_INVALID_SUBTOTAL';
1763
+ description?: string;
1764
+ data?: CouponsError;
1765
+ } | {
1766
+ code?: 'MISSING_BUSINESS_ADDRESS_COUNTRY';
1767
+ description?: string;
1768
+ data?: Record<string, any>;
1769
+ } | {
1770
+ code?: 'MISSING_BUSINESS_ADDRESS_STATE';
1771
+ description?: string;
1772
+ data?: Record<string, any>;
1773
+ };
1485
1774
  interface BaseEventMetadata {
1486
1775
  /**
1487
1776
  * App instance ID.
@@ -1530,54 +1819,315 @@ interface OrderAutoRenewCanceledEnvelope {
1530
1819
  data: OrderAutoRenewCanceled;
1531
1820
  metadata: EventMetadata;
1532
1821
  }
1822
+ /**
1823
+ * Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
1824
+ *
1825
+ * This webhook is *not* triggered in the following scenarios:
1826
+ * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
1827
+ * + When an order expires at the end of the current payment cycle because it was canceled and `effectiveAt` was set to `NEXT_PAYMENT_DATE`. Instead, at the time of expiration, Order Canceled and Order Ended are triggered.
1828
+ * @permissionScope Manage Orders
1829
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1830
+ * @permissionScope Read Orders
1831
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1832
+ * @permissionScope Manage plans and orders of Pricing Plans
1833
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1834
+ * @permissionScope Manage Events
1835
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1836
+ * @permissionId PRICING_PLANS.READ_ORDERS
1837
+ * @webhook
1838
+ * @eventType wix.pricing_plans.v2.order_auto_renew_canceled
1839
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1840
+ * @slug auto_renew_canceled
1841
+ */
1842
+ declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
1533
1843
  interface OrderCanceledEnvelope {
1534
1844
  data: OrderCanceled;
1535
1845
  metadata: EventMetadata;
1536
1846
  }
1847
+ /**
1848
+ * Triggered when an order is canceled.
1849
+ *
1850
+ * This webhook is triggered either immediately or at the end of the current payment cycle, as follows:
1851
+ * + If the order is canceled and `effectiveAt` is set to `IMMEDIATELY`, the webhook is triggered immediately when canceled.
1852
+ * + If the order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`, the webhook is triggered at the end of the current payment cycle. In this case, the Order Auto Renew Canceled Webhook is triggered immediately.
1853
+ * @permissionScope Manage Orders
1854
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1855
+ * @permissionScope Read Orders
1856
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1857
+ * @permissionScope Manage plans and orders of Pricing Plans
1858
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1859
+ * @permissionScope Manage Events
1860
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1861
+ * @permissionId PRICING_PLANS.READ_ORDERS
1862
+ * @webhook
1863
+ * @eventType wix.pricing_plans.v2.order_canceled
1864
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1865
+ * @slug canceled
1866
+ */
1867
+ declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
1537
1868
  interface OrderCycleStartedEnvelope {
1538
1869
  data: OrderCycleStarted;
1539
1870
  metadata: EventMetadata;
1540
1871
  }
1872
+ /**
1873
+ * Triggered at the start of a new payment cycle for an existing order.
1874
+ *
1875
+ * Not triggered at the initial start of an offline order.
1876
+ * @permissionScope Manage Orders
1877
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1878
+ * @permissionScope Read Orders
1879
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1880
+ * @permissionScope Manage plans and orders of Pricing Plans
1881
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1882
+ * @permissionScope Manage Events
1883
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1884
+ * @permissionId PRICING_PLANS.READ_ORDERS
1885
+ * @webhook
1886
+ * @eventType wix.pricing_plans.v2.order_cycle_started
1887
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1888
+ * @slug cycle_started
1889
+ */
1890
+ declare function onOrderCycleStarted(handler: (event: OrderCycleStartedEnvelope) => void | Promise<void>): void;
1541
1891
  interface OrderEndDatePostponedEnvelope {
1542
1892
  data: OrderEndDatePostponed;
1543
1893
  metadata: EventMetadata;
1544
1894
  }
1895
+ /**
1896
+ * Triggered when an order's `endDate` is postponed.
1897
+ * @permissionScope Manage Orders
1898
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1899
+ * @permissionScope Read Orders
1900
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1901
+ * @permissionScope Manage plans and orders of Pricing Plans
1902
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1903
+ * @permissionScope Manage Events
1904
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1905
+ * @permissionId PRICING_PLANS.READ_ORDERS
1906
+ * @webhook
1907
+ * @eventType wix.pricing_plans.v2.order_end_date_postponed
1908
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1909
+ * @slug end_date_postponed
1910
+ */
1911
+ declare function onOrderEndDatePostponed(handler: (event: OrderEndDatePostponedEnvelope) => void | Promise<void>): void;
1545
1912
  interface OrderEndedEnvelope {
1546
1913
  data: OrderEnded;
1547
1914
  metadata: EventMetadata;
1548
1915
  }
1916
+ /**
1917
+ * Triggered when an order ends.
1918
+ *
1919
+ * This webhook is triggered:
1920
+ * + When an order expires at the end of the current payment cycle.
1921
+ * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`.
1922
+ * @permissionScope Manage Orders
1923
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1924
+ * @permissionScope Read Orders
1925
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1926
+ * @permissionScope Manage plans and orders of Pricing Plans
1927
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1928
+ * @permissionScope Manage Events
1929
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1930
+ * @permissionId PRICING_PLANS.READ_ORDERS
1931
+ * @webhook
1932
+ * @eventType wix.pricing_plans.v2.order_ended
1933
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1934
+ * @slug ended
1935
+ */
1936
+ declare function onOrderEnded(handler: (event: OrderEndedEnvelope) => void | Promise<void>): void;
1549
1937
  interface OrderMarkedAsPaidEnvelope {
1550
1938
  data: OrderMarkedAsPaid;
1551
1939
  metadata: EventMetadata;
1552
1940
  }
1941
+ /**
1942
+ * Triggered when an offline order is marked as paid.
1943
+ * @permissionScope Manage Orders
1944
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1945
+ * @permissionScope Read Orders
1946
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1947
+ * @permissionScope Manage plans and orders of Pricing Plans
1948
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1949
+ * @permissionScope Manage Events
1950
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1951
+ * @permissionId PRICING_PLANS.READ_ORDERS
1952
+ * @webhook
1953
+ * @eventType wix.pricing_plans.v2.order_marked_as_paid
1954
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1955
+ * @slug marked_as_paid
1956
+ */
1957
+ declare function onOrderMarkedAsPaid(handler: (event: OrderMarkedAsPaidEnvelope) => void | Promise<void>): void;
1553
1958
  interface OrderPausedEnvelope {
1554
1959
  data: OrderPaused;
1555
1960
  metadata: EventMetadata;
1556
1961
  }
1962
+ /**
1963
+ * Triggered when an order is paused.
1964
+ * @permissionScope Manage Orders
1965
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1966
+ * @permissionScope Read Orders
1967
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1968
+ * @permissionScope Manage plans and orders of Pricing Plans
1969
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1970
+ * @permissionScope Manage Events
1971
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1972
+ * @permissionId PRICING_PLANS.READ_ORDERS
1973
+ * @webhook
1974
+ * @eventType wix.pricing_plans.v2.order_paused
1975
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1976
+ * @slug paused
1977
+ */
1978
+ declare function onOrderPaused(handler: (event: OrderPausedEnvelope) => void | Promise<void>): void;
1557
1979
  interface OrderPurchasedEnvelope {
1558
1980
  data: OrderPurchased;
1559
1981
  metadata: EventMetadata;
1560
1982
  }
1983
+ /**
1984
+ * Triggered for any of the following purchase events:
1985
+ * + Order is paid in full.
1986
+ * + At least 1 order cycle payment is paid for.
1987
+ * + Offline order is created, even if not yet marked as paid.
1988
+ * + Free order is created.
1989
+ * @permissionScope Manage Orders
1990
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1991
+ * @permissionScope Read Orders
1992
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1993
+ * @permissionScope Manage plans and orders of Pricing Plans
1994
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1995
+ * @permissionScope Manage Events
1996
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1997
+ * @permissionId PRICING_PLANS.READ_ORDERS
1998
+ * @webhook
1999
+ * @eventType wix.pricing_plans.v2.order_purchased
2000
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2001
+ * @slug purchased
2002
+ */
2003
+ declare function onOrderPurchased(handler: (event: OrderPurchasedEnvelope) => void | Promise<void>): void;
1561
2004
  interface OrderResumedEnvelope {
1562
2005
  data: OrderResumed;
1563
2006
  metadata: EventMetadata;
1564
2007
  }
2008
+ /**
2009
+ * Triggered when a paused order is resumed.
2010
+ * @permissionScope Manage Orders
2011
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2012
+ * @permissionScope Read Orders
2013
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
2014
+ * @permissionScope Manage plans and orders of Pricing Plans
2015
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2016
+ * @permissionScope Manage Events
2017
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2018
+ * @permissionId PRICING_PLANS.READ_ORDERS
2019
+ * @webhook
2020
+ * @eventType wix.pricing_plans.v2.order_resumed
2021
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2022
+ * @slug resumed
2023
+ */
2024
+ declare function onOrderResumed(handler: (event: OrderResumedEnvelope) => void | Promise<void>): void;
1565
2025
  interface OrderStartedEnvelope {
1566
2026
  data: OrderStarted;
1567
2027
  metadata: EventMetadata;
1568
2028
  }
2029
+ /**
2030
+ * Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
2031
+ * @permissionScope Manage Orders
2032
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2033
+ * @permissionScope Read Orders
2034
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
2035
+ * @permissionScope Manage plans and orders of Pricing Plans
2036
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2037
+ * @permissionScope Manage Events
2038
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2039
+ * @permissionId PRICING_PLANS.READ_ORDERS
2040
+ * @webhook
2041
+ * @eventType wix.pricing_plans.v2.order_started
2042
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2043
+ * @slug started
2044
+ */
2045
+ declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
1569
2046
  interface OrderUpdatedEnvelope {
1570
2047
  entity: Order;
1571
2048
  metadata: EventMetadata;
1572
2049
  }
2050
+ /**
2051
+ * Triggered for any of the following update events:
2052
+ *
2053
+ * + Order is paid for. Order Purchased is also triggered.
2054
+ * + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
2055
+ * + New payment cycle of an order starts. Order Cycle Started is also triggered.
2056
+ * + Offline order is marked as paid. Order Marked As Paid is also triggered.
2057
+ * + End date of the order is postponed. Order End Date Postponed is also triggered
2058
+ * + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
2059
+ * + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
2060
+ * @permissionScope Manage Orders
2061
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2062
+ * @permissionScope Read Orders
2063
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
2064
+ * @permissionScope Manage plans and orders of Pricing Plans
2065
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2066
+ * @permissionScope Manage Events
2067
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2068
+ * @permissionId PRICING_PLANS.READ_ORDERS
2069
+ * @webhook
2070
+ * @eventType wix.pricing_plans.v2.order_updated
2071
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2072
+ * @slug updated
2073
+ */
2074
+ declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
1573
2075
  interface OrderCreatedEnvelope {
1574
2076
  entity: Order;
1575
2077
  metadata: EventMetadata;
1576
2078
  }
2079
+ /**
2080
+ * Triggered when an order is created.
2081
+ * @permissionScope Manage Orders
2082
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2083
+ * @permissionScope Read Orders
2084
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
2085
+ * @permissionScope Manage plans and orders of Pricing Plans
2086
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2087
+ * @permissionScope Manage Events
2088
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2089
+ * @permissionId PRICING_PLANS.READ_ORDERS
2090
+ * @webhook
2091
+ * @eventType wix.pricing_plans.v2.order_created
2092
+ * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
2093
+ * @slug created
2094
+ */
2095
+ declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
1577
2096
  interface OrderStartDateChangedEnvelope {
1578
2097
  data: OrderStartDateChanged;
1579
2098
  metadata: EventMetadata;
1580
2099
  }
2100
+ /**
2101
+ * Triggered when an order's `startDate` is changed.
2102
+ * @permissionScope Manage Orders
2103
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2104
+ * @permissionScope Read Orders
2105
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
2106
+ * @permissionScope Manage plans and orders of Pricing Plans
2107
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2108
+ * @permissionScope Manage Events
2109
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2110
+ * @permissionId PRICING_PLANS.READ_ORDERS
2111
+ * @webhook
2112
+ * @eventType wix.pricing_plans.v2.order_start_date_changed
2113
+ * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
2114
+ * @slug start_date_changed
2115
+ */
2116
+ declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
2117
+ type OrderNonNullablePaths = `_id` | `planId` | `subscriptionId` | `buyer.memberId` | `buyer.contactId` | `priceDetails.subscription.cycleDuration.unit` | `priceDetails.subtotal` | `priceDetails.discount` | `priceDetails.tax.name` | `priceDetails.tax.includedInPrice` | `priceDetails.tax.rate` | `priceDetails.tax.amount` | `priceDetails.total` | `priceDetails.planPrice` | `priceDetails.currency` | `priceDetails.coupon.code` | `priceDetails.coupon.amount` | `priceDetails.coupon._id` | `pricing.subscription.cycleDuration.unit` | `pricing.prices` | `pricing.prices.${number}.duration.cycleFrom` | `pricing.prices.${number}.price.subtotal` | `pricing.prices.${number}.price.coupon.code` | `pricing.prices.${number}.price.coupon.amount` | `pricing.prices.${number}.price.coupon._id` | `pricing.prices.${number}.price.discount` | `pricing.prices.${number}.price.tax.name` | `pricing.prices.${number}.price.tax.includedInPrice` | `pricing.prices.${number}.price.tax.rate` | `pricing.prices.${number}.price.tax.amount` | `pricing.prices.${number}.price.total` | `pricing.prices.${number}.price.currency` | `pricing.prices.${number}.price.proration` | `type` | `status` | `cancellation.cause` | `cancellation.effectiveAt` | `lastPaymentStatus` | `pausePeriods` | `pausePeriods.${number}.status` | `currentCycle.index` | `planName` | `planDescription` | `planPrice`;
2118
+ /**
2119
+ * Retrieves an order by ID.
2120
+ * @param _id - Order ID.
2121
+ * @public
2122
+ * @requiredField _id
2123
+ * @param options - Options to use when getting an order.
2124
+ * @permissionId PRICING_PLANS.READ_ORDERS
2125
+ * @applicableIdentity APP
2126
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
2127
+ */
2128
+ declare function managementGetOrder(_id: string, options?: ManagementGetOrderOptions): Promise<NonNullablePaths<GetOrderResponse, {
2129
+ [P in OrderNonNullablePaths]: `order.${P}`;
2130
+ }[OrderNonNullablePaths]>>;
1581
2131
  interface ManagementGetOrderOptions {
1582
2132
  /**
1583
2133
  * Predefined set of fields to return.
@@ -1586,6 +2136,20 @@ interface ManagementGetOrderOptions {
1586
2136
  */
1587
2137
  fieldSet?: SetWithLiterals;
1588
2138
  }
2139
+ /**
2140
+ * Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
2141
+ *
2142
+ * By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
2143
+ * `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
2144
+ * @public
2145
+ * @param options - Filtering, sorting, and pagination options.
2146
+ * @permissionId PRICING_PLANS.READ_ORDERS
2147
+ * @applicableIdentity APP
2148
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
2149
+ */
2150
+ declare function managementListOrders(options?: ManagementListOrdersOptions): Promise<NonNullablePaths<ListOrdersResponse, {
2151
+ [P in OrderNonNullablePaths]: `orders.${number}.${P}`;
2152
+ }[OrderNonNullablePaths]>>;
1589
2153
  interface ManagementListOrdersOptions {
1590
2154
  /**
1591
2155
  * Filter by a buyer's member ID, from the Members API.
@@ -1628,6 +2192,120 @@ interface ManagementListOrdersOptions {
1628
2192
  */
1629
2193
  fieldSet?: SetWithLiterals;
1630
2194
  }
2195
+ /**
2196
+ * Extends the duration of a pricing plan order by postponing the order's `endDate`. Postponing the end date of an order does not impact payments.
2197
+ *
2198
+ * New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
2199
+ * Can't postpone an order with `status`: `PAUSED`.
2200
+ * @param _id - Order ID.
2201
+ * @param endDate - New end date and time.
2202
+ *
2203
+ * Must be later than the current end date and time.
2204
+ * @public
2205
+ * @requiredField _id
2206
+ * @requiredField endDate
2207
+ * @param options - Options for postponing the end date of an order.
2208
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2209
+ * @applicableIdentity APP
2210
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
2211
+ */
2212
+ declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
2213
+ /**
2214
+ * Cancels an existing order.
2215
+ *
2216
+ * For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
2217
+ * For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
2218
+ *
2219
+ * #### Canceling during the free trial period.
2220
+ *
2221
+ * When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
2222
+ * of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
2223
+ * of the free trial period.
2224
+ *
2225
+ * When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
2226
+ * `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
2227
+ * immediately, even during the free trial period and the buyer won't be billed. Canceling at the
2228
+ * `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
2229
+ * Then, the subscription ends and the buyer is not billed.
2230
+ * @param _id - Order ID.
2231
+ * @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
2232
+ * @public
2233
+ * @requiredField _id
2234
+ * @requiredField effectiveAt
2235
+ * @param options - Options for canceling orders.
2236
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2237
+ * @applicableIdentity APP
2238
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
2239
+ */
2240
+ declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
2241
+ /**
2242
+ * Marks an offline order as paid.
2243
+ * > __Note__: Marking separate payment cycles as paid is not yet supported. The entire order will be marked as paid. Subsequent offline payments do trigger events and emails, but are not registered as additional offline payments.
2244
+ *
2245
+ * Marking an offline order as paid causes the following changes:
2246
+ * - The order's `lastPaymentStatus` changes to `"PAID"`.
2247
+ * - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
2248
+ *
2249
+ * An error occurs if you attempt to:
2250
+ * - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
2251
+ * - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
2252
+ * @param _id - Order ID.
2253
+ * @public
2254
+ * @requiredField _id
2255
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2256
+ * @applicableIdentity APP
2257
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
2258
+ */
2259
+ declare function markAsPaid(_id: string): Promise<void>;
2260
+ /**
2261
+ * Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
2262
+ *
2263
+ * Only orders with `status`: `ACTIVE` can be paused.
2264
+ * For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
2265
+ * Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
2266
+ * The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
2267
+ *
2268
+ * To resume a paused order, call Resume Order.
2269
+ * @param _id - Order ID.
2270
+ * @public
2271
+ * @requiredField _id
2272
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2273
+ * @applicableIdentity APP
2274
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
2275
+ */
2276
+ declare function pauseOrder(_id: string): Promise<void>;
2277
+ /**
2278
+ * Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
2279
+ *
2280
+ * Resuming an order causes the following changes:
2281
+ * - The order status changes to `"ACTIVE"`.
2282
+ * - The `pausePeriods` array is updated.
2283
+ * - The `endDate` for the order is adjusted to include the pause period.
2284
+ * - For orders with recurring payments, the payment schedule is restarted.
2285
+ * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
2286
+ *
2287
+ * To pause an order, call Pause Order.
2288
+ * @param _id - Order ID.
2289
+ * @public
2290
+ * @requiredField _id
2291
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2292
+ * @applicableIdentity APP
2293
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
2294
+ */
2295
+ declare function resumeOrder(_id: string): Promise<void>;
2296
+ /**
2297
+ * Retrieves an order for the currently logged-in member by ID.
2298
+ * @param _id - Order ID.
2299
+ * @public
2300
+ * @requiredField _id
2301
+ * @param options - Options for getting a logged-in member's order.
2302
+ * @permissionId PRICING_PLANS.READ_OWN_ORDERS
2303
+ * @applicableIdentity APP
2304
+ * @applicableIdentity MEMBER
2305
+ * @returns Requested order.
2306
+ * @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.GetOrder
2307
+ */
2308
+ declare function memberGetOrder(_id: string, options?: MemberGetOrderOptions): Promise<NonNullablePaths<Order, OrderNonNullablePaths>>;
1631
2309
  interface MemberGetOrderOptions {
1632
2310
  /**
1633
2311
  * Predefined set of fields to return.
@@ -1636,6 +2314,18 @@ interface MemberGetOrderOptions {
1636
2314
  */
1637
2315
  fieldSet?: SetWithLiterals;
1638
2316
  }
2317
+ /**
2318
+ * Retrieves a list of up to 100 pricing plan orders for currently logged-in member.
2319
+ * @public
2320
+ * @param options - Filtering, sorting, and pagination options.
2321
+ * @permissionId PRICING_PLANS.READ_OWN_ORDERS
2322
+ * @applicableIdentity APP
2323
+ * @applicableIdentity MEMBER
2324
+ * @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.ListOrders
2325
+ */
2326
+ declare function memberListOrders(options?: MemberListOrdersOptions): Promise<NonNullablePaths<MemberListOrdersResponse, {
2327
+ [P in OrderNonNullablePaths]: `orders.${number}.${P}`;
2328
+ }[OrderNonNullablePaths]>>;
1639
2329
  interface MemberListOrdersOptions {
1640
2330
  /**
1641
2331
  * Filter by plan IDs.
@@ -1665,6 +2355,45 @@ interface MemberListOrdersOptions {
1665
2355
  */
1666
2356
  fieldSet?: SetWithLiterals;
1667
2357
  }
2358
+ /**
2359
+ * Cancels an order. Recurring orders can be canceled either immediately or at the next payment date. One time orders can only be canceled immediately.
2360
+ *
2361
+ * There may be some operations that continue to be processed before the status of the order is changed to `"CANCELED"`. For example, payments might need to be refunded before the order is fully canceled.
2362
+ *
2363
+ * Canceling during the free trial period: When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end of the free trial period and they won't be billed. The buyer may continue using the benefits until the end of the free trial period.
2364
+ *
2365
+ * >**Note:**
2366
+ * >This method requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
2367
+ * @param _id - Order ID.
2368
+ * @param effectiveAt - Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately.
2369
+ * @public
2370
+ * @requiredField _id
2371
+ * @requiredField effectiveAt
2372
+ * @param options - Options for requesting a cancellation.
2373
+ * @permissionId PRICING_PLANS.MANAGE_OWN_ORDERS
2374
+ * @applicableIdentity APP
2375
+ * @applicableIdentity MEMBER
2376
+ * @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.RequestCancellation
2377
+ */
2378
+ declare function requestCancellation(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
2379
+ /**
2380
+ * Creates an online order for a site member.
2381
+ *
2382
+ * If this method is called by a site member ([SDK](https://dev.wix.com/docs/sdk/articles/get-started/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#site-member)), the plan is automatically ordered on behalf of that site member. Otherwise, you must specify `onBehalf.memberId` in your call.
2383
+ *
2384
+ * When an online order is created, but payment hasn't been processed, its status is set to `DRAFT`. After the payment has been processed, if the start date is in the future the order's status is set to `PENDING`. Otherwise, it's set to `ACTIVE`.
2385
+ * @param planId - Plan ID.
2386
+ * @public
2387
+ * @requiredField options.onBehalf.memberId
2388
+ * @requiredField planId
2389
+ * @fqn com.wixpress.membership.v2.orders.CheckoutService.CreateOnlineOrder
2390
+ */
2391
+ declare function createOnlineOrder(planId: string, options?: NonNullablePaths<CreateOnlineOrderOptions, `onBehalf.memberId`>): Promise<NonNullablePaths<CreateOnlineOrderResponse, {
2392
+ [P in OrderNonNullablePaths]: `order.${P}`;
2393
+ }[OrderNonNullablePaths]> & {
2394
+ __applicationErrorsType?: CreateOnlineOrderApplicationErrors;
2395
+ __validationErrorsType?: CreateOnlineOrderValidationErrors;
2396
+ }>;
1668
2397
  interface CreateOnlineOrderOptions {
1669
2398
  /**
1670
2399
  * Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
@@ -1686,6 +2415,40 @@ interface CreateOnlineOrderOptions {
1686
2415
  */
1687
2416
  submissionId?: string | null;
1688
2417
  }
2418
+ /**
2419
+ * Creates an order for a buyer who purchased the plan with an offline transaction.
2420
+ *
2421
+ * An offline order is handled off of the Wix site and is marked as `type`: `offline`. If a pricing plan
2422
+ * has a limit on the amount of purchases per buyer, that limit is ignored for offline orders.
2423
+ * Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
2424
+ *
2425
+ * When creating a free offline order:
2426
+ * The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
2427
+ * The order's last payment status is set to `"NOT_APPLICABLE"`. "
2428
+ *
2429
+ * When creating a non-free offline order:
2430
+ * The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
2431
+ * The order's last payment status is set to `"UNPAID"` or `"PAID"` based on the data passed in the `paid` boolean in the request.
2432
+ *
2433
+ * Payment for an offline order can be set in 1 of 2 ways:
2434
+ * + During order creation, set `paid`: `true`.
2435
+ * + After creation, call Mark As Paid.
2436
+ * @param planId - ID of the plan being ordered, from the Plans API.
2437
+ * @param memberId - ID of the member ordering the plan, from the Members API.
2438
+ * @public
2439
+ * @requiredField memberId
2440
+ * @requiredField planId
2441
+ * @param options - Options for creating an offline order.
2442
+ * @permissionId PRICING_PLANS.REGISTER_OFFLINE_ORDERS
2443
+ * @applicableIdentity APP
2444
+ * @fqn com.wixpress.membership.v2.orders.CheckoutService.CreateOfflineOrder
2445
+ */
2446
+ declare function createOfflineOrder(planId: string, memberId: string, options?: CreateOfflineOrderOptions): Promise<NonNullablePaths<CreateOfflineOrderResponse, {
2447
+ [P in OrderNonNullablePaths]: `order.${P}`;
2448
+ }[OrderNonNullablePaths]> & {
2449
+ __applicationErrorsType?: CreateOfflineOrderApplicationErrors;
2450
+ __validationErrorsType?: CreateOfflineOrderValidationErrors;
2451
+ }>;
1689
2452
  interface CreateOfflineOrderOptions {
1690
2453
  /**
1691
2454
  * Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
@@ -1711,6 +2474,26 @@ interface CreateOfflineOrderOptions {
1711
2474
  */
1712
2475
  submissionId?: string | null;
1713
2476
  }
2477
+ /**
2478
+ * Returns an `order` object that represents a potential online order for a site member.
2479
+ *
2480
+ * You can use this method to show a site member a preview of an online order before [creating](https://dev.wix.com/docs/rest/business-solutions/pricing-plans/pricing-plans/orders/create-online-order) it.
2481
+ *
2482
+ * This method must be called using the site member identity ([SDK](https://dev.wix.com/docs/sdk/articles/get-started/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#site-member)). Therefore, [Wix apps](https://dev.wix.com/docs/build-apps) can't currently call this method using REST.
2483
+ * @param planId - Plan ID.
2484
+ * @public
2485
+ * @requiredField planId
2486
+ * @permissionId PRICING_PLANS.PURCHASE_PLANS
2487
+ * @applicableIdentity APP
2488
+ * @applicableIdentity MEMBER
2489
+ * @fqn com.wixpress.membership.v2.orders.CheckoutService.GetOnlineOrderPreview
2490
+ */
2491
+ declare function getOnlineOrderPreview(planId: string, options?: GetOnlineOrderPreviewOptions): Promise<NonNullablePaths<GetOnlineOrderPreviewResponse, {
2492
+ [P in OrderNonNullablePaths]: `order.${P}`;
2493
+ }[OrderNonNullablePaths] | `purchaseLimitExceeded`> & {
2494
+ __applicationErrorsType?: GetOnlineOrderPreviewApplicationErrors;
2495
+ __validationErrorsType?: GetOnlineOrderPreviewValidationErrors;
2496
+ }>;
1714
2497
  interface GetOnlineOrderPreviewOptions {
1715
2498
  /**
1716
2499
  * Start date and time for the plan of the order preview in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
@@ -1725,6 +2508,34 @@ interface GetOnlineOrderPreviewOptions {
1725
2508
  */
1726
2509
  couponCode?: string | null;
1727
2510
  }
2511
+ /**
2512
+ * Performs a dry run of a purchase and provides an order preview.
2513
+ *
2514
+ * The preview uses the same logic as purchasing a plan, but the preview is not saved. Because an order is not actually
2515
+ * created, the preview order's `orderId` and `subscriptionId` are displayed as a string of multiple zero characters
2516
+ * (`000000-0000`). Tax is only calculated if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
2517
+ * <br>
2518
+ * If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview.
2519
+ * But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then
2520
+ * `purchaseLimitExceeded` will return as `true`.
2521
+ *
2522
+ * To get a general price preview for a plan that's not buyer-specific, call Get Price Preview.
2523
+ * @param memberId - Member ID of the buyer the previewed order is for, from the Members API.
2524
+ * @public
2525
+ * @requiredField memberId
2526
+ * @requiredField planId
2527
+ * @param options - Options for previewing the offline order.
2528
+ * @param planId - ID of the plan of the previewed order.
2529
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2530
+ * @applicableIdentity APP
2531
+ * @fqn com.wixpress.membership.v2.orders.CheckoutService.GetOfflineOrderPreview
2532
+ */
2533
+ declare function getOfflineOrderPreview(planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions): Promise<NonNullablePaths<GetOfflineOrderPreviewResponse, {
2534
+ [P in OrderNonNullablePaths]: `order.${P}`;
2535
+ }[OrderNonNullablePaths] | `purchaseLimitExceeded`> & {
2536
+ __applicationErrorsType?: GetOfflineOrderPreviewApplicationErrors;
2537
+ __validationErrorsType?: GetOfflineOrderPreviewValidationErrors;
2538
+ }>;
1728
2539
  interface GetOfflineOrderPreviewOptions {
1729
2540
  /**
1730
2541
  * Start date and time for plan of the previewed order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
@@ -1739,6 +2550,27 @@ interface GetOfflineOrderPreviewOptions {
1739
2550
  */
1740
2551
  couponCode?: string | null;
1741
2552
  }
2553
+ /**
2554
+ * Retrieves a plan's pricing.
2555
+ *
2556
+ * The price preview uses the same logic as purchasing a plan, but the preview is not saved. Tax is only applied if
2557
+ * the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection). The price is returned
2558
+ * in the pricing model format used for orders. Learn more about pricing models ([REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/introduction#pricing-models)).
2559
+ *
2560
+ * Buyers do not have to be logged in to preview the price, and as such, the details returned are not buyer-specific. To
2561
+ * generate a preview of a purchase for a specific buyer, call Get Offline Order Preview.
2562
+ * @param planId - ID of plan to preview.
2563
+ * @public
2564
+ * @requiredField planId
2565
+ * @param options - Options for getting a price preview.
2566
+ * @permissionId PRICING_PLANS.READ_PUBLIC_PLANS
2567
+ * @applicableIdentity APP
2568
+ * @applicableIdentity VISITOR
2569
+ * @fqn com.wixpress.membership.v2.orders.CheckoutService.GetPricePreview
2570
+ */
2571
+ declare function getPricePreview(planId: string, options?: GetPricePreviewOptions): Promise<NonNullablePaths<GetPricePreviewResponse, `price.subscription.cycleDuration.unit` | `price.subtotal` | `price.discount` | `price.tax.name` | `price.tax.includedInPrice` | `price.tax.rate` | `price.tax.amount` | `price.total` | `price.planPrice` | `price.currency` | `price.coupon.code` | `price.coupon.amount` | `price.coupon._id` | `prices` | `prices.${number}.duration.cycleFrom` | `prices.${number}.price.subtotal` | `prices.${number}.price.coupon.code` | `prices.${number}.price.coupon.amount` | `prices.${number}.price.coupon._id` | `prices.${number}.price.discount` | `prices.${number}.price.tax.name` | `prices.${number}.price.tax.includedInPrice` | `prices.${number}.price.tax.rate` | `prices.${number}.price.tax.amount` | `prices.${number}.price.total` | `prices.${number}.price.currency` | `prices.${number}.price.proration`> & {
2572
+ __applicationErrorsType?: GetPricePreviewApplicationErrors;
2573
+ }>;
1742
2574
  interface GetPricePreviewOptions {
1743
2575
  /**
1744
2576
  * Coupon code to apply, from the Coupons API.
@@ -1748,4 +2580,4 @@ interface GetPricePreviewOptions {
1748
2580
  couponCode?: string | null;
1749
2581
  }
1750
2582
 
1751
- export { type SpannedPrice as $, type OrderStartDateChangedEnvelope as A, OrderType as B, type CancellationEffectiveAtWithLiterals as C, OrderMethod as D, OrderStatus as E, CancellationCause as F, type GetOrderResponse as G, CancellationEffectiveAt as H, PaymentStatus as I, Set as J, SortOrder as K, type ListOrdersResponse as L, type ManagementGetOrderOptions as M, type Buyer as N, type Order as O, PeriodUnit as P, type PriceDetails as Q, ReasonNotSuspendable as R, Status as S, type PriceDetailsPricingModelOneOf as T, type Tax as U, type Recurrence as V, WebhookIdentityType as W, type Duration as X, type Coupon as Y, type PricingDetails as Z, type PricingDetailsPricingModelOneOf as _, type ManagementListOrdersOptions as a, type MemberGetOrderResponse as a$, type PriceDuration as a0, type Price as a1, type Fee as a2, type Cancellation as a3, type PausePeriod as a4, type CurrentCycle as a5, type OrderCycle as a6, type FormData as a7, type DomainEvent as a8, type DomainEventBodyOneOf as a9, type PostponeEndDateRequest as aA, type PostponeEndDateResponse as aB, type OrderEndDatePostponed as aC, type CancelOrderRequest as aD, type CancelOrderResponse as aE, type OrderCanceled as aF, type MarkAsPaidRequest as aG, type MarkAsPaidResponse as aH, type OrderMarkedAsPaid as aI, type PauseOrderRequest as aJ, type PauseOrderResponse as aK, type OrderPaused as aL, type BulkPauseOrderRequest as aM, type BulkPauseOrderResponse as aN, type BulkOrderResult as aO, type ItemMetadata as aP, type ApplicationError as aQ, type BulkActionMetadata as aR, type ResumeOrderRequest as aS, type ResumeOrderResponse as aT, type OrderResumed as aU, type BulkResumeOrderRequest as aV, type BulkResumeOrderResponse as aW, type MessageEnvelope as aX, type IdentificationData as aY, type IdentificationDataIdOneOf as aZ, type MemberGetOrderRequest as a_, type EntityCreatedEvent as aa, type RestoreInfo as ab, type EntityUpdatedEvent as ac, type EntityDeletedEvent as ad, type ActionEvent as ae, type Empty as af, type OrderPurchased as ag, type OrderStarted as ah, type OrderCycleStarted as ai, type OrderAutoRenewCanceled as aj, type OrderEnded as ak, type GetOrderRequest as al, type ListOrdersRequest as am, type Sorting as an, type PagingMetadataV2 as ao, type Cursors as ap, type OrdersQueryOrdersRequest as aq, type QueryV2 as ar, type QueryV2PagingMethodOneOf as as, type Paging as at, type CursorPaging as au, type OrdersQueryOrdersResponse as av, type GetOrdersStatsRequest as aw, type GetOrdersStatsResponse as ax, type GetAvailableOrderActionsRequest as ay, type GetAvailableOrderActionsResponse as az, type MemberGetOrderOptions as b, type MemberListOrdersRequest as b0, type QueryOrdersRequest as b1, type QueryOrdersResponse as b2, type RequestCancellationRequest as b3, type RequestCancellationResponse as b4, type CreateOnlineOrderRequest as b5, type OnBehalf as b6, type CouponsError as b7, type CreateGuestOnlineOrderRequest as b8, type Captcha as b9, type Guest as ba, type CreateGuestOnlineOrderResponse as bb, type CreateOfflineOrderRequest as bc, type CreateExternalOrderRequest as bd, type CreateExternalOrderResponse as be, type GetOnlineOrderPreviewRequest as bf, type GetGuestOnlineOrderPreviewRequest as bg, type GetGuestOnlineOrderPreviewResponse as bh, type GetOfflineOrderPreviewRequest as bi, type GetPricePreviewRequest as bj, type ChangeStartDateRequest as bk, type ChangeStartDateResponse as bl, type OrderStartDateChanged as bm, type ApplyCouponRequest as bn, type ApplyCouponResponse as bo, type SetSubmissionRequest as bp, type SetSubmissionResponse as bq, type BaseEventMetadata as br, type EventMetadata as bs, type MemberListOrdersOptions as c, type MemberListOrdersResponse as d, type CreateOnlineOrderOptions as e, type CreateOnlineOrderResponse as f, type CreateOfflineOrderOptions as g, type CreateOfflineOrderResponse as h, type GetOnlineOrderPreviewOptions as i, type GetOnlineOrderPreviewResponse as j, type GetOfflineOrderPreviewOptions as k, type GetOfflineOrderPreviewResponse as l, type GetPricePreviewOptions as m, type GetPricePreviewResponse as n, type OrderAutoRenewCanceledEnvelope as o, type OrderCanceledEnvelope as p, type OrderCycleStartedEnvelope as q, type OrderEndDatePostponedEnvelope as r, type OrderEndedEnvelope as s, type OrderMarkedAsPaidEnvelope as t, type OrderPausedEnvelope as u, type OrderPurchasedEnvelope as v, type OrderResumedEnvelope as w, type OrderStartedEnvelope as x, type OrderUpdatedEnvelope as y, type OrderCreatedEnvelope as z };
2583
+ export { type ActionEvent, type ApplicationError, type ApplyCouponRequest, type ApplyCouponResponse, type BaseEventMetadata, type BulkActionMetadata, type BulkOrderResult, type BulkPauseOrderRequest, type BulkPauseOrderResponse, type BulkResumeOrderRequest, type BulkResumeOrderResponse, type Buyer, type CancelOrderRequest, type CancelOrderResponse, type Cancellation, CancellationCause, type CancellationCauseWithLiterals, CancellationEffectiveAt, type CancellationEffectiveAtWithLiterals, type Captcha, type ChangeStartDateRequest, type ChangeStartDateResponse, type Coupon, type CouponsError, type CreateExternalOrderRequest, type CreateExternalOrderResponse, type CreateGuestOnlineOrderRequest, type CreateGuestOnlineOrderResponse, type CreateOfflineOrderApplicationErrors, type CreateOfflineOrderOptions, type CreateOfflineOrderRequest, type CreateOfflineOrderResponse, type CreateOfflineOrderValidationErrors, type CreateOnlineOrderApplicationErrors, type CreateOnlineOrderOptions, type CreateOnlineOrderRequest, type CreateOnlineOrderResponse, type CreateOnlineOrderValidationErrors, type CurrentCycle, type CursorPaging, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type Duration, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type Fee, type FormData, type GetAvailableOrderActionsRequest, type GetAvailableOrderActionsResponse, type GetGuestOnlineOrderPreviewRequest, type GetGuestOnlineOrderPreviewResponse, type GetOfflineOrderPreviewApplicationErrors, type GetOfflineOrderPreviewOptions, type GetOfflineOrderPreviewRequest, type GetOfflineOrderPreviewResponse, type GetOfflineOrderPreviewValidationErrors, type GetOnlineOrderPreviewApplicationErrors, type GetOnlineOrderPreviewOptions, type GetOnlineOrderPreviewRequest, type GetOnlineOrderPreviewResponse, type GetOnlineOrderPreviewValidationErrors, type GetOrderRequest, type GetOrderResponse, type GetOrdersStatsRequest, type GetOrdersStatsResponse, type GetPricePreviewApplicationErrors, type GetPricePreviewOptions, type GetPricePreviewRequest, type GetPricePreviewResponse, type Guest, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type ListOrdersRequest, type ListOrdersResponse, type ManagementGetOrderOptions, type ManagementListOrdersOptions, type MarkAsPaidRequest, type MarkAsPaidResponse, type MemberGetOrderOptions, type MemberGetOrderRequest, type MemberGetOrderResponse, type MemberListOrdersOptions, type MemberListOrdersRequest, type MemberListOrdersResponse, type MessageEnvelope, type OnBehalf, type Order, type OrderAutoRenewCanceled, type OrderAutoRenewCanceledEnvelope, type OrderCanceled, type OrderCanceledEnvelope, type OrderCreatedEnvelope, type OrderCycle, type OrderCycleStarted, type OrderCycleStartedEnvelope, type OrderEndDatePostponed, type OrderEndDatePostponedEnvelope, type OrderEnded, type OrderEndedEnvelope, type OrderMarkedAsPaid, type OrderMarkedAsPaidEnvelope, OrderMethod, type OrderMethodWithLiterals, type OrderPaused, type OrderPausedEnvelope, type OrderPurchased, type OrderPurchasedEnvelope, type OrderResumed, type OrderResumedEnvelope, type OrderStartDateChanged, type OrderStartDateChangedEnvelope, type OrderStarted, type OrderStartedEnvelope, OrderStatus, type OrderStatusWithLiterals, OrderType, type OrderTypeWithLiterals, type OrderUpdatedEnvelope, type OrdersQueryOrdersRequest, type OrdersQueryOrdersResponse, type Paging, type PagingMetadataV2, type PauseOrderRequest, type PauseOrderResponse, type PausePeriod, PaymentStatus, type PaymentStatusWithLiterals, PeriodUnit, type PeriodUnitWithLiterals, type PostponeEndDateRequest, type PostponeEndDateResponse, type Price, type PriceDetails, type PriceDetailsPricingModelOneOf, type PriceDuration, type PricingDetails, type PricingDetailsPricingModelOneOf, type QueryOrdersRequest, type QueryOrdersResponse, type QueryV2, type QueryV2PagingMethodOneOf, ReasonNotSuspendable, type ReasonNotSuspendableWithLiterals, type Recurrence, type RequestCancellationRequest, type RequestCancellationResponse, type RestoreInfo, type ResumeOrderRequest, type ResumeOrderResponse, Set, type SetSubmissionRequest, type SetSubmissionResponse, type SetWithLiterals, SortOrder, type SortOrderWithLiterals, type Sorting, type SpannedPrice, Status, type StatusWithLiterals, type Tax, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, cancelOrder, createOfflineOrder, createOnlineOrder, getOfflineOrderPreview, getOnlineOrderPreview, getPricePreview, managementGetOrder, managementListOrders, markAsPaid, memberGetOrder, memberListOrders, onOrderAutoRenewCanceled, onOrderCanceled, onOrderCreated, onOrderCycleStarted, onOrderEndDatePostponed, onOrderEnded, onOrderMarkedAsPaid, onOrderPaused, onOrderPurchased, onOrderResumed, onOrderStartDateChanged, onOrderStarted, onOrderUpdated, pauseOrder, postponeEndDate, requestCancellation, resumeOrder };