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