@wix/auto_sdk_pricing-plans_orders 1.0.89 → 1.0.90
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 +153 -153
- package/build/cjs/index.js +711 -711
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +799 -799
- package/build/cjs/index.typings.js +577 -577
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +459 -459
- package/build/cjs/meta.js +403 -403
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +153 -153
- package/build/es/index.mjs +711 -711
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +799 -799
- package/build/es/index.typings.mjs +577 -577
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +459 -459
- package/build/es/meta.mjs +403 -403
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +153 -153
- package/build/internal/cjs/index.js +711 -711
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +799 -799
- package/build/internal/cjs/index.typings.js +577 -577
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +459 -459
- package/build/internal/cjs/meta.js +403 -403
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +153 -153
- package/build/internal/es/index.mjs +711 -711
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +799 -799
- package/build/internal/es/index.typings.mjs +577 -577
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +459 -459
- package/build/internal/es/meta.mjs +403 -403
- package/build/internal/es/meta.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.
|
|
@@ -1087,93 +883,16 @@ declare enum WebhookIdentityType {
|
|
|
1087
883
|
}
|
|
1088
884
|
/** @enumType */
|
|
1089
885
|
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
1090
|
-
interface
|
|
886
|
+
interface CreateOnlineOrderRequest {
|
|
1091
887
|
/**
|
|
1092
|
-
*
|
|
888
|
+
* Plan ID.
|
|
1093
889
|
* @format GUID
|
|
1094
890
|
*/
|
|
1095
|
-
|
|
891
|
+
planId: string;
|
|
1096
892
|
/**
|
|
1097
|
-
*
|
|
893
|
+
* Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
|
|
1098
894
|
*
|
|
1099
|
-
* Default:
|
|
1100
|
-
*/
|
|
1101
|
-
fieldSet?: SetWithLiterals;
|
|
1102
|
-
}
|
|
1103
|
-
interface MemberGetOrderResponse {
|
|
1104
|
-
/** Requested order. */
|
|
1105
|
-
order?: Order;
|
|
1106
|
-
}
|
|
1107
|
-
interface MemberListOrdersRequest {
|
|
1108
|
-
/**
|
|
1109
|
-
* Filter by plan IDs.
|
|
1110
|
-
* @format GUID
|
|
1111
|
-
*/
|
|
1112
|
-
planIds?: string[];
|
|
1113
|
-
/** Filter for orders where auto renewal was canceled. */
|
|
1114
|
-
autoRenewCanceled?: boolean | null;
|
|
1115
|
-
/** Filter by order status. */
|
|
1116
|
-
orderStatuses?: OrderStatusWithLiterals[];
|
|
1117
|
-
/** Filter by payment status. */
|
|
1118
|
-
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
1119
|
-
/**
|
|
1120
|
-
* Limit the number of pricing plans returned. Default limit is 50.
|
|
1121
|
-
* @min 1
|
|
1122
|
-
* @max 50
|
|
1123
|
-
*/
|
|
1124
|
-
limit?: number | null;
|
|
1125
|
-
/** Number of entries to offset. */
|
|
1126
|
-
offset?: number | null;
|
|
1127
|
-
/** Sorting direction (defaults to ASC) and field to sort by. */
|
|
1128
|
-
sorting?: Sorting;
|
|
1129
|
-
/**
|
|
1130
|
-
* Predefined set of fields to return.
|
|
1131
|
-
*
|
|
1132
|
-
* Default: If `fieldSet` is omitted, no order form submission data is returned.
|
|
1133
|
-
*/
|
|
1134
|
-
fieldSet?: SetWithLiterals;
|
|
1135
|
-
}
|
|
1136
|
-
interface MemberListOrdersResponse {
|
|
1137
|
-
/** Requested orders. */
|
|
1138
|
-
orders?: Order[];
|
|
1139
|
-
/** Object containing paging-related data (number of orders returned, offset). */
|
|
1140
|
-
pagingMetadata?: PagingMetadataV2;
|
|
1141
|
-
}
|
|
1142
|
-
/**
|
|
1143
|
-
* TODO: Write orders filter and sort docs page
|
|
1144
|
-
* Retrieves a list of up to 1,000 orders, based on the provided paging, sorting, and filtering.
|
|
1145
|
-
*/
|
|
1146
|
-
interface QueryOrdersRequest {
|
|
1147
|
-
/** Query filter. */
|
|
1148
|
-
query?: QueryV2;
|
|
1149
|
-
}
|
|
1150
|
-
interface QueryOrdersResponse {
|
|
1151
|
-
/** Order data. */
|
|
1152
|
-
plans?: Order[];
|
|
1153
|
-
/** Paging-related data (number of orders returned, offset). */
|
|
1154
|
-
pagingMetadata?: PagingMetadataV2;
|
|
1155
|
-
}
|
|
1156
|
-
interface RequestCancellationRequest {
|
|
1157
|
-
/**
|
|
1158
|
-
* Order ID.
|
|
1159
|
-
* @format GUID
|
|
1160
|
-
*/
|
|
1161
|
-
_id: string;
|
|
1162
|
-
/** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
|
|
1163
|
-
effectiveAt: CancellationEffectiveAtWithLiterals;
|
|
1164
|
-
}
|
|
1165
|
-
interface RequestCancellationResponse {
|
|
1166
|
-
}
|
|
1167
|
-
interface CreateOnlineOrderRequest {
|
|
1168
|
-
/**
|
|
1169
|
-
* Plan ID.
|
|
1170
|
-
* @format GUID
|
|
1171
|
-
*/
|
|
1172
|
-
planId: string;
|
|
1173
|
-
/**
|
|
1174
|
-
* Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
|
|
1175
|
-
*
|
|
1176
|
-
* Default: Current date and time.
|
|
895
|
+
* Default: Current date and time.
|
|
1177
896
|
*/
|
|
1178
897
|
startDate?: Date | null;
|
|
1179
898
|
/**
|
|
@@ -1467,185 +1186,466 @@ interface SetSubmissionResponse {
|
|
|
1467
1186
|
/** Order with submission id */
|
|
1468
1187
|
order?: Order;
|
|
1469
1188
|
}
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
data
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1189
|
+
interface OrderPurchased {
|
|
1190
|
+
/** Order that was paid for. If a free or an offline order, the order that was created. */
|
|
1191
|
+
order?: Order;
|
|
1192
|
+
}
|
|
1193
|
+
interface OrderStarted {
|
|
1194
|
+
/** Order that reached its `startDate`. */
|
|
1195
|
+
order?: Order;
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Triggered at the start of a new payment cycle for an existing order.
|
|
1199
|
+
*
|
|
1200
|
+
* This webhook does not trigger at the initial start of an offline order.
|
|
1201
|
+
*/
|
|
1202
|
+
interface OrderCycleStarted {
|
|
1203
|
+
/** Order whose new cycle started. */
|
|
1204
|
+
order?: Order;
|
|
1205
|
+
/** Number of the payment cycle will be 0 when the order is in the free trial period. In other cases, the cycle number starts from 1. */
|
|
1206
|
+
cycleNumber?: number;
|
|
1207
|
+
}
|
|
1208
|
+
/** Emitted when a recurring order is canceled for the next payment cycle */
|
|
1209
|
+
interface OrderAutoRenewCanceled {
|
|
1210
|
+
/** Order that is canceled, effective at the end of the current payment cycle. */
|
|
1211
|
+
order?: Order;
|
|
1212
|
+
}
|
|
1213
|
+
interface OrderEnded {
|
|
1214
|
+
/** Order that ended. */
|
|
1215
|
+
order?: Order;
|
|
1216
|
+
}
|
|
1217
|
+
interface GetOrderRequest {
|
|
1218
|
+
/**
|
|
1219
|
+
* Order ID.
|
|
1220
|
+
* @format GUID
|
|
1221
|
+
*/
|
|
1222
|
+
_id: string;
|
|
1223
|
+
/**
|
|
1224
|
+
* Predefined set of fields to return.
|
|
1225
|
+
*
|
|
1226
|
+
* Default: If `fieldSet` is omitted, no order form submission data is returned.
|
|
1227
|
+
*/
|
|
1228
|
+
fieldSet?: SetWithLiterals;
|
|
1229
|
+
}
|
|
1230
|
+
interface GetOrderResponse {
|
|
1231
|
+
/** Order. */
|
|
1232
|
+
order?: Order;
|
|
1233
|
+
}
|
|
1234
|
+
interface ListOrdersRequest {
|
|
1235
|
+
/**
|
|
1236
|
+
* Filter by a buyer's member ID, from the Members API.
|
|
1237
|
+
* @format GUID
|
|
1238
|
+
*/
|
|
1239
|
+
buyerIds?: string[];
|
|
1240
|
+
/**
|
|
1241
|
+
* Filter by plan IDs, from the Plans API.
|
|
1242
|
+
* @format GUID
|
|
1243
|
+
*/
|
|
1244
|
+
planIds?: string[];
|
|
1245
|
+
/** Filter by whether or not the auto-renewal of recurring orders was canceled. */
|
|
1246
|
+
autoRenewCanceled?: boolean | null;
|
|
1247
|
+
/** Filter by order status. */
|
|
1248
|
+
orderStatuses?: OrderStatusWithLiterals[];
|
|
1249
|
+
/** Filter by payment status. */
|
|
1250
|
+
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
1251
|
+
/**
|
|
1252
|
+
* Number of orders to return. See Sorting and Paging for more information.
|
|
1253
|
+
*
|
|
1254
|
+
* Max: `50`
|
|
1255
|
+
* @min 1
|
|
1256
|
+
* @max 50
|
|
1257
|
+
*/
|
|
1258
|
+
limit?: number | null;
|
|
1259
|
+
/** Number of orders to skip in the current sort order. */
|
|
1260
|
+
offset?: number | null;
|
|
1261
|
+
/**
|
|
1262
|
+
* Sort order.
|
|
1263
|
+
*
|
|
1264
|
+
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
1265
|
+
*
|
|
1266
|
+
* Default: `DESC`.
|
|
1267
|
+
*/
|
|
1268
|
+
sorting?: Sorting;
|
|
1269
|
+
/**
|
|
1270
|
+
* Predefined set of fields to return.
|
|
1271
|
+
*
|
|
1272
|
+
* Default: If `fieldSet` is omitted, no order form submission data is returned.
|
|
1273
|
+
*/
|
|
1274
|
+
fieldSet?: SetWithLiterals;
|
|
1275
|
+
}
|
|
1276
|
+
interface ListOrdersResponse {
|
|
1277
|
+
/** List of orders. */
|
|
1278
|
+
orders?: Order[];
|
|
1279
|
+
/** Object containing paging-related data (number of orders returned, offset). */
|
|
1280
|
+
pagingMetadata?: PagingMetadataV2;
|
|
1281
|
+
}
|
|
1282
|
+
interface OrdersQueryOrdersRequest {
|
|
1283
|
+
/** Query filter. */
|
|
1284
|
+
query?: QueryV2;
|
|
1285
|
+
}
|
|
1286
|
+
interface OrdersQueryOrdersResponse {
|
|
1287
|
+
/** Retrieved orders. */
|
|
1288
|
+
plans?: Order[];
|
|
1289
|
+
/** Paging-related data (number of orders returned, offset). */
|
|
1290
|
+
pagingMetadata?: PagingMetadataV2;
|
|
1291
|
+
}
|
|
1292
|
+
interface GetOrdersStatsRequest {
|
|
1293
|
+
}
|
|
1294
|
+
interface GetOrdersStatsResponse {
|
|
1295
|
+
/** Total number of orders. */
|
|
1296
|
+
totalOrderCount?: number;
|
|
1297
|
+
/** Number of active orders. */
|
|
1298
|
+
activeOrderCount?: number;
|
|
1299
|
+
}
|
|
1300
|
+
interface GetAvailableOrderActionsRequest {
|
|
1301
|
+
/**
|
|
1302
|
+
* Order ID.
|
|
1303
|
+
* @format GUID
|
|
1304
|
+
*/
|
|
1305
|
+
_id?: string;
|
|
1306
|
+
}
|
|
1307
|
+
interface GetAvailableOrderActionsResponse {
|
|
1308
|
+
/** Whether the order can be suspended. */
|
|
1309
|
+
suspendable?: boolean;
|
|
1310
|
+
/** If the order cannot be suspended, a reason is returned here. */
|
|
1311
|
+
notSuspendableReason?: ReasonNotSuspendableWithLiterals;
|
|
1312
|
+
/** Whether the order can be canceled by the buyer. */
|
|
1313
|
+
cancelableByBuyer?: boolean;
|
|
1314
|
+
}
|
|
1315
|
+
declare enum ReasonNotSuspendable {
|
|
1316
|
+
/** Undefined reason. */
|
|
1317
|
+
UNDEFINED = "UNDEFINED",
|
|
1318
|
+
/** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
|
|
1319
|
+
PENDING = "PENDING",
|
|
1320
|
+
/** Trial orders can't be suspended. */
|
|
1321
|
+
TRIAL = "TRIAL",
|
|
1322
|
+
/** Canceled orders can't be suspended. */
|
|
1323
|
+
CANCELED = "CANCELED",
|
|
1324
|
+
/** Ended orders can't be suspended. */
|
|
1325
|
+
ENDED = "ENDED",
|
|
1326
|
+
/** Paid for orders with future start dates can't be suspended. */
|
|
1327
|
+
NOT_STARTED = "NOT_STARTED",
|
|
1328
|
+
/** Order is already suspended. */
|
|
1329
|
+
ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
|
|
1330
|
+
/** Orders based on recurring payments using older stripe versions can't be suspended. */
|
|
1331
|
+
OLD_STRIPE = "OLD_STRIPE"
|
|
1332
|
+
}
|
|
1333
|
+
/** @enumType */
|
|
1334
|
+
type ReasonNotSuspendableWithLiterals = ReasonNotSuspendable | 'UNDEFINED' | 'PENDING' | 'TRIAL' | 'CANCELED' | 'ENDED' | 'NOT_STARTED' | 'ALREADY_SUSPENDED' | 'OLD_STRIPE';
|
|
1335
|
+
interface PostponeEndDateRequest {
|
|
1336
|
+
/**
|
|
1337
|
+
* Order ID.
|
|
1338
|
+
* @format GUID
|
|
1339
|
+
*/
|
|
1340
|
+
_id: string;
|
|
1341
|
+
/**
|
|
1342
|
+
* New end date and time.
|
|
1343
|
+
*
|
|
1344
|
+
* Must be later than the current end date and time.
|
|
1345
|
+
*/
|
|
1346
|
+
endDate: Date | null;
|
|
1347
|
+
}
|
|
1348
|
+
interface PostponeEndDateResponse {
|
|
1349
|
+
}
|
|
1350
|
+
interface OrderEndDatePostponed {
|
|
1351
|
+
/** Order whose `endDate` was postponed. */
|
|
1352
|
+
order?: Order;
|
|
1353
|
+
}
|
|
1354
|
+
interface CancelOrderRequest {
|
|
1355
|
+
/**
|
|
1356
|
+
* Order ID.
|
|
1357
|
+
* @format GUID
|
|
1358
|
+
*/
|
|
1359
|
+
_id: string;
|
|
1360
|
+
/** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
|
|
1361
|
+
effectiveAt: CancellationEffectiveAtWithLiterals;
|
|
1362
|
+
}
|
|
1363
|
+
interface CancelOrderResponse {
|
|
1364
|
+
}
|
|
1365
|
+
interface MarkAsPaidRequest {
|
|
1366
|
+
/**
|
|
1367
|
+
* Order ID.
|
|
1368
|
+
* @format GUID
|
|
1369
|
+
*/
|
|
1370
|
+
_id: string;
|
|
1371
|
+
}
|
|
1372
|
+
interface MarkAsPaidResponse {
|
|
1373
|
+
}
|
|
1374
|
+
interface OrderMarkedAsPaid {
|
|
1375
|
+
/** Order that was marked as paid. */
|
|
1376
|
+
order?: Order;
|
|
1377
|
+
}
|
|
1378
|
+
interface PauseOrderRequest {
|
|
1379
|
+
/**
|
|
1380
|
+
* Order ID.
|
|
1381
|
+
* @format GUID
|
|
1382
|
+
*/
|
|
1383
|
+
_id: string;
|
|
1384
|
+
}
|
|
1385
|
+
interface PauseOrderResponse {
|
|
1386
|
+
}
|
|
1387
|
+
interface OrderPaused {
|
|
1388
|
+
/** Paused order. */
|
|
1389
|
+
order?: Order;
|
|
1390
|
+
}
|
|
1391
|
+
interface BulkPauseOrderRequest {
|
|
1392
|
+
/**
|
|
1393
|
+
* List of Order IDs.
|
|
1394
|
+
* @format GUID
|
|
1395
|
+
* @minSize 1
|
|
1396
|
+
* @maxSize 100
|
|
1397
|
+
*/
|
|
1398
|
+
ids?: string[];
|
|
1399
|
+
/** Set to true to return Order entity in response. */
|
|
1400
|
+
returnFullEntity?: boolean;
|
|
1401
|
+
}
|
|
1402
|
+
interface BulkPauseOrderResponse {
|
|
1403
|
+
/** Orders that were paused. */
|
|
1404
|
+
results?: BulkOrderResult[];
|
|
1405
|
+
/** Bulk action metadata. */
|
|
1406
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1407
|
+
}
|
|
1408
|
+
interface BulkOrderResult {
|
|
1409
|
+
/** Item metadata */
|
|
1410
|
+
itemMetadata?: ItemMetadata;
|
|
1411
|
+
/** The order. */
|
|
1412
|
+
order?: Order;
|
|
1413
|
+
}
|
|
1414
|
+
interface ItemMetadata {
|
|
1415
|
+
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
|
1416
|
+
_id?: string | null;
|
|
1417
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
1418
|
+
originalIndex?: number;
|
|
1419
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
1420
|
+
success?: boolean;
|
|
1421
|
+
/** Details about the error in case of failure. */
|
|
1422
|
+
error?: ApplicationError;
|
|
1423
|
+
}
|
|
1424
|
+
interface ApplicationError {
|
|
1425
|
+
/** Error code. */
|
|
1426
|
+
code?: string;
|
|
1427
|
+
/** Description of the error. */
|
|
1428
|
+
description?: string;
|
|
1429
|
+
/** Data related to the error. */
|
|
1430
|
+
data?: Record<string, any> | null;
|
|
1431
|
+
}
|
|
1432
|
+
interface BulkActionMetadata {
|
|
1433
|
+
/** Number of items that were successfully processed. */
|
|
1434
|
+
totalSuccesses?: number;
|
|
1435
|
+
/** Number of items that couldn't be processed. */
|
|
1436
|
+
totalFailures?: number;
|
|
1437
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
1438
|
+
undetailedFailures?: number;
|
|
1439
|
+
}
|
|
1440
|
+
interface ResumeOrderRequest {
|
|
1441
|
+
/**
|
|
1442
|
+
* Order ID.
|
|
1443
|
+
* @format GUID
|
|
1444
|
+
*/
|
|
1445
|
+
_id: string;
|
|
1446
|
+
}
|
|
1447
|
+
interface ResumeOrderResponse {
|
|
1448
|
+
}
|
|
1449
|
+
interface OrderResumed {
|
|
1450
|
+
/** Resumed order. */
|
|
1451
|
+
order?: Order;
|
|
1452
|
+
}
|
|
1453
|
+
interface BulkResumeOrderRequest {
|
|
1454
|
+
/**
|
|
1455
|
+
* List of Order IDs.
|
|
1456
|
+
* @format GUID
|
|
1457
|
+
* @minSize 1
|
|
1458
|
+
* @maxSize 100
|
|
1459
|
+
*/
|
|
1460
|
+
ids?: string[];
|
|
1461
|
+
/** Set to true to return Order entity in response. */
|
|
1462
|
+
returnFullEntity?: boolean;
|
|
1463
|
+
}
|
|
1464
|
+
interface BulkResumeOrderResponse {
|
|
1465
|
+
/** Orders that were resumed. */
|
|
1466
|
+
results?: BulkOrderResult[];
|
|
1467
|
+
/** Bulk action metadata. */
|
|
1468
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1469
|
+
}
|
|
1470
|
+
/** @docsIgnore */
|
|
1471
|
+
type CreateOnlineOrderApplicationErrors = {
|
|
1472
|
+
code?: 'MEMBER_REQUIRED';
|
|
1473
|
+
description?: string;
|
|
1474
|
+
data?: Record<string, any>;
|
|
1475
|
+
} | {
|
|
1476
|
+
code?: 'archived_plan';
|
|
1477
|
+
description?: string;
|
|
1478
|
+
data?: Record<string, any>;
|
|
1479
|
+
} | {
|
|
1480
|
+
code?: 'member_not_found';
|
|
1481
|
+
description?: string;
|
|
1482
|
+
data?: Record<string, any>;
|
|
1483
|
+
} | {
|
|
1484
|
+
code?: 'purchases_limit_reached';
|
|
1485
|
+
description?: string;
|
|
1486
|
+
data?: Record<string, any>;
|
|
1487
|
+
} | {
|
|
1488
|
+
code?: 'buyer_can_not_pick_future_start_date';
|
|
1489
|
+
description?: string;
|
|
1490
|
+
data?: Record<string, any>;
|
|
1491
|
+
} | {
|
|
1492
|
+
code?: 'invalid_start_date';
|
|
1493
|
+
description?: string;
|
|
1494
|
+
data?: Record<string, any>;
|
|
1495
|
+
} | {
|
|
1496
|
+
code?: 'accept_payment_feature_missing';
|
|
1497
|
+
description?: string;
|
|
1498
|
+
data?: Record<string, any>;
|
|
1499
|
+
} | {
|
|
1500
|
+
code?: 'meta_site_id_missing';
|
|
1501
|
+
description?: string;
|
|
1502
|
+
data?: Record<string, any>;
|
|
1503
|
+
} | {
|
|
1504
|
+
code?: 'ERROR_COUPON_IS_DISABLED';
|
|
1505
|
+
description?: string;
|
|
1506
|
+
data?: CouponsError;
|
|
1507
|
+
} | {
|
|
1508
|
+
code?: 'ERROR_COUPON_USAGE_EXCEEDED';
|
|
1509
|
+
description?: string;
|
|
1510
|
+
data?: CouponsError;
|
|
1511
|
+
} | {
|
|
1512
|
+
code?: 'ERROR_COUPON_LIMIT_PER_CUSTOMER_EXCEEDED';
|
|
1513
|
+
description?: string;
|
|
1514
|
+
data?: CouponsError;
|
|
1515
|
+
} | {
|
|
1516
|
+
code?: 'ERROR_COUPON_IS_NOT_ACTIVE_YET';
|
|
1517
|
+
description?: string;
|
|
1518
|
+
data?: CouponsError;
|
|
1519
|
+
} | {
|
|
1520
|
+
code?: 'ERROR_COUPON_HAS_EXPIRED';
|
|
1521
|
+
description?: string;
|
|
1522
|
+
data?: CouponsError;
|
|
1523
|
+
} | {
|
|
1524
|
+
code?: 'ERROR_COUPON_DOES_NOT_EXIST';
|
|
1525
|
+
description?: string;
|
|
1526
|
+
data?: CouponsError;
|
|
1527
|
+
} | {
|
|
1528
|
+
code?: 'ERROR_COUPON_NOT_APPLICABLE_FOR_PLAN';
|
|
1529
|
+
description?: string;
|
|
1530
|
+
data?: CouponsError;
|
|
1531
|
+
} | {
|
|
1532
|
+
code?: 'ERROR_INVALID_SUBTOTAL';
|
|
1533
|
+
description?: string;
|
|
1534
|
+
data?: CouponsError;
|
|
1535
|
+
} | {
|
|
1536
|
+
code?: 'undefined_not_allowed';
|
|
1537
|
+
description?: string;
|
|
1538
|
+
data?: Record<string, any>;
|
|
1539
|
+
} | {
|
|
1540
|
+
code?: 'MISSING_BUSINESS_ADDRESS_COUNTRY';
|
|
1541
|
+
description?: string;
|
|
1542
|
+
data?: Record<string, any>;
|
|
1543
|
+
} | {
|
|
1544
|
+
code?: 'MISSING_BUSINESS_ADDRESS_STATE';
|
|
1545
|
+
description?: string;
|
|
1546
|
+
data?: Record<string, any>;
|
|
1547
|
+
};
|
|
1548
|
+
/** @docsIgnore */
|
|
1549
|
+
type CreateOnlineOrderValidationErrors = {
|
|
1550
|
+
ruleName?: 'UNKNOWN_ORDER_METHOD';
|
|
1551
|
+
} | {
|
|
1552
|
+
ruleName?: 'RECURRING_POS_UNSUPPORTED';
|
|
1553
|
+
} | {
|
|
1554
|
+
ruleName?: 'invalid_sort_field';
|
|
1555
|
+
};
|
|
1556
|
+
/** @docsIgnore */
|
|
1557
|
+
type CreateOfflineOrderApplicationErrors = {
|
|
1558
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
1559
|
+
description?: string;
|
|
1560
|
+
data?: Record<string, any>;
|
|
1561
|
+
} | {
|
|
1562
|
+
code?: 'meta_site_id_missing';
|
|
1563
|
+
description?: string;
|
|
1564
|
+
data?: Record<string, any>;
|
|
1565
|
+
} | {
|
|
1566
|
+
code?: 'ERROR_COUPON_IS_DISABLED';
|
|
1567
|
+
description?: string;
|
|
1568
|
+
data?: CouponsError;
|
|
1569
|
+
} | {
|
|
1570
|
+
code?: 'ERROR_COUPON_USAGE_EXCEEDED';
|
|
1571
|
+
description?: string;
|
|
1572
|
+
data?: CouponsError;
|
|
1573
|
+
} | {
|
|
1574
|
+
code?: 'ERROR_COUPON_LIMIT_PER_CUSTOMER_EXCEEDED';
|
|
1575
|
+
description?: string;
|
|
1576
|
+
data?: CouponsError;
|
|
1577
|
+
} | {
|
|
1578
|
+
code?: 'ERROR_COUPON_IS_NOT_ACTIVE_YET';
|
|
1579
|
+
description?: string;
|
|
1580
|
+
data?: CouponsError;
|
|
1581
|
+
} | {
|
|
1582
|
+
code?: 'ERROR_COUPON_HAS_EXPIRED';
|
|
1583
|
+
description?: string;
|
|
1584
|
+
data?: CouponsError;
|
|
1585
|
+
} | {
|
|
1586
|
+
code?: 'ERROR_COUPON_DOES_NOT_EXIST';
|
|
1587
|
+
description?: string;
|
|
1588
|
+
data?: CouponsError;
|
|
1589
|
+
} | {
|
|
1590
|
+
code?: 'ERROR_COUPON_NOT_APPLICABLE_FOR_PLAN';
|
|
1591
|
+
description?: string;
|
|
1592
|
+
data?: CouponsError;
|
|
1593
|
+
} | {
|
|
1594
|
+
code?: 'ERROR_INVALID_SUBTOTAL';
|
|
1595
|
+
description?: string;
|
|
1596
|
+
data?: CouponsError;
|
|
1597
|
+
} | {
|
|
1598
|
+
code?: 'undefined_not_allowed';
|
|
1599
|
+
description?: string;
|
|
1600
|
+
data?: Record<string, any>;
|
|
1601
|
+
} | {
|
|
1602
|
+
code?: 'MISSING_BUSINESS_ADDRESS_COUNTRY';
|
|
1603
|
+
description?: string;
|
|
1604
|
+
data?: Record<string, any>;
|
|
1605
|
+
} | {
|
|
1606
|
+
code?: 'MISSING_BUSINESS_ADDRESS_STATE';
|
|
1607
|
+
description?: string;
|
|
1608
|
+
data?: Record<string, any>;
|
|
1609
|
+
};
|
|
1610
|
+
/** @docsIgnore */
|
|
1611
|
+
type CreateOfflineOrderValidationErrors = {
|
|
1612
|
+
ruleName?: 'MEMBER_DOESNT_EXIST';
|
|
1613
|
+
} | {
|
|
1614
|
+
ruleName?: 'invalid_sort_field';
|
|
1615
|
+
};
|
|
1616
|
+
/** @docsIgnore */
|
|
1617
|
+
type GetOnlineOrderPreviewApplicationErrors = {
|
|
1618
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
1619
|
+
description?: string;
|
|
1620
|
+
data?: Record<string, any>;
|
|
1621
|
+
} | {
|
|
1622
|
+
code?: 'ERROR_COUPON_IS_DISABLED';
|
|
1623
|
+
description?: string;
|
|
1624
|
+
data?: CouponsError;
|
|
1625
|
+
} | {
|
|
1626
|
+
code?: 'ERROR_COUPON_USAGE_EXCEEDED';
|
|
1627
|
+
description?: string;
|
|
1628
|
+
data?: CouponsError;
|
|
1629
|
+
} | {
|
|
1630
|
+
code?: 'ERROR_COUPON_LIMIT_PER_CUSTOMER_EXCEEDED';
|
|
1631
|
+
description?: string;
|
|
1632
|
+
data?: CouponsError;
|
|
1633
|
+
} | {
|
|
1634
|
+
code?: 'ERROR_COUPON_IS_NOT_ACTIVE_YET';
|
|
1635
|
+
description?: string;
|
|
1636
|
+
data?: CouponsError;
|
|
1637
|
+
} | {
|
|
1638
|
+
code?: 'ERROR_COUPON_HAS_EXPIRED';
|
|
1639
|
+
description?: string;
|
|
1640
|
+
data?: CouponsError;
|
|
1641
|
+
} | {
|
|
1642
|
+
code?: 'ERROR_COUPON_DOES_NOT_EXIST';
|
|
1643
|
+
description?: string;
|
|
1644
|
+
data?: CouponsError;
|
|
1645
|
+
} | {
|
|
1646
|
+
code?: 'ERROR_COUPON_NOT_APPLICABLE_FOR_PLAN';
|
|
1647
|
+
description?: string;
|
|
1648
|
+
data?: CouponsError;
|
|
1649
1649
|
} | {
|
|
1650
1650
|
code?: 'ERROR_INVALID_SUBTOTAL';
|
|
1651
1651
|
description?: string;
|
|
@@ -1807,31 +1807,6 @@ interface EventMetadata extends BaseEventMetadata {
|
|
|
1807
1807
|
*/
|
|
1808
1808
|
entityEventSequence?: string | null;
|
|
1809
1809
|
}
|
|
1810
|
-
interface OrderAutoRenewCanceledEnvelope {
|
|
1811
|
-
data: OrderAutoRenewCanceled;
|
|
1812
|
-
metadata: EventMetadata;
|
|
1813
|
-
}
|
|
1814
|
-
/**
|
|
1815
|
-
* Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
|
|
1816
|
-
*
|
|
1817
|
-
* This webhook is *not* triggered in the following scenarios:
|
|
1818
|
-
* + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
|
|
1819
|
-
* + 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.
|
|
1820
|
-
* @permissionScope Manage Orders
|
|
1821
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1822
|
-
* @permissionScope Read Orders
|
|
1823
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
1824
|
-
* @permissionScope Manage plans and orders of Pricing Plans
|
|
1825
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
1826
|
-
* @permissionScope Manage Events
|
|
1827
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1828
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1829
|
-
* @webhook
|
|
1830
|
-
* @eventType wix.pricing_plans.v2.order_auto_renew_canceled
|
|
1831
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
1832
|
-
* @slug auto_renew_canceled
|
|
1833
|
-
*/
|
|
1834
|
-
declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
|
|
1835
1810
|
interface OrderCanceledEnvelope {
|
|
1836
1811
|
data: OrderCanceled;
|
|
1837
1812
|
metadata: EventMetadata;
|
|
@@ -1853,64 +1828,16 @@ interface OrderCanceledEnvelope {
|
|
|
1853
1828
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1854
1829
|
* @webhook
|
|
1855
1830
|
* @eventType wix.pricing_plans.v2.order_canceled
|
|
1856
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.
|
|
1831
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.member.MemberOrdersService
|
|
1857
1832
|
* @slug canceled
|
|
1858
1833
|
*/
|
|
1859
1834
|
declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
|
|
1860
|
-
interface
|
|
1861
|
-
|
|
1862
|
-
metadata: EventMetadata;
|
|
1863
|
-
}
|
|
1864
|
-
/**
|
|
1865
|
-
* Triggered at the start of a new payment cycle for an existing order.
|
|
1866
|
-
*
|
|
1867
|
-
* Not triggered at the initial start of an offline order.
|
|
1868
|
-
* @permissionScope Manage Orders
|
|
1869
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1870
|
-
* @permissionScope Read Orders
|
|
1871
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
1872
|
-
* @permissionScope Manage plans and orders of Pricing Plans
|
|
1873
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
1874
|
-
* @permissionScope Manage Events
|
|
1875
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1876
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1877
|
-
* @webhook
|
|
1878
|
-
* @eventType wix.pricing_plans.v2.order_cycle_started
|
|
1879
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
1880
|
-
* @slug cycle_started
|
|
1881
|
-
*/
|
|
1882
|
-
declare function onOrderCycleStarted(handler: (event: OrderCycleStartedEnvelope) => void | Promise<void>): void;
|
|
1883
|
-
interface OrderEndDatePostponedEnvelope {
|
|
1884
|
-
data: OrderEndDatePostponed;
|
|
1885
|
-
metadata: EventMetadata;
|
|
1886
|
-
}
|
|
1887
|
-
/**
|
|
1888
|
-
* Triggered when an order's `endDate` is postponed.
|
|
1889
|
-
* @permissionScope Manage Orders
|
|
1890
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1891
|
-
* @permissionScope Read Orders
|
|
1892
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
1893
|
-
* @permissionScope Manage plans and orders of Pricing Plans
|
|
1894
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
1895
|
-
* @permissionScope Manage Events
|
|
1896
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1897
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1898
|
-
* @webhook
|
|
1899
|
-
* @eventType wix.pricing_plans.v2.order_end_date_postponed
|
|
1900
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
1901
|
-
* @slug end_date_postponed
|
|
1902
|
-
*/
|
|
1903
|
-
declare function onOrderEndDatePostponed(handler: (event: OrderEndDatePostponedEnvelope) => void | Promise<void>): void;
|
|
1904
|
-
interface OrderEndedEnvelope {
|
|
1905
|
-
data: OrderEnded;
|
|
1835
|
+
interface OrderCreatedEnvelope {
|
|
1836
|
+
entity: Order;
|
|
1906
1837
|
metadata: EventMetadata;
|
|
1907
1838
|
}
|
|
1908
1839
|
/**
|
|
1909
|
-
* Triggered when an order
|
|
1910
|
-
*
|
|
1911
|
-
* This webhook is triggered:
|
|
1912
|
-
* + When an order expires at the end of the current payment cycle.
|
|
1913
|
-
* + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`.
|
|
1840
|
+
* Triggered when an order is created.
|
|
1914
1841
|
* @permissionScope Manage Orders
|
|
1915
1842
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1916
1843
|
* @permissionScope Read Orders
|
|
@@ -1921,17 +1848,17 @@ interface OrderEndedEnvelope {
|
|
|
1921
1848
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1922
1849
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1923
1850
|
* @webhook
|
|
1924
|
-
* @eventType wix.pricing_plans.v2.
|
|
1925
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.
|
|
1926
|
-
* @slug
|
|
1851
|
+
* @eventType wix.pricing_plans.v2.order_created
|
|
1852
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
1853
|
+
* @slug created
|
|
1927
1854
|
*/
|
|
1928
|
-
declare function
|
|
1929
|
-
interface
|
|
1930
|
-
data:
|
|
1855
|
+
declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
|
|
1856
|
+
interface OrderStartDateChangedEnvelope {
|
|
1857
|
+
data: OrderStartDateChanged;
|
|
1931
1858
|
metadata: EventMetadata;
|
|
1932
1859
|
}
|
|
1933
1860
|
/**
|
|
1934
|
-
* Triggered when an
|
|
1861
|
+
* Triggered when an order's `startDate` is changed.
|
|
1935
1862
|
* @permissionScope Manage Orders
|
|
1936
1863
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1937
1864
|
* @permissionScope Read Orders
|
|
@@ -1942,17 +1869,25 @@ interface OrderMarkedAsPaidEnvelope {
|
|
|
1942
1869
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1943
1870
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1944
1871
|
* @webhook
|
|
1945
|
-
* @eventType wix.pricing_plans.v2.
|
|
1946
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.
|
|
1947
|
-
* @slug
|
|
1872
|
+
* @eventType wix.pricing_plans.v2.order_start_date_changed
|
|
1873
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
1874
|
+
* @slug start_date_changed
|
|
1948
1875
|
*/
|
|
1949
|
-
declare function
|
|
1950
|
-
interface
|
|
1951
|
-
|
|
1876
|
+
declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
|
|
1877
|
+
interface OrderUpdatedEnvelope {
|
|
1878
|
+
entity: Order;
|
|
1952
1879
|
metadata: EventMetadata;
|
|
1953
1880
|
}
|
|
1954
1881
|
/**
|
|
1955
|
-
* Triggered
|
|
1882
|
+
* Triggered for any of the following update events:
|
|
1883
|
+
*
|
|
1884
|
+
* + Order is paid for. Order Purchased is also triggered.
|
|
1885
|
+
* + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
|
|
1886
|
+
* + New payment cycle of an order starts. Order Cycle Started is also triggered.
|
|
1887
|
+
* + Offline order is marked as paid. Order Marked As Paid is also triggered.
|
|
1888
|
+
* + End date of the order is postponed. Order End Date Postponed is also triggered
|
|
1889
|
+
* + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
|
|
1890
|
+
* + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
|
|
1956
1891
|
* @permissionScope Manage Orders
|
|
1957
1892
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1958
1893
|
* @permissionScope Read Orders
|
|
@@ -1963,21 +1898,21 @@ interface OrderPausedEnvelope {
|
|
|
1963
1898
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1964
1899
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1965
1900
|
* @webhook
|
|
1966
|
-
* @eventType wix.pricing_plans.v2.
|
|
1967
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.
|
|
1968
|
-
* @slug
|
|
1901
|
+
* @eventType wix.pricing_plans.v2.order_updated
|
|
1902
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
|
|
1903
|
+
* @slug updated
|
|
1969
1904
|
*/
|
|
1970
|
-
declare function
|
|
1971
|
-
interface
|
|
1972
|
-
data:
|
|
1905
|
+
declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
|
|
1906
|
+
interface OrderAutoRenewCanceledEnvelope {
|
|
1907
|
+
data: OrderAutoRenewCanceled;
|
|
1973
1908
|
metadata: EventMetadata;
|
|
1974
1909
|
}
|
|
1975
1910
|
/**
|
|
1976
|
-
* Triggered
|
|
1977
|
-
*
|
|
1978
|
-
*
|
|
1979
|
-
* +
|
|
1980
|
-
* +
|
|
1911
|
+
* Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
|
|
1912
|
+
*
|
|
1913
|
+
* This webhook is *not* triggered in the following scenarios:
|
|
1914
|
+
* + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
|
|
1915
|
+
* + When an order expires at the end of the current payment cycle because it was canceled and `effectiveAt` was set to `NEXT_PAYMENT_DATE`. Instead, at the time of expiration, Order Canceled and Order Ended are triggered.
|
|
1981
1916
|
* @permissionScope Manage Orders
|
|
1982
1917
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1983
1918
|
* @permissionScope Read Orders
|
|
@@ -1988,17 +1923,19 @@ interface OrderPurchasedEnvelope {
|
|
|
1988
1923
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1989
1924
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
1990
1925
|
* @webhook
|
|
1991
|
-
* @eventType wix.pricing_plans.v2.
|
|
1926
|
+
* @eventType wix.pricing_plans.v2.order_auto_renew_canceled
|
|
1992
1927
|
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
1993
|
-
* @slug
|
|
1928
|
+
* @slug auto_renew_canceled
|
|
1994
1929
|
*/
|
|
1995
|
-
declare function
|
|
1996
|
-
interface
|
|
1997
|
-
data:
|
|
1930
|
+
declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
|
|
1931
|
+
interface OrderCycleStartedEnvelope {
|
|
1932
|
+
data: OrderCycleStarted;
|
|
1998
1933
|
metadata: EventMetadata;
|
|
1999
1934
|
}
|
|
2000
1935
|
/**
|
|
2001
|
-
* Triggered
|
|
1936
|
+
* Triggered at the start of a new payment cycle for an existing order.
|
|
1937
|
+
*
|
|
1938
|
+
* Not triggered at the initial start of an offline order.
|
|
2002
1939
|
* @permissionScope Manage Orders
|
|
2003
1940
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2004
1941
|
* @permissionScope Read Orders
|
|
@@ -2009,17 +1946,17 @@ interface OrderResumedEnvelope {
|
|
|
2009
1946
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2010
1947
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2011
1948
|
* @webhook
|
|
2012
|
-
* @eventType wix.pricing_plans.v2.
|
|
1949
|
+
* @eventType wix.pricing_plans.v2.order_cycle_started
|
|
2013
1950
|
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
2014
|
-
* @slug
|
|
1951
|
+
* @slug cycle_started
|
|
2015
1952
|
*/
|
|
2016
|
-
declare function
|
|
2017
|
-
interface
|
|
2018
|
-
data:
|
|
1953
|
+
declare function onOrderCycleStarted(handler: (event: OrderCycleStartedEnvelope) => void | Promise<void>): void;
|
|
1954
|
+
interface OrderEndDatePostponedEnvelope {
|
|
1955
|
+
data: OrderEndDatePostponed;
|
|
2019
1956
|
metadata: EventMetadata;
|
|
2020
1957
|
}
|
|
2021
1958
|
/**
|
|
2022
|
-
* Triggered when an order
|
|
1959
|
+
* Triggered when an order's `endDate` is postponed.
|
|
2023
1960
|
* @permissionScope Manage Orders
|
|
2024
1961
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2025
1962
|
* @permissionScope Read Orders
|
|
@@ -2030,25 +1967,21 @@ interface OrderStartedEnvelope {
|
|
|
2030
1967
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2031
1968
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2032
1969
|
* @webhook
|
|
2033
|
-
* @eventType wix.pricing_plans.v2.
|
|
1970
|
+
* @eventType wix.pricing_plans.v2.order_end_date_postponed
|
|
2034
1971
|
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
2035
|
-
* @slug
|
|
1972
|
+
* @slug end_date_postponed
|
|
2036
1973
|
*/
|
|
2037
|
-
declare function
|
|
2038
|
-
interface
|
|
2039
|
-
|
|
1974
|
+
declare function onOrderEndDatePostponed(handler: (event: OrderEndDatePostponedEnvelope) => void | Promise<void>): void;
|
|
1975
|
+
interface OrderEndedEnvelope {
|
|
1976
|
+
data: OrderEnded;
|
|
2040
1977
|
metadata: EventMetadata;
|
|
2041
1978
|
}
|
|
2042
1979
|
/**
|
|
2043
|
-
* Triggered
|
|
1980
|
+
* Triggered when an order ends.
|
|
2044
1981
|
*
|
|
2045
|
-
*
|
|
2046
|
-
* +
|
|
2047
|
-
* +
|
|
2048
|
-
* + Offline order is marked as paid. Order Marked As Paid is also triggered.
|
|
2049
|
-
* + End date of the order is postponed. Order End Date Postponed is also triggered
|
|
2050
|
-
* + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
|
|
2051
|
-
* + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
|
|
1982
|
+
* This webhook is triggered:
|
|
1983
|
+
* + When an order expires at the end of the current payment cycle.
|
|
1984
|
+
* + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`.
|
|
2052
1985
|
* @permissionScope Manage Orders
|
|
2053
1986
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2054
1987
|
* @permissionScope Read Orders
|
|
@@ -2059,17 +1992,17 @@ interface OrderUpdatedEnvelope {
|
|
|
2059
1992
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2060
1993
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2061
1994
|
* @webhook
|
|
2062
|
-
* @eventType wix.pricing_plans.v2.
|
|
1995
|
+
* @eventType wix.pricing_plans.v2.order_ended
|
|
2063
1996
|
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
2064
|
-
* @slug
|
|
1997
|
+
* @slug ended
|
|
2065
1998
|
*/
|
|
2066
|
-
declare function
|
|
2067
|
-
interface
|
|
2068
|
-
|
|
1999
|
+
declare function onOrderEnded(handler: (event: OrderEndedEnvelope) => void | Promise<void>): void;
|
|
2000
|
+
interface OrderMarkedAsPaidEnvelope {
|
|
2001
|
+
data: OrderMarkedAsPaid;
|
|
2069
2002
|
metadata: EventMetadata;
|
|
2070
2003
|
}
|
|
2071
2004
|
/**
|
|
2072
|
-
* Triggered when an order is
|
|
2005
|
+
* Triggered when an offline order is marked as paid.
|
|
2073
2006
|
* @permissionScope Manage Orders
|
|
2074
2007
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2075
2008
|
* @permissionScope Read Orders
|
|
@@ -2080,17 +2013,17 @@ interface OrderCreatedEnvelope {
|
|
|
2080
2013
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2081
2014
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2082
2015
|
* @webhook
|
|
2083
|
-
* @eventType wix.pricing_plans.v2.
|
|
2084
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.
|
|
2085
|
-
* @slug
|
|
2016
|
+
* @eventType wix.pricing_plans.v2.order_marked_as_paid
|
|
2017
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
2018
|
+
* @slug marked_as_paid
|
|
2086
2019
|
*/
|
|
2087
|
-
declare function
|
|
2088
|
-
interface
|
|
2089
|
-
data:
|
|
2020
|
+
declare function onOrderMarkedAsPaid(handler: (event: OrderMarkedAsPaidEnvelope) => void | Promise<void>): void;
|
|
2021
|
+
interface OrderPausedEnvelope {
|
|
2022
|
+
data: OrderPaused;
|
|
2090
2023
|
metadata: EventMetadata;
|
|
2091
2024
|
}
|
|
2092
2025
|
/**
|
|
2093
|
-
* Triggered when an order
|
|
2026
|
+
* Triggered when an order is paused.
|
|
2094
2027
|
* @permissionScope Manage Orders
|
|
2095
2028
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2096
2029
|
* @permissionScope Read Orders
|
|
@@ -2101,185 +2034,78 @@ interface OrderStartDateChangedEnvelope {
|
|
|
2101
2034
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2102
2035
|
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2103
2036
|
* @webhook
|
|
2104
|
-
* @eventType wix.pricing_plans.v2.
|
|
2105
|
-
* @serviceIdentifier com.wixpress.membership.v2.orders.
|
|
2106
|
-
* @slug
|
|
2107
|
-
*/
|
|
2108
|
-
declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
|
|
2109
|
-
/**
|
|
2110
|
-
* Retrieves an order by ID.
|
|
2111
|
-
* @param _id - Order ID.
|
|
2112
|
-
* @public
|
|
2113
|
-
* @requiredField _id
|
|
2114
|
-
* @param options - Options to use when getting an order.
|
|
2115
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2116
|
-
* @applicableIdentity APP
|
|
2117
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
|
|
2118
|
-
*/
|
|
2119
|
-
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>>;
|
|
2120
|
-
interface ManagementGetOrderOptions {
|
|
2121
|
-
/**
|
|
2122
|
-
* Predefined set of fields to return.
|
|
2123
|
-
*
|
|
2124
|
-
* Default: If `fieldSet` is omitted, no order form submission data is returned.
|
|
2125
|
-
*/
|
|
2126
|
-
fieldSet?: SetWithLiterals;
|
|
2127
|
-
}
|
|
2128
|
-
/**
|
|
2129
|
-
* Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
|
|
2130
|
-
*
|
|
2131
|
-
* By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
|
|
2132
|
-
* `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
|
|
2133
|
-
* @public
|
|
2134
|
-
* @param options - Filtering, sorting, and pagination options.
|
|
2135
|
-
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2136
|
-
* @applicableIdentity APP
|
|
2137
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
|
|
2037
|
+
* @eventType wix.pricing_plans.v2.order_paused
|
|
2038
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
2039
|
+
* @slug paused
|
|
2138
2040
|
*/
|
|
2139
|
-
declare function
|
|
2140
|
-
interface
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
* @format GUID
|
|
2144
|
-
*/
|
|
2145
|
-
buyerIds?: string[];
|
|
2146
|
-
/**
|
|
2147
|
-
* Filter by plan IDs, from the Plans API.
|
|
2148
|
-
* @format GUID
|
|
2149
|
-
*/
|
|
2150
|
-
planIds?: string[];
|
|
2151
|
-
/** Filter by whether or not the auto-renewal of recurring orders was canceled. */
|
|
2152
|
-
autoRenewCanceled?: boolean | null;
|
|
2153
|
-
/** Filter by order status. */
|
|
2154
|
-
orderStatuses?: OrderStatusWithLiterals[];
|
|
2155
|
-
/** Filter by payment status. */
|
|
2156
|
-
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
2157
|
-
/**
|
|
2158
|
-
* Number of orders to return. See Sorting and Paging for more information.
|
|
2159
|
-
*
|
|
2160
|
-
* Max: `50`
|
|
2161
|
-
* @min 1
|
|
2162
|
-
* @max 50
|
|
2163
|
-
*/
|
|
2164
|
-
limit?: number | null;
|
|
2165
|
-
/** Number of orders to skip in the current sort order. */
|
|
2166
|
-
offset?: number | null;
|
|
2167
|
-
/**
|
|
2168
|
-
* Sort order.
|
|
2169
|
-
*
|
|
2170
|
-
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
2171
|
-
*
|
|
2172
|
-
* Default: `DESC`.
|
|
2173
|
-
*/
|
|
2174
|
-
sorting?: Sorting;
|
|
2175
|
-
/**
|
|
2176
|
-
* Predefined set of fields to return.
|
|
2177
|
-
*
|
|
2178
|
-
* Default: If `fieldSet` is omitted, no order form submission data is returned.
|
|
2179
|
-
*/
|
|
2180
|
-
fieldSet?: SetWithLiterals;
|
|
2041
|
+
declare function onOrderPaused(handler: (event: OrderPausedEnvelope) => void | Promise<void>): void;
|
|
2042
|
+
interface OrderPurchasedEnvelope {
|
|
2043
|
+
data: OrderPurchased;
|
|
2044
|
+
metadata: EventMetadata;
|
|
2181
2045
|
}
|
|
2182
2046
|
/**
|
|
2183
|
-
*
|
|
2184
|
-
*
|
|
2185
|
-
*
|
|
2186
|
-
*
|
|
2187
|
-
*
|
|
2188
|
-
* @
|
|
2189
|
-
*
|
|
2190
|
-
*
|
|
2191
|
-
* @
|
|
2192
|
-
* @
|
|
2193
|
-
* @
|
|
2194
|
-
* @
|
|
2195
|
-
* @
|
|
2196
|
-
* @
|
|
2197
|
-
* @
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
* Cancels an existing order.
|
|
2202
|
-
*
|
|
2203
|
-
* For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
|
|
2204
|
-
* For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
|
|
2205
|
-
*
|
|
2206
|
-
* #### Canceling during the free trial period.
|
|
2207
|
-
*
|
|
2208
|
-
* When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
|
|
2209
|
-
* of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
|
|
2210
|
-
* of the free trial period.
|
|
2211
|
-
*
|
|
2212
|
-
* When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
|
|
2213
|
-
* `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
|
|
2214
|
-
* immediately, even during the free trial period and the buyer won't be billed. Canceling at the
|
|
2215
|
-
* `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
|
|
2216
|
-
* Then, the subscription ends and the buyer is not billed.
|
|
2217
|
-
* @param _id - Order ID.
|
|
2218
|
-
* @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
|
|
2219
|
-
* @public
|
|
2220
|
-
* @requiredField _id
|
|
2221
|
-
* @requiredField effectiveAt
|
|
2222
|
-
* @param options - Options for canceling orders.
|
|
2223
|
-
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2224
|
-
* @applicableIdentity APP
|
|
2225
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
|
|
2226
|
-
*/
|
|
2227
|
-
declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
|
|
2228
|
-
/**
|
|
2229
|
-
* Marks an offline order as paid.
|
|
2230
|
-
* > __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.
|
|
2231
|
-
*
|
|
2232
|
-
* Marking an offline order as paid causes the following changes:
|
|
2233
|
-
* - The order's `lastPaymentStatus` changes to `"PAID"`.
|
|
2234
|
-
* - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
|
|
2235
|
-
*
|
|
2236
|
-
* An error occurs if you attempt to:
|
|
2237
|
-
* - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
|
|
2238
|
-
* - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
|
|
2239
|
-
* @param _id - Order ID.
|
|
2240
|
-
* @public
|
|
2241
|
-
* @requiredField _id
|
|
2242
|
-
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2243
|
-
* @applicableIdentity APP
|
|
2244
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
|
|
2047
|
+
* Triggered for any of the following purchase events:
|
|
2048
|
+
* + Order is paid in full.
|
|
2049
|
+
* + At least 1 order cycle payment is paid for.
|
|
2050
|
+
* + Offline order is created, even if not yet marked as paid.
|
|
2051
|
+
* + Free order is created.
|
|
2052
|
+
* @permissionScope Manage Orders
|
|
2053
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2054
|
+
* @permissionScope Read Orders
|
|
2055
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
2056
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
2057
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
2058
|
+
* @permissionScope Manage Events
|
|
2059
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2060
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2061
|
+
* @webhook
|
|
2062
|
+
* @eventType wix.pricing_plans.v2.order_purchased
|
|
2063
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
2064
|
+
* @slug purchased
|
|
2245
2065
|
*/
|
|
2246
|
-
declare function
|
|
2066
|
+
declare function onOrderPurchased(handler: (event: OrderPurchasedEnvelope) => void | Promise<void>): void;
|
|
2067
|
+
interface OrderResumedEnvelope {
|
|
2068
|
+
data: OrderResumed;
|
|
2069
|
+
metadata: EventMetadata;
|
|
2070
|
+
}
|
|
2247
2071
|
/**
|
|
2248
|
-
*
|
|
2249
|
-
*
|
|
2250
|
-
*
|
|
2251
|
-
*
|
|
2252
|
-
*
|
|
2253
|
-
*
|
|
2254
|
-
*
|
|
2255
|
-
*
|
|
2256
|
-
* @
|
|
2257
|
-
* @
|
|
2258
|
-
* @
|
|
2259
|
-
* @
|
|
2260
|
-
* @
|
|
2261
|
-
* @
|
|
2072
|
+
* Triggered when a paused order is resumed.
|
|
2073
|
+
* @permissionScope Manage Orders
|
|
2074
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2075
|
+
* @permissionScope Read Orders
|
|
2076
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
2077
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
2078
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
2079
|
+
* @permissionScope Manage Events
|
|
2080
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2081
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2082
|
+
* @webhook
|
|
2083
|
+
* @eventType wix.pricing_plans.v2.order_resumed
|
|
2084
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
2085
|
+
* @slug resumed
|
|
2262
2086
|
*/
|
|
2263
|
-
declare function
|
|
2087
|
+
declare function onOrderResumed(handler: (event: OrderResumedEnvelope) => void | Promise<void>): void;
|
|
2088
|
+
interface OrderStartedEnvelope {
|
|
2089
|
+
data: OrderStarted;
|
|
2090
|
+
metadata: EventMetadata;
|
|
2091
|
+
}
|
|
2264
2092
|
/**
|
|
2265
|
-
*
|
|
2266
|
-
*
|
|
2267
|
-
*
|
|
2268
|
-
*
|
|
2269
|
-
*
|
|
2270
|
-
*
|
|
2271
|
-
*
|
|
2272
|
-
*
|
|
2273
|
-
*
|
|
2274
|
-
*
|
|
2275
|
-
* @
|
|
2276
|
-
* @
|
|
2277
|
-
* @
|
|
2278
|
-
* @
|
|
2279
|
-
* @applicableIdentity APP
|
|
2280
|
-
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
|
|
2093
|
+
* Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
|
|
2094
|
+
* @permissionScope Manage Orders
|
|
2095
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
2096
|
+
* @permissionScope Read Orders
|
|
2097
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
|
2098
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
2099
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
2100
|
+
* @permissionScope Manage Events
|
|
2101
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2102
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2103
|
+
* @webhook
|
|
2104
|
+
* @eventType wix.pricing_plans.v2.order_started
|
|
2105
|
+
* @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
|
|
2106
|
+
* @slug started
|
|
2281
2107
|
*/
|
|
2282
|
-
declare function
|
|
2108
|
+
declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
|
|
2283
2109
|
/**
|
|
2284
2110
|
* Retrieves an order for the currently logged-in member by ID.
|
|
2285
2111
|
* @param _id - Order ID.
|
|
@@ -2289,10 +2115,9 @@ declare function resumeOrder(_id: string): Promise<void>;
|
|
|
2289
2115
|
* @permissionId PRICING_PLANS.READ_OWN_ORDERS
|
|
2290
2116
|
* @applicableIdentity APP
|
|
2291
2117
|
* @applicableIdentity MEMBER
|
|
2292
|
-
* @returns Requested order.
|
|
2293
2118
|
* @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.GetOrder
|
|
2294
2119
|
*/
|
|
2295
|
-
declare function memberGetOrder(_id: string, options?: MemberGetOrderOptions): Promise<NonNullablePaths<
|
|
2120
|
+
declare function memberGetOrder(_id: string, options?: MemberGetOrderOptions): Promise<NonNullablePaths<MemberGetOrderResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice`, 7>>;
|
|
2296
2121
|
interface MemberGetOrderOptions {
|
|
2297
2122
|
/**
|
|
2298
2123
|
* Predefined set of fields to return.
|
|
@@ -2555,5 +2380,180 @@ interface GetPricePreviewOptions {
|
|
|
2555
2380
|
*/
|
|
2556
2381
|
couponCode?: string | null;
|
|
2557
2382
|
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Retrieves an order by ID.
|
|
2385
|
+
* @param _id - Order ID.
|
|
2386
|
+
* @public
|
|
2387
|
+
* @requiredField _id
|
|
2388
|
+
* @param options - Options to use when getting an order.
|
|
2389
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2390
|
+
* @applicableIdentity APP
|
|
2391
|
+
* @returns Order.
|
|
2392
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
|
|
2393
|
+
*/
|
|
2394
|
+
declare function managementGetOrder(_id: string, options?: ManagementGetOrderOptions): Promise<NonNullablePaths<Order, `_id` | `planId` | `subscriptionId` | `buyer.memberId` | `buyer.contactId` | `priceDetails.subscription.cycleDuration.unit` | `priceDetails.subtotal` | `priceDetails.discount` | `priceDetails.tax.name` | `priceDetails.tax.includedInPrice` | `priceDetails.tax.rate` | `priceDetails.tax.amount` | `priceDetails.total` | `priceDetails.planPrice` | `priceDetails.currency` | `priceDetails.coupon.code` | `priceDetails.coupon.amount` | `priceDetails.coupon._id` | `pricing.prices` | `pricing.prices.${number}.duration.cycleFrom` | `pricing.prices.${number}.price.subtotal` | `pricing.prices.${number}.price.discount` | `pricing.prices.${number}.price.total` | `pricing.prices.${number}.price.currency` | `pricing.prices.${number}.price.proration` | `type` | `status` | `cancellation.cause` | `cancellation.effectiveAt` | `lastPaymentStatus` | `pausePeriods` | `pausePeriods.${number}.status` | `currentCycle.index` | `planName` | `planDescription` | `planPrice`, 6>>;
|
|
2395
|
+
interface ManagementGetOrderOptions {
|
|
2396
|
+
/**
|
|
2397
|
+
* Predefined set of fields to return.
|
|
2398
|
+
*
|
|
2399
|
+
* Default: If `fieldSet` is omitted, no order form submission data is returned.
|
|
2400
|
+
*/
|
|
2401
|
+
fieldSet?: SetWithLiterals;
|
|
2402
|
+
}
|
|
2403
|
+
/**
|
|
2404
|
+
* Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
|
|
2405
|
+
*
|
|
2406
|
+
* By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
|
|
2407
|
+
* `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
|
|
2408
|
+
* @public
|
|
2409
|
+
* @param options - Filtering, sorting, and pagination options.
|
|
2410
|
+
* @permissionId PRICING_PLANS.READ_ORDERS
|
|
2411
|
+
* @applicableIdentity APP
|
|
2412
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
|
|
2413
|
+
*/
|
|
2414
|
+
declare function managementListOrders(options?: ManagementListOrdersOptions): Promise<NonNullablePaths<ListOrdersResponse, `orders` | `orders.${number}._id` | `orders.${number}.planId` | `orders.${number}.subscriptionId` | `orders.${number}.buyer.memberId` | `orders.${number}.buyer.contactId` | `orders.${number}.priceDetails.singlePaymentForDuration.unit` | `orders.${number}.priceDetails.subtotal` | `orders.${number}.priceDetails.discount` | `orders.${number}.priceDetails.tax.name` | `orders.${number}.priceDetails.tax.includedInPrice` | `orders.${number}.priceDetails.tax.rate` | `orders.${number}.priceDetails.tax.amount` | `orders.${number}.priceDetails.total` | `orders.${number}.priceDetails.planPrice` | `orders.${number}.priceDetails.currency` | `orders.${number}.priceDetails.coupon.code` | `orders.${number}.priceDetails.coupon.amount` | `orders.${number}.priceDetails.coupon._id` | `orders.${number}.type` | `orders.${number}.status` | `orders.${number}.cancellation.cause` | `orders.${number}.cancellation.effectiveAt` | `orders.${number}.lastPaymentStatus` | `orders.${number}.currentCycle.index` | `orders.${number}.planName` | `orders.${number}.planDescription` | `orders.${number}.planPrice`, 6>>;
|
|
2415
|
+
interface ManagementListOrdersOptions {
|
|
2416
|
+
/**
|
|
2417
|
+
* Filter by a buyer's member ID, from the Members API.
|
|
2418
|
+
* @format GUID
|
|
2419
|
+
*/
|
|
2420
|
+
buyerIds?: string[];
|
|
2421
|
+
/**
|
|
2422
|
+
* Filter by plan IDs, from the Plans API.
|
|
2423
|
+
* @format GUID
|
|
2424
|
+
*/
|
|
2425
|
+
planIds?: string[];
|
|
2426
|
+
/** Filter by whether or not the auto-renewal of recurring orders was canceled. */
|
|
2427
|
+
autoRenewCanceled?: boolean | null;
|
|
2428
|
+
/** Filter by order status. */
|
|
2429
|
+
orderStatuses?: OrderStatusWithLiterals[];
|
|
2430
|
+
/** Filter by payment status. */
|
|
2431
|
+
paymentStatuses?: PaymentStatusWithLiterals[];
|
|
2432
|
+
/**
|
|
2433
|
+
* Number of orders to return. See Sorting and Paging for more information.
|
|
2434
|
+
*
|
|
2435
|
+
* Max: `50`
|
|
2436
|
+
* @min 1
|
|
2437
|
+
* @max 50
|
|
2438
|
+
*/
|
|
2439
|
+
limit?: number | null;
|
|
2440
|
+
/** Number of orders to skip in the current sort order. */
|
|
2441
|
+
offset?: number | null;
|
|
2442
|
+
/**
|
|
2443
|
+
* Sort order.
|
|
2444
|
+
*
|
|
2445
|
+
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
2446
|
+
*
|
|
2447
|
+
* Default: `DESC`.
|
|
2448
|
+
*/
|
|
2449
|
+
sorting?: Sorting;
|
|
2450
|
+
/**
|
|
2451
|
+
* Predefined set of fields to return.
|
|
2452
|
+
*
|
|
2453
|
+
* Default: If `fieldSet` is omitted, no order form submission data is returned.
|
|
2454
|
+
*/
|
|
2455
|
+
fieldSet?: SetWithLiterals;
|
|
2456
|
+
}
|
|
2457
|
+
/**
|
|
2458
|
+
* Extends the duration of a pricing plan order by postponing the order's `endDate`. Postponing the end date of an order does not impact payments.
|
|
2459
|
+
*
|
|
2460
|
+
* New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
|
|
2461
|
+
* Can't postpone an order with `status`: `PAUSED`.
|
|
2462
|
+
* @param _id - Order ID.
|
|
2463
|
+
* @param endDate - New end date and time.
|
|
2464
|
+
*
|
|
2465
|
+
* Must be later than the current end date and time.
|
|
2466
|
+
* @public
|
|
2467
|
+
* @requiredField _id
|
|
2468
|
+
* @requiredField endDate
|
|
2469
|
+
* @param options - Options for postponing the end date of an order.
|
|
2470
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2471
|
+
* @applicableIdentity APP
|
|
2472
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
|
|
2473
|
+
*/
|
|
2474
|
+
declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
|
|
2475
|
+
/**
|
|
2476
|
+
* Cancels an existing order.
|
|
2477
|
+
*
|
|
2478
|
+
* For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
|
|
2479
|
+
* For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
|
|
2480
|
+
*
|
|
2481
|
+
* #### Canceling during the free trial period.
|
|
2482
|
+
*
|
|
2483
|
+
* When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
|
|
2484
|
+
* of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
|
|
2485
|
+
* of the free trial period.
|
|
2486
|
+
*
|
|
2487
|
+
* When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
|
|
2488
|
+
* `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
|
|
2489
|
+
* immediately, even during the free trial period and the buyer won't be billed. Canceling at the
|
|
2490
|
+
* `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
|
|
2491
|
+
* Then, the subscription ends and the buyer is not billed.
|
|
2492
|
+
* @param _id - Order ID.
|
|
2493
|
+
* @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
|
|
2494
|
+
* @public
|
|
2495
|
+
* @requiredField _id
|
|
2496
|
+
* @requiredField effectiveAt
|
|
2497
|
+
* @param options - Options for canceling orders.
|
|
2498
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2499
|
+
* @applicableIdentity APP
|
|
2500
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
|
|
2501
|
+
*/
|
|
2502
|
+
declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
|
|
2503
|
+
/**
|
|
2504
|
+
* Marks an offline order as paid.
|
|
2505
|
+
* > __Note__: Marking separate payment cycles as paid is not yet supported. The entire order will be marked as paid. Subsequent offline payments do trigger events and emails, but are not registered as additional offline payments.
|
|
2506
|
+
*
|
|
2507
|
+
* Marking an offline order as paid causes the following changes:
|
|
2508
|
+
* - The order's `lastPaymentStatus` changes to `"PAID"`.
|
|
2509
|
+
* - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
|
|
2510
|
+
*
|
|
2511
|
+
* An error occurs if you attempt to:
|
|
2512
|
+
* - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
|
|
2513
|
+
* - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
|
|
2514
|
+
* @param _id - Order ID.
|
|
2515
|
+
* @public
|
|
2516
|
+
* @requiredField _id
|
|
2517
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2518
|
+
* @applicableIdentity APP
|
|
2519
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
|
|
2520
|
+
*/
|
|
2521
|
+
declare function markAsPaid(_id: string): Promise<void>;
|
|
2522
|
+
/**
|
|
2523
|
+
* Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
|
|
2524
|
+
*
|
|
2525
|
+
* Only orders with `status`: `ACTIVE` can be paused.
|
|
2526
|
+
* For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
|
|
2527
|
+
* Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
|
|
2528
|
+
* The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
|
|
2529
|
+
*
|
|
2530
|
+
* To resume a paused order, call Resume Order.
|
|
2531
|
+
* @param _id - Order ID.
|
|
2532
|
+
* @public
|
|
2533
|
+
* @requiredField _id
|
|
2534
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2535
|
+
* @applicableIdentity APP
|
|
2536
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
|
|
2537
|
+
*/
|
|
2538
|
+
declare function pauseOrder(_id: string): Promise<void>;
|
|
2539
|
+
/**
|
|
2540
|
+
* Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
|
|
2541
|
+
*
|
|
2542
|
+
* Resuming an order causes the following changes:
|
|
2543
|
+
* - The order status changes to `"ACTIVE"`.
|
|
2544
|
+
* - The `pausePeriods` array is updated.
|
|
2545
|
+
* - The `endDate` for the order is adjusted to include the pause period.
|
|
2546
|
+
* - For orders with recurring payments, the payment schedule is restarted.
|
|
2547
|
+
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
|
|
2548
|
+
*
|
|
2549
|
+
* To pause an order, call Pause Order.
|
|
2550
|
+
* @param _id - Order ID.
|
|
2551
|
+
* @public
|
|
2552
|
+
* @requiredField _id
|
|
2553
|
+
* @permissionId PRICING_PLANS.MANAGE_ORDERS
|
|
2554
|
+
* @applicableIdentity APP
|
|
2555
|
+
* @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
|
|
2556
|
+
*/
|
|
2557
|
+
declare function resumeOrder(_id: string): Promise<void>;
|
|
2558
2558
|
|
|
2559
2559
|
export { type ActionEvent, type ApplicationError, type ApplyCouponRequest, type ApplyCouponResponse, type BaseEventMetadata, type BulkActionMetadata, type BulkOrderResult, type BulkPauseOrderRequest, type BulkPauseOrderResponse, type BulkResumeOrderRequest, type BulkResumeOrderResponse, type Buyer, type CancelOrderRequest, type CancelOrderResponse, type Cancellation, CancellationCause, type CancellationCauseWithLiterals, CancellationEffectiveAt, type CancellationEffectiveAtWithLiterals, type Captcha, type ChangeStartDateRequest, type ChangeStartDateResponse, type Coupon, type CouponsError, type CreateExternalOrderRequest, type CreateExternalOrderResponse, type CreateGuestOnlineOrderRequest, type CreateGuestOnlineOrderResponse, type CreateOfflineOrderApplicationErrors, type CreateOfflineOrderOptions, type CreateOfflineOrderRequest, type CreateOfflineOrderResponse, type CreateOfflineOrderValidationErrors, type CreateOnlineOrderApplicationErrors, type CreateOnlineOrderOptions, type CreateOnlineOrderRequest, type CreateOnlineOrderResponse, type CreateOnlineOrderValidationErrors, type CurrentCycle, type CursorPaging, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type Duration, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type Fee, type FormData, type GetAvailableOrderActionsRequest, type GetAvailableOrderActionsResponse, type GetGuestOnlineOrderPreviewRequest, type GetGuestOnlineOrderPreviewResponse, type GetOfflineOrderPreviewApplicationErrors, type GetOfflineOrderPreviewOptions, type GetOfflineOrderPreviewRequest, type GetOfflineOrderPreviewResponse, type GetOfflineOrderPreviewValidationErrors, type GetOnlineOrderPreviewApplicationErrors, type GetOnlineOrderPreviewOptions, type GetOnlineOrderPreviewRequest, type GetOnlineOrderPreviewResponse, type GetOnlineOrderPreviewValidationErrors, type GetOrderRequest, type GetOrderResponse, type GetOrdersStatsRequest, type GetOrdersStatsResponse, type GetPricePreviewApplicationErrors, type GetPricePreviewOptions, type GetPricePreviewRequest, type GetPricePreviewResponse, type Guest, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type ListOrdersRequest, type ListOrdersResponse, type ManagementGetOrderOptions, type ManagementListOrdersOptions, type MarkAsPaidRequest, type MarkAsPaidResponse, type MemberGetOrderOptions, type MemberGetOrderRequest, type MemberGetOrderResponse, type MemberListOrdersOptions, type MemberListOrdersRequest, type MemberListOrdersResponse, type MessageEnvelope, type OnBehalf, type Order, type OrderAutoRenewCanceled, type OrderAutoRenewCanceledEnvelope, type OrderCanceled, type OrderCanceledEnvelope, type OrderCreatedEnvelope, type OrderCycle, type OrderCycleStarted, type OrderCycleStartedEnvelope, type OrderEndDatePostponed, type OrderEndDatePostponedEnvelope, type OrderEnded, type OrderEndedEnvelope, type OrderMarkedAsPaid, type OrderMarkedAsPaidEnvelope, OrderMethod, type OrderMethodWithLiterals, type OrderPaused, type OrderPausedEnvelope, type OrderPurchased, type OrderPurchasedEnvelope, type OrderResumed, type OrderResumedEnvelope, type OrderStartDateChanged, type OrderStartDateChangedEnvelope, type OrderStarted, type OrderStartedEnvelope, OrderStatus, type OrderStatusWithLiterals, OrderType, type OrderTypeWithLiterals, type OrderUpdatedEnvelope, type OrdersQueryOrdersRequest, type OrdersQueryOrdersResponse, type Paging, type PagingMetadataV2, type PauseOrderRequest, type PauseOrderResponse, type PausePeriod, PaymentStatus, type PaymentStatusWithLiterals, PeriodUnit, type PeriodUnitWithLiterals, type PostponeEndDateRequest, type PostponeEndDateResponse, type Price, type PriceDetails, type PriceDetailsPricingModelOneOf, type PriceDuration, type PricingDetails, type PricingDetailsPricingModelOneOf, type QueryOrdersRequest, type QueryOrdersResponse, type QueryV2, type QueryV2PagingMethodOneOf, ReasonNotSuspendable, type ReasonNotSuspendableWithLiterals, type Recurrence, type RequestCancellationRequest, type RequestCancellationResponse, type RestoreInfo, type ResumeOrderRequest, type ResumeOrderResponse, Set, type SetSubmissionRequest, type SetSubmissionResponse, type SetWithLiterals, SortOrder, type SortOrderWithLiterals, type Sorting, type SpannedPrice, Status, type StatusWithLiterals, type Tax, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, cancelOrder, createOfflineOrder, createOnlineOrder, getOfflineOrderPreview, getOnlineOrderPreview, getPricePreview, managementGetOrder, managementListOrders, markAsPaid, memberGetOrder, memberListOrders, onOrderAutoRenewCanceled, onOrderCanceled, onOrderCreated, onOrderCycleStarted, onOrderEndDatePostponed, onOrderEnded, onOrderMarkedAsPaid, onOrderPaused, onOrderPurchased, onOrderResumed, onOrderStartDateChanged, onOrderStarted, onOrderUpdated, pauseOrder, postponeEndDate, requestCancellation, resumeOrder };
|