@wix/auto_sdk_pricing-plans_orders 1.0.90 → 1.0.92

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 (37) hide show
  1. package/build/cjs/index.d.ts +153 -153
  2. package/build/cjs/index.js +642 -642
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +629 -612
  5. package/build/cjs/index.typings.js +507 -507
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +481 -464
  8. package/build/cjs/meta.js +403 -403
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +153 -153
  11. package/build/es/index.mjs +642 -642
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +629 -612
  14. package/build/es/index.typings.mjs +507 -507
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +481 -464
  17. package/build/es/meta.mjs +403 -403
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +153 -153
  20. package/build/internal/cjs/index.js +642 -642
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +629 -612
  23. package/build/internal/cjs/index.typings.js +507 -507
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +481 -464
  26. package/build/internal/cjs/meta.js +403 -403
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +153 -153
  29. package/build/internal/es/index.mjs +642 -642
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +629 -612
  32. package/build/internal/es/index.typings.mjs +507 -507
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +481 -464
  35. package/build/internal/es/meta.mjs +403 -403
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -626,7 +626,35 @@ interface ActionEvent {
626
626
  }
627
627
  interface Empty {
628
628
  }
629
- interface MemberGetOrderRequest {
629
+ interface OrderPurchased {
630
+ /** Order that was paid for. If a free or an offline order, the order that was created. */
631
+ order?: Order;
632
+ }
633
+ interface OrderStarted {
634
+ /** Order that reached its `startDate`. */
635
+ order?: Order;
636
+ }
637
+ /**
638
+ * Triggered at the start of a new payment cycle for an existing order.
639
+ *
640
+ * This webhook does not trigger at the initial start of an offline order.
641
+ */
642
+ interface OrderCycleStarted {
643
+ /** Order whose new cycle started. */
644
+ order?: Order;
645
+ /** 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. */
646
+ cycleNumber?: number;
647
+ }
648
+ /** Emitted when a recurring order is canceled for the next payment cycle */
649
+ interface OrderAutoRenewCanceled {
650
+ /** Order that is canceled, effective at the end of the current payment cycle. */
651
+ order?: Order;
652
+ }
653
+ interface OrderEnded {
654
+ /** Order that ended. */
655
+ order?: Order;
656
+ }
657
+ interface GetOrderRequest {
630
658
  /**
631
659
  * Order ID.
632
660
  * @format GUID
@@ -649,31 +677,44 @@ declare enum Set {
649
677
  }
650
678
  /** @enumType */
651
679
  type SetWithLiterals = Set | 'UNKNOWN_SET' | 'BASIC' | 'FULL';
652
- interface MemberGetOrderResponse {
653
- /** Requested order. */
680
+ interface GetOrderResponse {
681
+ /** Order. */
654
682
  order?: Order;
655
683
  }
656
- interface MemberListOrdersRequest {
684
+ interface ListOrdersRequest {
657
685
  /**
658
- * Filter by plan IDs.
686
+ * Filter by a buyer's member ID, from the Members API.
687
+ * @format GUID
688
+ */
689
+ buyerIds?: string[];
690
+ /**
691
+ * Filter by plan IDs, from the Plans API.
659
692
  * @format GUID
660
693
  */
661
694
  planIds?: string[];
662
- /** Filter for orders where auto renewal was canceled. */
695
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
663
696
  autoRenewCanceled?: boolean | null;
664
697
  /** Filter by order status. */
665
698
  orderStatuses?: OrderStatusWithLiterals[];
666
699
  /** Filter by payment status. */
667
700
  paymentStatuses?: PaymentStatusWithLiterals[];
668
701
  /**
669
- * Limit the number of pricing plans returned. Default limit is 50.
702
+ * Number of orders to return. See Sorting and Paging for more information.
703
+ *
704
+ * Max: `50`
670
705
  * @min 1
671
706
  * @max 50
672
707
  */
673
708
  limit?: number | null;
674
- /** Number of entries to offset. */
709
+ /** Number of orders to skip in the current sort order. */
675
710
  offset?: number | null;
676
- /** Sorting direction (defaults to ASC) and field to sort by. */
711
+ /**
712
+ * Sort order.
713
+ *
714
+ * Use `ASC` for ascending order or `DESC` for descending order.
715
+ *
716
+ * Default: `DESC`.
717
+ */
677
718
  sorting?: Sorting;
678
719
  /**
679
720
  * Predefined set of fields to return.
@@ -697,8 +738,8 @@ declare enum SortOrder {
697
738
  }
698
739
  /** @enumType */
699
740
  type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
700
- interface MemberListOrdersResponse {
701
- /** Requested orders. */
741
+ interface ListOrdersResponse {
742
+ /** List of orders. */
702
743
  orders?: Order[];
703
744
  /** Object containing paging-related data (number of orders returned, offset). */
704
745
  pagingMetadata?: PagingMetadataV2;
@@ -727,11 +768,7 @@ interface Cursors {
727
768
  */
728
769
  prev?: string | null;
729
770
  }
730
- /**
731
- * TODO: Write orders filter and sort docs page
732
- * Retrieves a list of up to 1,000 orders, based on the provided paging, sorting, and filtering.
733
- */
734
- interface QueryOrdersRequest {
771
+ interface OrdersQueryOrdersRequest {
735
772
  /** Query filter. */
736
773
  query?: QueryV2;
737
774
  }
@@ -785,22 +822,84 @@ interface CursorPaging {
785
822
  */
786
823
  cursor?: string | null;
787
824
  }
788
- interface QueryOrdersResponse {
789
- /** Order data. */
825
+ interface OrdersQueryOrdersResponse {
826
+ /** Retrieved orders. */
790
827
  plans?: Order[];
791
828
  /** Paging-related data (number of orders returned, offset). */
792
829
  pagingMetadata?: PagingMetadataV2;
793
830
  }
794
- interface RequestCancellationRequest {
831
+ interface GetOrdersStatsRequest {
832
+ }
833
+ interface GetOrdersStatsResponse {
834
+ /** Total number of orders. */
835
+ totalOrderCount?: number;
836
+ /** Number of active orders. */
837
+ activeOrderCount?: number;
838
+ }
839
+ interface GetAvailableOrderActionsRequest {
840
+ /**
841
+ * Order ID.
842
+ * @format GUID
843
+ */
844
+ _id?: string;
845
+ }
846
+ interface GetAvailableOrderActionsResponse {
847
+ /** Whether the order can be suspended. */
848
+ suspendable?: boolean;
849
+ /** If the order cannot be suspended, a reason is returned here. */
850
+ notSuspendableReason?: ReasonNotSuspendableWithLiterals;
851
+ /** Whether the order can be canceled by the buyer. */
852
+ cancelableByBuyer?: boolean;
853
+ }
854
+ declare enum ReasonNotSuspendable {
855
+ /** Undefined reason. */
856
+ UNDEFINED = "UNDEFINED",
857
+ /** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
858
+ PENDING = "PENDING",
859
+ /** Trial orders can't be suspended. */
860
+ TRIAL = "TRIAL",
861
+ /** Canceled orders can't be suspended. */
862
+ CANCELED = "CANCELED",
863
+ /** Ended orders can't be suspended. */
864
+ ENDED = "ENDED",
865
+ /** Paid for orders with future start dates can't be suspended. */
866
+ NOT_STARTED = "NOT_STARTED",
867
+ /** Order is already suspended. */
868
+ ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
869
+ /** Orders based on recurring payments using older stripe versions can't be suspended. */
870
+ OLD_STRIPE = "OLD_STRIPE"
871
+ }
872
+ /** @enumType */
873
+ type ReasonNotSuspendableWithLiterals = ReasonNotSuspendable | 'UNDEFINED' | 'PENDING' | 'TRIAL' | 'CANCELED' | 'ENDED' | 'NOT_STARTED' | 'ALREADY_SUSPENDED' | 'OLD_STRIPE';
874
+ interface PostponeEndDateRequest {
795
875
  /**
796
876
  * Order ID.
797
877
  * @format GUID
798
878
  */
799
879
  _id: string;
800
- /** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
880
+ /**
881
+ * New end date and time.
882
+ *
883
+ * Must be later than the current end date and time.
884
+ */
885
+ endDate: Date | null;
886
+ }
887
+ interface PostponeEndDateResponse {
888
+ }
889
+ interface OrderEndDatePostponed {
890
+ /** Order whose `endDate` was postponed. */
891
+ order?: Order;
892
+ }
893
+ interface CancelOrderRequest {
894
+ /**
895
+ * Order ID.
896
+ * @format GUID
897
+ */
898
+ _id: string;
899
+ /** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
801
900
  effectiveAt: CancellationEffectiveAtWithLiterals;
802
901
  }
803
- interface RequestCancellationResponse {
902
+ interface CancelOrderResponse {
804
903
  }
805
904
  /**
806
905
  * Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
@@ -811,6 +910,111 @@ interface OrderCanceled {
811
910
  /** Canceled order. */
812
911
  order?: Order;
813
912
  }
913
+ interface MarkAsPaidRequest {
914
+ /**
915
+ * Order ID.
916
+ * @format GUID
917
+ */
918
+ _id: string;
919
+ }
920
+ interface MarkAsPaidResponse {
921
+ }
922
+ interface OrderMarkedAsPaid {
923
+ /** Order that was marked as paid. */
924
+ order?: Order;
925
+ }
926
+ interface PauseOrderRequest {
927
+ /**
928
+ * Order ID.
929
+ * @format GUID
930
+ */
931
+ _id: string;
932
+ }
933
+ interface PauseOrderResponse {
934
+ }
935
+ interface OrderPaused {
936
+ /** Paused order. */
937
+ order?: Order;
938
+ }
939
+ interface BulkPauseOrderRequest {
940
+ /**
941
+ * List of Order IDs.
942
+ * @format GUID
943
+ * @minSize 1
944
+ * @maxSize 100
945
+ */
946
+ ids?: string[];
947
+ /** Set to true to return Order entity in response. */
948
+ returnFullEntity?: boolean;
949
+ }
950
+ interface BulkPauseOrderResponse {
951
+ /** Orders that were paused. */
952
+ results?: BulkOrderResult[];
953
+ /** Bulk action metadata. */
954
+ bulkActionMetadata?: BulkActionMetadata;
955
+ }
956
+ interface BulkOrderResult {
957
+ /** Item metadata */
958
+ itemMetadata?: ItemMetadata;
959
+ /** The order. */
960
+ order?: Order;
961
+ }
962
+ interface ItemMetadata {
963
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
964
+ _id?: string | null;
965
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
966
+ originalIndex?: number;
967
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
968
+ success?: boolean;
969
+ /** Details about the error in case of failure. */
970
+ error?: ApplicationError;
971
+ }
972
+ interface ApplicationError {
973
+ /** Error code. */
974
+ code?: string;
975
+ /** Description of the error. */
976
+ description?: string;
977
+ /** Data related to the error. */
978
+ data?: Record<string, any> | null;
979
+ }
980
+ interface BulkActionMetadata {
981
+ /** Number of items that were successfully processed. */
982
+ totalSuccesses?: number;
983
+ /** Number of items that couldn't be processed. */
984
+ totalFailures?: number;
985
+ /** Number of failures without details because detailed failure threshold was exceeded. */
986
+ undetailedFailures?: number;
987
+ }
988
+ interface ResumeOrderRequest {
989
+ /**
990
+ * Order ID.
991
+ * @format GUID
992
+ */
993
+ _id: string;
994
+ }
995
+ interface ResumeOrderResponse {
996
+ }
997
+ interface OrderResumed {
998
+ /** Resumed order. */
999
+ order?: Order;
1000
+ }
1001
+ interface BulkResumeOrderRequest {
1002
+ /**
1003
+ * List of Order IDs.
1004
+ * @format GUID
1005
+ * @minSize 1
1006
+ * @maxSize 100
1007
+ */
1008
+ ids?: string[];
1009
+ /** Set to true to return Order entity in response. */
1010
+ returnFullEntity?: boolean;
1011
+ }
1012
+ interface BulkResumeOrderResponse {
1013
+ /** Orders that were resumed. */
1014
+ results?: BulkOrderResult[];
1015
+ /** Bulk action metadata. */
1016
+ bulkActionMetadata?: BulkActionMetadata;
1017
+ }
814
1018
  interface MessageEnvelope {
815
1019
  /**
816
1020
  * App instance ID.
@@ -883,21 +1087,115 @@ declare enum WebhookIdentityType {
883
1087
  }
884
1088
  /** @enumType */
885
1089
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
886
- interface CreateOnlineOrderRequest {
1090
+ interface AccountDetails {
887
1091
  /**
888
- * Plan ID.
1092
+ * ID of the account.
889
1093
  * @format GUID
890
1094
  */
891
- planId: string;
1095
+ accountId?: string | null;
892
1096
  /**
893
- * Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
894
- *
895
- * Default: Current date and time.
1097
+ * ID of the parent account.
1098
+ * @format GUID
896
1099
  */
897
- startDate?: Date | null;
1100
+ parentAccountId?: string | null;
898
1101
  /**
899
- * Coupon code to apply.
900
- * @minLength 1
1102
+ * ID of the site, if applicable.
1103
+ * @format GUID
1104
+ */
1105
+ siteId?: string | null;
1106
+ }
1107
+ interface MemberGetOrderRequest {
1108
+ /**
1109
+ * Order ID.
1110
+ * @format GUID
1111
+ */
1112
+ _id: string;
1113
+ /**
1114
+ * Predefined set of fields to return.
1115
+ *
1116
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1117
+ */
1118
+ fieldSet?: SetWithLiterals;
1119
+ }
1120
+ interface MemberGetOrderResponse {
1121
+ /** Requested order. */
1122
+ order?: Order;
1123
+ }
1124
+ interface MemberListOrdersRequest {
1125
+ /**
1126
+ * Filter by plan IDs.
1127
+ * @format GUID
1128
+ */
1129
+ planIds?: string[];
1130
+ /** Filter for orders where auto renewal was canceled. */
1131
+ autoRenewCanceled?: boolean | null;
1132
+ /** Filter by order status. */
1133
+ orderStatuses?: OrderStatusWithLiterals[];
1134
+ /** Filter by payment status. */
1135
+ paymentStatuses?: PaymentStatusWithLiterals[];
1136
+ /**
1137
+ * Limit the number of pricing plans returned. Default limit is 50.
1138
+ * @min 1
1139
+ * @max 50
1140
+ */
1141
+ limit?: number | null;
1142
+ /** Number of entries to offset. */
1143
+ offset?: number | null;
1144
+ /** Sorting direction (defaults to ASC) and field to sort by. */
1145
+ sorting?: Sorting;
1146
+ /**
1147
+ * Predefined set of fields to return.
1148
+ *
1149
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1150
+ */
1151
+ fieldSet?: SetWithLiterals;
1152
+ }
1153
+ interface MemberListOrdersResponse {
1154
+ /** Requested orders. */
1155
+ orders?: Order[];
1156
+ /** Object containing paging-related data (number of orders returned, offset). */
1157
+ pagingMetadata?: PagingMetadataV2;
1158
+ }
1159
+ /**
1160
+ * TODO: Write orders filter and sort docs page
1161
+ * Retrieves a list of up to 1,000 orders, based on the provided paging, sorting, and filtering.
1162
+ */
1163
+ interface QueryOrdersRequest {
1164
+ /** Query filter. */
1165
+ query?: QueryV2;
1166
+ }
1167
+ interface QueryOrdersResponse {
1168
+ /** Order data. */
1169
+ plans?: Order[];
1170
+ /** Paging-related data (number of orders returned, offset). */
1171
+ pagingMetadata?: PagingMetadataV2;
1172
+ }
1173
+ interface RequestCancellationRequest {
1174
+ /**
1175
+ * Order ID.
1176
+ * @format GUID
1177
+ */
1178
+ _id: string;
1179
+ /** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
1180
+ effectiveAt: CancellationEffectiveAtWithLiterals;
1181
+ }
1182
+ interface RequestCancellationResponse {
1183
+ }
1184
+ interface CreateOnlineOrderRequest {
1185
+ /**
1186
+ * Plan ID.
1187
+ * @format GUID
1188
+ */
1189
+ planId: string;
1190
+ /**
1191
+ * Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1192
+ *
1193
+ * Default: Current date and time.
1194
+ */
1195
+ startDate?: Date | null;
1196
+ /**
1197
+ * Coupon code to apply.
1198
+ * @minLength 1
901
1199
  * @maxLength 20
902
1200
  */
903
1201
  couponCode?: string | null;
@@ -1186,287 +1484,6 @@ interface SetSubmissionResponse {
1186
1484
  /** Order with submission id */
1187
1485
  order?: Order;
1188
1486
  }
1189
- interface OrderPurchased {
1190
- /** Order that was paid for. If a free or an offline order, the order that was created. */
1191
- order?: Order;
1192
- }
1193
- interface OrderStarted {
1194
- /** Order that reached its `startDate`. */
1195
- order?: Order;
1196
- }
1197
- /**
1198
- * Triggered at the start of a new payment cycle for an existing order.
1199
- *
1200
- * This webhook does not trigger at the initial start of an offline order.
1201
- */
1202
- interface OrderCycleStarted {
1203
- /** Order whose new cycle started. */
1204
- order?: Order;
1205
- /** 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. */
1206
- cycleNumber?: number;
1207
- }
1208
- /** Emitted when a recurring order is canceled for the next payment cycle */
1209
- interface OrderAutoRenewCanceled {
1210
- /** Order that is canceled, effective at the end of the current payment cycle. */
1211
- order?: Order;
1212
- }
1213
- interface OrderEnded {
1214
- /** Order that ended. */
1215
- order?: Order;
1216
- }
1217
- interface GetOrderRequest {
1218
- /**
1219
- * Order ID.
1220
- * @format GUID
1221
- */
1222
- _id: string;
1223
- /**
1224
- * Predefined set of fields to return.
1225
- *
1226
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
1227
- */
1228
- fieldSet?: SetWithLiterals;
1229
- }
1230
- interface GetOrderResponse {
1231
- /** Order. */
1232
- order?: Order;
1233
- }
1234
- interface ListOrdersRequest {
1235
- /**
1236
- * Filter by a buyer's member ID, from the Members API.
1237
- * @format GUID
1238
- */
1239
- buyerIds?: string[];
1240
- /**
1241
- * Filter by plan IDs, from the Plans API.
1242
- * @format GUID
1243
- */
1244
- planIds?: string[];
1245
- /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
1246
- autoRenewCanceled?: boolean | null;
1247
- /** Filter by order status. */
1248
- orderStatuses?: OrderStatusWithLiterals[];
1249
- /** Filter by payment status. */
1250
- paymentStatuses?: PaymentStatusWithLiterals[];
1251
- /**
1252
- * Number of orders to return. See Sorting and Paging for more information.
1253
- *
1254
- * Max: `50`
1255
- * @min 1
1256
- * @max 50
1257
- */
1258
- limit?: number | null;
1259
- /** Number of orders to skip in the current sort order. */
1260
- offset?: number | null;
1261
- /**
1262
- * Sort order.
1263
- *
1264
- * Use `ASC` for ascending order or `DESC` for descending order.
1265
- *
1266
- * Default: `DESC`.
1267
- */
1268
- sorting?: Sorting;
1269
- /**
1270
- * Predefined set of fields to return.
1271
- *
1272
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
1273
- */
1274
- fieldSet?: SetWithLiterals;
1275
- }
1276
- interface ListOrdersResponse {
1277
- /** List of orders. */
1278
- orders?: Order[];
1279
- /** Object containing paging-related data (number of orders returned, offset). */
1280
- pagingMetadata?: PagingMetadataV2;
1281
- }
1282
- interface OrdersQueryOrdersRequest {
1283
- /** Query filter. */
1284
- query?: QueryV2;
1285
- }
1286
- interface OrdersQueryOrdersResponse {
1287
- /** Retrieved orders. */
1288
- plans?: Order[];
1289
- /** Paging-related data (number of orders returned, offset). */
1290
- pagingMetadata?: PagingMetadataV2;
1291
- }
1292
- interface GetOrdersStatsRequest {
1293
- }
1294
- interface GetOrdersStatsResponse {
1295
- /** Total number of orders. */
1296
- totalOrderCount?: number;
1297
- /** Number of active orders. */
1298
- activeOrderCount?: number;
1299
- }
1300
- interface GetAvailableOrderActionsRequest {
1301
- /**
1302
- * Order ID.
1303
- * @format GUID
1304
- */
1305
- _id?: string;
1306
- }
1307
- interface GetAvailableOrderActionsResponse {
1308
- /** Whether the order can be suspended. */
1309
- suspendable?: boolean;
1310
- /** If the order cannot be suspended, a reason is returned here. */
1311
- notSuspendableReason?: ReasonNotSuspendableWithLiterals;
1312
- /** Whether the order can be canceled by the buyer. */
1313
- cancelableByBuyer?: boolean;
1314
- }
1315
- declare enum ReasonNotSuspendable {
1316
- /** Undefined reason. */
1317
- UNDEFINED = "UNDEFINED",
1318
- /** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
1319
- PENDING = "PENDING",
1320
- /** Trial orders can't be suspended. */
1321
- TRIAL = "TRIAL",
1322
- /** Canceled orders can't be suspended. */
1323
- CANCELED = "CANCELED",
1324
- /** Ended orders can't be suspended. */
1325
- ENDED = "ENDED",
1326
- /** Paid for orders with future start dates can't be suspended. */
1327
- NOT_STARTED = "NOT_STARTED",
1328
- /** Order is already suspended. */
1329
- ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
1330
- /** Orders based on recurring payments using older stripe versions can't be suspended. */
1331
- OLD_STRIPE = "OLD_STRIPE"
1332
- }
1333
- /** @enumType */
1334
- type ReasonNotSuspendableWithLiterals = ReasonNotSuspendable | 'UNDEFINED' | 'PENDING' | 'TRIAL' | 'CANCELED' | 'ENDED' | 'NOT_STARTED' | 'ALREADY_SUSPENDED' | 'OLD_STRIPE';
1335
- interface PostponeEndDateRequest {
1336
- /**
1337
- * Order ID.
1338
- * @format GUID
1339
- */
1340
- _id: string;
1341
- /**
1342
- * New end date and time.
1343
- *
1344
- * Must be later than the current end date and time.
1345
- */
1346
- endDate: Date | null;
1347
- }
1348
- interface PostponeEndDateResponse {
1349
- }
1350
- interface OrderEndDatePostponed {
1351
- /** Order whose `endDate` was postponed. */
1352
- order?: Order;
1353
- }
1354
- interface CancelOrderRequest {
1355
- /**
1356
- * Order ID.
1357
- * @format GUID
1358
- */
1359
- _id: string;
1360
- /** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
1361
- effectiveAt: CancellationEffectiveAtWithLiterals;
1362
- }
1363
- interface CancelOrderResponse {
1364
- }
1365
- interface MarkAsPaidRequest {
1366
- /**
1367
- * Order ID.
1368
- * @format GUID
1369
- */
1370
- _id: string;
1371
- }
1372
- interface MarkAsPaidResponse {
1373
- }
1374
- interface OrderMarkedAsPaid {
1375
- /** Order that was marked as paid. */
1376
- order?: Order;
1377
- }
1378
- interface PauseOrderRequest {
1379
- /**
1380
- * Order ID.
1381
- * @format GUID
1382
- */
1383
- _id: string;
1384
- }
1385
- interface PauseOrderResponse {
1386
- }
1387
- interface OrderPaused {
1388
- /** Paused order. */
1389
- order?: Order;
1390
- }
1391
- interface BulkPauseOrderRequest {
1392
- /**
1393
- * List of Order IDs.
1394
- * @format GUID
1395
- * @minSize 1
1396
- * @maxSize 100
1397
- */
1398
- ids?: string[];
1399
- /** Set to true to return Order entity in response. */
1400
- returnFullEntity?: boolean;
1401
- }
1402
- interface BulkPauseOrderResponse {
1403
- /** Orders that were paused. */
1404
- results?: BulkOrderResult[];
1405
- /** Bulk action metadata. */
1406
- bulkActionMetadata?: BulkActionMetadata;
1407
- }
1408
- interface BulkOrderResult {
1409
- /** Item metadata */
1410
- itemMetadata?: ItemMetadata;
1411
- /** The order. */
1412
- order?: Order;
1413
- }
1414
- interface ItemMetadata {
1415
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1416
- _id?: string | null;
1417
- /** Index of the item within the request array. Allows for correlation between request and response items. */
1418
- originalIndex?: number;
1419
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1420
- success?: boolean;
1421
- /** Details about the error in case of failure. */
1422
- error?: ApplicationError;
1423
- }
1424
- interface ApplicationError {
1425
- /** Error code. */
1426
- code?: string;
1427
- /** Description of the error. */
1428
- description?: string;
1429
- /** Data related to the error. */
1430
- data?: Record<string, any> | null;
1431
- }
1432
- interface BulkActionMetadata {
1433
- /** Number of items that were successfully processed. */
1434
- totalSuccesses?: number;
1435
- /** Number of items that couldn't be processed. */
1436
- totalFailures?: number;
1437
- /** Number of failures without details because detailed failure threshold was exceeded. */
1438
- undetailedFailures?: number;
1439
- }
1440
- interface ResumeOrderRequest {
1441
- /**
1442
- * Order ID.
1443
- * @format GUID
1444
- */
1445
- _id: string;
1446
- }
1447
- interface ResumeOrderResponse {
1448
- }
1449
- interface OrderResumed {
1450
- /** Resumed order. */
1451
- order?: Order;
1452
- }
1453
- interface BulkResumeOrderRequest {
1454
- /**
1455
- * List of Order IDs.
1456
- * @format GUID
1457
- * @minSize 1
1458
- * @maxSize 100
1459
- */
1460
- ids?: string[];
1461
- /** Set to true to return Order entity in response. */
1462
- returnFullEntity?: boolean;
1463
- }
1464
- interface BulkResumeOrderResponse {
1465
- /** Orders that were resumed. */
1466
- results?: BulkOrderResult[];
1467
- /** Bulk action metadata. */
1468
- bulkActionMetadata?: BulkActionMetadata;
1469
- }
1470
1487
  /** @docsIgnore */
1471
1488
  type CreateOnlineOrderApplicationErrors = {
1472
1489
  code?: 'MEMBER_REQUIRED';
@@ -1807,6 +1824,31 @@ interface EventMetadata extends BaseEventMetadata {
1807
1824
  */
1808
1825
  entityEventSequence?: string | null;
1809
1826
  }
1827
+ interface OrderAutoRenewCanceledEnvelope {
1828
+ data: OrderAutoRenewCanceled;
1829
+ metadata: EventMetadata;
1830
+ }
1831
+ /**
1832
+ * Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
1833
+ *
1834
+ * This webhook is *not* triggered in the following scenarios:
1835
+ * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
1836
+ * + 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.
1837
+ * @permissionScope Manage Orders
1838
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1839
+ * @permissionScope Read Orders
1840
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1841
+ * @permissionScope Manage plans and orders of Pricing Plans
1842
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
1843
+ * @permissionScope Manage Events
1844
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1845
+ * @permissionId PRICING_PLANS.READ_ORDERS
1846
+ * @webhook
1847
+ * @eventType wix.pricing_plans.v2.order_auto_renew_canceled
1848
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1849
+ * @slug auto_renew_canceled
1850
+ */
1851
+ declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
1810
1852
  interface OrderCanceledEnvelope {
1811
1853
  data: OrderCanceled;
1812
1854
  metadata: EventMetadata;
@@ -1828,16 +1870,18 @@ interface OrderCanceledEnvelope {
1828
1870
  * @permissionId PRICING_PLANS.READ_ORDERS
1829
1871
  * @webhook
1830
1872
  * @eventType wix.pricing_plans.v2.order_canceled
1831
- * @serviceIdentifier com.wixpress.membership.v2.orders.member.MemberOrdersService
1873
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1832
1874
  * @slug canceled
1833
1875
  */
1834
1876
  declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
1835
- interface OrderCreatedEnvelope {
1836
- entity: Order;
1877
+ interface OrderCycleStartedEnvelope {
1878
+ data: OrderCycleStarted;
1837
1879
  metadata: EventMetadata;
1838
1880
  }
1839
1881
  /**
1840
- * Triggered when an order is created.
1882
+ * Triggered at the start of a new payment cycle for an existing order.
1883
+ *
1884
+ * Not triggered at the initial start of an offline order.
1841
1885
  * @permissionScope Manage Orders
1842
1886
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1843
1887
  * @permissionScope Read Orders
@@ -1848,17 +1892,17 @@ interface OrderCreatedEnvelope {
1848
1892
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1849
1893
  * @permissionId PRICING_PLANS.READ_ORDERS
1850
1894
  * @webhook
1851
- * @eventType wix.pricing_plans.v2.order_created
1852
- * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1853
- * @slug created
1895
+ * @eventType wix.pricing_plans.v2.order_cycle_started
1896
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1897
+ * @slug cycle_started
1854
1898
  */
1855
- declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
1856
- interface OrderStartDateChangedEnvelope {
1857
- data: OrderStartDateChanged;
1899
+ declare function onOrderCycleStarted(handler: (event: OrderCycleStartedEnvelope) => void | Promise<void>): void;
1900
+ interface OrderEndDatePostponedEnvelope {
1901
+ data: OrderEndDatePostponed;
1858
1902
  metadata: EventMetadata;
1859
1903
  }
1860
1904
  /**
1861
- * Triggered when an order's `startDate` is changed.
1905
+ * Triggered when an order's `endDate` is postponed.
1862
1906
  * @permissionScope Manage Orders
1863
1907
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1864
1908
  * @permissionScope Read Orders
@@ -1869,25 +1913,21 @@ interface OrderStartDateChangedEnvelope {
1869
1913
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1870
1914
  * @permissionId PRICING_PLANS.READ_ORDERS
1871
1915
  * @webhook
1872
- * @eventType wix.pricing_plans.v2.order_start_date_changed
1873
- * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1874
- * @slug start_date_changed
1916
+ * @eventType wix.pricing_plans.v2.order_end_date_postponed
1917
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1918
+ * @slug end_date_postponed
1875
1919
  */
1876
- declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
1877
- interface OrderUpdatedEnvelope {
1878
- entity: Order;
1920
+ declare function onOrderEndDatePostponed(handler: (event: OrderEndDatePostponedEnvelope) => void | Promise<void>): void;
1921
+ interface OrderEndedEnvelope {
1922
+ data: OrderEnded;
1879
1923
  metadata: EventMetadata;
1880
1924
  }
1881
1925
  /**
1882
- * Triggered for any of the following update events:
1926
+ * Triggered when an order ends.
1883
1927
  *
1884
- * + Order is paid for. Order Purchased is also triggered.
1885
- * + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
1886
- * + New payment cycle of an order starts. Order Cycle Started is also triggered.
1887
- * + Offline order is marked as paid. Order Marked As Paid is also triggered.
1888
- * + End date of the order is postponed. Order End Date Postponed is also triggered
1889
- * + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
1890
- * + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
1928
+ * This webhook is triggered:
1929
+ * + When an order expires at the end of the current payment cycle.
1930
+ * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`.
1891
1931
  * @permissionScope Manage Orders
1892
1932
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1893
1933
  * @permissionScope Read Orders
@@ -1898,21 +1938,17 @@ interface OrderUpdatedEnvelope {
1898
1938
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1899
1939
  * @permissionId PRICING_PLANS.READ_ORDERS
1900
1940
  * @webhook
1901
- * @eventType wix.pricing_plans.v2.order_updated
1902
- * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1903
- * @slug updated
1941
+ * @eventType wix.pricing_plans.v2.order_ended
1942
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1943
+ * @slug ended
1904
1944
  */
1905
- declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
1906
- interface OrderAutoRenewCanceledEnvelope {
1907
- data: OrderAutoRenewCanceled;
1945
+ declare function onOrderEnded(handler: (event: OrderEndedEnvelope) => void | Promise<void>): void;
1946
+ interface OrderMarkedAsPaidEnvelope {
1947
+ data: OrderMarkedAsPaid;
1908
1948
  metadata: EventMetadata;
1909
1949
  }
1910
1950
  /**
1911
- * Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
1912
- *
1913
- * This webhook is *not* triggered in the following scenarios:
1914
- * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
1915
- * + 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.
1951
+ * Triggered when an offline order is marked as paid.
1916
1952
  * @permissionScope Manage Orders
1917
1953
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1918
1954
  * @permissionScope Read Orders
@@ -1923,19 +1959,17 @@ interface OrderAutoRenewCanceledEnvelope {
1923
1959
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1924
1960
  * @permissionId PRICING_PLANS.READ_ORDERS
1925
1961
  * @webhook
1926
- * @eventType wix.pricing_plans.v2.order_auto_renew_canceled
1962
+ * @eventType wix.pricing_plans.v2.order_marked_as_paid
1927
1963
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1928
- * @slug auto_renew_canceled
1964
+ * @slug marked_as_paid
1929
1965
  */
1930
- declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
1931
- interface OrderCycleStartedEnvelope {
1932
- data: OrderCycleStarted;
1966
+ declare function onOrderMarkedAsPaid(handler: (event: OrderMarkedAsPaidEnvelope) => void | Promise<void>): void;
1967
+ interface OrderPausedEnvelope {
1968
+ data: OrderPaused;
1933
1969
  metadata: EventMetadata;
1934
1970
  }
1935
1971
  /**
1936
- * Triggered at the start of a new payment cycle for an existing order.
1937
- *
1938
- * Not triggered at the initial start of an offline order.
1972
+ * Triggered when an order is paused.
1939
1973
  * @permissionScope Manage Orders
1940
1974
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1941
1975
  * @permissionScope Read Orders
@@ -1946,17 +1980,21 @@ interface OrderCycleStartedEnvelope {
1946
1980
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1947
1981
  * @permissionId PRICING_PLANS.READ_ORDERS
1948
1982
  * @webhook
1949
- * @eventType wix.pricing_plans.v2.order_cycle_started
1983
+ * @eventType wix.pricing_plans.v2.order_paused
1950
1984
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1951
- * @slug cycle_started
1985
+ * @slug paused
1952
1986
  */
1953
- declare function onOrderCycleStarted(handler: (event: OrderCycleStartedEnvelope) => void | Promise<void>): void;
1954
- interface OrderEndDatePostponedEnvelope {
1955
- data: OrderEndDatePostponed;
1987
+ declare function onOrderPaused(handler: (event: OrderPausedEnvelope) => void | Promise<void>): void;
1988
+ interface OrderPurchasedEnvelope {
1989
+ data: OrderPurchased;
1956
1990
  metadata: EventMetadata;
1957
1991
  }
1958
1992
  /**
1959
- * Triggered when an order's `endDate` is postponed.
1993
+ * Triggered for any of the following purchase events:
1994
+ * + Order is paid in full.
1995
+ * + At least 1 order cycle payment is paid for.
1996
+ * + Offline order is created, even if not yet marked as paid.
1997
+ * + Free order is created.
1960
1998
  * @permissionScope Manage Orders
1961
1999
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1962
2000
  * @permissionScope Read Orders
@@ -1967,21 +2005,17 @@ interface OrderEndDatePostponedEnvelope {
1967
2005
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1968
2006
  * @permissionId PRICING_PLANS.READ_ORDERS
1969
2007
  * @webhook
1970
- * @eventType wix.pricing_plans.v2.order_end_date_postponed
2008
+ * @eventType wix.pricing_plans.v2.order_purchased
1971
2009
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1972
- * @slug end_date_postponed
2010
+ * @slug purchased
1973
2011
  */
1974
- declare function onOrderEndDatePostponed(handler: (event: OrderEndDatePostponedEnvelope) => void | Promise<void>): void;
1975
- interface OrderEndedEnvelope {
1976
- data: OrderEnded;
2012
+ declare function onOrderPurchased(handler: (event: OrderPurchasedEnvelope) => void | Promise<void>): void;
2013
+ interface OrderResumedEnvelope {
2014
+ data: OrderResumed;
1977
2015
  metadata: EventMetadata;
1978
2016
  }
1979
2017
  /**
1980
- * Triggered when an order ends.
1981
- *
1982
- * This webhook is triggered:
1983
- * + When an order expires at the end of the current payment cycle.
1984
- * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`.
2018
+ * Triggered when a paused order is resumed.
1985
2019
  * @permissionScope Manage Orders
1986
2020
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1987
2021
  * @permissionScope Read Orders
@@ -1992,17 +2026,17 @@ interface OrderEndedEnvelope {
1992
2026
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1993
2027
  * @permissionId PRICING_PLANS.READ_ORDERS
1994
2028
  * @webhook
1995
- * @eventType wix.pricing_plans.v2.order_ended
2029
+ * @eventType wix.pricing_plans.v2.order_resumed
1996
2030
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1997
- * @slug ended
2031
+ * @slug resumed
1998
2032
  */
1999
- declare function onOrderEnded(handler: (event: OrderEndedEnvelope) => void | Promise<void>): void;
2000
- interface OrderMarkedAsPaidEnvelope {
2001
- data: OrderMarkedAsPaid;
2033
+ declare function onOrderResumed(handler: (event: OrderResumedEnvelope) => void | Promise<void>): void;
2034
+ interface OrderStartedEnvelope {
2035
+ data: OrderStarted;
2002
2036
  metadata: EventMetadata;
2003
2037
  }
2004
2038
  /**
2005
- * Triggered when an offline order is marked as paid.
2039
+ * Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
2006
2040
  * @permissionScope Manage Orders
2007
2041
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2008
2042
  * @permissionScope Read Orders
@@ -2013,17 +2047,25 @@ interface OrderMarkedAsPaidEnvelope {
2013
2047
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2014
2048
  * @permissionId PRICING_PLANS.READ_ORDERS
2015
2049
  * @webhook
2016
- * @eventType wix.pricing_plans.v2.order_marked_as_paid
2050
+ * @eventType wix.pricing_plans.v2.order_started
2017
2051
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2018
- * @slug marked_as_paid
2052
+ * @slug started
2019
2053
  */
2020
- declare function onOrderMarkedAsPaid(handler: (event: OrderMarkedAsPaidEnvelope) => void | Promise<void>): void;
2021
- interface OrderPausedEnvelope {
2022
- data: OrderPaused;
2054
+ declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
2055
+ interface OrderUpdatedEnvelope {
2056
+ entity: Order;
2023
2057
  metadata: EventMetadata;
2024
2058
  }
2025
2059
  /**
2026
- * Triggered when an order is paused.
2060
+ * Triggered for any of the following update events:
2061
+ *
2062
+ * + Order is paid for. Order Purchased is also triggered.
2063
+ * + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
2064
+ * + New payment cycle of an order starts. Order Cycle Started is also triggered.
2065
+ * + Offline order is marked as paid. Order Marked As Paid is also triggered.
2066
+ * + End date of the order is postponed. Order End Date Postponed is also triggered
2067
+ * + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
2068
+ * + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
2027
2069
  * @permissionScope Manage Orders
2028
2070
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2029
2071
  * @permissionScope Read Orders
@@ -2034,21 +2076,17 @@ interface OrderPausedEnvelope {
2034
2076
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2035
2077
  * @permissionId PRICING_PLANS.READ_ORDERS
2036
2078
  * @webhook
2037
- * @eventType wix.pricing_plans.v2.order_paused
2079
+ * @eventType wix.pricing_plans.v2.order_updated
2038
2080
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2039
- * @slug paused
2081
+ * @slug updated
2040
2082
  */
2041
- declare function onOrderPaused(handler: (event: OrderPausedEnvelope) => void | Promise<void>): void;
2042
- interface OrderPurchasedEnvelope {
2043
- data: OrderPurchased;
2083
+ declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
2084
+ interface OrderCreatedEnvelope {
2085
+ entity: Order;
2044
2086
  metadata: EventMetadata;
2045
2087
  }
2046
2088
  /**
2047
- * Triggered for any of the following purchase events:
2048
- * + Order is paid in full.
2049
- * + At least 1 order cycle payment is paid for.
2050
- * + Offline order is created, even if not yet marked as paid.
2051
- * + Free order is created.
2089
+ * Triggered when an order is created.
2052
2090
  * @permissionScope Manage Orders
2053
2091
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2054
2092
  * @permissionScope Read Orders
@@ -2059,53 +2097,206 @@ interface OrderPurchasedEnvelope {
2059
2097
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2060
2098
  * @permissionId PRICING_PLANS.READ_ORDERS
2061
2099
  * @webhook
2062
- * @eventType wix.pricing_plans.v2.order_purchased
2063
- * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2064
- * @slug purchased
2100
+ * @eventType wix.pricing_plans.v2.order_created
2101
+ * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
2102
+ * @slug created
2103
+ */
2104
+ declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
2105
+ interface OrderStartDateChangedEnvelope {
2106
+ data: OrderStartDateChanged;
2107
+ metadata: EventMetadata;
2108
+ }
2109
+ /**
2110
+ * Triggered when an order's `startDate` is changed.
2111
+ * @permissionScope Manage Orders
2112
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2113
+ * @permissionScope Read Orders
2114
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
2115
+ * @permissionScope Manage plans and orders of Pricing Plans
2116
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2117
+ * @permissionScope Manage Events
2118
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2119
+ * @permissionId PRICING_PLANS.READ_ORDERS
2120
+ * @webhook
2121
+ * @eventType wix.pricing_plans.v2.order_start_date_changed
2122
+ * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
2123
+ * @slug start_date_changed
2124
+ */
2125
+ declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
2126
+ /**
2127
+ * Retrieves an order by ID.
2128
+ * @param _id - Order ID.
2129
+ * @public
2130
+ * @requiredField _id
2131
+ * @param options - Options to use when getting an order.
2132
+ * @permissionId PRICING_PLANS.READ_ORDERS
2133
+ * @applicableIdentity APP
2134
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
2135
+ */
2136
+ 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>>;
2137
+ interface ManagementGetOrderOptions {
2138
+ /**
2139
+ * Predefined set of fields to return.
2140
+ *
2141
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
2142
+ */
2143
+ fieldSet?: SetWithLiterals;
2144
+ }
2145
+ /**
2146
+ * Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
2147
+ *
2148
+ * By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
2149
+ * `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
2150
+ * @public
2151
+ * @param options - Filtering, sorting, and pagination options.
2152
+ * @permissionId PRICING_PLANS.READ_ORDERS
2153
+ * @applicableIdentity APP
2154
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
2155
+ */
2156
+ 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>>;
2157
+ interface ManagementListOrdersOptions {
2158
+ /**
2159
+ * Filter by a buyer's member ID, from the Members API.
2160
+ * @format GUID
2161
+ */
2162
+ buyerIds?: string[];
2163
+ /**
2164
+ * Filter by plan IDs, from the Plans API.
2165
+ * @format GUID
2166
+ */
2167
+ planIds?: string[];
2168
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
2169
+ autoRenewCanceled?: boolean | null;
2170
+ /** Filter by order status. */
2171
+ orderStatuses?: OrderStatusWithLiterals[];
2172
+ /** Filter by payment status. */
2173
+ paymentStatuses?: PaymentStatusWithLiterals[];
2174
+ /**
2175
+ * Number of orders to return. See Sorting and Paging for more information.
2176
+ *
2177
+ * Max: `50`
2178
+ * @min 1
2179
+ * @max 50
2180
+ */
2181
+ limit?: number | null;
2182
+ /** Number of orders to skip in the current sort order. */
2183
+ offset?: number | null;
2184
+ /**
2185
+ * Sort order.
2186
+ *
2187
+ * Use `ASC` for ascending order or `DESC` for descending order.
2188
+ *
2189
+ * Default: `DESC`.
2190
+ */
2191
+ sorting?: Sorting;
2192
+ /**
2193
+ * Predefined set of fields to return.
2194
+ *
2195
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
2196
+ */
2197
+ fieldSet?: SetWithLiterals;
2198
+ }
2199
+ /**
2200
+ * 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.
2201
+ *
2202
+ * New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
2203
+ * Can't postpone an order with `status`: `PAUSED`.
2204
+ * @param _id - Order ID.
2205
+ * @param endDate - New end date and time.
2206
+ *
2207
+ * Must be later than the current end date and time.
2208
+ * @public
2209
+ * @requiredField _id
2210
+ * @requiredField endDate
2211
+ * @param options - Options for postponing the end date of an order.
2212
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2213
+ * @applicableIdentity APP
2214
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
2215
+ */
2216
+ declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
2217
+ /**
2218
+ * Cancels an existing order.
2219
+ *
2220
+ * For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
2221
+ * For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
2222
+ *
2223
+ * #### Canceling during the free trial period.
2224
+ *
2225
+ * When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
2226
+ * of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
2227
+ * of the free trial period.
2228
+ *
2229
+ * When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
2230
+ * `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
2231
+ * immediately, even during the free trial period and the buyer won't be billed. Canceling at the
2232
+ * `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
2233
+ * Then, the subscription ends and the buyer is not billed.
2234
+ * @param _id - Order ID.
2235
+ * @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
2236
+ * @public
2237
+ * @requiredField _id
2238
+ * @requiredField effectiveAt
2239
+ * @param options - Options for canceling orders.
2240
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2241
+ * @applicableIdentity APP
2242
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
2243
+ */
2244
+ declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
2245
+ /**
2246
+ * Marks an offline order as paid.
2247
+ * > __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.
2248
+ *
2249
+ * Marking an offline order as paid causes the following changes:
2250
+ * - The order's `lastPaymentStatus` changes to `"PAID"`.
2251
+ * - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
2252
+ *
2253
+ * An error occurs if you attempt to:
2254
+ * - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
2255
+ * - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
2256
+ * @param _id - Order ID.
2257
+ * @public
2258
+ * @requiredField _id
2259
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2260
+ * @applicableIdentity APP
2261
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
2065
2262
  */
2066
- declare function onOrderPurchased(handler: (event: OrderPurchasedEnvelope) => void | Promise<void>): void;
2067
- interface OrderResumedEnvelope {
2068
- data: OrderResumed;
2069
- metadata: EventMetadata;
2070
- }
2263
+ declare function markAsPaid(_id: string): Promise<void>;
2071
2264
  /**
2072
- * Triggered when a paused order is resumed.
2073
- * @permissionScope Manage Orders
2074
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2075
- * @permissionScope Read Orders
2076
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
2077
- * @permissionScope Manage plans and orders of Pricing Plans
2078
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2079
- * @permissionScope Manage Events
2080
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2081
- * @permissionId PRICING_PLANS.READ_ORDERS
2082
- * @webhook
2083
- * @eventType wix.pricing_plans.v2.order_resumed
2084
- * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2085
- * @slug resumed
2265
+ * Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
2266
+ *
2267
+ * Only orders with `status`: `ACTIVE` can be paused.
2268
+ * For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
2269
+ * Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
2270
+ * The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
2271
+ *
2272
+ * To resume a paused order, call Resume Order.
2273
+ * @param _id - Order ID.
2274
+ * @public
2275
+ * @requiredField _id
2276
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2277
+ * @applicableIdentity APP
2278
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
2086
2279
  */
2087
- declare function onOrderResumed(handler: (event: OrderResumedEnvelope) => void | Promise<void>): void;
2088
- interface OrderStartedEnvelope {
2089
- data: OrderStarted;
2090
- metadata: EventMetadata;
2091
- }
2280
+ declare function pauseOrder(_id: string): Promise<void>;
2092
2281
  /**
2093
- * Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
2094
- * @permissionScope Manage Orders
2095
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2096
- * @permissionScope Read Orders
2097
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
2098
- * @permissionScope Manage plans and orders of Pricing Plans
2099
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
2100
- * @permissionScope Manage Events
2101
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2102
- * @permissionId PRICING_PLANS.READ_ORDERS
2103
- * @webhook
2104
- * @eventType wix.pricing_plans.v2.order_started
2105
- * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
2106
- * @slug started
2282
+ * Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
2283
+ *
2284
+ * Resuming an order causes the following changes:
2285
+ * - The order status changes to `"ACTIVE"`.
2286
+ * - The `pausePeriods` array is updated.
2287
+ * - The `endDate` for the order is adjusted to include the pause period.
2288
+ * - For orders with recurring payments, the payment schedule is restarted.
2289
+ * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
2290
+ *
2291
+ * To pause an order, call Pause Order.
2292
+ * @param _id - Order ID.
2293
+ * @public
2294
+ * @requiredField _id
2295
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2296
+ * @applicableIdentity APP
2297
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
2107
2298
  */
2108
- declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
2299
+ declare function resumeOrder(_id: string): Promise<void>;
2109
2300
  /**
2110
2301
  * Retrieves an order for the currently logged-in member by ID.
2111
2302
  * @param _id - Order ID.
@@ -2115,9 +2306,10 @@ declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void |
2115
2306
  * @permissionId PRICING_PLANS.READ_OWN_ORDERS
2116
2307
  * @applicableIdentity APP
2117
2308
  * @applicableIdentity MEMBER
2309
+ * @returns Requested order.
2118
2310
  * @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.GetOrder
2119
2311
  */
2120
- declare function memberGetOrder(_id: string, options?: MemberGetOrderOptions): Promise<NonNullablePaths<MemberGetOrderResponse, `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>>;
2312
+ declare function memberGetOrder(_id: string, options?: MemberGetOrderOptions): Promise<NonNullablePaths<Order, `_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.prices` | `pricing.prices.${number}.duration.cycleFrom` | `pricing.prices.${number}.price.subtotal` | `pricing.prices.${number}.price.discount` | `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`, 6>>;
2121
2313
  interface MemberGetOrderOptions {
2122
2314
  /**
2123
2315
  * Predefined set of fields to return.
@@ -2380,180 +2572,5 @@ interface GetPricePreviewOptions {
2380
2572
  */
2381
2573
  couponCode?: string | null;
2382
2574
  }
2383
- /**
2384
- * Retrieves an order by ID.
2385
- * @param _id - Order ID.
2386
- * @public
2387
- * @requiredField _id
2388
- * @param options - Options to use when getting an order.
2389
- * @permissionId PRICING_PLANS.READ_ORDERS
2390
- * @applicableIdentity APP
2391
- * @returns Order.
2392
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
2393
- */
2394
- declare function managementGetOrder(_id: string, options?: ManagementGetOrderOptions): Promise<NonNullablePaths<Order, `_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.prices` | `pricing.prices.${number}.duration.cycleFrom` | `pricing.prices.${number}.price.subtotal` | `pricing.prices.${number}.price.discount` | `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`, 6>>;
2395
- interface ManagementGetOrderOptions {
2396
- /**
2397
- * Predefined set of fields to return.
2398
- *
2399
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
2400
- */
2401
- fieldSet?: SetWithLiterals;
2402
- }
2403
- /**
2404
- * Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
2405
- *
2406
- * By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
2407
- * `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
2408
- * @public
2409
- * @param options - Filtering, sorting, and pagination options.
2410
- * @permissionId PRICING_PLANS.READ_ORDERS
2411
- * @applicableIdentity APP
2412
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
2413
- */
2414
- 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>>;
2415
- interface ManagementListOrdersOptions {
2416
- /**
2417
- * Filter by a buyer's member ID, from the Members API.
2418
- * @format GUID
2419
- */
2420
- buyerIds?: string[];
2421
- /**
2422
- * Filter by plan IDs, from the Plans API.
2423
- * @format GUID
2424
- */
2425
- planIds?: string[];
2426
- /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
2427
- autoRenewCanceled?: boolean | null;
2428
- /** Filter by order status. */
2429
- orderStatuses?: OrderStatusWithLiterals[];
2430
- /** Filter by payment status. */
2431
- paymentStatuses?: PaymentStatusWithLiterals[];
2432
- /**
2433
- * Number of orders to return. See Sorting and Paging for more information.
2434
- *
2435
- * Max: `50`
2436
- * @min 1
2437
- * @max 50
2438
- */
2439
- limit?: number | null;
2440
- /** Number of orders to skip in the current sort order. */
2441
- offset?: number | null;
2442
- /**
2443
- * Sort order.
2444
- *
2445
- * Use `ASC` for ascending order or `DESC` for descending order.
2446
- *
2447
- * Default: `DESC`.
2448
- */
2449
- sorting?: Sorting;
2450
- /**
2451
- * Predefined set of fields to return.
2452
- *
2453
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
2454
- */
2455
- fieldSet?: SetWithLiterals;
2456
- }
2457
- /**
2458
- * 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.
2459
- *
2460
- * New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
2461
- * Can't postpone an order with `status`: `PAUSED`.
2462
- * @param _id - Order ID.
2463
- * @param endDate - New end date and time.
2464
- *
2465
- * Must be later than the current end date and time.
2466
- * @public
2467
- * @requiredField _id
2468
- * @requiredField endDate
2469
- * @param options - Options for postponing the end date of an order.
2470
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2471
- * @applicableIdentity APP
2472
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
2473
- */
2474
- declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
2475
- /**
2476
- * Cancels an existing order.
2477
- *
2478
- * For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
2479
- * For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
2480
- *
2481
- * #### Canceling during the free trial period.
2482
- *
2483
- * When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
2484
- * of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
2485
- * of the free trial period.
2486
- *
2487
- * When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
2488
- * `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
2489
- * immediately, even during the free trial period and the buyer won't be billed. Canceling at the
2490
- * `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
2491
- * Then, the subscription ends and the buyer is not billed.
2492
- * @param _id - Order ID.
2493
- * @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
2494
- * @public
2495
- * @requiredField _id
2496
- * @requiredField effectiveAt
2497
- * @param options - Options for canceling orders.
2498
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2499
- * @applicableIdentity APP
2500
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
2501
- */
2502
- declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
2503
- /**
2504
- * Marks an offline order as paid.
2505
- * > __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.
2506
- *
2507
- * Marking an offline order as paid causes the following changes:
2508
- * - The order's `lastPaymentStatus` changes to `"PAID"`.
2509
- * - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
2510
- *
2511
- * An error occurs if you attempt to:
2512
- * - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
2513
- * - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
2514
- * @param _id - Order ID.
2515
- * @public
2516
- * @requiredField _id
2517
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2518
- * @applicableIdentity APP
2519
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
2520
- */
2521
- declare function markAsPaid(_id: string): Promise<void>;
2522
- /**
2523
- * Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
2524
- *
2525
- * Only orders with `status`: `ACTIVE` can be paused.
2526
- * For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
2527
- * Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
2528
- * The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
2529
- *
2530
- * To resume a paused order, call Resume Order.
2531
- * @param _id - Order ID.
2532
- * @public
2533
- * @requiredField _id
2534
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2535
- * @applicableIdentity APP
2536
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
2537
- */
2538
- declare function pauseOrder(_id: string): Promise<void>;
2539
- /**
2540
- * Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
2541
- *
2542
- * Resuming an order causes the following changes:
2543
- * - The order status changes to `"ACTIVE"`.
2544
- * - The `pausePeriods` array is updated.
2545
- * - The `endDate` for the order is adjusted to include the pause period.
2546
- * - For orders with recurring payments, the payment schedule is restarted.
2547
- * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
2548
- *
2549
- * To pause an order, call Pause Order.
2550
- * @param _id - Order ID.
2551
- * @public
2552
- * @requiredField _id
2553
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2554
- * @applicableIdentity APP
2555
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
2556
- */
2557
- declare function resumeOrder(_id: string): Promise<void>;
2558
2575
 
2559
- 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 };
2576
+ export { type AccountDetails, 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 };