@wix/auto_sdk_pricing-plans_orders 1.0.120 → 1.0.121

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 (49) hide show
  1. package/build/cjs/index.d.ts +129 -129
  2. package/build/cjs/index.js +548 -548
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +787 -787
  5. package/build/cjs/index.typings.js +421 -421
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +484 -484
  8. package/build/cjs/meta.js +352 -352
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/schemas.d.ts +199 -199
  11. package/build/cjs/schemas.js +885 -885
  12. package/build/cjs/schemas.js.map +1 -1
  13. package/build/es/index.d.mts +129 -129
  14. package/build/es/index.mjs +548 -548
  15. package/build/es/index.mjs.map +1 -1
  16. package/build/es/index.typings.d.mts +787 -787
  17. package/build/es/index.typings.mjs +421 -421
  18. package/build/es/index.typings.mjs.map +1 -1
  19. package/build/es/meta.d.mts +484 -484
  20. package/build/es/meta.mjs +352 -352
  21. package/build/es/meta.mjs.map +1 -1
  22. package/build/es/schemas.d.mts +199 -199
  23. package/build/es/schemas.mjs +885 -885
  24. package/build/es/schemas.mjs.map +1 -1
  25. package/build/internal/cjs/index.d.ts +129 -129
  26. package/build/internal/cjs/index.js +548 -548
  27. package/build/internal/cjs/index.js.map +1 -1
  28. package/build/internal/cjs/index.typings.d.ts +845 -786
  29. package/build/internal/cjs/index.typings.js +421 -421
  30. package/build/internal/cjs/index.typings.js.map +1 -1
  31. package/build/internal/cjs/meta.d.ts +578 -477
  32. package/build/internal/cjs/meta.js +352 -352
  33. package/build/internal/cjs/meta.js.map +1 -1
  34. package/build/internal/cjs/schemas.d.ts +199 -199
  35. package/build/internal/cjs/schemas.js +885 -885
  36. package/build/internal/cjs/schemas.js.map +1 -1
  37. package/build/internal/es/index.d.mts +129 -129
  38. package/build/internal/es/index.mjs +548 -548
  39. package/build/internal/es/index.mjs.map +1 -1
  40. package/build/internal/es/index.typings.d.mts +845 -786
  41. package/build/internal/es/index.typings.mjs +421 -421
  42. package/build/internal/es/index.typings.mjs.map +1 -1
  43. package/build/internal/es/meta.d.mts +578 -477
  44. package/build/internal/es/meta.mjs +352 -352
  45. package/build/internal/es/meta.mjs.map +1 -1
  46. package/build/internal/es/schemas.d.mts +199 -199
  47. package/build/internal/es/schemas.mjs +885 -885
  48. package/build/internal/es/schemas.mjs.map +1 -1
  49. package/package.json +4 -4
@@ -66,6 +66,12 @@ interface Order {
66
66
  * @readonly
67
67
  */
68
68
  type?: OrderTypeWithLiterals;
69
+ /**
70
+ * Method by which checkout was initiated on buyer's behalf.
71
+ * @internal
72
+ * @readonly
73
+ */
74
+ orderMethod?: OrderMethodWithLiterals;
69
75
  /**
70
76
  * Status of the order.
71
77
  * @readonly
@@ -135,6 +141,12 @@ interface Order {
135
141
  * @readonly
136
142
  */
137
143
  currentCycle?: CurrentCycle;
144
+ /**
145
+ * Past and current cycles for the order.
146
+ * @internal
147
+ * @readonly
148
+ */
149
+ cycles?: OrderCycle[];
138
150
  /**
139
151
  * Plan name at the time of purchase.
140
152
  * @readonly
@@ -166,6 +178,17 @@ interface Order {
166
178
  * @readonly
167
179
  */
168
180
  formData?: FormData;
181
+ /**
182
+ * TODO PPL-1357: Remove when migration to new status is completed
183
+ * @internal
184
+ */
185
+ statusNew?: OrderStatusWithLiterals;
186
+ /**
187
+ * Used to differentiate orders that were created from eCom flow.
188
+ * @internal
189
+ * @readonly
190
+ */
191
+ onEcom?: boolean;
169
192
  }
170
193
  interface Buyer {
171
194
  /**
@@ -392,6 +415,14 @@ interface Price {
392
415
  * @format CURRENCY
393
416
  */
394
417
  currency?: string;
418
+ /**
419
+ * Additional fees that would have been applied to the price, one of which could be a setup fee.
420
+ *
421
+ * Tax is also applied to additional fees.
422
+ * @internal
423
+ * @readonly
424
+ */
425
+ fees?: Fee[];
395
426
  /**
396
427
  * Price change after billing date was change and price was adjusted. Could be positive and negative values.
397
428
  * @format DECIMAL_VALUE
@@ -635,345 +666,316 @@ interface ActionEvent {
635
666
  }
636
667
  interface Empty {
637
668
  }
638
- interface OrderPurchased {
639
- /** Order that was paid for. If a free or an offline order, the order that was created. */
640
- order?: Order;
641
- }
642
- interface OrderStarted {
643
- /** Order that reached its `startDate`. */
644
- order?: Order;
669
+ interface CreateOnlineOrderRequest {
670
+ /**
671
+ * Plan ID.
672
+ * @format GUID
673
+ */
674
+ planId: string;
675
+ /**
676
+ * Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
677
+ *
678
+ * Default: Current date and time.
679
+ */
680
+ startDate?: Date | null;
681
+ /**
682
+ * Coupon code to apply.
683
+ * @minLength 1
684
+ * @maxLength 20
685
+ */
686
+ couponCode?: string | null;
687
+ /** Provided if checkout is initiated on buyer's behalf. */
688
+ onBehalf?: OnBehalf;
689
+ /**
690
+ * Submission ID of the form submitted with this order.
691
+ * @format GUID
692
+ */
693
+ submissionId?: string | null;
645
694
  }
646
- /**
647
- * Triggered at the start of a new payment cycle for an existing order.
648
- *
649
- * This webhook does not trigger at the initial start of an offline order.
650
- */
651
- interface OrderCycleStarted {
652
- /** Order whose new cycle started. */
653
- order?: Order;
654
- /** Number of the payment cycle will be 0 when the order is in the free trial period. In other cases, the cycle number starts from 1. */
655
- cycleNumber?: number;
695
+ interface OnBehalf {
696
+ /**
697
+ * Member ID.
698
+ * @format GUID
699
+ */
700
+ memberId?: string;
701
+ /** Method by which checkout is initiated. */
702
+ orderMethod?: OrderMethodWithLiterals;
656
703
  }
657
- /** Emitted when a recurring order is canceled for the next payment cycle */
658
- interface OrderAutoRenewCanceled {
659
- /** Order that is canceled, effective at the end of the current payment cycle. */
704
+ interface CreateOnlineOrderResponse {
705
+ /** Created online order. */
660
706
  order?: Order;
661
707
  }
662
- interface OrderEnded {
663
- /** Order that ended. */
664
- order?: Order;
708
+ interface CouponsError {
709
+ /** Coupon code. */
710
+ couponCode?: string;
711
+ /** Plan ID. */
712
+ planId?: string;
665
713
  }
666
- interface GetOrderRequest {
714
+ interface CreateGuestOnlineOrderRequest {
667
715
  /**
668
- * Order ID.
716
+ * Plan ID.
669
717
  * @format GUID
670
718
  */
671
- _id: string;
719
+ planId?: string;
672
720
  /**
673
- * Predefined set of fields to return.
721
+ * Start date for the ordered plan.
674
722
  *
675
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
723
+ * Default: Current date
676
724
  */
677
- fieldSet?: SetWithLiterals;
725
+ startDate?: Date | null;
726
+ /**
727
+ * Coupon code to apply.
728
+ * @minLength 1
729
+ * @maxLength 20
730
+ */
731
+ couponCode?: string | null;
732
+ /** Captcha data to prove you are not a robot */
733
+ captcha?: Captcha;
734
+ /** Visitor info */
735
+ guest?: Guest;
736
+ /**
737
+ * Form submission id that was submitted together with the order
738
+ * @format GUID
739
+ */
740
+ submissionId?: string | null;
678
741
  }
679
- declare enum Set {
680
- /** Same behavior as `BASIC`.` */
681
- UNKNOWN_SET = "UNKNOWN_SET",
682
- /** Doesn't return any order form submission data. */
683
- BASIC = "BASIC",
684
- /** Returns all order form submission data. */
685
- FULL = "FULL"
742
+ interface Captcha {
743
+ /** Token from captcha */
744
+ token?: string;
686
745
  }
687
- /** @enumType */
688
- type SetWithLiterals = Set | 'UNKNOWN_SET' | 'BASIC' | 'FULL';
689
- interface GetOrderResponse {
746
+ interface Guest {
747
+ /**
748
+ * Email for checkout
749
+ * @format EMAIL
750
+ */
751
+ email?: string;
752
+ }
753
+ interface CreateGuestOnlineOrderResponse {
690
754
  /** Order. */
691
755
  order?: Order;
692
756
  }
693
- interface ListOrdersRequest {
757
+ interface CreateOfflineOrderRequest {
694
758
  /**
695
- * Filter by a buyer's member ID, from the Members API.
759
+ * ID of the plan being ordered, from the Plans API.
696
760
  * @format GUID
697
761
  */
698
- buyerIds?: string[];
762
+ planId: string;
699
763
  /**
700
- * Filter by plan IDs, from the Plans API.
764
+ * ID of the member ordering the plan, from the Members API.
701
765
  * @format GUID
702
766
  */
703
- planIds?: string[];
704
- /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
705
- autoRenewCanceled?: boolean | null;
706
- /** Filter by order status. */
707
- orderStatuses?: OrderStatusWithLiterals[];
708
- /** Filter by payment status. */
709
- paymentStatuses?: PaymentStatusWithLiterals[];
710
- /**
711
- * Number of orders to return. See Sorting and Paging for more information.
712
- *
713
- * Max: `50`
714
- * @min 1
715
- * @max 50
716
- */
717
- limit?: number | null;
718
- /** Number of orders to skip in the current sort order. */
719
- offset?: number | null;
767
+ memberId: string;
720
768
  /**
721
- * Sort order.
722
- *
723
- * Use `ASC` for ascending order or `DESC` for descending order.
769
+ * Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
724
770
  *
725
- * Default: `DESC`.
771
+ * Default: Current date and time.
726
772
  */
727
- sorting?: Sorting;
773
+ startDate?: Date | null;
728
774
  /**
729
- * Predefined set of fields to return.
775
+ * Whether the order is paid.
730
776
  *
731
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
777
+ * Default: `false`
732
778
  */
733
- fieldSet?: SetWithLiterals;
734
- }
735
- interface Sorting {
779
+ paid?: boolean | null;
736
780
  /**
737
- * Name of the field to sort by.
738
- * @maxLength 512
781
+ * Coupon code to apply, from the Coupons API.
782
+ * @minLength 1
783
+ * @maxLength 20
739
784
  */
740
- fieldName?: string;
741
- /** Sort order. */
742
- order?: SortOrderWithLiterals;
785
+ couponCode?: string | null;
743
786
  /**
744
- * Origin point for geo-distance sorting on a GEO field
745
- * results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
787
+ * Form submission ID that was submitted with the order.
788
+ * @format GUID
746
789
  */
747
- origin?: AddressLocation;
748
- }
749
- declare enum SortOrder {
750
- ASC = "ASC",
751
- DESC = "DESC"
752
- }
753
- /** @enumType */
754
- type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
755
- interface AddressLocation {
756
- /** Address latitude. */
757
- latitude?: number | null;
758
- /** Address longitude. */
759
- longitude?: number | null;
760
- }
761
- interface ListOrdersResponse {
762
- /** List of orders. */
763
- orders?: Order[];
764
- /** Object containing paging-related data (number of orders returned, offset). */
765
- pagingMetadata?: PagingMetadataV2;
790
+ submissionId?: string | null;
766
791
  }
767
- interface PagingMetadataV2 {
768
- /** Number of items returned in the response. */
769
- count?: number | null;
770
- /** Offset that was requested. */
771
- offset?: number | null;
772
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
773
- total?: number | null;
774
- /** Flag that indicates the server failed to calculate the `total` field. */
775
- tooManyToCount?: boolean | null;
776
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
777
- cursors?: Cursors;
792
+ interface CreateOfflineOrderResponse {
793
+ /** Order. */
794
+ order?: Order;
778
795
  }
779
- interface Cursors {
796
+ interface CreateExternalOrderRequest {
780
797
  /**
781
- * Cursor string pointing to the next page in the list of results.
782
- * @maxLength 16000
798
+ * Plan ID.
799
+ * @format GUID
783
800
  */
784
- next?: string | null;
801
+ planId?: string;
785
802
  /**
786
- * Cursor pointing to the previous page in the list of results.
787
- * @maxLength 16000
803
+ * Form submission id that was submitted together with the order
804
+ * @format GUID
788
805
  */
789
- prev?: string | null;
790
- }
791
- interface GetOrdersStatsRequest {
806
+ submissionId?: string | null;
792
807
  }
793
- interface GetOrdersStatsResponse {
794
- /** Total number of orders. */
795
- totalOrderCount?: number;
796
- /** Number of active orders. */
797
- activeOrderCount?: number;
808
+ interface CreateExternalOrderResponse {
809
+ /** Created order */
810
+ order?: Order;
798
811
  }
799
- interface GetAvailableOrderActionsRequest {
812
+ interface GetOnlineOrderPreviewRequest {
800
813
  /**
801
- * Order ID.
814
+ * Plan ID.
802
815
  * @format GUID
803
816
  */
804
- _id?: string;
805
- }
806
- interface GetAvailableOrderActionsResponse {
807
- /** Whether the order can be suspended. */
808
- suspendable?: boolean;
809
- /** If the order cannot be suspended, a reason is returned here. */
810
- notSuspendableReason?: ReasonNotSuspendableWithLiterals;
811
- /** Whether the order can be canceled by the buyer. */
812
- cancelableByBuyer?: boolean;
817
+ planId: string;
818
+ /**
819
+ * Start date and time for the plan of the order preview in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
820
+ *
821
+ * Default: Current date and time.
822
+ */
823
+ startDate?: Date | null;
824
+ /**
825
+ * Coupon code to apply.
826
+ * @minLength 1
827
+ * @maxLength 20
828
+ */
829
+ couponCode?: string | null;
813
830
  }
814
- declare enum ReasonNotSuspendable {
815
- /** Undefined reason. */
816
- UNDEFINED = "UNDEFINED",
817
- /** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
818
- PENDING = "PENDING",
819
- /** Trial orders can't be suspended. */
820
- TRIAL = "TRIAL",
821
- /** Canceled orders can't be suspended. */
822
- CANCELED = "CANCELED",
823
- /** Ended orders can't be suspended. */
824
- ENDED = "ENDED",
825
- /** Paid for orders with future start dates can't be suspended. */
826
- NOT_STARTED = "NOT_STARTED",
827
- /** Order is already suspended. */
828
- ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
829
- /** Orders based on recurring payments using older stripe versions can't be suspended. */
830
- OLD_STRIPE = "OLD_STRIPE"
831
+ interface GetOnlineOrderPreviewResponse {
832
+ /** Order preview. This field is undefined if the member has already reached the purchase limit for the order's plan. */
833
+ order?: Order;
834
+ /** Whether the member has already reached purchase limit for the order's plan. */
835
+ purchaseLimitExceeded?: boolean;
831
836
  }
832
- /** @enumType */
833
- type ReasonNotSuspendableWithLiterals = ReasonNotSuspendable | 'UNDEFINED' | 'PENDING' | 'TRIAL' | 'CANCELED' | 'ENDED' | 'NOT_STARTED' | 'ALREADY_SUSPENDED' | 'OLD_STRIPE';
834
- interface PostponeEndDateRequest {
837
+ interface GetGuestOnlineOrderPreviewRequest {
835
838
  /**
836
- * Order ID.
839
+ * Plan ID.
837
840
  * @format GUID
838
841
  */
839
- _id: string;
842
+ planId?: string;
840
843
  /**
841
- * New end date and time.
844
+ * Start date for the ordered plan.
842
845
  *
843
- * Must be later than the current end date and time.
846
+ * Default: Current date
844
847
  */
845
- endDate: Date | null;
846
- }
847
- interface PostponeEndDateResponse {
848
+ startDate?: Date | null;
849
+ /**
850
+ * Coupon code to apply.
851
+ * @minLength 1
852
+ * @maxLength 20
853
+ */
854
+ couponCode?: string | null;
855
+ /**
856
+ * Email for checkout
857
+ * @format EMAIL
858
+ */
859
+ email?: string;
848
860
  }
849
- interface OrderEndDatePostponed {
850
- /** Order whose `endDate` was postponed. */
861
+ interface GetGuestOnlineOrderPreviewResponse {
862
+ /** Will be missing if limit is exceeded */
851
863
  order?: Order;
864
+ /**
865
+ * Whether the purchase limit has already been reached for this plan by this email.
866
+ * Always false for plans without purchase limits.
867
+ */
868
+ purchaseLimitExceeded?: boolean;
852
869
  }
853
- interface CancelOrderRequest {
870
+ interface GetOfflineOrderPreviewRequest {
854
871
  /**
855
- * Order ID.
872
+ * ID of the plan of the previewed order, from the Plans API.
856
873
  * @format GUID
857
874
  */
858
- _id: string;
859
- /** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
860
- effectiveAt: CancellationEffectiveAtWithLiterals;
861
- }
862
- interface CancelOrderResponse {
875
+ planId: string;
876
+ /**
877
+ * Member ID of the buyer the previewed order is for, from the Members API.
878
+ * @format GUID
879
+ */
880
+ memberId: string;
881
+ /**
882
+ * Start date and time for plan of the previewed order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
883
+ *
884
+ * Default: Current date and time.
885
+ */
886
+ startDate?: Date | null;
887
+ /**
888
+ * Coupon code to apply, from the Coupons API.
889
+ * @minLength 1
890
+ * @maxLength 20
891
+ */
892
+ couponCode?: string | null;
863
893
  }
864
- /**
865
- * Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
866
- *
867
- * To determine the specific reason of the cancellation check `order.cancellation.cause` field.
868
- */
869
- interface OrderCanceled {
870
- /** Canceled order. */
894
+ interface GetOfflineOrderPreviewResponse {
895
+ /** The previewed order, as if the plan had been ordered. */
871
896
  order?: Order;
897
+ /**
898
+ * Whether this previewed order would exceed the permitted amount of purchases available
899
+ * for this plan for this buyer.
900
+ *
901
+ * Always `false` for plans that do not have purchase limits.
902
+ */
903
+ purchaseLimitExceeded?: boolean;
872
904
  }
873
- interface MarkAsPaidRequest {
905
+ interface GetPricePreviewRequest {
874
906
  /**
875
- * Order ID.
907
+ * ID of plan to preview.
876
908
  * @format GUID
877
909
  */
878
- _id: string;
879
- }
880
- interface MarkAsPaidResponse {
910
+ planId: string;
911
+ /**
912
+ * Coupon code to apply, from the Coupons API.
913
+ * @minLength 1
914
+ * @maxLength 20
915
+ */
916
+ couponCode?: string | null;
881
917
  }
882
- interface OrderMarkedAsPaid {
883
- /** Order that was marked as paid. */
884
- order?: Order;
918
+ interface GetPricePreviewResponse {
919
+ /**
920
+ * @internal
921
+ * @internal
922
+ * @deprecated __Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022.
923
+ * @replacedBy prices
924
+ * @targetRemovalDate 2022-10-01
925
+ */
926
+ price?: PriceDetails;
927
+ /** Pricing details. */
928
+ prices?: SpannedPrice[];
885
929
  }
886
- interface PauseOrderRequest {
930
+ interface ChangeStartDateRequest {
887
931
  /**
888
- * Order ID.
932
+ * Draft order ID.
889
933
  * @format GUID
890
934
  */
891
- _id: string;
935
+ orderId?: string;
936
+ /** New valid from date (timestamp). */
937
+ startDate?: Date | null;
892
938
  }
893
- interface PauseOrderResponse {
939
+ interface ChangeStartDateResponse {
940
+ /** Updated draft order. */
941
+ order?: Order;
894
942
  }
895
- interface OrderPaused {
896
- /** Paused order. */
943
+ interface OrderStartDateChanged {
944
+ /** Order whose `startDate` changed. */
897
945
  order?: Order;
898
946
  }
899
- interface BulkPauseOrderRequest {
947
+ interface ApplyCouponRequest {
900
948
  /**
901
- * List of Order IDs.
949
+ * Draft order ID.
902
950
  * @format GUID
903
- * @minSize 1
904
- * @maxSize 100
905
951
  */
906
- ids?: string[];
907
- /** Set to true to return Order entity in response. */
908
- returnFullEntity?: boolean;
909
- }
910
- interface BulkPauseOrderResponse {
911
- /** Orders that were paused. */
912
- results?: BulkOrderResult[];
913
- /** Bulk action metadata. */
914
- bulkActionMetadata?: BulkActionMetadata;
952
+ orderId?: string;
953
+ /**
954
+ * Coupon code to apply.
955
+ * @minLength 1
956
+ * @maxLength 20
957
+ */
958
+ couponCode?: string;
915
959
  }
916
- interface BulkOrderResult {
917
- /** Item metadata */
918
- itemMetadata?: ItemMetadata;
919
- /** The order. */
960
+ interface ApplyCouponResponse {
961
+ /** Order with applied coupon and recalculated tax. */
920
962
  order?: Order;
921
963
  }
922
- interface ItemMetadata {
923
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
924
- _id?: string | null;
925
- /** Index of the item within the request array. Allows for correlation between request and response items. */
926
- originalIndex?: number;
927
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
928
- success?: boolean;
929
- /** Details about the error in case of failure. */
930
- error?: ApplicationError;
931
- }
932
- interface ApplicationError {
933
- /** Error code. */
934
- code?: string;
935
- /** Description of the error. */
936
- description?: string;
937
- /** Data related to the error. */
938
- data?: Record<string, any> | null;
939
- }
940
- interface BulkActionMetadata {
941
- /** Number of items that were successfully processed. */
942
- totalSuccesses?: number;
943
- /** Number of items that couldn't be processed. */
944
- totalFailures?: number;
945
- /** Number of failures without details because detailed failure threshold was exceeded. */
946
- undetailedFailures?: number;
947
- }
948
- interface ResumeOrderRequest {
964
+ interface SetSubmissionRequest {
949
965
  /**
950
966
  * Order ID.
951
967
  * @format GUID
952
968
  */
953
- _id: string;
954
- }
955
- interface ResumeOrderResponse {
956
- }
957
- interface OrderResumed {
958
- /** Resumed order. */
959
- order?: Order;
960
- }
961
- interface BulkResumeOrderRequest {
969
+ orderId?: string;
962
970
  /**
963
- * List of Order IDs.
971
+ * Submission ID.
964
972
  * @format GUID
965
- * @minSize 1
966
- * @maxSize 100
967
973
  */
968
- ids?: string[];
969
- /** Set to true to return Order entity in response. */
970
- returnFullEntity?: boolean;
974
+ submissionId?: string;
971
975
  }
972
- interface BulkResumeOrderResponse {
973
- /** Orders that were resumed. */
974
- results?: BulkOrderResult[];
975
- /** Bulk action metadata. */
976
- bulkActionMetadata?: BulkActionMetadata;
976
+ interface SetSubmissionResponse {
977
+ /** Order with submission id */
978
+ order?: Order;
977
979
  }
978
980
  interface MessageEnvelope {
979
981
  /**
@@ -1066,316 +1068,373 @@ interface AccountInfo {
1066
1068
  */
1067
1069
  siteId?: string | null;
1068
1070
  }
1069
- interface CreateOnlineOrderRequest {
1070
- /**
1071
- * Plan ID.
1072
- * @format GUID
1073
- */
1074
- planId: string;
1075
- /**
1076
- * Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1077
- *
1078
- * Default: Current date and time.
1079
- */
1080
- startDate?: Date | null;
1081
- /**
1082
- * Coupon code to apply.
1083
- * @minLength 1
1084
- * @maxLength 20
1085
- */
1086
- couponCode?: string | null;
1087
- /** Provided if checkout is initiated on buyer's behalf. */
1088
- onBehalf?: OnBehalf;
1089
- /**
1090
- * Submission ID of the form submitted with this order.
1091
- * @format GUID
1092
- */
1093
- submissionId?: string | null;
1071
+ interface OrderPurchased {
1072
+ /** Order that was paid for. If a free or an offline order, the order that was created. */
1073
+ order?: Order;
1094
1074
  }
1095
- interface OnBehalf {
1096
- /**
1097
- * Member ID.
1098
- * @format GUID
1099
- */
1100
- memberId?: string;
1101
- /** Method by which checkout is initiated. */
1102
- orderMethod?: OrderMethodWithLiterals;
1075
+ interface OrderStarted {
1076
+ /** Order that reached its `startDate`. */
1077
+ order?: Order;
1103
1078
  }
1104
- interface CreateOnlineOrderResponse {
1105
- /** Created online order. */
1079
+ /**
1080
+ * Triggered at the start of a new payment cycle for an existing order.
1081
+ *
1082
+ * This webhook does not trigger at the initial start of an offline order.
1083
+ */
1084
+ interface OrderCycleStarted {
1085
+ /** Order whose new cycle started. */
1106
1086
  order?: Order;
1087
+ /** Number of the payment cycle will be 0 when the order is in the free trial period. In other cases, the cycle number starts from 1. */
1088
+ cycleNumber?: number;
1107
1089
  }
1108
- interface CouponsError {
1109
- /** Coupon code. */
1110
- couponCode?: string;
1111
- /** Plan ID. */
1112
- planId?: string;
1090
+ /** Emitted when a recurring order is canceled for the next payment cycle */
1091
+ interface OrderAutoRenewCanceled {
1092
+ /** Order that is canceled, effective at the end of the current payment cycle. */
1093
+ order?: Order;
1113
1094
  }
1114
- interface CreateGuestOnlineOrderRequest {
1095
+ interface OrderEnded {
1096
+ /** Order that ended. */
1097
+ order?: Order;
1098
+ }
1099
+ interface GetOrderRequest {
1115
1100
  /**
1116
- * Plan ID.
1101
+ * Order ID.
1117
1102
  * @format GUID
1118
1103
  */
1119
- planId?: string;
1104
+ _id: string;
1120
1105
  /**
1121
- * Start date for the ordered plan.
1106
+ * Predefined set of fields to return.
1122
1107
  *
1123
- * Default: Current date
1124
- */
1125
- startDate?: Date | null;
1126
- /**
1127
- * Coupon code to apply.
1128
- * @minLength 1
1129
- * @maxLength 20
1130
- */
1131
- couponCode?: string | null;
1132
- /** Captcha data to prove you are not a robot */
1133
- captcha?: Captcha;
1134
- /** Visitor info */
1135
- guest?: Guest;
1136
- /**
1137
- * Form submission id that was submitted together with the order
1138
- * @format GUID
1108
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1139
1109
  */
1140
- submissionId?: string | null;
1141
- }
1142
- interface Captcha {
1143
- /** Token from captcha */
1144
- token?: string;
1110
+ fieldSet?: SetWithLiterals;
1145
1111
  }
1146
- interface Guest {
1147
- /**
1148
- * Email for checkout
1149
- * @format EMAIL
1150
- */
1151
- email?: string;
1112
+ declare enum Set {
1113
+ /** Same behavior as `BASIC`.` */
1114
+ UNKNOWN_SET = "UNKNOWN_SET",
1115
+ /** Doesn't return any order form submission data. */
1116
+ BASIC = "BASIC",
1117
+ /** Returns all order form submission data. */
1118
+ FULL = "FULL"
1152
1119
  }
1153
- interface CreateGuestOnlineOrderResponse {
1120
+ /** @enumType */
1121
+ type SetWithLiterals = Set | 'UNKNOWN_SET' | 'BASIC' | 'FULL';
1122
+ interface GetOrderResponse {
1154
1123
  /** Order. */
1155
1124
  order?: Order;
1156
1125
  }
1157
- interface CreateOfflineOrderRequest {
1126
+ interface ListOrdersRequest {
1158
1127
  /**
1159
- * ID of the plan being ordered, from the Plans API.
1128
+ * Filter by a buyer's member ID, from the Members API.
1160
1129
  * @format GUID
1161
1130
  */
1162
- planId: string;
1131
+ buyerIds?: string[];
1163
1132
  /**
1164
- * ID of the member ordering the plan, from the Members API.
1133
+ * Filter by plan IDs, from the Plans API.
1165
1134
  * @format GUID
1166
1135
  */
1167
- memberId: string;
1136
+ planIds?: string[];
1137
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
1138
+ autoRenewCanceled?: boolean | null;
1139
+ /** Filter by order status. */
1140
+ orderStatuses?: OrderStatusWithLiterals[];
1141
+ /** Filter by payment status. */
1142
+ paymentStatuses?: PaymentStatusWithLiterals[];
1168
1143
  /**
1169
- * Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1144
+ * Number of orders to return. See Sorting and Paging for more information.
1170
1145
  *
1171
- * Default: Current date and time.
1146
+ * Max: `50`
1147
+ * @min 1
1148
+ * @max 50
1172
1149
  */
1173
- startDate?: Date | null;
1150
+ limit?: number | null;
1151
+ /** Number of orders to skip in the current sort order. */
1152
+ offset?: number | null;
1174
1153
  /**
1175
- * Whether the order is paid.
1154
+ * Sort order.
1176
1155
  *
1177
- * Default: `false`
1178
- */
1179
- paid?: boolean | null;
1180
- /**
1181
- * Coupon code to apply, from the Coupons API.
1182
- * @minLength 1
1183
- * @maxLength 20
1184
- */
1185
- couponCode?: string | null;
1186
- /**
1187
- * Form submission ID that was submitted with the order.
1188
- * @format GUID
1156
+ * Use `ASC` for ascending order or `DESC` for descending order.
1157
+ *
1158
+ * Default: `DESC`.
1189
1159
  */
1190
- submissionId?: string | null;
1191
- }
1192
- interface CreateOfflineOrderResponse {
1193
- /** Order. */
1194
- order?: Order;
1195
- }
1196
- interface CreateExternalOrderRequest {
1160
+ sorting?: Sorting;
1197
1161
  /**
1198
- * Plan ID.
1199
- * @format GUID
1162
+ * Predefined set of fields to return.
1163
+ *
1164
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1200
1165
  */
1201
- planId?: string;
1166
+ fieldSet?: SetWithLiterals;
1202
1167
  /**
1203
- * Form submission id that was submitted together with the order
1168
+ * Filter by order IDs.
1169
+ * @internal
1204
1170
  * @format GUID
1171
+ * @maxSize 50
1205
1172
  */
1206
- submissionId?: string | null;
1173
+ orderIds?: string[];
1207
1174
  }
1208
- interface CreateExternalOrderResponse {
1209
- /** Created order */
1210
- order?: Order;
1211
- }
1212
- interface GetOnlineOrderPreviewRequest {
1175
+ interface Sorting {
1213
1176
  /**
1214
- * Plan ID.
1215
- * @format GUID
1177
+ * Name of the field to sort by.
1178
+ * @maxLength 512
1216
1179
  */
1217
- planId: string;
1180
+ fieldName?: string;
1181
+ /** Sort order. */
1182
+ order?: SortOrderWithLiterals;
1218
1183
  /**
1219
- * Start date and time for the plan of the order preview in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1184
+ * When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
1185
+ * a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
1220
1186
  *
1221
- * Default: Current date and time.
1187
+ * If multiple filters are provided, they are combined with AND operator.
1188
+ *
1189
+ * Example:
1190
+ * Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
1191
+ * and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
1192
+ * { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
1193
+ * @internal
1194
+ * @maxSize 10
1222
1195
  */
1223
- startDate?: Date | null;
1196
+ selectItemsBy?: Record<string, any>[] | null;
1224
1197
  /**
1225
- * Coupon code to apply.
1226
- * @minLength 1
1227
- * @maxLength 20
1198
+ * Origin point for geo-distance sorting on a GEO field
1199
+ * results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
1228
1200
  */
1229
- couponCode?: string | null;
1201
+ origin?: AddressLocation;
1230
1202
  }
1231
- interface GetOnlineOrderPreviewResponse {
1232
- /** Order preview. This field is undefined if the member has already reached the purchase limit for the order's plan. */
1233
- order?: Order;
1234
- /** Whether the member has already reached purchase limit for the order's plan. */
1235
- purchaseLimitExceeded?: boolean;
1203
+ declare enum SortOrder {
1204
+ ASC = "ASC",
1205
+ DESC = "DESC"
1236
1206
  }
1237
- interface GetGuestOnlineOrderPreviewRequest {
1238
- /**
1239
- * Plan ID.
1240
- * @format GUID
1241
- */
1242
- planId?: string;
1207
+ /** @enumType */
1208
+ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
1209
+ interface AddressLocation {
1210
+ /** Address latitude. */
1211
+ latitude?: number | null;
1212
+ /** Address longitude. */
1213
+ longitude?: number | null;
1214
+ }
1215
+ interface ListOrdersResponse {
1216
+ /** List of orders. */
1217
+ orders?: Order[];
1218
+ /** Object containing paging-related data (number of orders returned, offset). */
1219
+ pagingMetadata?: PagingMetadataV2;
1220
+ }
1221
+ interface PagingMetadataV2 {
1222
+ /** Number of items returned in the response. */
1223
+ count?: number | null;
1224
+ /** Offset that was requested. */
1225
+ offset?: number | null;
1226
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
1227
+ total?: number | null;
1228
+ /** Flag that indicates the server failed to calculate the `total` field. */
1229
+ tooManyToCount?: boolean | null;
1230
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
1231
+ cursors?: Cursors;
1243
1232
  /**
1244
- * Start date for the ordered plan.
1245
- *
1246
- * Default: Current date
1233
+ * Indicates if there are more results after the current page.
1234
+ * If `true`, another page of results can be retrieved.
1235
+ * If `false`, this is the last page.
1236
+ * @internal
1247
1237
  */
1248
- startDate?: Date | null;
1238
+ hasNext?: boolean | null;
1239
+ }
1240
+ interface Cursors {
1249
1241
  /**
1250
- * Coupon code to apply.
1251
- * @minLength 1
1252
- * @maxLength 20
1242
+ * Cursor string pointing to the next page in the list of results.
1243
+ * @maxLength 16000
1253
1244
  */
1254
- couponCode?: string | null;
1245
+ next?: string | null;
1255
1246
  /**
1256
- * Email for checkout
1257
- * @format EMAIL
1247
+ * Cursor pointing to the previous page in the list of results.
1248
+ * @maxLength 16000
1258
1249
  */
1259
- email?: string;
1250
+ prev?: string | null;
1260
1251
  }
1261
- interface GetGuestOnlineOrderPreviewResponse {
1262
- /** Will be missing if limit is exceeded */
1263
- order?: Order;
1264
- /**
1265
- * Whether the purchase limit has already been reached for this plan by this email.
1266
- * Always false for plans without purchase limits.
1267
- */
1268
- purchaseLimitExceeded?: boolean;
1252
+ interface GetOrdersStatsRequest {
1269
1253
  }
1270
- interface GetOfflineOrderPreviewRequest {
1254
+ interface GetOrdersStatsResponse {
1255
+ /** Total number of orders. */
1256
+ totalOrderCount?: number;
1257
+ /** Number of active orders. */
1258
+ activeOrderCount?: number;
1259
+ }
1260
+ interface GetAvailableOrderActionsRequest {
1271
1261
  /**
1272
- * ID of the plan of the previewed order, from the Plans API.
1262
+ * Order ID.
1273
1263
  * @format GUID
1274
1264
  */
1275
- planId: string;
1265
+ _id?: string;
1266
+ }
1267
+ interface GetAvailableOrderActionsResponse {
1268
+ /** Whether the order can be suspended. */
1269
+ suspendable?: boolean;
1270
+ /** If the order cannot be suspended, a reason is returned here. */
1271
+ notSuspendableReason?: ReasonNotSuspendableWithLiterals;
1272
+ /** Whether the order can be canceled by the buyer. */
1273
+ cancelableByBuyer?: boolean;
1274
+ }
1275
+ declare enum ReasonNotSuspendable {
1276
+ /** Undefined reason. */
1277
+ UNDEFINED = "UNDEFINED",
1278
+ /** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
1279
+ PENDING = "PENDING",
1280
+ /** Trial orders can't be suspended. */
1281
+ TRIAL = "TRIAL",
1282
+ /** Canceled orders can't be suspended. */
1283
+ CANCELED = "CANCELED",
1284
+ /** Ended orders can't be suspended. */
1285
+ ENDED = "ENDED",
1286
+ /** Paid for orders with future start dates can't be suspended. */
1287
+ NOT_STARTED = "NOT_STARTED",
1288
+ /** Order is already suspended. */
1289
+ ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
1290
+ /** Orders based on recurring payments using older stripe versions can't be suspended. */
1291
+ OLD_STRIPE = "OLD_STRIPE"
1292
+ }
1293
+ /** @enumType */
1294
+ type ReasonNotSuspendableWithLiterals = ReasonNotSuspendable | 'UNDEFINED' | 'PENDING' | 'TRIAL' | 'CANCELED' | 'ENDED' | 'NOT_STARTED' | 'ALREADY_SUSPENDED' | 'OLD_STRIPE';
1295
+ interface PostponeEndDateRequest {
1276
1296
  /**
1277
- * Member ID of the buyer the previewed order is for, from the Members API.
1297
+ * Order ID.
1278
1298
  * @format GUID
1279
1299
  */
1280
- memberId: string;
1300
+ _id: string;
1281
1301
  /**
1282
- * Start date and time for plan of the previewed order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1302
+ * New end date and time.
1283
1303
  *
1284
- * Default: Current date and time.
1285
- */
1286
- startDate?: Date | null;
1287
- /**
1288
- * Coupon code to apply, from the Coupons API.
1289
- * @minLength 1
1290
- * @maxLength 20
1304
+ * Must be later than the current end date and time.
1291
1305
  */
1292
- couponCode?: string | null;
1306
+ endDate: Date | null;
1293
1307
  }
1294
- interface GetOfflineOrderPreviewResponse {
1295
- /** The previewed order, as if the plan had been ordered. */
1308
+ interface PostponeEndDateResponse {
1309
+ }
1310
+ interface OrderEndDatePostponed {
1311
+ /** Order whose `endDate` was postponed. */
1296
1312
  order?: Order;
1297
- /**
1298
- * Whether this previewed order would exceed the permitted amount of purchases available
1299
- * for this plan for this buyer.
1300
- *
1301
- * Always `false` for plans that do not have purchase limits.
1302
- */
1303
- purchaseLimitExceeded?: boolean;
1304
1313
  }
1305
- interface GetPricePreviewRequest {
1314
+ interface CancelOrderRequest {
1306
1315
  /**
1307
- * ID of plan to preview.
1316
+ * Order ID.
1308
1317
  * @format GUID
1309
1318
  */
1310
- planId: string;
1311
- /**
1312
- * Coupon code to apply, from the Coupons API.
1313
- * @minLength 1
1314
- * @maxLength 20
1315
- */
1316
- couponCode?: string | null;
1319
+ _id: string;
1320
+ /** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
1321
+ effectiveAt: CancellationEffectiveAtWithLiterals;
1317
1322
  }
1318
- interface GetPricePreviewResponse {
1319
- /**
1320
- * @internal
1321
- * @internal
1322
- * @deprecated __Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022.
1323
- * @replacedBy prices
1324
- * @targetRemovalDate 2022-10-01
1325
- */
1326
- price?: PriceDetails;
1327
- /** Pricing details. */
1328
- prices?: SpannedPrice[];
1323
+ interface CancelOrderResponse {
1329
1324
  }
1330
- interface ChangeStartDateRequest {
1325
+ /**
1326
+ * Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
1327
+ *
1328
+ * To determine the specific reason of the cancellation check `order.cancellation.cause` field.
1329
+ */
1330
+ interface OrderCanceled {
1331
+ /** Canceled order. */
1332
+ order?: Order;
1333
+ }
1334
+ interface MarkAsPaidRequest {
1331
1335
  /**
1332
- * Draft order ID.
1336
+ * Order ID.
1333
1337
  * @format GUID
1334
1338
  */
1335
- orderId?: string;
1336
- /** New valid from date (timestamp). */
1337
- startDate?: Date | null;
1339
+ _id: string;
1338
1340
  }
1339
- interface ChangeStartDateResponse {
1340
- /** Updated draft order. */
1341
- order?: Order;
1341
+ interface MarkAsPaidResponse {
1342
1342
  }
1343
- interface OrderStartDateChanged {
1344
- /** Order whose `startDate` changed. */
1343
+ interface OrderMarkedAsPaid {
1344
+ /** Order that was marked as paid. */
1345
1345
  order?: Order;
1346
1346
  }
1347
- interface ApplyCouponRequest {
1347
+ interface PauseOrderRequest {
1348
1348
  /**
1349
- * Draft order ID.
1349
+ * Order ID.
1350
1350
  * @format GUID
1351
1351
  */
1352
- orderId?: string;
1352
+ _id: string;
1353
+ }
1354
+ interface PauseOrderResponse {
1355
+ }
1356
+ interface OrderPaused {
1357
+ /** Paused order. */
1358
+ order?: Order;
1359
+ }
1360
+ interface BulkPauseOrderRequest {
1353
1361
  /**
1354
- * Coupon code to apply.
1355
- * @minLength 1
1356
- * @maxLength 20
1362
+ * List of Order IDs.
1363
+ * @format GUID
1364
+ * @minSize 1
1365
+ * @maxSize 100
1357
1366
  */
1358
- couponCode?: string;
1367
+ ids?: string[];
1368
+ /** Set to true to return Order entity in response. */
1369
+ returnFullEntity?: boolean;
1359
1370
  }
1360
- interface ApplyCouponResponse {
1361
- /** Order with applied coupon and recalculated tax. */
1371
+ interface BulkPauseOrderResponse {
1372
+ /** Orders that were paused. */
1373
+ results?: BulkOrderResult[];
1374
+ /** Bulk action metadata. */
1375
+ bulkActionMetadata?: BulkActionMetadata;
1376
+ }
1377
+ interface BulkOrderResult {
1378
+ /** Item metadata */
1379
+ itemMetadata?: ItemMetadata;
1380
+ /** The order. */
1362
1381
  order?: Order;
1363
1382
  }
1364
- interface SetSubmissionRequest {
1383
+ interface ItemMetadata {
1384
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1385
+ _id?: string | null;
1386
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
1387
+ originalIndex?: number;
1388
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1389
+ success?: boolean;
1390
+ /** Details about the error in case of failure. */
1391
+ error?: ApplicationError;
1392
+ }
1393
+ interface ApplicationError {
1394
+ /** Error code. */
1395
+ code?: string;
1396
+ /** Description of the error. */
1397
+ description?: string;
1398
+ /** Data related to the error. */
1399
+ data?: Record<string, any> | null;
1400
+ }
1401
+ interface BulkActionMetadata {
1402
+ /** Number of items that were successfully processed. */
1403
+ totalSuccesses?: number;
1404
+ /** Number of items that couldn't be processed. */
1405
+ totalFailures?: number;
1406
+ /** Number of failures without details because detailed failure threshold was exceeded. */
1407
+ undetailedFailures?: number;
1408
+ }
1409
+ interface ResumeOrderRequest {
1365
1410
  /**
1366
1411
  * Order ID.
1367
1412
  * @format GUID
1368
1413
  */
1369
- orderId?: string;
1414
+ _id: string;
1415
+ }
1416
+ interface ResumeOrderResponse {
1417
+ }
1418
+ interface OrderResumed {
1419
+ /** Resumed order. */
1420
+ order?: Order;
1421
+ }
1422
+ interface BulkResumeOrderRequest {
1370
1423
  /**
1371
- * Submission ID.
1424
+ * List of Order IDs.
1372
1425
  * @format GUID
1426
+ * @minSize 1
1427
+ * @maxSize 100
1373
1428
  */
1374
- submissionId?: string;
1429
+ ids?: string[];
1430
+ /** Set to true to return Order entity in response. */
1431
+ returnFullEntity?: boolean;
1375
1432
  }
1376
- interface SetSubmissionResponse {
1377
- /** Order with submission id */
1378
- order?: Order;
1433
+ interface BulkResumeOrderResponse {
1434
+ /** Orders that were resumed. */
1435
+ results?: BulkOrderResult[];
1436
+ /** Bulk action metadata. */
1437
+ bulkActionMetadata?: BulkActionMetadata;
1379
1438
  }
1380
1439
  interface MemberGetOrderRequest {
1381
1440
  /**
@@ -1791,16 +1850,12 @@ interface AccountInfoMetadata {
1791
1850
  /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */
1792
1851
  parentAccountId?: string;
1793
1852
  }
1794
- interface OrderAutoRenewCanceledEnvelope {
1795
- data: OrderAutoRenewCanceled;
1853
+ interface OrderCreatedEnvelope {
1854
+ entity: Order;
1796
1855
  metadata: EventMetadata;
1797
1856
  }
1798
1857
  /**
1799
- * Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
1800
- *
1801
- * This webhook is *not* triggered in the following scenarios:
1802
- * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
1803
- * + 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.
1858
+ * Triggered when an order is created.
1804
1859
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
1805
1860
  * @permissionScopeId SCOPE.RENTALS.MANAGE
1806
1861
  * @permissionScope Manage Orders
@@ -1813,21 +1868,17 @@ interface OrderAutoRenewCanceledEnvelope {
1813
1868
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1814
1869
  * @permissionId PRICING_PLANS.READ_ORDERS
1815
1870
  * @webhook
1816
- * @eventType wix.pricing_plans.v2.order_auto_renew_canceled
1817
- * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1818
- * @slug auto_renew_canceled
1871
+ * @eventType wix.pricing_plans.v2.order_created
1872
+ * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1873
+ * @slug created
1819
1874
  */
1820
- declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
1821
- interface OrderCanceledEnvelope {
1822
- data: OrderCanceled;
1875
+ declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
1876
+ interface OrderStartDateChangedEnvelope {
1877
+ data: OrderStartDateChanged;
1823
1878
  metadata: EventMetadata;
1824
1879
  }
1825
1880
  /**
1826
- * Triggered when an order is canceled.
1827
- *
1828
- * This webhook is triggered either immediately or at the end of the current payment cycle, as follows:
1829
- * + If the order is canceled and `effectiveAt` is set to `IMMEDIATELY`, the webhook is triggered immediately when canceled.
1830
- * + 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.
1881
+ * Triggered when an order's `startDate` is changed.
1831
1882
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
1832
1883
  * @permissionScopeId SCOPE.RENTALS.MANAGE
1833
1884
  * @permissionScope Manage Orders
@@ -1840,42 +1891,25 @@ interface OrderCanceledEnvelope {
1840
1891
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1841
1892
  * @permissionId PRICING_PLANS.READ_ORDERS
1842
1893
  * @webhook
1843
- * @eventType wix.pricing_plans.v2.order_canceled
1844
- * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1845
- * @slug canceled
1894
+ * @eventType wix.pricing_plans.v2.order_start_date_changed
1895
+ * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1896
+ * @slug start_date_changed
1846
1897
  */
1847
- declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
1848
- interface OrderCycleStartedEnvelope {
1849
- data: OrderCycleStarted;
1898
+ declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
1899
+ interface OrderUpdatedEnvelope {
1900
+ entity: Order;
1850
1901
  metadata: EventMetadata;
1851
1902
  }
1852
1903
  /**
1853
- * Triggered at the start of a new payment cycle for an existing order.
1904
+ * Triggered for any of the following update events:
1854
1905
  *
1855
- * Not triggered at the initial start of an offline order.
1856
- * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
1857
- * @permissionScopeId SCOPE.RENTALS.MANAGE
1858
- * @permissionScope Manage Orders
1859
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1860
- * @permissionScope Read Orders
1861
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1862
- * @permissionScope Manage plans and orders of Pricing Plans
1863
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1864
- * @permissionScope Manage Events
1865
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1866
- * @permissionId PRICING_PLANS.READ_ORDERS
1867
- * @webhook
1868
- * @eventType wix.pricing_plans.v2.order_cycle_started
1869
- * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1870
- * @slug cycle_started
1871
- */
1872
- declare function onOrderCycleStarted(handler: (event: OrderCycleStartedEnvelope) => void | Promise<void>): void;
1873
- interface OrderEndDatePostponedEnvelope {
1874
- data: OrderEndDatePostponed;
1875
- metadata: EventMetadata;
1876
- }
1877
- /**
1878
- * Triggered when an order's `endDate` is postponed.
1906
+ * + Order is paid for. Order Purchased is also triggered.
1907
+ * + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
1908
+ * + New payment cycle of an order starts. Order Cycle Started is also triggered.
1909
+ * + Offline order is marked as paid. Order Marked As Paid is also triggered.
1910
+ * + End date of the order is postponed. Order End Date Postponed is also triggered
1911
+ * + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
1912
+ * + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
1879
1913
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
1880
1914
  * @permissionScopeId SCOPE.RENTALS.MANAGE
1881
1915
  * @permissionScope Manage Orders
@@ -1888,44 +1922,21 @@ interface OrderEndDatePostponedEnvelope {
1888
1922
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1889
1923
  * @permissionId PRICING_PLANS.READ_ORDERS
1890
1924
  * @webhook
1891
- * @eventType wix.pricing_plans.v2.order_end_date_postponed
1892
- * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1893
- * @slug end_date_postponed
1925
+ * @eventType wix.pricing_plans.v2.order_updated
1926
+ * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1927
+ * @slug updated
1894
1928
  */
1895
- declare function onOrderEndDatePostponed(handler: (event: OrderEndDatePostponedEnvelope) => void | Promise<void>): void;
1896
- interface OrderEndedEnvelope {
1897
- data: OrderEnded;
1929
+ declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
1930
+ interface OrderAutoRenewCanceledEnvelope {
1931
+ data: OrderAutoRenewCanceled;
1898
1932
  metadata: EventMetadata;
1899
1933
  }
1900
1934
  /**
1901
- * Triggered when an order ends.
1935
+ * Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
1902
1936
  *
1903
- * This webhook is triggered:
1904
- * + When an order expires at the end of the current payment cycle.
1905
- * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`.
1906
- * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
1907
- * @permissionScopeId SCOPE.RENTALS.MANAGE
1908
- * @permissionScope Manage Orders
1909
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1910
- * @permissionScope Read Orders
1911
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1912
- * @permissionScope Manage plans and orders of Pricing Plans
1913
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1914
- * @permissionScope Manage Events
1915
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1916
- * @permissionId PRICING_PLANS.READ_ORDERS
1917
- * @webhook
1918
- * @eventType wix.pricing_plans.v2.order_ended
1919
- * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1920
- * @slug ended
1921
- */
1922
- declare function onOrderEnded(handler: (event: OrderEndedEnvelope) => void | Promise<void>): void;
1923
- interface OrderMarkedAsPaidEnvelope {
1924
- data: OrderMarkedAsPaid;
1925
- metadata: EventMetadata;
1926
- }
1927
- /**
1928
- * Triggered when an offline order is marked as paid.
1937
+ * This webhook is *not* triggered in the following scenarios:
1938
+ * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
1939
+ * + 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.
1929
1940
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
1930
1941
  * @permissionScopeId SCOPE.RENTALS.MANAGE
1931
1942
  * @permissionScope Manage Orders
@@ -1938,17 +1949,21 @@ interface OrderMarkedAsPaidEnvelope {
1938
1949
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1939
1950
  * @permissionId PRICING_PLANS.READ_ORDERS
1940
1951
  * @webhook
1941
- * @eventType wix.pricing_plans.v2.order_marked_as_paid
1952
+ * @eventType wix.pricing_plans.v2.order_auto_renew_canceled
1942
1953
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1943
- * @slug marked_as_paid
1954
+ * @slug auto_renew_canceled
1944
1955
  */
1945
- declare function onOrderMarkedAsPaid(handler: (event: OrderMarkedAsPaidEnvelope) => void | Promise<void>): void;
1946
- interface OrderPausedEnvelope {
1947
- data: OrderPaused;
1956
+ declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
1957
+ interface OrderCanceledEnvelope {
1958
+ data: OrderCanceled;
1948
1959
  metadata: EventMetadata;
1949
1960
  }
1950
1961
  /**
1951
- * Triggered when an order is paused.
1962
+ * Triggered when an order is canceled.
1963
+ *
1964
+ * This webhook is triggered either immediately or at the end of the current payment cycle, as follows:
1965
+ * + If the order is canceled and `effectiveAt` is set to `IMMEDIATELY`, the webhook is triggered immediately when canceled.
1966
+ * + 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.
1952
1967
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
1953
1968
  * @permissionScopeId SCOPE.RENTALS.MANAGE
1954
1969
  * @permissionScope Manage Orders
@@ -1961,21 +1976,19 @@ interface OrderPausedEnvelope {
1961
1976
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1962
1977
  * @permissionId PRICING_PLANS.READ_ORDERS
1963
1978
  * @webhook
1964
- * @eventType wix.pricing_plans.v2.order_paused
1979
+ * @eventType wix.pricing_plans.v2.order_canceled
1965
1980
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1966
- * @slug paused
1981
+ * @slug canceled
1967
1982
  */
1968
- declare function onOrderPaused(handler: (event: OrderPausedEnvelope) => void | Promise<void>): void;
1969
- interface OrderPurchasedEnvelope {
1970
- data: OrderPurchased;
1983
+ declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
1984
+ interface OrderCycleStartedEnvelope {
1985
+ data: OrderCycleStarted;
1971
1986
  metadata: EventMetadata;
1972
1987
  }
1973
1988
  /**
1974
- * Triggered for any of the following purchase events:
1975
- * + Order is paid in full.
1976
- * + At least 1 order cycle payment is paid for.
1977
- * + Offline order is created, even if not yet marked as paid.
1978
- * + Free order is created.
1989
+ * Triggered at the start of a new payment cycle for an existing order.
1990
+ *
1991
+ * Not triggered at the initial start of an offline order.
1979
1992
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
1980
1993
  * @permissionScopeId SCOPE.RENTALS.MANAGE
1981
1994
  * @permissionScope Manage Orders
@@ -1988,17 +2001,17 @@ interface OrderPurchasedEnvelope {
1988
2001
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1989
2002
  * @permissionId PRICING_PLANS.READ_ORDERS
1990
2003
  * @webhook
1991
- * @eventType wix.pricing_plans.v2.order_purchased
2004
+ * @eventType wix.pricing_plans.v2.order_cycle_started
1992
2005
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1993
- * @slug purchased
2006
+ * @slug cycle_started
1994
2007
  */
1995
- declare function onOrderPurchased(handler: (event: OrderPurchasedEnvelope) => void | Promise<void>): void;
1996
- interface OrderResumedEnvelope {
1997
- data: OrderResumed;
2008
+ declare function onOrderCycleStarted(handler: (event: OrderCycleStartedEnvelope) => void | Promise<void>): void;
2009
+ interface OrderEndDatePostponedEnvelope {
2010
+ data: OrderEndDatePostponed;
1998
2011
  metadata: EventMetadata;
1999
2012
  }
2000
2013
  /**
2001
- * Triggered when a paused order is resumed.
2014
+ * Triggered when an order's `endDate` is postponed.
2002
2015
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
2003
2016
  * @permissionScopeId SCOPE.RENTALS.MANAGE
2004
2017
  * @permissionScope Manage Orders
@@ -2011,17 +2024,21 @@ interface OrderResumedEnvelope {
2011
2024
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2012
2025
  * @permissionId PRICING_PLANS.READ_ORDERS
2013
2026
  * @webhook
2014
- * @eventType wix.pricing_plans.v2.order_resumed
2027
+ * @eventType wix.pricing_plans.v2.order_end_date_postponed
2015
2028
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2016
- * @slug resumed
2029
+ * @slug end_date_postponed
2017
2030
  */
2018
- declare function onOrderResumed(handler: (event: OrderResumedEnvelope) => void | Promise<void>): void;
2019
- interface OrderStartedEnvelope {
2020
- data: OrderStarted;
2031
+ declare function onOrderEndDatePostponed(handler: (event: OrderEndDatePostponedEnvelope) => void | Promise<void>): void;
2032
+ interface OrderEndedEnvelope {
2033
+ data: OrderEnded;
2021
2034
  metadata: EventMetadata;
2022
2035
  }
2023
2036
  /**
2024
- * Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
2037
+ * Triggered when an order ends.
2038
+ *
2039
+ * This webhook is triggered:
2040
+ * + When an order expires at the end of the current payment cycle.
2041
+ * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`.
2025
2042
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
2026
2043
  * @permissionScopeId SCOPE.RENTALS.MANAGE
2027
2044
  * @permissionScope Manage Orders
@@ -2034,25 +2051,17 @@ interface OrderStartedEnvelope {
2034
2051
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2035
2052
  * @permissionId PRICING_PLANS.READ_ORDERS
2036
2053
  * @webhook
2037
- * @eventType wix.pricing_plans.v2.order_started
2054
+ * @eventType wix.pricing_plans.v2.order_ended
2038
2055
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2039
- * @slug started
2056
+ * @slug ended
2040
2057
  */
2041
- declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
2042
- interface OrderUpdatedEnvelope {
2043
- entity: Order;
2058
+ declare function onOrderEnded(handler: (event: OrderEndedEnvelope) => void | Promise<void>): void;
2059
+ interface OrderMarkedAsPaidEnvelope {
2060
+ data: OrderMarkedAsPaid;
2044
2061
  metadata: EventMetadata;
2045
2062
  }
2046
2063
  /**
2047
- * Triggered for any of the following update events:
2048
- *
2049
- * + Order is paid for. Order Purchased is also triggered.
2050
- * + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
2051
- * + New payment cycle of an order starts. Order Cycle Started is also triggered.
2052
- * + Offline order is marked as paid. Order Marked As Paid is also triggered.
2053
- * + End date of the order is postponed. Order End Date Postponed is also triggered
2054
- * + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
2055
- * + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
2064
+ * Triggered when an offline order is marked as paid.
2056
2065
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
2057
2066
  * @permissionScopeId SCOPE.RENTALS.MANAGE
2058
2067
  * @permissionScope Manage Orders
@@ -2065,17 +2074,17 @@ interface OrderUpdatedEnvelope {
2065
2074
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2066
2075
  * @permissionId PRICING_PLANS.READ_ORDERS
2067
2076
  * @webhook
2068
- * @eventType wix.pricing_plans.v2.order_updated
2077
+ * @eventType wix.pricing_plans.v2.order_marked_as_paid
2069
2078
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2070
- * @slug updated
2079
+ * @slug marked_as_paid
2071
2080
  */
2072
- declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
2073
- interface OrderCreatedEnvelope {
2074
- entity: Order;
2081
+ declare function onOrderMarkedAsPaid(handler: (event: OrderMarkedAsPaidEnvelope) => void | Promise<void>): void;
2082
+ interface OrderPausedEnvelope {
2083
+ data: OrderPaused;
2075
2084
  metadata: EventMetadata;
2076
2085
  }
2077
2086
  /**
2078
- * Triggered when an order is created.
2087
+ * Triggered when an order is paused.
2079
2088
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
2080
2089
  * @permissionScopeId SCOPE.RENTALS.MANAGE
2081
2090
  * @permissionScope Manage Orders
@@ -2088,17 +2097,21 @@ interface OrderCreatedEnvelope {
2088
2097
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2089
2098
  * @permissionId PRICING_PLANS.READ_ORDERS
2090
2099
  * @webhook
2091
- * @eventType wix.pricing_plans.v2.order_created
2092
- * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
2093
- * @slug created
2100
+ * @eventType wix.pricing_plans.v2.order_paused
2101
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2102
+ * @slug paused
2094
2103
  */
2095
- declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
2096
- interface OrderStartDateChangedEnvelope {
2097
- data: OrderStartDateChanged;
2104
+ declare function onOrderPaused(handler: (event: OrderPausedEnvelope) => void | Promise<void>): void;
2105
+ interface OrderPurchasedEnvelope {
2106
+ data: OrderPurchased;
2098
2107
  metadata: EventMetadata;
2099
2108
  }
2100
2109
  /**
2101
- * Triggered when an order's `startDate` is changed.
2110
+ * Triggered for any of the following purchase events:
2111
+ * + Order is paid in full.
2112
+ * + At least 1 order cycle payment is paid for.
2113
+ * + Offline order is created, even if not yet marked as paid.
2114
+ * + Free order is created.
2102
2115
  * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
2103
2116
  * @permissionScopeId SCOPE.RENTALS.MANAGE
2104
2117
  * @permissionScope Manage Orders
@@ -2108,188 +2121,60 @@ interface OrderStartDateChangedEnvelope {
2108
2121
  * @permissionScope Manage plans and orders of Pricing Plans
2109
2122
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2110
2123
  * @permissionScope Manage Events
2111
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2112
- * @permissionId PRICING_PLANS.READ_ORDERS
2113
- * @webhook
2114
- * @eventType wix.pricing_plans.v2.order_start_date_changed
2115
- * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
2116
- * @slug start_date_changed
2117
- */
2118
- declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
2119
- /**
2120
- * Retrieves an order by ID.
2121
- * @param _id - Order ID.
2122
- * @public
2123
- * @requiredField _id
2124
- * @param options - Options to use when getting an order.
2125
- * @permissionId PRICING_PLANS.READ_ORDERS
2126
- * @applicableIdentity APP
2127
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
2128
- */
2129
- declare function managementGetOrder(_id: string, options?: ManagementGetOrderOptions): Promise<NonNullablePaths<GetOrderResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice`, 7>>;
2130
- interface ManagementGetOrderOptions {
2131
- /**
2132
- * Predefined set of fields to return.
2133
- *
2134
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
2135
- */
2136
- fieldSet?: SetWithLiterals;
2137
- }
2138
- /**
2139
- * Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
2140
- *
2141
- * By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
2142
- * `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
2143
- * @public
2144
- * @param options - Filtering, sorting, and pagination options.
2145
- * @permissionId PRICING_PLANS.READ_ORDERS
2146
- * @applicableIdentity APP
2147
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
2148
- */
2149
- declare function managementListOrders(options?: ManagementListOrdersOptions): Promise<NonNullablePaths<ListOrdersResponse, `orders` | `orders.${number}._id` | `orders.${number}.planId` | `orders.${number}.subscriptionId` | `orders.${number}.buyer.memberId` | `orders.${number}.buyer.contactId` | `orders.${number}.priceDetails.singlePaymentForDuration.unit` | `orders.${number}.priceDetails.subtotal` | `orders.${number}.priceDetails.discount` | `orders.${number}.priceDetails.tax.name` | `orders.${number}.priceDetails.tax.includedInPrice` | `orders.${number}.priceDetails.tax.rate` | `orders.${number}.priceDetails.tax.amount` | `orders.${number}.priceDetails.total` | `orders.${number}.priceDetails.planPrice` | `orders.${number}.priceDetails.currency` | `orders.${number}.priceDetails.coupon.code` | `orders.${number}.priceDetails.coupon.amount` | `orders.${number}.priceDetails.coupon._id` | `orders.${number}.type` | `orders.${number}.status` | `orders.${number}.cancellation.cause` | `orders.${number}.cancellation.effectiveAt` | `orders.${number}.lastPaymentStatus` | `orders.${number}.currentCycle.index` | `orders.${number}.planName` | `orders.${number}.planDescription` | `orders.${number}.planPrice`, 6>>;
2150
- interface ManagementListOrdersOptions {
2151
- /**
2152
- * Filter by a buyer's member ID, from the Members API.
2153
- * @format GUID
2154
- */
2155
- buyerIds?: string[];
2156
- /**
2157
- * Filter by plan IDs, from the Plans API.
2158
- * @format GUID
2159
- */
2160
- planIds?: string[];
2161
- /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
2162
- autoRenewCanceled?: boolean | null;
2163
- /** Filter by order status. */
2164
- orderStatuses?: OrderStatusWithLiterals[];
2165
- /** Filter by payment status. */
2166
- paymentStatuses?: PaymentStatusWithLiterals[];
2167
- /**
2168
- * Number of orders to return. See Sorting and Paging for more information.
2169
- *
2170
- * Max: `50`
2171
- * @min 1
2172
- * @max 50
2173
- */
2174
- limit?: number | null;
2175
- /** Number of orders to skip in the current sort order. */
2176
- offset?: number | null;
2177
- /**
2178
- * Sort order.
2179
- *
2180
- * Use `ASC` for ascending order or `DESC` for descending order.
2181
- *
2182
- * Default: `DESC`.
2183
- */
2184
- sorting?: Sorting;
2185
- /**
2186
- * Predefined set of fields to return.
2187
- *
2188
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
2189
- */
2190
- fieldSet?: SetWithLiterals;
2191
- }
2192
- /**
2193
- * 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.
2194
- *
2195
- * New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
2196
- * Can't postpone an order with `status`: `PAUSED`.
2197
- * @param _id - Order ID.
2198
- * @param endDate - New end date and time.
2199
- *
2200
- * Must be later than the current end date and time.
2201
- * @public
2202
- * @requiredField _id
2203
- * @requiredField endDate
2204
- * @param options - Options for postponing the end date of an order.
2205
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2206
- * @applicableIdentity APP
2207
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
2208
- */
2209
- declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
2210
- /**
2211
- * Cancels an existing order.
2212
- *
2213
- * For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
2214
- * For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
2215
- *
2216
- * #### Canceling during the free trial period.
2217
- *
2218
- * When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
2219
- * of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
2220
- * of the free trial period.
2221
- *
2222
- * When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
2223
- * `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
2224
- * immediately, even during the free trial period and the buyer won't be billed. Canceling at the
2225
- * `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
2226
- * Then, the subscription ends and the buyer is not billed.
2227
- * @param _id - Order ID.
2228
- * @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
2229
- * @public
2230
- * @requiredField _id
2231
- * @requiredField effectiveAt
2232
- * @param options - Options for canceling orders.
2233
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2234
- * @applicableIdentity APP
2235
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
2236
- */
2237
- declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
2238
- /**
2239
- * Marks an offline order as paid.
2240
- * > __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.
2241
- *
2242
- * Marking an offline order as paid causes the following changes:
2243
- * - The order's `lastPaymentStatus` changes to `"PAID"`.
2244
- * - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
2245
- *
2246
- * An error occurs if you attempt to:
2247
- * - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
2248
- * - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
2249
- * @param _id - Order ID.
2250
- * @public
2251
- * @requiredField _id
2252
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2253
- * @applicableIdentity APP
2254
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
2124
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2125
+ * @permissionId PRICING_PLANS.READ_ORDERS
2126
+ * @webhook
2127
+ * @eventType wix.pricing_plans.v2.order_purchased
2128
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2129
+ * @slug purchased
2255
2130
  */
2256
- declare function markAsPaid(_id: string): Promise<void>;
2131
+ declare function onOrderPurchased(handler: (event: OrderPurchasedEnvelope) => void | Promise<void>): void;
2132
+ interface OrderResumedEnvelope {
2133
+ data: OrderResumed;
2134
+ metadata: EventMetadata;
2135
+ }
2257
2136
  /**
2258
- * Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
2259
- *
2260
- * Only orders with `status`: `ACTIVE` can be paused.
2261
- * For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
2262
- * Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
2263
- * The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
2264
- *
2265
- * To resume a paused order, call Resume Order.
2266
- * @param _id - Order ID.
2267
- * @public
2268
- * @requiredField _id
2269
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2270
- * @applicableIdentity APP
2271
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
2137
+ * Triggered when a paused order is resumed.
2138
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
2139
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
2140
+ * @permissionScope Manage Orders
2141
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2142
+ * @permissionScope Read Orders
2143
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
2144
+ * @permissionScope Manage plans and orders of Pricing Plans
2145
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2146
+ * @permissionScope Manage Events
2147
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2148
+ * @permissionId PRICING_PLANS.READ_ORDERS
2149
+ * @webhook
2150
+ * @eventType wix.pricing_plans.v2.order_resumed
2151
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2152
+ * @slug resumed
2272
2153
  */
2273
- declare function pauseOrder(_id: string): Promise<void>;
2154
+ declare function onOrderResumed(handler: (event: OrderResumedEnvelope) => void | Promise<void>): void;
2155
+ interface OrderStartedEnvelope {
2156
+ data: OrderStarted;
2157
+ metadata: EventMetadata;
2158
+ }
2274
2159
  /**
2275
- * Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
2276
- *
2277
- * Resuming an order causes the following changes:
2278
- * - The order status changes to `"ACTIVE"`.
2279
- * - The `pausePeriods` array is updated.
2280
- * - The `endDate` for the order is adjusted to include the pause period.
2281
- * - For orders with recurring payments, the payment schedule is restarted.
2282
- * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
2283
- *
2284
- * To pause an order, call Pause Order.
2285
- * @param _id - Order ID.
2286
- * @public
2287
- * @requiredField _id
2288
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2289
- * @applicableIdentity APP
2290
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
2160
+ * Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
2161
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
2162
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
2163
+ * @permissionScope Manage Orders
2164
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2165
+ * @permissionScope Read Orders
2166
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
2167
+ * @permissionScope Manage plans and orders of Pricing Plans
2168
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2169
+ * @permissionScope Manage Events
2170
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2171
+ * @permissionId PRICING_PLANS.READ_ORDERS
2172
+ * @webhook
2173
+ * @eventType wix.pricing_plans.v2.order_started
2174
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2175
+ * @slug started
2291
2176
  */
2292
- declare function resumeOrder(_id: string): Promise<void>;
2177
+ declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
2293
2178
  /**
2294
2179
  * Creates an online order for a site member.
2295
2180
  *
@@ -2484,6 +2369,180 @@ interface GetPricePreviewOptions {
2484
2369
  */
2485
2370
  couponCode?: string | null;
2486
2371
  }
2372
+ /**
2373
+ * Retrieves an order by ID.
2374
+ * @param _id - Order ID.
2375
+ * @public
2376
+ * @requiredField _id
2377
+ * @param options - Options to use when getting an order.
2378
+ * @permissionId PRICING_PLANS.READ_ORDERS
2379
+ * @applicableIdentity APP
2380
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
2381
+ */
2382
+ declare function managementGetOrder(_id: string, options?: ManagementGetOrderOptions): Promise<NonNullablePaths<GetOrderResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice`, 7>>;
2383
+ interface ManagementGetOrderOptions {
2384
+ /**
2385
+ * Predefined set of fields to return.
2386
+ *
2387
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
2388
+ */
2389
+ fieldSet?: SetWithLiterals;
2390
+ }
2391
+ /**
2392
+ * Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
2393
+ *
2394
+ * By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
2395
+ * `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
2396
+ * @public
2397
+ * @param options - Filtering, sorting, and pagination options.
2398
+ * @permissionId PRICING_PLANS.READ_ORDERS
2399
+ * @applicableIdentity APP
2400
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
2401
+ */
2402
+ declare function managementListOrders(options?: ManagementListOrdersOptions): Promise<NonNullablePaths<ListOrdersResponse, `orders` | `orders.${number}._id` | `orders.${number}.planId` | `orders.${number}.subscriptionId` | `orders.${number}.buyer.memberId` | `orders.${number}.buyer.contactId` | `orders.${number}.priceDetails.singlePaymentForDuration.unit` | `orders.${number}.priceDetails.subtotal` | `orders.${number}.priceDetails.discount` | `orders.${number}.priceDetails.tax.name` | `orders.${number}.priceDetails.tax.includedInPrice` | `orders.${number}.priceDetails.tax.rate` | `orders.${number}.priceDetails.tax.amount` | `orders.${number}.priceDetails.total` | `orders.${number}.priceDetails.planPrice` | `orders.${number}.priceDetails.currency` | `orders.${number}.priceDetails.coupon.code` | `orders.${number}.priceDetails.coupon.amount` | `orders.${number}.priceDetails.coupon._id` | `orders.${number}.type` | `orders.${number}.status` | `orders.${number}.cancellation.cause` | `orders.${number}.cancellation.effectiveAt` | `orders.${number}.lastPaymentStatus` | `orders.${number}.currentCycle.index` | `orders.${number}.planName` | `orders.${number}.planDescription` | `orders.${number}.planPrice`, 6>>;
2403
+ interface ManagementListOrdersOptions {
2404
+ /**
2405
+ * Filter by a buyer's member ID, from the Members API.
2406
+ * @format GUID
2407
+ */
2408
+ buyerIds?: string[];
2409
+ /**
2410
+ * Filter by plan IDs, from the Plans API.
2411
+ * @format GUID
2412
+ */
2413
+ planIds?: string[];
2414
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
2415
+ autoRenewCanceled?: boolean | null;
2416
+ /** Filter by order status. */
2417
+ orderStatuses?: OrderStatusWithLiterals[];
2418
+ /** Filter by payment status. */
2419
+ paymentStatuses?: PaymentStatusWithLiterals[];
2420
+ /**
2421
+ * Number of orders to return. See Sorting and Paging for more information.
2422
+ *
2423
+ * Max: `50`
2424
+ * @min 1
2425
+ * @max 50
2426
+ */
2427
+ limit?: number | null;
2428
+ /** Number of orders to skip in the current sort order. */
2429
+ offset?: number | null;
2430
+ /**
2431
+ * Sort order.
2432
+ *
2433
+ * Use `ASC` for ascending order or `DESC` for descending order.
2434
+ *
2435
+ * Default: `DESC`.
2436
+ */
2437
+ sorting?: Sorting;
2438
+ /**
2439
+ * Predefined set of fields to return.
2440
+ *
2441
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
2442
+ */
2443
+ fieldSet?: SetWithLiterals;
2444
+ }
2445
+ /**
2446
+ * 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.
2447
+ *
2448
+ * New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
2449
+ * Can't postpone an order with `status`: `PAUSED`.
2450
+ * @param _id - Order ID.
2451
+ * @param endDate - New end date and time.
2452
+ *
2453
+ * Must be later than the current end date and time.
2454
+ * @public
2455
+ * @requiredField _id
2456
+ * @requiredField endDate
2457
+ * @param options - Options for postponing the end date of an order.
2458
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2459
+ * @applicableIdentity APP
2460
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
2461
+ */
2462
+ declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
2463
+ /**
2464
+ * Cancels an existing order.
2465
+ *
2466
+ * For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
2467
+ * For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
2468
+ *
2469
+ * #### Canceling during the free trial period.
2470
+ *
2471
+ * When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
2472
+ * of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
2473
+ * of the free trial period.
2474
+ *
2475
+ * When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
2476
+ * `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
2477
+ * immediately, even during the free trial period and the buyer won't be billed. Canceling at the
2478
+ * `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
2479
+ * Then, the subscription ends and the buyer is not billed.
2480
+ * @param _id - Order ID.
2481
+ * @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
2482
+ * @public
2483
+ * @requiredField _id
2484
+ * @requiredField effectiveAt
2485
+ * @param options - Options for canceling orders.
2486
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2487
+ * @applicableIdentity APP
2488
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
2489
+ */
2490
+ declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
2491
+ /**
2492
+ * Marks an offline order as paid.
2493
+ * > __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.
2494
+ *
2495
+ * Marking an offline order as paid causes the following changes:
2496
+ * - The order's `lastPaymentStatus` changes to `"PAID"`.
2497
+ * - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
2498
+ *
2499
+ * An error occurs if you attempt to:
2500
+ * - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
2501
+ * - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
2502
+ * @param _id - Order ID.
2503
+ * @public
2504
+ * @requiredField _id
2505
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2506
+ * @applicableIdentity APP
2507
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
2508
+ */
2509
+ declare function markAsPaid(_id: string): Promise<void>;
2510
+ /**
2511
+ * Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
2512
+ *
2513
+ * Only orders with `status`: `ACTIVE` can be paused.
2514
+ * For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
2515
+ * Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
2516
+ * The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
2517
+ *
2518
+ * To resume a paused order, call Resume Order.
2519
+ * @param _id - Order ID.
2520
+ * @public
2521
+ * @requiredField _id
2522
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2523
+ * @applicableIdentity APP
2524
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
2525
+ */
2526
+ declare function pauseOrder(_id: string): Promise<void>;
2527
+ /**
2528
+ * Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
2529
+ *
2530
+ * Resuming an order causes the following changes:
2531
+ * - The order status changes to `"ACTIVE"`.
2532
+ * - The `pausePeriods` array is updated.
2533
+ * - The `endDate` for the order is adjusted to include the pause period.
2534
+ * - For orders with recurring payments, the payment schedule is restarted.
2535
+ * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
2536
+ *
2537
+ * To pause an order, call Pause Order.
2538
+ * @param _id - Order ID.
2539
+ * @public
2540
+ * @requiredField _id
2541
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2542
+ * @applicableIdentity APP
2543
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
2544
+ */
2545
+ declare function resumeOrder(_id: string): Promise<void>;
2487
2546
  /**
2488
2547
  * Retrieves an order for the currently logged-in member by ID.
2489
2548
  * @param _id - Order ID.