@wix/auto_sdk_pricing-plans_orders 1.0.119 → 1.0.120
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 +489 -470
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +509 -498
- package/build/cjs/index.typings.js +361 -342
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +261 -250
- package/build/cjs/meta.js +361 -342
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +38 -30
- package/build/cjs/schemas.js +73 -61
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +155 -155
- package/build/es/index.mjs +489 -470
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +509 -498
- package/build/es/index.typings.mjs +361 -342
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +261 -250
- package/build/es/meta.mjs +361 -342
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +38 -30
- package/build/es/schemas.mjs +73 -61
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +155 -155
- package/build/internal/cjs/index.js +489 -470
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +509 -498
- package/build/internal/cjs/index.typings.js +361 -342
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +261 -250
- package/build/internal/cjs/meta.js +361 -342
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +38 -30
- package/build/internal/cjs/schemas.js +73 -61
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +155 -155
- package/build/internal/es/index.mjs +489 -470
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +509 -498
- package/build/internal/es/index.typings.mjs +361 -342
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +261 -250
- package/build/internal/es/meta.mjs +361 -342
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +38 -30
- package/build/internal/es/schemas.mjs +73 -61
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -626,7 +626,35 @@ interface ActionEvent {
|
|
|
626
626
|
}
|
|
627
627
|
interface Empty {
|
|
628
628
|
}
|
|
629
|
-
interface
|
|
629
|
+
interface OrderPurchased {
|
|
630
|
+
/** Order that was paid for. If a free or an offline order, the order that was created. */
|
|
631
|
+
order?: Order;
|
|
632
|
+
}
|
|
633
|
+
interface OrderStarted {
|
|
634
|
+
/** Order that reached its `startDate`. */
|
|
635
|
+
order?: Order;
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Triggered at the start of a new payment cycle for an existing order.
|
|
639
|
+
*
|
|
640
|
+
* This webhook does not trigger at the initial start of an offline order.
|
|
641
|
+
*/
|
|
642
|
+
interface OrderCycleStarted {
|
|
643
|
+
/** Order whose new cycle started. */
|
|
644
|
+
order?: Order;
|
|
645
|
+
/** Number of the payment cycle will be 0 when the order is in the free trial period. In other cases, the cycle number starts from 1. */
|
|
646
|
+
cycleNumber?: number;
|
|
647
|
+
}
|
|
648
|
+
/** Emitted when a recurring order is canceled for the next payment cycle */
|
|
649
|
+
interface OrderAutoRenewCanceled {
|
|
650
|
+
/** Order that is canceled, effective at the end of the current payment cycle. */
|
|
651
|
+
order?: Order;
|
|
652
|
+
}
|
|
653
|
+
interface OrderEnded {
|
|
654
|
+
/** Order that ended. */
|
|
655
|
+
order?: Order;
|
|
656
|
+
}
|
|
657
|
+
interface GetOrderRequest {
|
|
630
658
|
/**
|
|
631
659
|
* Order ID.
|
|
632
660
|
* @format GUID
|
|
@@ -649,31 +677,44 @@ declare enum Set {
|
|
|
649
677
|
}
|
|
650
678
|
/** @enumType */
|
|
651
679
|
type SetWithLiterals = Set | 'UNKNOWN_SET' | 'BASIC' | 'FULL';
|
|
652
|
-
interface
|
|
653
|
-
/**
|
|
680
|
+
interface GetOrderResponse {
|
|
681
|
+
/** Order. */
|
|
654
682
|
order?: Order;
|
|
655
683
|
}
|
|
656
|
-
interface
|
|
684
|
+
interface ListOrdersRequest {
|
|
657
685
|
/**
|
|
658
|
-
* Filter by
|
|
686
|
+
* Filter by a buyer's member ID, from the Members API.
|
|
687
|
+
* @format GUID
|
|
688
|
+
*/
|
|
689
|
+
buyerIds?: string[];
|
|
690
|
+
/**
|
|
691
|
+
* Filter by plan IDs, from the Plans API.
|
|
659
692
|
* @format GUID
|
|
660
693
|
*/
|
|
661
694
|
planIds?: string[];
|
|
662
|
-
/** Filter
|
|
695
|
+
/** Filter by whether or not the auto-renewal of recurring orders was canceled. */
|
|
663
696
|
autoRenewCanceled?: boolean | null;
|
|
664
697
|
/** Filter by order status. */
|
|
665
698
|
orderStatuses?: OrderStatusWithLiterals[];
|
|
666
699
|
/** Filter by payment status. */
|
|
667
700
|
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
668
701
|
/**
|
|
669
|
-
*
|
|
702
|
+
* Number of orders to return. See Sorting and Paging for more information.
|
|
703
|
+
*
|
|
704
|
+
* Max: `50`
|
|
670
705
|
* @min 1
|
|
671
706
|
* @max 50
|
|
672
707
|
*/
|
|
673
708
|
limit?: number | null;
|
|
674
|
-
/** Number of
|
|
709
|
+
/** Number of orders to skip in the current sort order. */
|
|
675
710
|
offset?: number | null;
|
|
676
|
-
/**
|
|
711
|
+
/**
|
|
712
|
+
* Sort order.
|
|
713
|
+
*
|
|
714
|
+
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
715
|
+
*
|
|
716
|
+
* Default: `DESC`.
|
|
717
|
+
*/
|
|
677
718
|
sorting?: Sorting;
|
|
678
719
|
/**
|
|
679
720
|
* Predefined set of fields to return.
|
|
@@ -690,6 +731,11 @@ interface Sorting {
|
|
|
690
731
|
fieldName?: string;
|
|
691
732
|
/** Sort order. */
|
|
692
733
|
order?: SortOrderWithLiterals;
|
|
734
|
+
/**
|
|
735
|
+
* Origin point for geo-distance sorting on a GEO field
|
|
736
|
+
* results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
|
|
737
|
+
*/
|
|
738
|
+
origin?: AddressLocation;
|
|
693
739
|
}
|
|
694
740
|
declare enum SortOrder {
|
|
695
741
|
ASC = "ASC",
|
|
@@ -697,8 +743,14 @@ declare enum SortOrder {
|
|
|
697
743
|
}
|
|
698
744
|
/** @enumType */
|
|
699
745
|
type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
|
|
700
|
-
interface
|
|
701
|
-
/**
|
|
746
|
+
interface AddressLocation {
|
|
747
|
+
/** Address latitude. */
|
|
748
|
+
latitude?: number | null;
|
|
749
|
+
/** Address longitude. */
|
|
750
|
+
longitude?: number | null;
|
|
751
|
+
}
|
|
752
|
+
interface ListOrdersResponse {
|
|
753
|
+
/** List of orders. */
|
|
702
754
|
orders?: Order[];
|
|
703
755
|
/** Object containing paging-related data (number of orders returned, offset). */
|
|
704
756
|
pagingMetadata?: PagingMetadataV2;
|
|
@@ -727,16 +779,78 @@ interface Cursors {
|
|
|
727
779
|
*/
|
|
728
780
|
prev?: string | null;
|
|
729
781
|
}
|
|
730
|
-
interface
|
|
782
|
+
interface GetOrdersStatsRequest {
|
|
783
|
+
}
|
|
784
|
+
interface GetOrdersStatsResponse {
|
|
785
|
+
/** Total number of orders. */
|
|
786
|
+
totalOrderCount?: number;
|
|
787
|
+
/** Number of active orders. */
|
|
788
|
+
activeOrderCount?: number;
|
|
789
|
+
}
|
|
790
|
+
interface GetAvailableOrderActionsRequest {
|
|
791
|
+
/**
|
|
792
|
+
* Order ID.
|
|
793
|
+
* @format GUID
|
|
794
|
+
*/
|
|
795
|
+
_id?: string;
|
|
796
|
+
}
|
|
797
|
+
interface GetAvailableOrderActionsResponse {
|
|
798
|
+
/** Whether the order can be suspended. */
|
|
799
|
+
suspendable?: boolean;
|
|
800
|
+
/** If the order cannot be suspended, a reason is returned here. */
|
|
801
|
+
notSuspendableReason?: ReasonNotSuspendableWithLiterals;
|
|
802
|
+
/** Whether the order can be canceled by the buyer. */
|
|
803
|
+
cancelableByBuyer?: boolean;
|
|
804
|
+
}
|
|
805
|
+
declare enum ReasonNotSuspendable {
|
|
806
|
+
/** Undefined reason. */
|
|
807
|
+
UNDEFINED = "UNDEFINED",
|
|
808
|
+
/** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
|
|
809
|
+
PENDING = "PENDING",
|
|
810
|
+
/** Trial orders can't be suspended. */
|
|
811
|
+
TRIAL = "TRIAL",
|
|
812
|
+
/** Canceled orders can't be suspended. */
|
|
813
|
+
CANCELED = "CANCELED",
|
|
814
|
+
/** Ended orders can't be suspended. */
|
|
815
|
+
ENDED = "ENDED",
|
|
816
|
+
/** Paid for orders with future start dates can't be suspended. */
|
|
817
|
+
NOT_STARTED = "NOT_STARTED",
|
|
818
|
+
/** Order is already suspended. */
|
|
819
|
+
ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
|
|
820
|
+
/** Orders based on recurring payments using older stripe versions can't be suspended. */
|
|
821
|
+
OLD_STRIPE = "OLD_STRIPE"
|
|
822
|
+
}
|
|
823
|
+
/** @enumType */
|
|
824
|
+
type ReasonNotSuspendableWithLiterals = ReasonNotSuspendable | 'UNDEFINED' | 'PENDING' | 'TRIAL' | 'CANCELED' | 'ENDED' | 'NOT_STARTED' | 'ALREADY_SUSPENDED' | 'OLD_STRIPE';
|
|
825
|
+
interface PostponeEndDateRequest {
|
|
731
826
|
/**
|
|
732
827
|
* Order ID.
|
|
733
828
|
* @format GUID
|
|
734
829
|
*/
|
|
735
830
|
_id: string;
|
|
736
|
-
/**
|
|
831
|
+
/**
|
|
832
|
+
* New end date and time.
|
|
833
|
+
*
|
|
834
|
+
* Must be later than the current end date and time.
|
|
835
|
+
*/
|
|
836
|
+
endDate: Date | null;
|
|
837
|
+
}
|
|
838
|
+
interface PostponeEndDateResponse {
|
|
839
|
+
}
|
|
840
|
+
interface OrderEndDatePostponed {
|
|
841
|
+
/** Order whose `endDate` was postponed. */
|
|
842
|
+
order?: Order;
|
|
843
|
+
}
|
|
844
|
+
interface CancelOrderRequest {
|
|
845
|
+
/**
|
|
846
|
+
* Order ID.
|
|
847
|
+
* @format GUID
|
|
848
|
+
*/
|
|
849
|
+
_id: string;
|
|
850
|
+
/** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
|
|
737
851
|
effectiveAt: CancellationEffectiveAtWithLiterals;
|
|
738
852
|
}
|
|
739
|
-
interface
|
|
853
|
+
interface CancelOrderResponse {
|
|
740
854
|
}
|
|
741
855
|
/**
|
|
742
856
|
* Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
|
|
@@ -747,6 +861,111 @@ interface OrderCanceled {
|
|
|
747
861
|
/** Canceled order. */
|
|
748
862
|
order?: Order;
|
|
749
863
|
}
|
|
864
|
+
interface MarkAsPaidRequest {
|
|
865
|
+
/**
|
|
866
|
+
* Order ID.
|
|
867
|
+
* @format GUID
|
|
868
|
+
*/
|
|
869
|
+
_id: string;
|
|
870
|
+
}
|
|
871
|
+
interface MarkAsPaidResponse {
|
|
872
|
+
}
|
|
873
|
+
interface OrderMarkedAsPaid {
|
|
874
|
+
/** Order that was marked as paid. */
|
|
875
|
+
order?: Order;
|
|
876
|
+
}
|
|
877
|
+
interface PauseOrderRequest {
|
|
878
|
+
/**
|
|
879
|
+
* Order ID.
|
|
880
|
+
* @format GUID
|
|
881
|
+
*/
|
|
882
|
+
_id: string;
|
|
883
|
+
}
|
|
884
|
+
interface PauseOrderResponse {
|
|
885
|
+
}
|
|
886
|
+
interface OrderPaused {
|
|
887
|
+
/** Paused order. */
|
|
888
|
+
order?: Order;
|
|
889
|
+
}
|
|
890
|
+
interface BulkPauseOrderRequest {
|
|
891
|
+
/**
|
|
892
|
+
* List of Order IDs.
|
|
893
|
+
* @format GUID
|
|
894
|
+
* @minSize 1
|
|
895
|
+
* @maxSize 100
|
|
896
|
+
*/
|
|
897
|
+
ids?: string[];
|
|
898
|
+
/** Set to true to return Order entity in response. */
|
|
899
|
+
returnFullEntity?: boolean;
|
|
900
|
+
}
|
|
901
|
+
interface BulkPauseOrderResponse {
|
|
902
|
+
/** Orders that were paused. */
|
|
903
|
+
results?: BulkOrderResult[];
|
|
904
|
+
/** Bulk action metadata. */
|
|
905
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
906
|
+
}
|
|
907
|
+
interface BulkOrderResult {
|
|
908
|
+
/** Item metadata */
|
|
909
|
+
itemMetadata?: ItemMetadata;
|
|
910
|
+
/** The order. */
|
|
911
|
+
order?: Order;
|
|
912
|
+
}
|
|
913
|
+
interface ItemMetadata {
|
|
914
|
+
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
|
915
|
+
_id?: string | null;
|
|
916
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
917
|
+
originalIndex?: number;
|
|
918
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
919
|
+
success?: boolean;
|
|
920
|
+
/** Details about the error in case of failure. */
|
|
921
|
+
error?: ApplicationError;
|
|
922
|
+
}
|
|
923
|
+
interface ApplicationError {
|
|
924
|
+
/** Error code. */
|
|
925
|
+
code?: string;
|
|
926
|
+
/** Description of the error. */
|
|
927
|
+
description?: string;
|
|
928
|
+
/** Data related to the error. */
|
|
929
|
+
data?: Record<string, any> | null;
|
|
930
|
+
}
|
|
931
|
+
interface BulkActionMetadata {
|
|
932
|
+
/** Number of items that were successfully processed. */
|
|
933
|
+
totalSuccesses?: number;
|
|
934
|
+
/** Number of items that couldn't be processed. */
|
|
935
|
+
totalFailures?: number;
|
|
936
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
937
|
+
undetailedFailures?: number;
|
|
938
|
+
}
|
|
939
|
+
interface ResumeOrderRequest {
|
|
940
|
+
/**
|
|
941
|
+
* Order ID.
|
|
942
|
+
* @format GUID
|
|
943
|
+
*/
|
|
944
|
+
_id: string;
|
|
945
|
+
}
|
|
946
|
+
interface ResumeOrderResponse {
|
|
947
|
+
}
|
|
948
|
+
interface OrderResumed {
|
|
949
|
+
/** Resumed order. */
|
|
950
|
+
order?: Order;
|
|
951
|
+
}
|
|
952
|
+
interface BulkResumeOrderRequest {
|
|
953
|
+
/**
|
|
954
|
+
* List of Order IDs.
|
|
955
|
+
* @format GUID
|
|
956
|
+
* @minSize 1
|
|
957
|
+
* @maxSize 100
|
|
958
|
+
*/
|
|
959
|
+
ids?: string[];
|
|
960
|
+
/** Set to true to return Order entity in response. */
|
|
961
|
+
returnFullEntity?: boolean;
|
|
962
|
+
}
|
|
963
|
+
interface BulkResumeOrderResponse {
|
|
964
|
+
/** Orders that were resumed. */
|
|
965
|
+
results?: BulkOrderResult[];
|
|
966
|
+
/** Bulk action metadata. */
|
|
967
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
968
|
+
}
|
|
750
969
|
interface MessageEnvelope {
|
|
751
970
|
/**
|
|
752
971
|
* App instance ID.
|
|
@@ -1141,85 +1360,44 @@ interface SetSubmissionResponse {
|
|
|
1141
1360
|
/** Order with submission id */
|
|
1142
1361
|
order?: Order;
|
|
1143
1362
|
}
|
|
1144
|
-
interface
|
|
1145
|
-
/**
|
|
1363
|
+
interface MemberGetOrderRequest {
|
|
1364
|
+
/**
|
|
1365
|
+
* Order ID.
|
|
1366
|
+
* @format GUID
|
|
1367
|
+
*/
|
|
1368
|
+
_id: string;
|
|
1369
|
+
/**
|
|
1370
|
+
* Predefined set of fields to return.
|
|
1371
|
+
*
|
|
1372
|
+
* Default: If `fieldSet` is omitted, no order form submission data is returned.
|
|
1373
|
+
*/
|
|
1374
|
+
fieldSet?: SetWithLiterals;
|
|
1375
|
+
}
|
|
1376
|
+
interface MemberGetOrderResponse {
|
|
1377
|
+
/** Requested order. */
|
|
1146
1378
|
order?: Order;
|
|
1147
1379
|
}
|
|
1148
|
-
interface
|
|
1149
|
-
/** Order that reached its `startDate`. */
|
|
1150
|
-
order?: Order;
|
|
1151
|
-
}
|
|
1152
|
-
/**
|
|
1153
|
-
* Triggered at the start of a new payment cycle for an existing order.
|
|
1154
|
-
*
|
|
1155
|
-
* This webhook does not trigger at the initial start of an offline order.
|
|
1156
|
-
*/
|
|
1157
|
-
interface OrderCycleStarted {
|
|
1158
|
-
/** Order whose new cycle started. */
|
|
1159
|
-
order?: Order;
|
|
1160
|
-
/** 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. */
|
|
1161
|
-
cycleNumber?: number;
|
|
1162
|
-
}
|
|
1163
|
-
/** Emitted when a recurring order is canceled for the next payment cycle */
|
|
1164
|
-
interface OrderAutoRenewCanceled {
|
|
1165
|
-
/** Order that is canceled, effective at the end of the current payment cycle. */
|
|
1166
|
-
order?: Order;
|
|
1167
|
-
}
|
|
1168
|
-
interface OrderEnded {
|
|
1169
|
-
/** Order that ended. */
|
|
1170
|
-
order?: Order;
|
|
1171
|
-
}
|
|
1172
|
-
interface GetOrderRequest {
|
|
1173
|
-
/**
|
|
1174
|
-
* Order ID.
|
|
1175
|
-
* @format GUID
|
|
1176
|
-
*/
|
|
1177
|
-
_id: string;
|
|
1178
|
-
/**
|
|
1179
|
-
* Predefined set of fields to return.
|
|
1180
|
-
*
|
|
1181
|
-
* Default: If `fieldSet` is omitted, no order form submission data is returned.
|
|
1182
|
-
*/
|
|
1183
|
-
fieldSet?: SetWithLiterals;
|
|
1184
|
-
}
|
|
1185
|
-
interface GetOrderResponse {
|
|
1186
|
-
/** Order. */
|
|
1187
|
-
order?: Order;
|
|
1188
|
-
}
|
|
1189
|
-
interface ListOrdersRequest {
|
|
1190
|
-
/**
|
|
1191
|
-
* Filter by a buyer's member ID, from the Members API.
|
|
1192
|
-
* @format GUID
|
|
1193
|
-
*/
|
|
1194
|
-
buyerIds?: string[];
|
|
1380
|
+
interface MemberListOrdersRequest {
|
|
1195
1381
|
/**
|
|
1196
|
-
* Filter by plan IDs
|
|
1382
|
+
* Filter by plan IDs.
|
|
1197
1383
|
* @format GUID
|
|
1198
1384
|
*/
|
|
1199
1385
|
planIds?: string[];
|
|
1200
|
-
/** Filter
|
|
1386
|
+
/** Filter for orders where auto renewal was canceled. */
|
|
1201
1387
|
autoRenewCanceled?: boolean | null;
|
|
1202
1388
|
/** Filter by order status. */
|
|
1203
1389
|
orderStatuses?: OrderStatusWithLiterals[];
|
|
1204
1390
|
/** Filter by payment status. */
|
|
1205
1391
|
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
1206
1392
|
/**
|
|
1207
|
-
*
|
|
1208
|
-
*
|
|
1209
|
-
* Max: `50`
|
|
1393
|
+
* Limit the number of pricing plans returned. Default limit is 50.
|
|
1210
1394
|
* @min 1
|
|
1211
1395
|
* @max 50
|
|
1212
1396
|
*/
|
|
1213
1397
|
limit?: number | null;
|
|
1214
|
-
/** Number of
|
|
1398
|
+
/** Number of entries to offset. */
|
|
1215
1399
|
offset?: number | null;
|
|
1216
|
-
/**
|
|
1217
|
-
* Sort order.
|
|
1218
|
-
*
|
|
1219
|
-
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
1220
|
-
*
|
|
1221
|
-
* Default: `DESC`.
|
|
1222
|
-
*/
|
|
1400
|
+
/** Sorting direction (defaults to ASC) and field to sort by. */
|
|
1223
1401
|
sorting?: Sorting;
|
|
1224
1402
|
/**
|
|
1225
1403
|
* Predefined set of fields to return.
|
|
@@ -1228,189 +1406,22 @@ interface ListOrdersRequest {
|
|
|
1228
1406
|
*/
|
|
1229
1407
|
fieldSet?: SetWithLiterals;
|
|
1230
1408
|
}
|
|
1231
|
-
interface
|
|
1232
|
-
/**
|
|
1409
|
+
interface MemberListOrdersResponse {
|
|
1410
|
+
/** Requested orders. */
|
|
1233
1411
|
orders?: Order[];
|
|
1234
1412
|
/** Object containing paging-related data (number of orders returned, offset). */
|
|
1235
1413
|
pagingMetadata?: PagingMetadataV2;
|
|
1236
1414
|
}
|
|
1237
|
-
interface
|
|
1238
|
-
}
|
|
1239
|
-
interface GetOrdersStatsResponse {
|
|
1240
|
-
/** Total number of orders. */
|
|
1241
|
-
totalOrderCount?: number;
|
|
1242
|
-
/** Number of active orders. */
|
|
1243
|
-
activeOrderCount?: number;
|
|
1244
|
-
}
|
|
1245
|
-
interface GetAvailableOrderActionsRequest {
|
|
1246
|
-
/**
|
|
1247
|
-
* Order ID.
|
|
1248
|
-
* @format GUID
|
|
1249
|
-
*/
|
|
1250
|
-
_id?: string;
|
|
1251
|
-
}
|
|
1252
|
-
interface GetAvailableOrderActionsResponse {
|
|
1253
|
-
/** Whether the order can be suspended. */
|
|
1254
|
-
suspendable?: boolean;
|
|
1255
|
-
/** If the order cannot be suspended, a reason is returned here. */
|
|
1256
|
-
notSuspendableReason?: ReasonNotSuspendableWithLiterals;
|
|
1257
|
-
/** Whether the order can be canceled by the buyer. */
|
|
1258
|
-
cancelableByBuyer?: boolean;
|
|
1259
|
-
}
|
|
1260
|
-
declare enum ReasonNotSuspendable {
|
|
1261
|
-
/** Undefined reason. */
|
|
1262
|
-
UNDEFINED = "UNDEFINED",
|
|
1263
|
-
/** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
|
|
1264
|
-
PENDING = "PENDING",
|
|
1265
|
-
/** Trial orders can't be suspended. */
|
|
1266
|
-
TRIAL = "TRIAL",
|
|
1267
|
-
/** Canceled orders can't be suspended. */
|
|
1268
|
-
CANCELED = "CANCELED",
|
|
1269
|
-
/** Ended orders can't be suspended. */
|
|
1270
|
-
ENDED = "ENDED",
|
|
1271
|
-
/** Paid for orders with future start dates can't be suspended. */
|
|
1272
|
-
NOT_STARTED = "NOT_STARTED",
|
|
1273
|
-
/** Order is already suspended. */
|
|
1274
|
-
ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
|
|
1275
|
-
/** Orders based on recurring payments using older stripe versions can't be suspended. */
|
|
1276
|
-
OLD_STRIPE = "OLD_STRIPE"
|
|
1277
|
-
}
|
|
1278
|
-
/** @enumType */
|
|
1279
|
-
type ReasonNotSuspendableWithLiterals = ReasonNotSuspendable | 'UNDEFINED' | 'PENDING' | 'TRIAL' | 'CANCELED' | 'ENDED' | 'NOT_STARTED' | 'ALREADY_SUSPENDED' | 'OLD_STRIPE';
|
|
1280
|
-
interface PostponeEndDateRequest {
|
|
1281
|
-
/**
|
|
1282
|
-
* Order ID.
|
|
1283
|
-
* @format GUID
|
|
1284
|
-
*/
|
|
1285
|
-
_id: string;
|
|
1286
|
-
/**
|
|
1287
|
-
* New end date and time.
|
|
1288
|
-
*
|
|
1289
|
-
* Must be later than the current end date and time.
|
|
1290
|
-
*/
|
|
1291
|
-
endDate: Date | null;
|
|
1292
|
-
}
|
|
1293
|
-
interface PostponeEndDateResponse {
|
|
1294
|
-
}
|
|
1295
|
-
interface OrderEndDatePostponed {
|
|
1296
|
-
/** Order whose `endDate` was postponed. */
|
|
1297
|
-
order?: Order;
|
|
1298
|
-
}
|
|
1299
|
-
interface CancelOrderRequest {
|
|
1415
|
+
interface RequestCancellationRequest {
|
|
1300
1416
|
/**
|
|
1301
1417
|
* Order ID.
|
|
1302
1418
|
* @format GUID
|
|
1303
1419
|
*/
|
|
1304
1420
|
_id: string;
|
|
1305
|
-
/**
|
|
1421
|
+
/** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
|
|
1306
1422
|
effectiveAt: CancellationEffectiveAtWithLiterals;
|
|
1307
1423
|
}
|
|
1308
|
-
interface
|
|
1309
|
-
}
|
|
1310
|
-
interface MarkAsPaidRequest {
|
|
1311
|
-
/**
|
|
1312
|
-
* Order ID.
|
|
1313
|
-
* @format GUID
|
|
1314
|
-
*/
|
|
1315
|
-
_id: string;
|
|
1316
|
-
}
|
|
1317
|
-
interface MarkAsPaidResponse {
|
|
1318
|
-
}
|
|
1319
|
-
interface OrderMarkedAsPaid {
|
|
1320
|
-
/** Order that was marked as paid. */
|
|
1321
|
-
order?: Order;
|
|
1322
|
-
}
|
|
1323
|
-
interface PauseOrderRequest {
|
|
1324
|
-
/**
|
|
1325
|
-
* Order ID.
|
|
1326
|
-
* @format GUID
|
|
1327
|
-
*/
|
|
1328
|
-
_id: string;
|
|
1329
|
-
}
|
|
1330
|
-
interface PauseOrderResponse {
|
|
1331
|
-
}
|
|
1332
|
-
interface OrderPaused {
|
|
1333
|
-
/** Paused order. */
|
|
1334
|
-
order?: Order;
|
|
1335
|
-
}
|
|
1336
|
-
interface BulkPauseOrderRequest {
|
|
1337
|
-
/**
|
|
1338
|
-
* List of Order IDs.
|
|
1339
|
-
* @format GUID
|
|
1340
|
-
* @minSize 1
|
|
1341
|
-
* @maxSize 100
|
|
1342
|
-
*/
|
|
1343
|
-
ids?: string[];
|
|
1344
|
-
/** Set to true to return Order entity in response. */
|
|
1345
|
-
returnFullEntity?: boolean;
|
|
1346
|
-
}
|
|
1347
|
-
interface BulkPauseOrderResponse {
|
|
1348
|
-
/** Orders that were paused. */
|
|
1349
|
-
results?: BulkOrderResult[];
|
|
1350
|
-
/** Bulk action metadata. */
|
|
1351
|
-
bulkActionMetadata?: BulkActionMetadata;
|
|
1352
|
-
}
|
|
1353
|
-
interface BulkOrderResult {
|
|
1354
|
-
/** Item metadata */
|
|
1355
|
-
itemMetadata?: ItemMetadata;
|
|
1356
|
-
/** The order. */
|
|
1357
|
-
order?: Order;
|
|
1358
|
-
}
|
|
1359
|
-
interface ItemMetadata {
|
|
1360
|
-
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
|
1361
|
-
_id?: string | null;
|
|
1362
|
-
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
1363
|
-
originalIndex?: number;
|
|
1364
|
-
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
1365
|
-
success?: boolean;
|
|
1366
|
-
/** Details about the error in case of failure. */
|
|
1367
|
-
error?: ApplicationError;
|
|
1368
|
-
}
|
|
1369
|
-
interface ApplicationError {
|
|
1370
|
-
/** Error code. */
|
|
1371
|
-
code?: string;
|
|
1372
|
-
/** Description of the error. */
|
|
1373
|
-
description?: string;
|
|
1374
|
-
/** Data related to the error. */
|
|
1375
|
-
data?: Record<string, any> | null;
|
|
1376
|
-
}
|
|
1377
|
-
interface BulkActionMetadata {
|
|
1378
|
-
/** Number of items that were successfully processed. */
|
|
1379
|
-
totalSuccesses?: number;
|
|
1380
|
-
/** Number of items that couldn't be processed. */
|
|
1381
|
-
totalFailures?: number;
|
|
1382
|
-
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
1383
|
-
undetailedFailures?: number;
|
|
1384
|
-
}
|
|
1385
|
-
interface ResumeOrderRequest {
|
|
1386
|
-
/**
|
|
1387
|
-
* Order ID.
|
|
1388
|
-
* @format GUID
|
|
1389
|
-
*/
|
|
1390
|
-
_id: string;
|
|
1391
|
-
}
|
|
1392
|
-
interface ResumeOrderResponse {
|
|
1393
|
-
}
|
|
1394
|
-
interface OrderResumed {
|
|
1395
|
-
/** Resumed order. */
|
|
1396
|
-
order?: Order;
|
|
1397
|
-
}
|
|
1398
|
-
interface BulkResumeOrderRequest {
|
|
1399
|
-
/**
|
|
1400
|
-
* List of Order IDs.
|
|
1401
|
-
* @format GUID
|
|
1402
|
-
* @minSize 1
|
|
1403
|
-
* @maxSize 100
|
|
1404
|
-
*/
|
|
1405
|
-
ids?: string[];
|
|
1406
|
-
/** Set to true to return Order entity in response. */
|
|
1407
|
-
returnFullEntity?: boolean;
|
|
1408
|
-
}
|
|
1409
|
-
interface BulkResumeOrderResponse {
|
|
1410
|
-
/** Orders that were resumed. */
|
|
1411
|
-
results?: BulkOrderResult[];
|
|
1412
|
-
/** Bulk action metadata. */
|
|
1413
|
-
bulkActionMetadata?: BulkActionMetadata;
|
|
1424
|
+
interface RequestCancellationResponse {
|
|
1414
1425
|
}
|
|
1415
1426
|
/** @docsIgnore */
|
|
1416
1427
|
type CreateOnlineOrderApplicationErrors = {
|
|
@@ -1763,16 +1774,16 @@ interface AccountInfoMetadata {
|
|
|
1763
1774
|
/** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */
|
|
1764
1775
|
parentAccountId?: string;
|
|
1765
1776
|
}
|
|
1766
|
-
interface
|
|
1767
|
-
data:
|
|
1777
|
+
interface OrderAutoRenewCanceledEnvelope {
|
|
1778
|
+
data: OrderAutoRenewCanceled;
|
|
1768
1779
|
metadata: EventMetadata;
|
|
1769
1780
|
}
|
|
1770
1781
|
/**
|
|
1771
|
-
* Triggered when an order is canceled
|
|
1782
|
+
* Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
|
|
1772
1783
|
*
|
|
1773
|
-
* This webhook is triggered
|
|
1774
|
-
* +
|
|
1775
|
-
* +
|
|
1784
|
+
* This webhook is *not* triggered in the following scenarios:
|
|
1785
|
+
* + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
|
|
1786
|
+
* + 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.
|
|
1776
1787
|
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1777
1788
|
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1778
1789
|
* @permissionScope Manage Orders
|
|
@@ -1785,98 +1796,21 @@ interface OrderCanceledEnvelope {
|
|
|
1785
1796
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1786
1797
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1787
1798
|
* @webhook
|
|
1788
|
-
* @eventType wix.pricing_plans.v2.
|
|
1789
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.
|
|
1790
|
-
* @slug
|
|
1791
|
-
*/
|
|
1792
|
-
declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
|
|
1793
|
-
interface OrderCreatedEnvelope {
|
|
1794
|
-
entity: Order;
|
|
1795
|
-
metadata: EventMetadata;
|
|
1796
|
-
}
|
|
1797
|
-
/**
|
|
1798
|
-
* Triggered when an order is created.
|
|
1799
|
-
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1800
|
-
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1801
|
-
* @permissionScope Manage Orders
|
|
1802
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1803
|
-
* @permissionScope Read Orders
|
|
1804
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
1805
|
-
* @permissionScope Manage plans and orders of Pricing Plans
|
|
1806
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
1807
|
-
* @permissionScope Manage Events
|
|
1808
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1809
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1810
|
-
* @webhook
|
|
1811
|
-
* @eventType wix.pricing_plans.v2.order_created
|
|
1812
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
1813
|
-
* @slug created
|
|
1814
|
-
*/
|
|
1815
|
-
declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
|
|
1816
|
-
interface OrderStartDateChangedEnvelope {
|
|
1817
|
-
data: OrderStartDateChanged;
|
|
1818
|
-
metadata: EventMetadata;
|
|
1819
|
-
}
|
|
1820
|
-
/**
|
|
1821
|
-
* Triggered when an order's `startDate` is changed.
|
|
1822
|
-
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1823
|
-
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1824
|
-
* @permissionScope Manage Orders
|
|
1825
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1826
|
-
* @permissionScope Read Orders
|
|
1827
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
1828
|
-
* @permissionScope Manage plans and orders of Pricing Plans
|
|
1829
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
1830
|
-
* @permissionScope Manage Events
|
|
1831
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1832
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1833
|
-
* @webhook
|
|
1834
|
-
* @eventType wix.pricing_plans.v2.order_start_date_changed
|
|
1835
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
1836
|
-
* @slug start_date_changed
|
|
1837
|
-
*/
|
|
1838
|
-
declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
|
|
1839
|
-
interface OrderUpdatedEnvelope {
|
|
1840
|
-
entity: Order;
|
|
1841
|
-
metadata: EventMetadata;
|
|
1842
|
-
}
|
|
1843
|
-
/**
|
|
1844
|
-
* Triggered for any of the following update events:
|
|
1845
|
-
*
|
|
1846
|
-
* + Order is paid for. Order Purchased is also triggered.
|
|
1847
|
-
* + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
|
|
1848
|
-
* + New payment cycle of an order starts. Order Cycle Started is also triggered.
|
|
1849
|
-
* + Offline order is marked as paid. Order Marked As Paid is also triggered.
|
|
1850
|
-
* + End date of the order is postponed. Order End Date Postponed is also triggered
|
|
1851
|
-
* + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
|
|
1852
|
-
* + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
|
|
1853
|
-
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1854
|
-
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1855
|
-
* @permissionScope Manage Orders
|
|
1856
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1857
|
-
* @permissionScope Read Orders
|
|
1858
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
1859
|
-
* @permissionScope Manage plans and orders of Pricing Plans
|
|
1860
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
1861
|
-
* @permissionScope Manage Events
|
|
1862
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1863
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1864
|
-
* @webhook
|
|
1865
|
-
* @eventType wix.pricing_plans.v2.order_updated
|
|
1866
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
1867
|
-
* @slug updated
|
|
1799
|
+
* @eventType wix.pricing_plans.v2.order_auto_renew_canceled
|
|
1800
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
1801
|
+
* @slug auto_renew_canceled
|
|
1868
1802
|
*/
|
|
1869
|
-
declare function
|
|
1870
|
-
interface
|
|
1871
|
-
data:
|
|
1803
|
+
declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
|
|
1804
|
+
interface OrderCanceledEnvelope {
|
|
1805
|
+
data: OrderCanceled;
|
|
1872
1806
|
metadata: EventMetadata;
|
|
1873
1807
|
}
|
|
1874
1808
|
/**
|
|
1875
|
-
* Triggered when an order is canceled
|
|
1809
|
+
* Triggered when an order is canceled.
|
|
1876
1810
|
*
|
|
1877
|
-
* This webhook is
|
|
1878
|
-
* +
|
|
1879
|
-
* +
|
|
1811
|
+
* This webhook is triggered either immediately or at the end of the current payment cycle, as follows:
|
|
1812
|
+
* + If the order is canceled and `effectiveAt` is set to `IMMEDIATELY`, the webhook is triggered immediately when canceled.
|
|
1813
|
+
* + 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.
|
|
1880
1814
|
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
1881
1815
|
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
1882
1816
|
* @permissionScope Manage Orders
|
|
@@ -1889,11 +1823,11 @@ interface OrderAutoRenewCanceledEnvelope {
|
|
|
1889
1823
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1890
1824
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1891
1825
|
* @webhook
|
|
1892
|
-
* @eventType wix.pricing_plans.v2.
|
|
1826
|
+
* @eventType wix.pricing_plans.v2.order_canceled
|
|
1893
1827
|
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
1894
|
-
* @slug
|
|
1828
|
+
* @slug canceled
|
|
1895
1829
|
*/
|
|
1896
|
-
declare function
|
|
1830
|
+
declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
|
|
1897
1831
|
interface OrderCycleStartedEnvelope {
|
|
1898
1832
|
data: OrderCycleStarted;
|
|
1899
1833
|
metadata: EventMetadata;
|
|
@@ -2088,19 +2022,95 @@ interface OrderStartedEnvelope {
|
|
|
2088
2022
|
* @slug started
|
|
2089
2023
|
*/
|
|
2090
2024
|
declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
|
|
2025
|
+
interface OrderUpdatedEnvelope {
|
|
2026
|
+
entity: Order;
|
|
2027
|
+
metadata: EventMetadata;
|
|
2028
|
+
}
|
|
2091
2029
|
/**
|
|
2092
|
-
*
|
|
2030
|
+
* Triggered for any of the following update events:
|
|
2031
|
+
*
|
|
2032
|
+
* + Order is paid for. Order Purchased is also triggered.
|
|
2033
|
+
* + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
|
|
2034
|
+
* + New payment cycle of an order starts. Order Cycle Started is also triggered.
|
|
2035
|
+
* + Offline order is marked as paid. Order Marked As Paid is also triggered.
|
|
2036
|
+
* + End date of the order is postponed. Order End Date Postponed is also triggered
|
|
2037
|
+
* + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
|
|
2038
|
+
* + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
|
|
2039
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
2040
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
2041
|
+
* @permissionScope Manage Orders
|
|
2042
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2043
|
+
* @permissionScope Read Orders
|
|
2044
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
2045
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
2046
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
2047
|
+
* @permissionScope Manage Events
|
|
2048
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2049
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2050
|
+
* @webhook
|
|
2051
|
+
* @eventType wix.pricing_plans.v2.order_updated
|
|
2052
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
2053
|
+
* @slug updated
|
|
2054
|
+
*/
|
|
2055
|
+
declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
|
|
2056
|
+
interface OrderCreatedEnvelope {
|
|
2057
|
+
entity: Order;
|
|
2058
|
+
metadata: EventMetadata;
|
|
2059
|
+
}
|
|
2060
|
+
/**
|
|
2061
|
+
* Triggered when an order is created.
|
|
2062
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
2063
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
2064
|
+
* @permissionScope Manage Orders
|
|
2065
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2066
|
+
* @permissionScope Read Orders
|
|
2067
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
2068
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
2069
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
2070
|
+
* @permissionScope Manage Events
|
|
2071
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2072
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2073
|
+
* @webhook
|
|
2074
|
+
* @eventType wix.pricing_plans.v2.order_created
|
|
2075
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
2076
|
+
* @slug created
|
|
2077
|
+
*/
|
|
2078
|
+
declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
|
|
2079
|
+
interface OrderStartDateChangedEnvelope {
|
|
2080
|
+
data: OrderStartDateChanged;
|
|
2081
|
+
metadata: EventMetadata;
|
|
2082
|
+
}
|
|
2083
|
+
/**
|
|
2084
|
+
* Triggered when an order's `startDate` is changed.
|
|
2085
|
+
* @permissionScope Manage_Wix_Rentals_App_Forms_submissions
|
|
2086
|
+
* @permissionScopeId SCOPE.RENTALS.MANAGE
|
|
2087
|
+
* @permissionScope Manage Orders
|
|
2088
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2089
|
+
* @permissionScope Read Orders
|
|
2090
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
2091
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
2092
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
2093
|
+
* @permissionScope Manage Events
|
|
2094
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2095
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2096
|
+
* @webhook
|
|
2097
|
+
* @eventType wix.pricing_plans.v2.order_start_date_changed
|
|
2098
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
2099
|
+
* @slug start_date_changed
|
|
2100
|
+
*/
|
|
2101
|
+
declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
|
|
2102
|
+
/**
|
|
2103
|
+
* Retrieves an order by ID.
|
|
2093
2104
|
* @param _id - Order ID.
|
|
2094
2105
|
* @public
|
|
2095
2106
|
* @requiredField _id
|
|
2096
|
-
* @param options - Options
|
|
2097
|
-
* @permissionId PRICING_PLANS.
|
|
2107
|
+
* @param options - Options to use when getting an order.
|
|
2108
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2098
2109
|
* @applicableIdentity APP
|
|
2099
|
-
* @
|
|
2100
|
-
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.GetOrder
|
|
2110
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
|
|
2101
2111
|
*/
|
|
2102
|
-
declare function
|
|
2103
|
-
interface
|
|
2112
|
+
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>>;
|
|
2113
|
+
interface ManagementGetOrderOptions {
|
|
2104
2114
|
/**
|
|
2105
2115
|
* Predefined set of fields to return.
|
|
2106
2116
|
*
|
|
@@ -2109,36 +2119,51 @@ interface MemberGetOrderOptions {
|
|
|
2109
2119
|
fieldSet?: SetWithLiterals;
|
|
2110
2120
|
}
|
|
2111
2121
|
/**
|
|
2112
|
-
* Retrieves a list of up to
|
|
2122
|
+
* Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
|
|
2123
|
+
*
|
|
2124
|
+
* By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
|
|
2125
|
+
* `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
|
|
2113
2126
|
* @public
|
|
2114
2127
|
* @param options - Filtering, sorting, and pagination options.
|
|
2115
|
-
* @permissionId PRICING_PLANS.
|
|
2128
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2116
2129
|
* @applicableIdentity APP
|
|
2117
|
-
* @
|
|
2118
|
-
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.ListOrders
|
|
2130
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
|
|
2119
2131
|
*/
|
|
2120
|
-
declare function
|
|
2121
|
-
interface
|
|
2132
|
+
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>>;
|
|
2133
|
+
interface ManagementListOrdersOptions {
|
|
2122
2134
|
/**
|
|
2123
|
-
* Filter by
|
|
2135
|
+
* Filter by a buyer's member ID, from the Members API.
|
|
2136
|
+
* @format GUID
|
|
2137
|
+
*/
|
|
2138
|
+
buyerIds?: string[];
|
|
2139
|
+
/**
|
|
2140
|
+
* Filter by plan IDs, from the Plans API.
|
|
2124
2141
|
* @format GUID
|
|
2125
2142
|
*/
|
|
2126
2143
|
planIds?: string[];
|
|
2127
|
-
/** Filter
|
|
2144
|
+
/** Filter by whether or not the auto-renewal of recurring orders was canceled. */
|
|
2128
2145
|
autoRenewCanceled?: boolean | null;
|
|
2129
2146
|
/** Filter by order status. */
|
|
2130
2147
|
orderStatuses?: OrderStatusWithLiterals[];
|
|
2131
2148
|
/** Filter by payment status. */
|
|
2132
2149
|
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
2133
2150
|
/**
|
|
2134
|
-
*
|
|
2151
|
+
* Number of orders to return. See Sorting and Paging for more information.
|
|
2152
|
+
*
|
|
2153
|
+
* Max: `50`
|
|
2135
2154
|
* @min 1
|
|
2136
2155
|
* @max 50
|
|
2137
2156
|
*/
|
|
2138
2157
|
limit?: number | null;
|
|
2139
|
-
/** Number of
|
|
2158
|
+
/** Number of orders to skip in the current sort order. */
|
|
2140
2159
|
offset?: number | null;
|
|
2141
|
-
/**
|
|
2160
|
+
/**
|
|
2161
|
+
* Sort order.
|
|
2162
|
+
*
|
|
2163
|
+
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
2164
|
+
*
|
|
2165
|
+
* Default: `DESC`.
|
|
2166
|
+
*/
|
|
2142
2167
|
sorting?: Sorting;
|
|
2143
2168
|
/**
|
|
2144
2169
|
* Predefined set of fields to return.
|
|
@@ -2148,26 +2173,106 @@ interface MemberListOrdersOptions {
|
|
|
2148
2173
|
fieldSet?: SetWithLiterals;
|
|
2149
2174
|
}
|
|
2150
2175
|
/**
|
|
2151
|
-
*
|
|
2176
|
+
* 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.
|
|
2152
2177
|
*
|
|
2153
|
-
*
|
|
2178
|
+
* New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
|
|
2179
|
+
* Can't postpone an order with `status`: `PAUSED`.
|
|
2180
|
+
* @param _id - Order ID.
|
|
2181
|
+
* @param endDate - New end date and time.
|
|
2154
2182
|
*
|
|
2155
|
-
*
|
|
2183
|
+
* Must be later than the current end date and time.
|
|
2184
|
+
* @public
|
|
2185
|
+
* @requiredField _id
|
|
2186
|
+
* @requiredField endDate
|
|
2187
|
+
* @param options - Options for postponing the end date of an order.
|
|
2188
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2189
|
+
* @applicableIdentity APP
|
|
2190
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
|
|
2191
|
+
*/
|
|
2192
|
+
declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
|
|
2193
|
+
/**
|
|
2194
|
+
* Cancels an existing order.
|
|
2156
2195
|
*
|
|
2157
|
-
*
|
|
2158
|
-
*
|
|
2196
|
+
* For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
|
|
2197
|
+
* For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
|
|
2198
|
+
*
|
|
2199
|
+
* #### Canceling during the free trial period.
|
|
2200
|
+
*
|
|
2201
|
+
* When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
|
|
2202
|
+
* of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
|
|
2203
|
+
* of the free trial period.
|
|
2204
|
+
*
|
|
2205
|
+
* When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
|
|
2206
|
+
* `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
|
|
2207
|
+
* immediately, even during the free trial period and the buyer won't be billed. Canceling at the
|
|
2208
|
+
* `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
|
|
2209
|
+
* Then, the subscription ends and the buyer is not billed.
|
|
2159
2210
|
* @param _id - Order ID.
|
|
2160
|
-
* @param effectiveAt -
|
|
2211
|
+
* @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
|
|
2161
2212
|
* @public
|
|
2162
2213
|
* @requiredField _id
|
|
2163
2214
|
* @requiredField effectiveAt
|
|
2164
|
-
* @param options - Options for
|
|
2165
|
-
* @permissionId PRICING_PLANS.
|
|
2215
|
+
* @param options - Options for canceling orders.
|
|
2216
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2166
2217
|
* @applicableIdentity APP
|
|
2167
|
-
* @
|
|
2168
|
-
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.RequestCancellation
|
|
2218
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
|
|
2169
2219
|
*/
|
|
2170
|
-
declare function
|
|
2220
|
+
declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
|
|
2221
|
+
/**
|
|
2222
|
+
* Marks an offline order as paid.
|
|
2223
|
+
* > __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.
|
|
2224
|
+
*
|
|
2225
|
+
* Marking an offline order as paid causes the following changes:
|
|
2226
|
+
* - The order's `lastPaymentStatus` changes to `"PAID"`.
|
|
2227
|
+
* - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
|
|
2228
|
+
*
|
|
2229
|
+
* An error occurs if you attempt to:
|
|
2230
|
+
* - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
|
|
2231
|
+
* - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
|
|
2232
|
+
* @param _id - Order ID.
|
|
2233
|
+
* @public
|
|
2234
|
+
* @requiredField _id
|
|
2235
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2236
|
+
* @applicableIdentity APP
|
|
2237
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
|
|
2238
|
+
*/
|
|
2239
|
+
declare function markAsPaid(_id: string): Promise<void>;
|
|
2240
|
+
/**
|
|
2241
|
+
* Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
|
|
2242
|
+
*
|
|
2243
|
+
* Only orders with `status`: `ACTIVE` can be paused.
|
|
2244
|
+
* For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
|
|
2245
|
+
* Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
|
|
2246
|
+
* The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
|
|
2247
|
+
*
|
|
2248
|
+
* To resume a paused order, call Resume Order.
|
|
2249
|
+
* @param _id - Order ID.
|
|
2250
|
+
* @public
|
|
2251
|
+
* @requiredField _id
|
|
2252
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2253
|
+
* @applicableIdentity APP
|
|
2254
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
|
|
2255
|
+
*/
|
|
2256
|
+
declare function pauseOrder(_id: string): Promise<void>;
|
|
2257
|
+
/**
|
|
2258
|
+
* Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
|
|
2259
|
+
*
|
|
2260
|
+
* Resuming an order causes the following changes:
|
|
2261
|
+
* - The order status changes to `"ACTIVE"`.
|
|
2262
|
+
* - The `pausePeriods` array is updated.
|
|
2263
|
+
* - The `endDate` for the order is adjusted to include the pause period.
|
|
2264
|
+
* - For orders with recurring payments, the payment schedule is restarted.
|
|
2265
|
+
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
|
|
2266
|
+
*
|
|
2267
|
+
* To pause an order, call Pause Order.
|
|
2268
|
+
* @param _id - Order ID.
|
|
2269
|
+
* @public
|
|
2270
|
+
* @requiredField _id
|
|
2271
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2272
|
+
* @applicableIdentity APP
|
|
2273
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
|
|
2274
|
+
*/
|
|
2275
|
+
declare function resumeOrder(_id: string): Promise<void>;
|
|
2171
2276
|
/**
|
|
2172
2277
|
* Creates an online order for a site member.
|
|
2173
2278
|
*
|
|
@@ -2363,18 +2468,19 @@ interface GetPricePreviewOptions {
|
|
|
2363
2468
|
couponCode?: string | null;
|
|
2364
2469
|
}
|
|
2365
2470
|
/**
|
|
2366
|
-
* Retrieves an order by ID.
|
|
2471
|
+
* Retrieves an order for the currently logged-in member by ID.
|
|
2367
2472
|
* @param _id - Order ID.
|
|
2368
2473
|
* @public
|
|
2369
2474
|
* @requiredField _id
|
|
2370
|
-
* @param options - Options
|
|
2371
|
-
* @permissionId PRICING_PLANS.
|
|
2475
|
+
* @param options - Options for getting a logged-in member's order.
|
|
2476
|
+
* @permissionId PRICING_PLANS.READ_OWN_ORDERS
|
|
2372
2477
|
* @applicableIdentity APP
|
|
2373
|
-
* @
|
|
2374
|
-
* @
|
|
2478
|
+
* @applicableIdentity MEMBER
|
|
2479
|
+
* @returns Requested order.
|
|
2480
|
+
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.GetOrder
|
|
2375
2481
|
*/
|
|
2376
|
-
declare function
|
|
2377
|
-
interface
|
|
2482
|
+
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>>;
|
|
2483
|
+
interface MemberGetOrderOptions {
|
|
2378
2484
|
/**
|
|
2379
2485
|
* Predefined set of fields to return.
|
|
2380
2486
|
*
|
|
@@ -2383,51 +2489,36 @@ interface ManagementGetOrderOptions {
|
|
|
2383
2489
|
fieldSet?: SetWithLiterals;
|
|
2384
2490
|
}
|
|
2385
2491
|
/**
|
|
2386
|
-
* Retrieves a list of up to
|
|
2387
|
-
*
|
|
2388
|
-
* By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
|
|
2389
|
-
* `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
|
|
2492
|
+
* Retrieves a list of up to 100 pricing plan orders for currently logged-in member.
|
|
2390
2493
|
* @public
|
|
2391
2494
|
* @param options - Filtering, sorting, and pagination options.
|
|
2392
|
-
* @permissionId PRICING_PLANS.
|
|
2495
|
+
* @permissionId PRICING_PLANS.READ_OWN_ORDERS
|
|
2393
2496
|
* @applicableIdentity APP
|
|
2394
|
-
* @
|
|
2497
|
+
* @applicableIdentity MEMBER
|
|
2498
|
+
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.ListOrders
|
|
2395
2499
|
*/
|
|
2396
|
-
declare function
|
|
2397
|
-
interface
|
|
2398
|
-
/**
|
|
2399
|
-
* Filter by a buyer's member ID, from the Members API.
|
|
2400
|
-
* @format GUID
|
|
2401
|
-
*/
|
|
2402
|
-
buyerIds?: string[];
|
|
2500
|
+
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>>;
|
|
2501
|
+
interface MemberListOrdersOptions {
|
|
2403
2502
|
/**
|
|
2404
|
-
* Filter by plan IDs
|
|
2503
|
+
* Filter by plan IDs.
|
|
2405
2504
|
* @format GUID
|
|
2406
2505
|
*/
|
|
2407
2506
|
planIds?: string[];
|
|
2408
|
-
/** Filter
|
|
2507
|
+
/** Filter for orders where auto renewal was canceled. */
|
|
2409
2508
|
autoRenewCanceled?: boolean | null;
|
|
2410
2509
|
/** Filter by order status. */
|
|
2411
2510
|
orderStatuses?: OrderStatusWithLiterals[];
|
|
2412
2511
|
/** Filter by payment status. */
|
|
2413
2512
|
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
2414
2513
|
/**
|
|
2415
|
-
*
|
|
2416
|
-
*
|
|
2417
|
-
* Max: `50`
|
|
2514
|
+
* Limit the number of pricing plans returned. Default limit is 50.
|
|
2418
2515
|
* @min 1
|
|
2419
2516
|
* @max 50
|
|
2420
2517
|
*/
|
|
2421
2518
|
limit?: number | null;
|
|
2422
|
-
/** Number of
|
|
2519
|
+
/** Number of entries to offset. */
|
|
2423
2520
|
offset?: number | null;
|
|
2424
|
-
/**
|
|
2425
|
-
* Sort order.
|
|
2426
|
-
*
|
|
2427
|
-
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
2428
|
-
*
|
|
2429
|
-
* Default: `DESC`.
|
|
2430
|
-
*/
|
|
2521
|
+
/** Sorting direction (defaults to ASC) and field to sort by. */
|
|
2431
2522
|
sorting?: Sorting;
|
|
2432
2523
|
/**
|
|
2433
2524
|
* Predefined set of fields to return.
|
|
@@ -2437,105 +2528,25 @@ interface ManagementListOrdersOptions {
|
|
|
2437
2528
|
fieldSet?: SetWithLiterals;
|
|
2438
2529
|
}
|
|
2439
2530
|
/**
|
|
2440
|
-
*
|
|
2441
|
-
*
|
|
2442
|
-
* New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
|
|
2443
|
-
* Can't postpone an order with `status`: `PAUSED`.
|
|
2444
|
-
* @param _id - Order ID.
|
|
2445
|
-
* @param endDate - New end date and time.
|
|
2446
|
-
*
|
|
2447
|
-
* Must be later than the current end date and time.
|
|
2448
|
-
* @public
|
|
2449
|
-
* @requiredField _id
|
|
2450
|
-
* @requiredField endDate
|
|
2451
|
-
* @param options - Options for postponing the end date of an order.
|
|
2452
|
-
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2453
|
-
* @applicableIdentity APP
|
|
2454
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
|
|
2455
|
-
*/
|
|
2456
|
-
declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
|
|
2457
|
-
/**
|
|
2458
|
-
* Cancels an existing order.
|
|
2459
|
-
*
|
|
2460
|
-
* For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
|
|
2461
|
-
* For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
|
|
2531
|
+
* Cancels an order. Recurring orders can be canceled either immediately or at the next payment date. One time orders can only be canceled immediately.
|
|
2462
2532
|
*
|
|
2463
|
-
*
|
|
2533
|
+
* 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.
|
|
2464
2534
|
*
|
|
2465
|
-
* When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
|
|
2466
|
-
* of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
|
|
2467
|
-
* of the free trial period.
|
|
2535
|
+
* 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.
|
|
2468
2536
|
*
|
|
2469
|
-
*
|
|
2470
|
-
*
|
|
2471
|
-
* immediately, even during the free trial period and the buyer won't be billed. Canceling at the
|
|
2472
|
-
* `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
|
|
2473
|
-
* Then, the subscription ends and the buyer is not billed.
|
|
2537
|
+
* >**Note:**
|
|
2538
|
+
* >This method requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
|
|
2474
2539
|
* @param _id - Order ID.
|
|
2475
|
-
* @param effectiveAt -
|
|
2540
|
+
* @param effectiveAt - Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately.
|
|
2476
2541
|
* @public
|
|
2477
2542
|
* @requiredField _id
|
|
2478
2543
|
* @requiredField effectiveAt
|
|
2479
|
-
* @param options - Options for
|
|
2480
|
-
* @permissionId PRICING_PLANS.
|
|
2481
|
-
* @applicableIdentity APP
|
|
2482
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
|
|
2483
|
-
*/
|
|
2484
|
-
declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
|
|
2485
|
-
/**
|
|
2486
|
-
* Marks an offline order as paid.
|
|
2487
|
-
* > __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.
|
|
2488
|
-
*
|
|
2489
|
-
* Marking an offline order as paid causes the following changes:
|
|
2490
|
-
* - The order's `lastPaymentStatus` changes to `"PAID"`.
|
|
2491
|
-
* - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
|
|
2492
|
-
*
|
|
2493
|
-
* An error occurs if you attempt to:
|
|
2494
|
-
* - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
|
|
2495
|
-
* - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
|
|
2496
|
-
* @param _id - Order ID.
|
|
2497
|
-
* @public
|
|
2498
|
-
* @requiredField _id
|
|
2499
|
-
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2500
|
-
* @applicableIdentity APP
|
|
2501
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
|
|
2502
|
-
*/
|
|
2503
|
-
declare function markAsPaid(_id: string): Promise<void>;
|
|
2504
|
-
/**
|
|
2505
|
-
* Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
|
|
2506
|
-
*
|
|
2507
|
-
* Only orders with `status`: `ACTIVE` can be paused.
|
|
2508
|
-
* For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
|
|
2509
|
-
* Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
|
|
2510
|
-
* The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
|
|
2511
|
-
*
|
|
2512
|
-
* To resume a paused order, call Resume Order.
|
|
2513
|
-
* @param _id - Order ID.
|
|
2514
|
-
* @public
|
|
2515
|
-
* @requiredField _id
|
|
2516
|
-
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2517
|
-
* @applicableIdentity APP
|
|
2518
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
|
|
2519
|
-
*/
|
|
2520
|
-
declare function pauseOrder(_id: string): Promise<void>;
|
|
2521
|
-
/**
|
|
2522
|
-
* Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
|
|
2523
|
-
*
|
|
2524
|
-
* Resuming an order causes the following changes:
|
|
2525
|
-
* - The order status changes to `"ACTIVE"`.
|
|
2526
|
-
* - The `pausePeriods` array is updated.
|
|
2527
|
-
* - The `endDate` for the order is adjusted to include the pause period.
|
|
2528
|
-
* - For orders with recurring payments, the payment schedule is restarted.
|
|
2529
|
-
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
|
|
2530
|
-
*
|
|
2531
|
-
* To pause an order, call Pause Order.
|
|
2532
|
-
* @param _id - Order ID.
|
|
2533
|
-
* @public
|
|
2534
|
-
* @requiredField _id
|
|
2535
|
-
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2544
|
+
* @param options - Options for requesting a cancellation.
|
|
2545
|
+
* @permissionId PRICING_PLANS.MANAGE_OWN_ORDERS
|
|
2536
2546
|
* @applicableIdentity APP
|
|
2537
|
-
* @
|
|
2547
|
+
* @applicableIdentity MEMBER
|
|
2548
|
+
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.RequestCancellation
|
|
2538
2549
|
*/
|
|
2539
|
-
declare function
|
|
2550
|
+
declare function requestCancellation(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
|
|
2540
2551
|
|
|
2541
|
-
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 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 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, 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 };
|
|
2552
|
+
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AddressLocation, 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 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 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, 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 };
|