@wix/auto_sdk_pricing-plans_orders 1.0.115 → 1.0.117
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.
- package/build/cjs/index.d.ts +155 -155
- package/build/cjs/index.js +452 -452
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +524 -498
- package/build/cjs/index.typings.js +323 -323
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +268 -268
- package/build/cjs/meta.js +334 -334
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +30 -30
- package/build/cjs/schemas.js +59 -59
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +155 -155
- package/build/es/index.mjs +452 -452
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +524 -498
- package/build/es/index.typings.mjs +323 -323
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +268 -268
- package/build/es/meta.mjs +334 -334
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +30 -30
- package/build/es/schemas.mjs +59 -59
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +155 -155
- package/build/internal/cjs/index.js +452 -452
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +524 -498
- package/build/internal/cjs/index.typings.js +323 -323
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +268 -268
- package/build/internal/cjs/meta.js +334 -334
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +30 -30
- package/build/internal/cjs/schemas.js +59 -59
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +155 -155
- package/build/internal/es/index.mjs +452 -452
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +524 -498
- package/build/internal/es/index.typings.mjs +323 -323
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +268 -268
- package/build/internal/es/meta.mjs +334 -334
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +30 -30
- package/build/internal/es/schemas.mjs +59 -59
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -626,35 +626,7 @@ interface ActionEvent {
|
|
|
626
626
|
}
|
|
627
627
|
interface Empty {
|
|
628
628
|
}
|
|
629
|
-
interface
|
|
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 {
|
|
629
|
+
interface MemberGetOrderRequest {
|
|
658
630
|
/**
|
|
659
631
|
* Order ID.
|
|
660
632
|
* @format GUID
|
|
@@ -677,44 +649,31 @@ declare enum Set {
|
|
|
677
649
|
}
|
|
678
650
|
/** @enumType */
|
|
679
651
|
type SetWithLiterals = Set | 'UNKNOWN_SET' | 'BASIC' | 'FULL';
|
|
680
|
-
interface
|
|
681
|
-
/**
|
|
652
|
+
interface MemberGetOrderResponse {
|
|
653
|
+
/** Requested order. */
|
|
682
654
|
order?: Order;
|
|
683
655
|
}
|
|
684
|
-
interface
|
|
685
|
-
/**
|
|
686
|
-
* Filter by a buyer's member ID, from the Members API.
|
|
687
|
-
* @format GUID
|
|
688
|
-
*/
|
|
689
|
-
buyerIds?: string[];
|
|
656
|
+
interface MemberListOrdersRequest {
|
|
690
657
|
/**
|
|
691
|
-
* Filter by plan IDs
|
|
658
|
+
* Filter by plan IDs.
|
|
692
659
|
* @format GUID
|
|
693
660
|
*/
|
|
694
661
|
planIds?: string[];
|
|
695
|
-
/** Filter
|
|
662
|
+
/** Filter for orders where auto renewal was canceled. */
|
|
696
663
|
autoRenewCanceled?: boolean | null;
|
|
697
664
|
/** Filter by order status. */
|
|
698
665
|
orderStatuses?: OrderStatusWithLiterals[];
|
|
699
666
|
/** Filter by payment status. */
|
|
700
667
|
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
701
668
|
/**
|
|
702
|
-
*
|
|
703
|
-
*
|
|
704
|
-
* Max: `50`
|
|
669
|
+
* Limit the number of pricing plans returned. Default limit is 50.
|
|
705
670
|
* @min 1
|
|
706
671
|
* @max 50
|
|
707
672
|
*/
|
|
708
673
|
limit?: number | null;
|
|
709
|
-
/** Number of
|
|
674
|
+
/** Number of entries to offset. */
|
|
710
675
|
offset?: number | null;
|
|
711
|
-
/**
|
|
712
|
-
* Sort order.
|
|
713
|
-
*
|
|
714
|
-
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
715
|
-
*
|
|
716
|
-
* Default: `DESC`.
|
|
717
|
-
*/
|
|
676
|
+
/** Sorting direction (defaults to ASC) and field to sort by. */
|
|
718
677
|
sorting?: Sorting;
|
|
719
678
|
/**
|
|
720
679
|
* Predefined set of fields to return.
|
|
@@ -738,8 +697,8 @@ declare enum SortOrder {
|
|
|
738
697
|
}
|
|
739
698
|
/** @enumType */
|
|
740
699
|
type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
|
|
741
|
-
interface
|
|
742
|
-
/**
|
|
700
|
+
interface MemberListOrdersResponse {
|
|
701
|
+
/** Requested orders. */
|
|
743
702
|
orders?: Order[];
|
|
744
703
|
/** Object containing paging-related data (number of orders returned, offset). */
|
|
745
704
|
pagingMetadata?: PagingMetadataV2;
|
|
@@ -768,7 +727,11 @@ interface Cursors {
|
|
|
768
727
|
*/
|
|
769
728
|
prev?: string | null;
|
|
770
729
|
}
|
|
771
|
-
|
|
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 {
|
|
772
735
|
/** Query filter. */
|
|
773
736
|
query?: QueryV2;
|
|
774
737
|
}
|
|
@@ -822,84 +785,22 @@ interface CursorPaging {
|
|
|
822
785
|
*/
|
|
823
786
|
cursor?: string | null;
|
|
824
787
|
}
|
|
825
|
-
interface
|
|
826
|
-
/**
|
|
788
|
+
interface QueryOrdersResponse {
|
|
789
|
+
/** Order data. */
|
|
827
790
|
plans?: Order[];
|
|
828
791
|
/** Paging-related data (number of orders returned, offset). */
|
|
829
792
|
pagingMetadata?: PagingMetadataV2;
|
|
830
793
|
}
|
|
831
|
-
interface
|
|
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 {
|
|
875
|
-
/**
|
|
876
|
-
* Order ID.
|
|
877
|
-
* @format GUID
|
|
878
|
-
*/
|
|
879
|
-
_id: string;
|
|
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 {
|
|
794
|
+
interface RequestCancellationRequest {
|
|
894
795
|
/**
|
|
895
796
|
* Order ID.
|
|
896
797
|
* @format GUID
|
|
897
798
|
*/
|
|
898
799
|
_id: string;
|
|
899
|
-
/**
|
|
800
|
+
/** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
|
|
900
801
|
effectiveAt: CancellationEffectiveAtWithLiterals;
|
|
901
802
|
}
|
|
902
|
-
interface
|
|
803
|
+
interface RequestCancellationResponse {
|
|
903
804
|
}
|
|
904
805
|
/**
|
|
905
806
|
* Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
|
|
@@ -910,111 +811,6 @@ interface OrderCanceled {
|
|
|
910
811
|
/** Canceled order. */
|
|
911
812
|
order?: Order;
|
|
912
813
|
}
|
|
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
|
-
}
|
|
1018
814
|
interface MessageEnvelope {
|
|
1019
815
|
/**
|
|
1020
816
|
* App instance ID.
|
|
@@ -1409,44 +1205,85 @@ interface SetSubmissionResponse {
|
|
|
1409
1205
|
/** Order with submission id */
|
|
1410
1206
|
order?: Order;
|
|
1411
1207
|
}
|
|
1412
|
-
interface
|
|
1413
|
-
/**
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1208
|
+
interface OrderPurchased {
|
|
1209
|
+
/** Order that was paid for. If a free or an offline order, the order that was created. */
|
|
1210
|
+
order?: Order;
|
|
1211
|
+
}
|
|
1212
|
+
interface OrderStarted {
|
|
1213
|
+
/** Order that reached its `startDate`. */
|
|
1214
|
+
order?: Order;
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Triggered at the start of a new payment cycle for an existing order.
|
|
1218
|
+
*
|
|
1219
|
+
* This webhook does not trigger at the initial start of an offline order.
|
|
1220
|
+
*/
|
|
1221
|
+
interface OrderCycleStarted {
|
|
1222
|
+
/** Order whose new cycle started. */
|
|
1223
|
+
order?: Order;
|
|
1224
|
+
/** 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. */
|
|
1225
|
+
cycleNumber?: number;
|
|
1226
|
+
}
|
|
1227
|
+
/** Emitted when a recurring order is canceled for the next payment cycle */
|
|
1228
|
+
interface OrderAutoRenewCanceled {
|
|
1229
|
+
/** Order that is canceled, effective at the end of the current payment cycle. */
|
|
1230
|
+
order?: Order;
|
|
1231
|
+
}
|
|
1232
|
+
interface OrderEnded {
|
|
1233
|
+
/** Order that ended. */
|
|
1234
|
+
order?: Order;
|
|
1235
|
+
}
|
|
1236
|
+
interface GetOrderRequest {
|
|
1237
|
+
/**
|
|
1238
|
+
* Order ID.
|
|
1239
|
+
* @format GUID
|
|
1240
|
+
*/
|
|
1241
|
+
_id: string;
|
|
1242
|
+
/**
|
|
1243
|
+
* Predefined set of fields to return.
|
|
1244
|
+
*
|
|
1245
|
+
* Default: If `fieldSet` is omitted, no order form submission data is returned.
|
|
1422
1246
|
*/
|
|
1423
1247
|
fieldSet?: SetWithLiterals;
|
|
1424
1248
|
}
|
|
1425
|
-
interface
|
|
1426
|
-
/**
|
|
1249
|
+
interface GetOrderResponse {
|
|
1250
|
+
/** Order. */
|
|
1427
1251
|
order?: Order;
|
|
1428
1252
|
}
|
|
1429
|
-
interface
|
|
1253
|
+
interface ListOrdersRequest {
|
|
1430
1254
|
/**
|
|
1431
|
-
* Filter by
|
|
1255
|
+
* Filter by a buyer's member ID, from the Members API.
|
|
1256
|
+
* @format GUID
|
|
1257
|
+
*/
|
|
1258
|
+
buyerIds?: string[];
|
|
1259
|
+
/**
|
|
1260
|
+
* Filter by plan IDs, from the Plans API.
|
|
1432
1261
|
* @format GUID
|
|
1433
1262
|
*/
|
|
1434
1263
|
planIds?: string[];
|
|
1435
|
-
/** Filter
|
|
1264
|
+
/** Filter by whether or not the auto-renewal of recurring orders was canceled. */
|
|
1436
1265
|
autoRenewCanceled?: boolean | null;
|
|
1437
1266
|
/** Filter by order status. */
|
|
1438
1267
|
orderStatuses?: OrderStatusWithLiterals[];
|
|
1439
1268
|
/** Filter by payment status. */
|
|
1440
1269
|
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
1441
1270
|
/**
|
|
1442
|
-
*
|
|
1271
|
+
* Number of orders to return. See Sorting and Paging for more information.
|
|
1272
|
+
*
|
|
1273
|
+
* Max: `50`
|
|
1443
1274
|
* @min 1
|
|
1444
1275
|
* @max 50
|
|
1445
1276
|
*/
|
|
1446
1277
|
limit?: number | null;
|
|
1447
|
-
/** Number of
|
|
1278
|
+
/** Number of orders to skip in the current sort order. */
|
|
1448
1279
|
offset?: number | null;
|
|
1449
|
-
/**
|
|
1280
|
+
/**
|
|
1281
|
+
* Sort order.
|
|
1282
|
+
*
|
|
1283
|
+
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
1284
|
+
*
|
|
1285
|
+
* Default: `DESC`.
|
|
1286
|
+
*/
|
|
1450
1287
|
sorting?: Sorting;
|
|
1451
1288
|
/**
|
|
1452
1289
|
* Predefined set of fields to return.
|
|
@@ -1455,36 +1292,199 @@ interface MemberListOrdersRequest {
|
|
|
1455
1292
|
*/
|
|
1456
1293
|
fieldSet?: SetWithLiterals;
|
|
1457
1294
|
}
|
|
1458
|
-
interface
|
|
1459
|
-
/**
|
|
1295
|
+
interface ListOrdersResponse {
|
|
1296
|
+
/** List of orders. */
|
|
1460
1297
|
orders?: Order[];
|
|
1461
1298
|
/** Object containing paging-related data (number of orders returned, offset). */
|
|
1462
1299
|
pagingMetadata?: PagingMetadataV2;
|
|
1463
1300
|
}
|
|
1464
|
-
|
|
1465
|
-
* TODO: Write orders filter and sort docs page
|
|
1466
|
-
* Retrieves a list of up to 1,000 orders, based on the provided paging, sorting, and filtering.
|
|
1467
|
-
*/
|
|
1468
|
-
interface QueryOrdersRequest {
|
|
1301
|
+
interface OrdersQueryOrdersRequest {
|
|
1469
1302
|
/** Query filter. */
|
|
1470
1303
|
query?: QueryV2;
|
|
1471
1304
|
}
|
|
1472
|
-
interface
|
|
1473
|
-
/**
|
|
1305
|
+
interface OrdersQueryOrdersResponse {
|
|
1306
|
+
/** Retrieved orders. */
|
|
1474
1307
|
plans?: Order[];
|
|
1475
1308
|
/** Paging-related data (number of orders returned, offset). */
|
|
1476
1309
|
pagingMetadata?: PagingMetadataV2;
|
|
1477
1310
|
}
|
|
1478
|
-
interface
|
|
1311
|
+
interface GetOrdersStatsRequest {
|
|
1312
|
+
}
|
|
1313
|
+
interface GetOrdersStatsResponse {
|
|
1314
|
+
/** Total number of orders. */
|
|
1315
|
+
totalOrderCount?: number;
|
|
1316
|
+
/** Number of active orders. */
|
|
1317
|
+
activeOrderCount?: number;
|
|
1318
|
+
}
|
|
1319
|
+
interface GetAvailableOrderActionsRequest {
|
|
1320
|
+
/**
|
|
1321
|
+
* Order ID.
|
|
1322
|
+
* @format GUID
|
|
1323
|
+
*/
|
|
1324
|
+
_id?: string;
|
|
1325
|
+
}
|
|
1326
|
+
interface GetAvailableOrderActionsResponse {
|
|
1327
|
+
/** Whether the order can be suspended. */
|
|
1328
|
+
suspendable?: boolean;
|
|
1329
|
+
/** If the order cannot be suspended, a reason is returned here. */
|
|
1330
|
+
notSuspendableReason?: ReasonNotSuspendableWithLiterals;
|
|
1331
|
+
/** Whether the order can be canceled by the buyer. */
|
|
1332
|
+
cancelableByBuyer?: boolean;
|
|
1333
|
+
}
|
|
1334
|
+
declare enum ReasonNotSuspendable {
|
|
1335
|
+
/** Undefined reason. */
|
|
1336
|
+
UNDEFINED = "UNDEFINED",
|
|
1337
|
+
/** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
|
|
1338
|
+
PENDING = "PENDING",
|
|
1339
|
+
/** Trial orders can't be suspended. */
|
|
1340
|
+
TRIAL = "TRIAL",
|
|
1341
|
+
/** Canceled orders can't be suspended. */
|
|
1342
|
+
CANCELED = "CANCELED",
|
|
1343
|
+
/** Ended orders can't be suspended. */
|
|
1344
|
+
ENDED = "ENDED",
|
|
1345
|
+
/** Paid for orders with future start dates can't be suspended. */
|
|
1346
|
+
NOT_STARTED = "NOT_STARTED",
|
|
1347
|
+
/** Order is already suspended. */
|
|
1348
|
+
ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
|
|
1349
|
+
/** Orders based on recurring payments using older stripe versions can't be suspended. */
|
|
1350
|
+
OLD_STRIPE = "OLD_STRIPE"
|
|
1351
|
+
}
|
|
1352
|
+
/** @enumType */
|
|
1353
|
+
type ReasonNotSuspendableWithLiterals = ReasonNotSuspendable | 'UNDEFINED' | 'PENDING' | 'TRIAL' | 'CANCELED' | 'ENDED' | 'NOT_STARTED' | 'ALREADY_SUSPENDED' | 'OLD_STRIPE';
|
|
1354
|
+
interface PostponeEndDateRequest {
|
|
1479
1355
|
/**
|
|
1480
1356
|
* Order ID.
|
|
1481
1357
|
* @format GUID
|
|
1482
1358
|
*/
|
|
1483
1359
|
_id: string;
|
|
1484
|
-
/**
|
|
1360
|
+
/**
|
|
1361
|
+
* New end date and time.
|
|
1362
|
+
*
|
|
1363
|
+
* Must be later than the current end date and time.
|
|
1364
|
+
*/
|
|
1365
|
+
endDate: Date | null;
|
|
1366
|
+
}
|
|
1367
|
+
interface PostponeEndDateResponse {
|
|
1368
|
+
}
|
|
1369
|
+
interface OrderEndDatePostponed {
|
|
1370
|
+
/** Order whose `endDate` was postponed. */
|
|
1371
|
+
order?: Order;
|
|
1372
|
+
}
|
|
1373
|
+
interface CancelOrderRequest {
|
|
1374
|
+
/**
|
|
1375
|
+
* Order ID.
|
|
1376
|
+
* @format GUID
|
|
1377
|
+
*/
|
|
1378
|
+
_id: string;
|
|
1379
|
+
/** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
|
|
1485
1380
|
effectiveAt: CancellationEffectiveAtWithLiterals;
|
|
1486
1381
|
}
|
|
1487
|
-
interface
|
|
1382
|
+
interface CancelOrderResponse {
|
|
1383
|
+
}
|
|
1384
|
+
interface MarkAsPaidRequest {
|
|
1385
|
+
/**
|
|
1386
|
+
* Order ID.
|
|
1387
|
+
* @format GUID
|
|
1388
|
+
*/
|
|
1389
|
+
_id: string;
|
|
1390
|
+
}
|
|
1391
|
+
interface MarkAsPaidResponse {
|
|
1392
|
+
}
|
|
1393
|
+
interface OrderMarkedAsPaid {
|
|
1394
|
+
/** Order that was marked as paid. */
|
|
1395
|
+
order?: Order;
|
|
1396
|
+
}
|
|
1397
|
+
interface PauseOrderRequest {
|
|
1398
|
+
/**
|
|
1399
|
+
* Order ID.
|
|
1400
|
+
* @format GUID
|
|
1401
|
+
*/
|
|
1402
|
+
_id: string;
|
|
1403
|
+
}
|
|
1404
|
+
interface PauseOrderResponse {
|
|
1405
|
+
}
|
|
1406
|
+
interface OrderPaused {
|
|
1407
|
+
/** Paused order. */
|
|
1408
|
+
order?: Order;
|
|
1409
|
+
}
|
|
1410
|
+
interface BulkPauseOrderRequest {
|
|
1411
|
+
/**
|
|
1412
|
+
* List of Order IDs.
|
|
1413
|
+
* @format GUID
|
|
1414
|
+
* @minSize 1
|
|
1415
|
+
* @maxSize 100
|
|
1416
|
+
*/
|
|
1417
|
+
ids?: string[];
|
|
1418
|
+
/** Set to true to return Order entity in response. */
|
|
1419
|
+
returnFullEntity?: boolean;
|
|
1420
|
+
}
|
|
1421
|
+
interface BulkPauseOrderResponse {
|
|
1422
|
+
/** Orders that were paused. */
|
|
1423
|
+
results?: BulkOrderResult[];
|
|
1424
|
+
/** Bulk action metadata. */
|
|
1425
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1426
|
+
}
|
|
1427
|
+
interface BulkOrderResult {
|
|
1428
|
+
/** Item metadata */
|
|
1429
|
+
itemMetadata?: ItemMetadata;
|
|
1430
|
+
/** The order. */
|
|
1431
|
+
order?: Order;
|
|
1432
|
+
}
|
|
1433
|
+
interface ItemMetadata {
|
|
1434
|
+
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
|
1435
|
+
_id?: string | null;
|
|
1436
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
1437
|
+
originalIndex?: number;
|
|
1438
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
1439
|
+
success?: boolean;
|
|
1440
|
+
/** Details about the error in case of failure. */
|
|
1441
|
+
error?: ApplicationError;
|
|
1442
|
+
}
|
|
1443
|
+
interface ApplicationError {
|
|
1444
|
+
/** Error code. */
|
|
1445
|
+
code?: string;
|
|
1446
|
+
/** Description of the error. */
|
|
1447
|
+
description?: string;
|
|
1448
|
+
/** Data related to the error. */
|
|
1449
|
+
data?: Record<string, any> | null;
|
|
1450
|
+
}
|
|
1451
|
+
interface BulkActionMetadata {
|
|
1452
|
+
/** Number of items that were successfully processed. */
|
|
1453
|
+
totalSuccesses?: number;
|
|
1454
|
+
/** Number of items that couldn't be processed. */
|
|
1455
|
+
totalFailures?: number;
|
|
1456
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
1457
|
+
undetailedFailures?: number;
|
|
1458
|
+
}
|
|
1459
|
+
interface ResumeOrderRequest {
|
|
1460
|
+
/**
|
|
1461
|
+
* Order ID.
|
|
1462
|
+
* @format GUID
|
|
1463
|
+
*/
|
|
1464
|
+
_id: string;
|
|
1465
|
+
}
|
|
1466
|
+
interface ResumeOrderResponse {
|
|
1467
|
+
}
|
|
1468
|
+
interface OrderResumed {
|
|
1469
|
+
/** Resumed order. */
|
|
1470
|
+
order?: Order;
|
|
1471
|
+
}
|
|
1472
|
+
interface BulkResumeOrderRequest {
|
|
1473
|
+
/**
|
|
1474
|
+
* List of Order IDs.
|
|
1475
|
+
* @format GUID
|
|
1476
|
+
* @minSize 1
|
|
1477
|
+
* @maxSize 100
|
|
1478
|
+
*/
|
|
1479
|
+
ids?: string[];
|
|
1480
|
+
/** Set to true to return Order entity in response. */
|
|
1481
|
+
returnFullEntity?: boolean;
|
|
1482
|
+
}
|
|
1483
|
+
interface BulkResumeOrderResponse {
|
|
1484
|
+
/** Orders that were resumed. */
|
|
1485
|
+
results?: BulkOrderResult[];
|
|
1486
|
+
/** Bulk action metadata. */
|
|
1487
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1488
1488
|
}
|
|
1489
1489
|
/** @docsIgnore */
|
|
1490
1490
|
type CreateOnlineOrderApplicationErrors = {
|
|
@@ -1837,16 +1837,18 @@ interface AccountInfoMetadata {
|
|
|
1837
1837
|
/** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */
|
|
1838
1838
|
parentAccountId?: string;
|
|
1839
1839
|
}
|
|
1840
|
-
interface
|
|
1841
|
-
data:
|
|
1840
|
+
interface OrderCanceledEnvelope {
|
|
1841
|
+
data: OrderCanceled;
|
|
1842
1842
|
metadata: EventMetadata;
|
|
1843
1843
|
}
|
|
1844
1844
|
/**
|
|
1845
|
-
* Triggered when an order is canceled
|
|
1845
|
+
* Triggered when an order is canceled.
|
|
1846
1846
|
*
|
|
1847
|
-
* This webhook is
|
|
1848
|
-
* +
|
|
1849
|
-
* +
|
|
1847
|
+
* This webhook is triggered either immediately or at the end of the current payment cycle, as follows:
|
|
1848
|
+
* + If the order is canceled and `effectiveAt` is set to `IMMEDIATELY`, the webhook is triggered immediately when canceled.
|
|
1849
|
+
* + If the order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`, the webhook is triggered at the end of the current payment cycle. In this case, the Order Auto Renew Canceled Webhook is triggered immediately.
|
|
1850
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1851
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1850
1852
|
* @permissionScope Manage Orders
|
|
1851
1853
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1852
1854
|
* @permissionScope Read Orders
|
|
@@ -1857,21 +1859,73 @@ interface OrderAutoRenewCanceledEnvelope {
|
|
|
1857
1859
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1858
1860
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1859
1861
|
* @webhook
|
|
1860
|
-
* @eventType wix.pricing_plans.v2.
|
|
1861
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.
|
|
1862
|
-
* @slug
|
|
1862
|
+
* @eventType wix.pricing_plans.v2.order_canceled
|
|
1863
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.member.MemberOrdersService
|
|
1864
|
+
* @slug canceled
|
|
1863
1865
|
*/
|
|
1864
|
-
declare function
|
|
1865
|
-
interface
|
|
1866
|
-
|
|
1866
|
+
declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
|
|
1867
|
+
interface OrderCreatedEnvelope {
|
|
1868
|
+
entity: Order;
|
|
1867
1869
|
metadata: EventMetadata;
|
|
1868
1870
|
}
|
|
1869
1871
|
/**
|
|
1870
|
-
* Triggered when an order is
|
|
1872
|
+
* Triggered when an order is created.
|
|
1873
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1874
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1875
|
+
* @permissionScope Manage Orders
|
|
1876
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1877
|
+
* @permissionScope Read Orders
|
|
1878
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
1879
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
1880
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
1881
|
+
* @permissionScope Manage Events
|
|
1882
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1883
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1884
|
+
* @webhook
|
|
1885
|
+
* @eventType wix.pricing_plans.v2.order_created
|
|
1886
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
1887
|
+
* @slug created
|
|
1888
|
+
*/
|
|
1889
|
+
declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
|
|
1890
|
+
interface OrderStartDateChangedEnvelope {
|
|
1891
|
+
data: OrderStartDateChanged;
|
|
1892
|
+
metadata: EventMetadata;
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* Triggered when an order's `startDate` is changed.
|
|
1896
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1897
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1898
|
+
* @permissionScope Manage Orders
|
|
1899
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1900
|
+
* @permissionScope Read Orders
|
|
1901
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
1902
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
1903
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
1904
|
+
* @permissionScope Manage Events
|
|
1905
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1906
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1907
|
+
* @webhook
|
|
1908
|
+
* @eventType wix.pricing_plans.v2.order_start_date_changed
|
|
1909
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
1910
|
+
* @slug start_date_changed
|
|
1911
|
+
*/
|
|
1912
|
+
declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
|
|
1913
|
+
interface OrderUpdatedEnvelope {
|
|
1914
|
+
entity: Order;
|
|
1915
|
+
metadata: EventMetadata;
|
|
1916
|
+
}
|
|
1917
|
+
/**
|
|
1918
|
+
* Triggered for any of the following update events:
|
|
1871
1919
|
*
|
|
1872
|
-
*
|
|
1873
|
-
* +
|
|
1874
|
-
* +
|
|
1920
|
+
* + Order is paid for. Order Purchased is also triggered.
|
|
1921
|
+
* + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
|
|
1922
|
+
* + New payment cycle of an order starts. Order Cycle Started is also triggered.
|
|
1923
|
+
* + Offline order is marked as paid. Order Marked As Paid is also triggered.
|
|
1924
|
+
* + End date of the order is postponed. Order End Date Postponed is also triggered
|
|
1925
|
+
* + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
|
|
1926
|
+
* + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
|
|
1927
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1928
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1875
1929
|
* @permissionScope Manage Orders
|
|
1876
1930
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1877
1931
|
* @permissionScope Read Orders
|
|
@@ -1882,11 +1936,38 @@ interface OrderCanceledEnvelope {
|
|
|
1882
1936
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1883
1937
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1884
1938
|
* @webhook
|
|
1885
|
-
* @eventType wix.pricing_plans.v2.
|
|
1939
|
+
* @eventType wix.pricing_plans.v2.order_updated
|
|
1940
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
1941
|
+
* @slug updated
|
|
1942
|
+
*/
|
|
1943
|
+
declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
|
|
1944
|
+
interface OrderAutoRenewCanceledEnvelope {
|
|
1945
|
+
data: OrderAutoRenewCanceled;
|
|
1946
|
+
metadata: EventMetadata;
|
|
1947
|
+
}
|
|
1948
|
+
/**
|
|
1949
|
+
* Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
|
|
1950
|
+
*
|
|
1951
|
+
* This webhook is *not* triggered in the following scenarios:
|
|
1952
|
+
* + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
|
|
1953
|
+
* + 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.
|
|
1954
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1955
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1956
|
+
* @permissionScope Manage Orders
|
|
1957
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1958
|
+
* @permissionScope Read Orders
|
|
1959
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
1960
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
1961
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
1962
|
+
* @permissionScope Manage Events
|
|
1963
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1964
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1965
|
+
* @webhook
|
|
1966
|
+
* @eventType wix.pricing_plans.v2.order_auto_renew_canceled
|
|
1886
1967
|
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
1887
|
-
* @slug
|
|
1968
|
+
* @slug auto_renew_canceled
|
|
1888
1969
|
*/
|
|
1889
|
-
declare function
|
|
1970
|
+
declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
|
|
1890
1971
|
interface OrderCycleStartedEnvelope {
|
|
1891
1972
|
data: OrderCycleStarted;
|
|
1892
1973
|
metadata: EventMetadata;
|
|
@@ -1895,6 +1976,8 @@ interface OrderCycleStartedEnvelope {
|
|
|
1895
1976
|
* Triggered at the start of a new payment cycle for an existing order.
|
|
1896
1977
|
*
|
|
1897
1978
|
* Not triggered at the initial start of an offline order.
|
|
1979
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1980
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1898
1981
|
* @permissionScope Manage Orders
|
|
1899
1982
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1900
1983
|
* @permissionScope Read Orders
|
|
@@ -1916,6 +1999,8 @@ interface OrderEndDatePostponedEnvelope {
|
|
|
1916
1999
|
}
|
|
1917
2000
|
/**
|
|
1918
2001
|
* Triggered when an order's `endDate` is postponed.
|
|
2002
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
2003
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1919
2004
|
* @permissionScope Manage Orders
|
|
1920
2005
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1921
2006
|
* @permissionScope Read Orders
|
|
@@ -1941,6 +2026,8 @@ interface OrderEndedEnvelope {
|
|
|
1941
2026
|
* This webhook is triggered:
|
|
1942
2027
|
* + When an order expires at the end of the current payment cycle.
|
|
1943
2028
|
* + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`.
|
|
2029
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
2030
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1944
2031
|
* @permissionScope Manage Orders
|
|
1945
2032
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1946
2033
|
* @permissionScope Read Orders
|
|
@@ -1962,6 +2049,8 @@ interface OrderMarkedAsPaidEnvelope {
|
|
|
1962
2049
|
}
|
|
1963
2050
|
/**
|
|
1964
2051
|
* Triggered when an offline order is marked as paid.
|
|
2052
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
2053
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1965
2054
|
* @permissionScope Manage Orders
|
|
1966
2055
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1967
2056
|
* @permissionScope Read Orders
|
|
@@ -1983,6 +2072,8 @@ interface OrderPausedEnvelope {
|
|
|
1983
2072
|
}
|
|
1984
2073
|
/**
|
|
1985
2074
|
* Triggered when an order is paused.
|
|
2075
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
2076
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1986
2077
|
* @permissionScope Manage Orders
|
|
1987
2078
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1988
2079
|
* @permissionScope Read Orders
|
|
@@ -2008,6 +2099,8 @@ interface OrderPurchasedEnvelope {
|
|
|
2008
2099
|
* + At least 1 order cycle payment is paid for.
|
|
2009
2100
|
* + Offline order is created, even if not yet marked as paid.
|
|
2010
2101
|
* + Free order is created.
|
|
2102
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
2103
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
2011
2104
|
* @permissionScope Manage Orders
|
|
2012
2105
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2013
2106
|
* @permissionScope Read Orders
|
|
@@ -2029,6 +2122,8 @@ interface OrderResumedEnvelope {
|
|
|
2029
2122
|
}
|
|
2030
2123
|
/**
|
|
2031
2124
|
* Triggered when a paused order is resumed.
|
|
2125
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
2126
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
2032
2127
|
* @permissionScope Manage Orders
|
|
2033
2128
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2034
2129
|
* @permissionScope Read Orders
|
|
@@ -2050,6 +2145,8 @@ interface OrderStartedEnvelope {
|
|
|
2050
2145
|
}
|
|
2051
2146
|
/**
|
|
2052
2147
|
* Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
|
|
2148
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
2149
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
2053
2150
|
* @permissionScope Manage Orders
|
|
2054
2151
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2055
2152
|
* @permissionScope Read Orders
|
|
@@ -2065,89 +2162,19 @@ interface OrderStartedEnvelope {
|
|
|
2065
2162
|
* @slug started
|
|
2066
2163
|
*/
|
|
2067
2164
|
declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
|
|
2068
|
-
interface OrderUpdatedEnvelope {
|
|
2069
|
-
entity: Order;
|
|
2070
|
-
metadata: EventMetadata;
|
|
2071
|
-
}
|
|
2072
2165
|
/**
|
|
2073
|
-
*
|
|
2074
|
-
*
|
|
2075
|
-
* + Order is paid for. Order Purchased is also triggered.
|
|
2076
|
-
* + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
|
|
2077
|
-
* + New payment cycle of an order starts. Order Cycle Started is also triggered.
|
|
2078
|
-
* + Offline order is marked as paid. Order Marked As Paid is also triggered.
|
|
2079
|
-
* + End date of the order is postponed. Order End Date Postponed is also triggered
|
|
2080
|
-
* + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
|
|
2081
|
-
* + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
|
|
2082
|
-
* @permissionScope Manage Orders
|
|
2083
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2084
|
-
* @permissionScope Read Orders
|
|
2085
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
2086
|
-
* @permissionScope Manage plans and orders of Pricing Plans
|
|
2087
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
2088
|
-
* @permissionScope Manage Events
|
|
2089
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2090
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2091
|
-
* @webhook
|
|
2092
|
-
* @eventType wix.pricing_plans.v2.order_updated
|
|
2093
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
2094
|
-
* @slug updated
|
|
2095
|
-
*/
|
|
2096
|
-
declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
|
|
2097
|
-
interface OrderCreatedEnvelope {
|
|
2098
|
-
entity: Order;
|
|
2099
|
-
metadata: EventMetadata;
|
|
2100
|
-
}
|
|
2101
|
-
/**
|
|
2102
|
-
* Triggered when an order is created.
|
|
2103
|
-
* @permissionScope Manage Orders
|
|
2104
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2105
|
-
* @permissionScope Read Orders
|
|
2106
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
2107
|
-
* @permissionScope Manage plans and orders of Pricing Plans
|
|
2108
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
2109
|
-
* @permissionScope Manage Events
|
|
2110
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2111
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2112
|
-
* @webhook
|
|
2113
|
-
* @eventType wix.pricing_plans.v2.order_created
|
|
2114
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
2115
|
-
* @slug created
|
|
2116
|
-
*/
|
|
2117
|
-
declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
|
|
2118
|
-
interface OrderStartDateChangedEnvelope {
|
|
2119
|
-
data: OrderStartDateChanged;
|
|
2120
|
-
metadata: EventMetadata;
|
|
2121
|
-
}
|
|
2122
|
-
/**
|
|
2123
|
-
* Triggered when an order's `startDate` is changed.
|
|
2124
|
-
* @permissionScope Manage Orders
|
|
2125
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2126
|
-
* @permissionScope Read Orders
|
|
2127
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
2128
|
-
* @permissionScope Manage plans and orders of Pricing Plans
|
|
2129
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
2130
|
-
* @permissionScope Manage Events
|
|
2131
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2132
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2133
|
-
* @webhook
|
|
2134
|
-
* @eventType wix.pricing_plans.v2.order_start_date_changed
|
|
2135
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
2136
|
-
* @slug start_date_changed
|
|
2137
|
-
*/
|
|
2138
|
-
declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
|
|
2139
|
-
/**
|
|
2140
|
-
* Retrieves an order by ID.
|
|
2166
|
+
* Retrieves an order for the currently logged-in member by ID.
|
|
2141
2167
|
* @param _id - Order ID.
|
|
2142
2168
|
* @public
|
|
2143
2169
|
* @requiredField _id
|
|
2144
|
-
* @param options - Options
|
|
2145
|
-
* @permissionId PRICING_PLANS.
|
|
2170
|
+
* @param options - Options for getting a logged-in member's order.
|
|
2171
|
+
* @permissionId PRICING_PLANS.READ_OWN_ORDERS
|
|
2146
2172
|
* @applicableIdentity APP
|
|
2147
|
-
* @
|
|
2173
|
+
* @applicableIdentity MEMBER
|
|
2174
|
+
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.GetOrder
|
|
2148
2175
|
*/
|
|
2149
|
-
declare function
|
|
2150
|
-
interface
|
|
2176
|
+
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>>;
|
|
2177
|
+
interface MemberGetOrderOptions {
|
|
2151
2178
|
/**
|
|
2152
2179
|
* Predefined set of fields to return.
|
|
2153
2180
|
*
|
|
@@ -2156,51 +2183,36 @@ interface ManagementGetOrderOptions {
|
|
|
2156
2183
|
fieldSet?: SetWithLiterals;
|
|
2157
2184
|
}
|
|
2158
2185
|
/**
|
|
2159
|
-
* Retrieves a list of up to
|
|
2160
|
-
*
|
|
2161
|
-
* By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
|
|
2162
|
-
* `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
|
|
2186
|
+
* Retrieves a list of up to 100 pricing plan orders for currently logged-in member.
|
|
2163
2187
|
* @public
|
|
2164
2188
|
* @param options - Filtering, sorting, and pagination options.
|
|
2165
|
-
* @permissionId PRICING_PLANS.
|
|
2189
|
+
* @permissionId PRICING_PLANS.READ_OWN_ORDERS
|
|
2166
2190
|
* @applicableIdentity APP
|
|
2167
|
-
* @
|
|
2191
|
+
* @applicableIdentity MEMBER
|
|
2192
|
+
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.ListOrders
|
|
2168
2193
|
*/
|
|
2169
|
-
declare function
|
|
2170
|
-
interface
|
|
2171
|
-
/**
|
|
2172
|
-
* Filter by a buyer's member ID, from the Members API.
|
|
2173
|
-
* @format GUID
|
|
2174
|
-
*/
|
|
2175
|
-
buyerIds?: string[];
|
|
2194
|
+
declare function memberListOrders(options?: MemberListOrdersOptions): Promise<NonNullablePaths<MemberListOrdersResponse, `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>>;
|
|
2195
|
+
interface MemberListOrdersOptions {
|
|
2176
2196
|
/**
|
|
2177
|
-
* Filter by plan IDs
|
|
2197
|
+
* Filter by plan IDs.
|
|
2178
2198
|
* @format GUID
|
|
2179
2199
|
*/
|
|
2180
2200
|
planIds?: string[];
|
|
2181
|
-
/** Filter
|
|
2201
|
+
/** Filter for orders where auto renewal was canceled. */
|
|
2182
2202
|
autoRenewCanceled?: boolean | null;
|
|
2183
2203
|
/** Filter by order status. */
|
|
2184
2204
|
orderStatuses?: OrderStatusWithLiterals[];
|
|
2185
2205
|
/** Filter by payment status. */
|
|
2186
2206
|
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
2187
2207
|
/**
|
|
2188
|
-
*
|
|
2189
|
-
*
|
|
2190
|
-
* Max: `50`
|
|
2208
|
+
* Limit the number of pricing plans returned. Default limit is 50.
|
|
2191
2209
|
* @min 1
|
|
2192
2210
|
* @max 50
|
|
2193
2211
|
*/
|
|
2194
2212
|
limit?: number | null;
|
|
2195
|
-
/** Number of
|
|
2213
|
+
/** Number of entries to offset. */
|
|
2196
2214
|
offset?: number | null;
|
|
2197
|
-
/**
|
|
2198
|
-
* Sort order.
|
|
2199
|
-
*
|
|
2200
|
-
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
2201
|
-
*
|
|
2202
|
-
* Default: `DESC`.
|
|
2203
|
-
*/
|
|
2215
|
+
/** Sorting direction (defaults to ASC) and field to sort by. */
|
|
2204
2216
|
sorting?: Sorting;
|
|
2205
2217
|
/**
|
|
2206
2218
|
* Predefined set of fields to return.
|
|
@@ -2210,106 +2222,26 @@ interface ManagementListOrdersOptions {
|
|
|
2210
2222
|
fieldSet?: SetWithLiterals;
|
|
2211
2223
|
}
|
|
2212
2224
|
/**
|
|
2213
|
-
*
|
|
2214
|
-
*
|
|
2215
|
-
* New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
|
|
2216
|
-
* Can't postpone an order with `status`: `PAUSED`.
|
|
2217
|
-
* @param _id - Order ID.
|
|
2218
|
-
* @param endDate - New end date and time.
|
|
2219
|
-
*
|
|
2220
|
-
* Must be later than the current end date and time.
|
|
2221
|
-
* @public
|
|
2222
|
-
* @requiredField _id
|
|
2223
|
-
* @requiredField endDate
|
|
2224
|
-
* @param options - Options for postponing the end date of an order.
|
|
2225
|
-
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2226
|
-
* @applicableIdentity APP
|
|
2227
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
|
|
2228
|
-
*/
|
|
2229
|
-
declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
|
|
2230
|
-
/**
|
|
2231
|
-
* Cancels an existing order.
|
|
2232
|
-
*
|
|
2233
|
-
* For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
|
|
2234
|
-
* For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
|
|
2225
|
+
* Cancels an order. Recurring orders can be canceled either immediately or at the next payment date. One time orders can only be canceled immediately.
|
|
2235
2226
|
*
|
|
2236
|
-
*
|
|
2227
|
+
* There may be some operations that continue to be processed before the status of the order is changed to `"CANCELED"`. For example, payments might need to be refunded before the order is fully canceled.
|
|
2237
2228
|
*
|
|
2238
|
-
* When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
|
|
2239
|
-
* of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
|
|
2240
|
-
* of the free trial period.
|
|
2229
|
+
* Canceling during the free trial period: When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end of the free trial period and they won't be billed. The buyer may continue using the benefits until the end of the free trial period.
|
|
2241
2230
|
*
|
|
2242
|
-
*
|
|
2243
|
-
*
|
|
2244
|
-
* immediately, even during the free trial period and the buyer won't be billed. Canceling at the
|
|
2245
|
-
* `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
|
|
2246
|
-
* Then, the subscription ends and the buyer is not billed.
|
|
2231
|
+
* >**Note:**
|
|
2232
|
+
* >This method requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
|
|
2247
2233
|
* @param _id - Order ID.
|
|
2248
|
-
* @param effectiveAt -
|
|
2234
|
+
* @param effectiveAt - Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately.
|
|
2249
2235
|
* @public
|
|
2250
2236
|
* @requiredField _id
|
|
2251
2237
|
* @requiredField effectiveAt
|
|
2252
|
-
* @param options - Options for
|
|
2253
|
-
* @permissionId PRICING_PLANS.
|
|
2254
|
-
* @applicableIdentity APP
|
|
2255
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
|
|
2256
|
-
*/
|
|
2257
|
-
declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
|
|
2258
|
-
/**
|
|
2259
|
-
* Marks an offline order as paid.
|
|
2260
|
-
* > __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.
|
|
2261
|
-
*
|
|
2262
|
-
* Marking an offline order as paid causes the following changes:
|
|
2263
|
-
* - The order's `lastPaymentStatus` changes to `"PAID"`.
|
|
2264
|
-
* - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
|
|
2265
|
-
*
|
|
2266
|
-
* An error occurs if you attempt to:
|
|
2267
|
-
* - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
|
|
2268
|
-
* - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
|
|
2269
|
-
* @param _id - Order ID.
|
|
2270
|
-
* @public
|
|
2271
|
-
* @requiredField _id
|
|
2272
|
-
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2273
|
-
* @applicableIdentity APP
|
|
2274
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
|
|
2275
|
-
*/
|
|
2276
|
-
declare function markAsPaid(_id: string): Promise<void>;
|
|
2277
|
-
/**
|
|
2278
|
-
* Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
|
|
2279
|
-
*
|
|
2280
|
-
* Only orders with `status`: `ACTIVE` can be paused.
|
|
2281
|
-
* For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
|
|
2282
|
-
* Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
|
|
2283
|
-
* The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
|
|
2284
|
-
*
|
|
2285
|
-
* To resume a paused order, call Resume Order.
|
|
2286
|
-
* @param _id - Order ID.
|
|
2287
|
-
* @public
|
|
2288
|
-
* @requiredField _id
|
|
2289
|
-
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2290
|
-
* @applicableIdentity APP
|
|
2291
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
|
|
2292
|
-
*/
|
|
2293
|
-
declare function pauseOrder(_id: string): Promise<void>;
|
|
2294
|
-
/**
|
|
2295
|
-
* Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
|
|
2296
|
-
*
|
|
2297
|
-
* Resuming an order causes the following changes:
|
|
2298
|
-
* - The order status changes to `"ACTIVE"`.
|
|
2299
|
-
* - The `pausePeriods` array is updated.
|
|
2300
|
-
* - The `endDate` for the order is adjusted to include the pause period.
|
|
2301
|
-
* - For orders with recurring payments, the payment schedule is restarted.
|
|
2302
|
-
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
|
|
2303
|
-
*
|
|
2304
|
-
* To pause an order, call Pause Order.
|
|
2305
|
-
* @param _id - Order ID.
|
|
2306
|
-
* @public
|
|
2307
|
-
* @requiredField _id
|
|
2308
|
-
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2238
|
+
* @param options - Options for requesting a cancellation.
|
|
2239
|
+
* @permissionId PRICING_PLANS.MANAGE_OWN_ORDERS
|
|
2309
2240
|
* @applicableIdentity APP
|
|
2310
|
-
* @
|
|
2241
|
+
* @applicableIdentity MEMBER
|
|
2242
|
+
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.RequestCancellation
|
|
2311
2243
|
*/
|
|
2312
|
-
declare function
|
|
2244
|
+
declare function requestCancellation(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
|
|
2313
2245
|
/**
|
|
2314
2246
|
* Creates an online order for a site member.
|
|
2315
2247
|
*
|
|
@@ -2505,19 +2437,18 @@ interface GetPricePreviewOptions {
|
|
|
2505
2437
|
couponCode?: string | null;
|
|
2506
2438
|
}
|
|
2507
2439
|
/**
|
|
2508
|
-
* Retrieves an order
|
|
2440
|
+
* Retrieves an order by ID.
|
|
2509
2441
|
* @param _id - Order ID.
|
|
2510
2442
|
* @public
|
|
2511
2443
|
* @requiredField _id
|
|
2512
|
-
* @param options - Options
|
|
2513
|
-
* @permissionId PRICING_PLANS.
|
|
2444
|
+
* @param options - Options to use when getting an order.
|
|
2445
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2514
2446
|
* @applicableIdentity APP
|
|
2515
|
-
* @
|
|
2516
|
-
* @
|
|
2517
|
-
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.GetOrder
|
|
2447
|
+
* @returns Order.
|
|
2448
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
|
|
2518
2449
|
*/
|
|
2519
|
-
declare function
|
|
2520
|
-
interface
|
|
2450
|
+
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>>;
|
|
2451
|
+
interface ManagementGetOrderOptions {
|
|
2521
2452
|
/**
|
|
2522
2453
|
* Predefined set of fields to return.
|
|
2523
2454
|
*
|
|
@@ -2526,36 +2457,51 @@ interface MemberGetOrderOptions {
|
|
|
2526
2457
|
fieldSet?: SetWithLiterals;
|
|
2527
2458
|
}
|
|
2528
2459
|
/**
|
|
2529
|
-
* Retrieves a list of up to
|
|
2460
|
+
* Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
|
|
2461
|
+
*
|
|
2462
|
+
* By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
|
|
2463
|
+
* `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
|
|
2530
2464
|
* @public
|
|
2531
2465
|
* @param options - Filtering, sorting, and pagination options.
|
|
2532
|
-
* @permissionId PRICING_PLANS.
|
|
2466
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2533
2467
|
* @applicableIdentity APP
|
|
2534
|
-
* @
|
|
2535
|
-
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.ListOrders
|
|
2468
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
|
|
2536
2469
|
*/
|
|
2537
|
-
declare function
|
|
2538
|
-
interface
|
|
2470
|
+
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>>;
|
|
2471
|
+
interface ManagementListOrdersOptions {
|
|
2539
2472
|
/**
|
|
2540
|
-
* Filter by
|
|
2473
|
+
* Filter by a buyer's member ID, from the Members API.
|
|
2474
|
+
* @format GUID
|
|
2475
|
+
*/
|
|
2476
|
+
buyerIds?: string[];
|
|
2477
|
+
/**
|
|
2478
|
+
* Filter by plan IDs, from the Plans API.
|
|
2541
2479
|
* @format GUID
|
|
2542
2480
|
*/
|
|
2543
2481
|
planIds?: string[];
|
|
2544
|
-
/** Filter
|
|
2482
|
+
/** Filter by whether or not the auto-renewal of recurring orders was canceled. */
|
|
2545
2483
|
autoRenewCanceled?: boolean | null;
|
|
2546
2484
|
/** Filter by order status. */
|
|
2547
2485
|
orderStatuses?: OrderStatusWithLiterals[];
|
|
2548
2486
|
/** Filter by payment status. */
|
|
2549
2487
|
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
2550
2488
|
/**
|
|
2551
|
-
*
|
|
2489
|
+
* Number of orders to return. See Sorting and Paging for more information.
|
|
2490
|
+
*
|
|
2491
|
+
* Max: `50`
|
|
2552
2492
|
* @min 1
|
|
2553
2493
|
* @max 50
|
|
2554
2494
|
*/
|
|
2555
2495
|
limit?: number | null;
|
|
2556
|
-
/** Number of
|
|
2496
|
+
/** Number of orders to skip in the current sort order. */
|
|
2557
2497
|
offset?: number | null;
|
|
2558
|
-
/**
|
|
2498
|
+
/**
|
|
2499
|
+
* Sort order.
|
|
2500
|
+
*
|
|
2501
|
+
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
2502
|
+
*
|
|
2503
|
+
* Default: `DESC`.
|
|
2504
|
+
*/
|
|
2559
2505
|
sorting?: Sorting;
|
|
2560
2506
|
/**
|
|
2561
2507
|
* Predefined set of fields to return.
|
|
@@ -2565,25 +2511,105 @@ interface MemberListOrdersOptions {
|
|
|
2565
2511
|
fieldSet?: SetWithLiterals;
|
|
2566
2512
|
}
|
|
2567
2513
|
/**
|
|
2568
|
-
*
|
|
2514
|
+
* 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.
|
|
2569
2515
|
*
|
|
2570
|
-
*
|
|
2516
|
+
* New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
|
|
2517
|
+
* Can't postpone an order with `status`: `PAUSED`.
|
|
2518
|
+
* @param _id - Order ID.
|
|
2519
|
+
* @param endDate - New end date and time.
|
|
2571
2520
|
*
|
|
2572
|
-
*
|
|
2521
|
+
* Must be later than the current end date and time.
|
|
2522
|
+
* @public
|
|
2523
|
+
* @requiredField _id
|
|
2524
|
+
* @requiredField endDate
|
|
2525
|
+
* @param options - Options for postponing the end date of an order.
|
|
2526
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2527
|
+
* @applicableIdentity APP
|
|
2528
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
|
|
2529
|
+
*/
|
|
2530
|
+
declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
|
|
2531
|
+
/**
|
|
2532
|
+
* Cancels an existing order.
|
|
2573
2533
|
*
|
|
2574
|
-
*
|
|
2575
|
-
*
|
|
2534
|
+
* For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
|
|
2535
|
+
* For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
|
|
2536
|
+
*
|
|
2537
|
+
* #### Canceling during the free trial period.
|
|
2538
|
+
*
|
|
2539
|
+
* When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
|
|
2540
|
+
* of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
|
|
2541
|
+
* of the free trial period.
|
|
2542
|
+
*
|
|
2543
|
+
* When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
|
|
2544
|
+
* `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
|
|
2545
|
+
* immediately, even during the free trial period and the buyer won't be billed. Canceling at the
|
|
2546
|
+
* `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
|
|
2547
|
+
* Then, the subscription ends and the buyer is not billed.
|
|
2576
2548
|
* @param _id - Order ID.
|
|
2577
|
-
* @param effectiveAt -
|
|
2549
|
+
* @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
|
|
2578
2550
|
* @public
|
|
2579
2551
|
* @requiredField _id
|
|
2580
2552
|
* @requiredField effectiveAt
|
|
2581
|
-
* @param options - Options for
|
|
2582
|
-
* @permissionId PRICING_PLANS.
|
|
2553
|
+
* @param options - Options for canceling orders.
|
|
2554
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2583
2555
|
* @applicableIdentity APP
|
|
2584
|
-
* @
|
|
2585
|
-
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.RequestCancellation
|
|
2556
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
|
|
2586
2557
|
*/
|
|
2587
|
-
declare function
|
|
2558
|
+
declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
|
|
2559
|
+
/**
|
|
2560
|
+
* Marks an offline order as paid.
|
|
2561
|
+
* > __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.
|
|
2562
|
+
*
|
|
2563
|
+
* Marking an offline order as paid causes the following changes:
|
|
2564
|
+
* - The order's `lastPaymentStatus` changes to `"PAID"`.
|
|
2565
|
+
* - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
|
|
2566
|
+
*
|
|
2567
|
+
* An error occurs if you attempt to:
|
|
2568
|
+
* - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
|
|
2569
|
+
* - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
|
|
2570
|
+
* @param _id - Order ID.
|
|
2571
|
+
* @public
|
|
2572
|
+
* @requiredField _id
|
|
2573
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2574
|
+
* @applicableIdentity APP
|
|
2575
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
|
|
2576
|
+
*/
|
|
2577
|
+
declare function markAsPaid(_id: string): Promise<void>;
|
|
2578
|
+
/**
|
|
2579
|
+
* Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
|
|
2580
|
+
*
|
|
2581
|
+
* Only orders with `status`: `ACTIVE` can be paused.
|
|
2582
|
+
* For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
|
|
2583
|
+
* Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
|
|
2584
|
+
* The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
|
|
2585
|
+
*
|
|
2586
|
+
* To resume a paused order, call Resume Order.
|
|
2587
|
+
* @param _id - Order ID.
|
|
2588
|
+
* @public
|
|
2589
|
+
* @requiredField _id
|
|
2590
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2591
|
+
* @applicableIdentity APP
|
|
2592
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
|
|
2593
|
+
*/
|
|
2594
|
+
declare function pauseOrder(_id: string): Promise<void>;
|
|
2595
|
+
/**
|
|
2596
|
+
* Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
|
|
2597
|
+
*
|
|
2598
|
+
* Resuming an order causes the following changes:
|
|
2599
|
+
* - The order status changes to `"ACTIVE"`.
|
|
2600
|
+
* - The `pausePeriods` array is updated.
|
|
2601
|
+
* - The `endDate` for the order is adjusted to include the pause period.
|
|
2602
|
+
* - For orders with recurring payments, the payment schedule is restarted.
|
|
2603
|
+
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
|
|
2604
|
+
*
|
|
2605
|
+
* To pause an order, call Pause Order.
|
|
2606
|
+
* @param _id - Order ID.
|
|
2607
|
+
* @public
|
|
2608
|
+
* @requiredField _id
|
|
2609
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2610
|
+
* @applicableIdentity APP
|
|
2611
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
|
|
2612
|
+
*/
|
|
2613
|
+
declare function resumeOrder(_id: string): Promise<void>;
|
|
2588
2614
|
|
|
2589
2615
|
export { type AccountInfo, type AccountInfoMetadata, 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 };
|