@wix/subscription 1.0.33 → 1.0.35

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.
@@ -89,6 +89,8 @@ interface Subscription$1 {
89
89
  changesCounter?: string | null;
90
90
  /** Billing order id. Optional. */
91
91
  orderId?: string | null;
92
+ /** Platform origin subscription is coming from. */
93
+ platformOrigin?: PlatformOrigin$1;
92
94
  /** items, minSize is 1, maxSize is 100 */
93
95
  items?: Item$1[];
94
96
  }
@@ -211,7 +213,9 @@ declare enum CollectionMethodEnumCollectionMethod$1 {
211
213
  /** Payment will be collected somehow. Billing only issues invoice per cycle. */
212
214
  SEND_INVOICE = "SEND_INVOICE",
213
215
  /** Payment will be collected externally */
214
- EXTERNAL = "EXTERNAL"
216
+ EXTERNAL = "EXTERNAL",
217
+ /** Indicates the product has a zero amount, meaning its free with no payment required. */
218
+ FREE = "FREE"
215
219
  }
216
220
  interface Duration$1 {
217
221
  /** Duration unit: DAY, WEEK, MONTH, YEAR */
@@ -814,18 +818,151 @@ interface SpecificDateSubscriptionUpdateData$1 {
814
818
  updateData?: SubscriptionUpdateData$1;
815
819
  executionDate?: Date | null;
816
820
  }
817
- interface GetSubscriptionRequest$1 {
818
- id: string;
821
+ interface PlatformOrigin$1 {
822
+ appId?: string | null;
823
+ entityId?: string | null;
819
824
  }
820
- interface GetSubscriptionResponse$1 {
825
+ interface ListSubscriptionHistoryRequest$1 {
826
+ subscriptionId: string;
827
+ /** Determines the type of view for the history: either a comprehensive backoffice view or a user-centric view. */
828
+ mode?: HistoryViewMode$1;
829
+ /** Cursor for efficient paging. If paging through results, pass this field from the previous search response to continue to the next page. */
830
+ cursor?: CursorPaging$1;
831
+ }
832
+ declare enum HistoryViewMode$1 {
833
+ UNKNOWN = "UNKNOWN",
834
+ /** Comprehensive view including all history events. */
835
+ BACKOFFICE = "BACKOFFICE",
836
+ /** User-centric view of the history. */
837
+ USER = "USER"
838
+ }
839
+ interface CursorPaging$1 {
840
+ /** Maximum number of items to return in the results. */
841
+ limit?: number | null;
842
+ /**
843
+ * Pointer to the next or previous page in the list of results.
844
+ *
845
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
846
+ * Not relevant for the first request.
847
+ */
848
+ cursor?: string | null;
849
+ }
850
+ interface ListSubscriptionHistoryResponse$1 {
851
+ /** List of history entries for the subscription. */
852
+ historyEntries?: SubscriptionHistoryEntry$1[];
853
+ /** Paging metadata. A `next` cursor is returned if there are more results. */
854
+ pagingMetadata?: PagingMetadataV2$1;
855
+ }
856
+ interface SubscriptionHistoryEntry$1 {
857
+ entryId?: string;
858
+ /** TODO: add max length? it is not defined in domainevents, so should we? */
859
+ slug?: string;
860
+ entryTime?: Date | null;
861
+ event?: SubscriptionEvent$1;
862
+ }
863
+ interface SubscriptionEvent$1 extends SubscriptionEventPayloadOneOf$1 {
864
+ created?: SubscriptionCreated$1;
865
+ updated?: SubscriptionUpdated$1;
866
+ deleted?: SubscriptionDeleted$1;
867
+ activated?: SubscriptionActivated$1;
868
+ ended?: SubscriptionEnded$1;
869
+ canceled?: SubscriptionCanceled$1;
870
+ paused?: SubscriptionPaused$1;
871
+ resumed?: SubscriptionResumed$1;
872
+ pauseRequested?: PauseSubscriptionRequested$1;
873
+ resumeRequested?: ResumeSubscriptionRequested$1;
874
+ scheduledPauseCanceled?: ScheduledPauseCanceled$1;
875
+ scheduledResumeCanceled?: ScheduledResumeCanceled$1;
876
+ billingCycleStarted?: SubscriptionBillingCycleStarted$1;
877
+ autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn$1;
878
+ autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff$1;
879
+ cycleReadyToPay?: SubscriptionCycleReadyToPay$1;
880
+ extended?: SubscriptionExtended$1;
881
+ initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted$1;
882
+ latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid$1;
883
+ revived?: SubscriptionRevived$1;
884
+ billingDateUpdated?: SubscriptionBillingDateUpdated$1;
885
+ futureUpdatesRequested?: FutureUpdatesRequested$1;
886
+ updatesApplied?: UpdatesApplied$1;
887
+ resetPendingUpdates?: ResetPendingUpdates$1;
888
+ gracePeriodStarted?: GracePeriodStarted$1;
889
+ gracePeriodEnded?: GracePeriodEnded$1;
890
+ paymentMethodUpdated?: PaymentMethodUpdated$1;
891
+ collectionMethodUpdated?: SubscriptionCollectionMethodUpdated$1;
892
+ freeTrailStarted?: FreeTrailStarted$1;
893
+ freeTrailEnded?: FreeTrailEnded$1;
894
+ subscriptionBoAction?: SubscriptionBackOfficeAction$1;
895
+ unknown?: UnknownSubscriptionEvent$1;
896
+ }
897
+ /** @oneof */
898
+ interface SubscriptionEventPayloadOneOf$1 {
899
+ created?: SubscriptionCreated$1;
900
+ updated?: SubscriptionUpdated$1;
901
+ deleted?: SubscriptionDeleted$1;
902
+ activated?: SubscriptionActivated$1;
903
+ ended?: SubscriptionEnded$1;
904
+ canceled?: SubscriptionCanceled$1;
905
+ paused?: SubscriptionPaused$1;
906
+ resumed?: SubscriptionResumed$1;
907
+ pauseRequested?: PauseSubscriptionRequested$1;
908
+ resumeRequested?: ResumeSubscriptionRequested$1;
909
+ scheduledPauseCanceled?: ScheduledPauseCanceled$1;
910
+ scheduledResumeCanceled?: ScheduledResumeCanceled$1;
911
+ billingCycleStarted?: SubscriptionBillingCycleStarted$1;
912
+ autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn$1;
913
+ autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff$1;
914
+ cycleReadyToPay?: SubscriptionCycleReadyToPay$1;
915
+ extended?: SubscriptionExtended$1;
916
+ initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted$1;
917
+ latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid$1;
918
+ revived?: SubscriptionRevived$1;
919
+ billingDateUpdated?: SubscriptionBillingDateUpdated$1;
920
+ futureUpdatesRequested?: FutureUpdatesRequested$1;
921
+ updatesApplied?: UpdatesApplied$1;
922
+ resetPendingUpdates?: ResetPendingUpdates$1;
923
+ gracePeriodStarted?: GracePeriodStarted$1;
924
+ gracePeriodEnded?: GracePeriodEnded$1;
925
+ paymentMethodUpdated?: PaymentMethodUpdated$1;
926
+ collectionMethodUpdated?: SubscriptionCollectionMethodUpdated$1;
927
+ freeTrailStarted?: FreeTrailStarted$1;
928
+ freeTrailEnded?: FreeTrailEnded$1;
929
+ subscriptionBoAction?: SubscriptionBackOfficeAction$1;
930
+ unknown?: UnknownSubscriptionEvent$1;
931
+ }
932
+ interface SubscriptionCreated$1 {
821
933
  subscription?: Subscription$1;
822
934
  }
823
- interface CustomerCancelSubscriptionRequest$1 {
824
- id: string;
825
- /** Optional action reason message */
826
- reason?: string | null;
935
+ interface SubscriptionUpdated$1 {
936
+ current?: Subscription$1;
937
+ previous?: Subscription$1;
938
+ diff?: SubscriptionDiff$1;
827
939
  }
828
- interface CustomerCancelSubscriptionResponse$1 {
940
+ interface SubscriptionDiff$1 {
941
+ added?: string | null;
942
+ changed?: string | null;
943
+ deleted?: string | null;
944
+ }
945
+ interface SubscriptionDeleted$1 {
946
+ subscriptionId?: string;
947
+ }
948
+ /**
949
+ * Sent each time a subscription status has been set to Active
950
+ * Active shows that a subscription is live and operational.
951
+ * For example:
952
+ * * For subscription with free trial, free trial start date is also the activation date.
953
+ * * For a subscription with future start date, the start date is also the activation date.
954
+ * * When a subscription is resumed from a pause status, the resume date is also the activation date.
955
+ */
956
+ interface SubscriptionActivated$1 {
957
+ subscription?: Subscription$1;
958
+ }
959
+ /**
960
+ * Sent each time a subscription status has been set to Ended
961
+ * Ended shows that a subscription reached its end date and ended its life cycle as a result of the agreement.
962
+ * This is different from a Canceled subscription which ends the subscription before a designated end date.
963
+ * Therefore, Ended and Canceled are mutually exclusive.
964
+ */
965
+ interface SubscriptionEnded$1 {
829
966
  subscription?: Subscription$1;
830
967
  }
831
968
  /**
@@ -843,32 +980,48 @@ interface ActionDetails$1 {
843
980
  initiator?: HistoryActionInitiator$1;
844
981
  reason?: string | null;
845
982
  }
846
- interface CustomerTurnOnAutoRenewalRequest$1 {
847
- id: string;
848
- /** Optional action reason message */
849
- reason?: string | null;
983
+ interface SubscriptionPaused$1 {
984
+ subscription?: Subscription$1;
985
+ pausePolicy?: PausePolicy$1;
986
+ actionDetails?: ActionDetails$1;
850
987
  }
851
- interface CustomerTurnOnAutoRenewalResponse$1 {
988
+ interface SubscriptionResumed$1 {
852
989
  subscription?: Subscription$1;
990
+ actionDetails?: ActionDetails$1;
853
991
  }
854
- interface CustomerTurnOffAutoRenewalRequest$1 {
855
- id: string;
856
- /** Optional action reason message */
857
- reason?: string | null;
992
+ interface PauseSubscriptionRequested$1 {
993
+ subscription?: Subscription$1;
994
+ pauseAt?: PauseAt$1;
995
+ pausePolicy?: PausePolicy$1;
996
+ actionDetails?: ActionDetails$1;
858
997
  }
859
- interface CustomerTurnOffAutoRenewalResponse$1 {
998
+ interface ResumeSubscriptionRequested$1 {
860
999
  subscription?: Subscription$1;
1000
+ resumeAt?: ResumeAt$1;
1001
+ actionDetails?: ActionDetails$1;
861
1002
  }
862
- interface CustomerExtendSubscriptionRequest$1 {
863
- /** The ID of the subscription to be extended */
864
- id: string;
865
- /** Optional action reason message */
866
- reason?: string | null;
867
- /** For termed - Subscription end date will be updated with the extension period and number of cycles will be added */
868
- billingCyclesToAdd: number | null;
1003
+ interface ScheduledPauseCanceled$1 {
1004
+ subscription?: Subscription$1;
1005
+ actionDetails?: ActionDetails$1;
869
1006
  }
870
- interface CustomerExtendSubscriptionResponse$1 {
871
- /** The now extended subscription */
1007
+ interface ScheduledResumeCanceled$1 {
1008
+ subscription?: Subscription$1;
1009
+ actionDetails?: ActionDetails$1;
1010
+ }
1011
+ interface SubscriptionBillingCycleStarted$1 {
1012
+ subscription?: Subscription$1;
1013
+ /** Wix Pay transaction id, optional. Exists if event was triggered by a payment. */
1014
+ paymentTransactionId?: string | null;
1015
+ }
1016
+ interface SubscriptionAutoRenewalTurnedOn$1 {
1017
+ subscription?: Subscription$1;
1018
+ actionDetails?: ActionDetails$1;
1019
+ }
1020
+ interface SubscriptionAutoRenewalTurnedOff$1 {
1021
+ subscription?: Subscription$1;
1022
+ actionDetails?: ActionDetails$1;
1023
+ }
1024
+ interface SubscriptionCycleReadyToPay$1 {
872
1025
  subscription?: Subscription$1;
873
1026
  }
874
1027
  interface SubscriptionExtended$1 extends SubscriptionExtendedExtendPolicyOneOf$1 {
@@ -882,68 +1035,95 @@ interface SubscriptionExtendedExtendPolicyOneOf$1 {
882
1035
  extensionPeriod?: Duration$1;
883
1036
  extensionBillingCycles?: number;
884
1037
  }
885
- interface QuerySubscriptionsRequest$1 {
886
- query?: QueryV2$1;
1038
+ interface SubscriptionInitialPurchaseCompleted$1 {
1039
+ subscription?: Subscription$1;
1040
+ actionDetails?: ActionDetails$1;
1041
+ paymentTransactionId?: string | null;
887
1042
  }
888
- interface QueryV2$1 extends QueryV2PagingMethodOneOf$1 {
889
- /** Paging options to limit and skip the number of items. */
890
- paging?: Paging$1;
891
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
892
- cursorPaging?: CursorPaging$1;
893
- /**
894
- * Filter object.
895
- *
896
- * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
897
- */
898
- filter?: Record<string, any> | null;
899
- /**
900
- * Sort object.
901
- *
902
- * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
903
- */
904
- sort?: Sorting$1[];
905
- /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
906
- fields?: string[];
907
- /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
908
- fieldsets?: string[];
1043
+ interface LatestInvoiceMarkedAsPaid$1 {
1044
+ subscription?: Subscription$1;
909
1045
  }
910
- /** @oneof */
911
- interface QueryV2PagingMethodOneOf$1 {
912
- /** Paging options to limit and skip the number of items. */
913
- paging?: Paging$1;
914
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
915
- cursorPaging?: CursorPaging$1;
1046
+ interface SubscriptionRevived$1 {
1047
+ subscription?: Subscription$1;
916
1048
  }
917
- interface Sorting$1 {
918
- /** Name of the field to sort by. */
919
- fieldName?: string;
920
- /** Sort order. */
921
- order?: SortOrder$1;
1049
+ interface SubscriptionBillingDateUpdated$1 {
1050
+ subscription?: Subscription$1;
1051
+ billingDate?: Date | null;
1052
+ proration?: Proration$1;
922
1053
  }
923
- declare enum SortOrder$1 {
924
- ASC = "ASC",
925
- DESC = "DESC"
1054
+ interface FutureUpdatesRequested$1 {
1055
+ subscription?: Subscription$1;
1056
+ requestedUpdateData?: SubscriptionUpdateData$1;
926
1057
  }
927
- interface Paging$1 {
928
- /** Number of items to load. */
929
- limit?: number | null;
930
- /** Number of items to skip in the current sort order. */
931
- offset?: number | null;
1058
+ interface UpdatesApplied$1 {
1059
+ subscription?: Subscription$1;
1060
+ updateAction?: UpdateAction$1;
1061
+ appliedUpdateData?: SubscriptionUpdateData$1;
932
1062
  }
933
- interface CursorPaging$1 {
934
- /** Maximum number of items to return in the results. */
935
- limit?: number | null;
936
- /**
937
- * Pointer to the next or previous page in the list of results.
938
- *
939
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
940
- * Not relevant for the first request.
941
- */
942
- cursor?: string | null;
1063
+ declare enum UpdateAction$1 {
1064
+ NONE = "NONE",
1065
+ /** Update subscription immediately, please note proration for updates changing price are not yet supported */
1066
+ IMMEDIATELY = "IMMEDIATELY",
1067
+ /** Request updates that will take affect only at the start of the next billing cycle. */
1068
+ NEXT_BILLING_CYCLE = "NEXT_BILLING_CYCLE",
1069
+ /** Reset all pending updates */
1070
+ RESET_PENDING_UPDATES = "RESET_PENDING_UPDATES",
1071
+ /** Request updates that will take affect only at a specific date. */
1072
+ SPECIFIC_DATE = "SPECIFIC_DATE"
943
1073
  }
944
- interface QuerySubscriptionsResponse$1 {
945
- subscriptions?: Subscription$1[];
946
- metadata?: PagingMetadataV2$1;
1074
+ interface ResetPendingUpdates$1 {
1075
+ subscription?: Subscription$1;
1076
+ }
1077
+ interface GracePeriodStarted$1 {
1078
+ subscription?: Subscription$1;
1079
+ }
1080
+ interface GracePeriodEnded$1 {
1081
+ subscription?: Subscription$1;
1082
+ /** Indication for the payment settlement method. */
1083
+ paymentSettlementMethod?: PaymentSettlementMethod$1;
1084
+ }
1085
+ declare enum PaymentSettlementMethod$1 {
1086
+ UNKNOWN = "UNKNOWN",
1087
+ /** System-defined payment settlement. */
1088
+ SYSTEM = "SYSTEM",
1089
+ /** Manually mark the payment as paid. */
1090
+ MARK_AS_PAID = "MARK_AS_PAID",
1091
+ /** Require the customer to pay immediately, by insert a new payment method. */
1092
+ CUSTOMER_PAY_NOW = "CUSTOMER_PAY_NOW"
1093
+ }
1094
+ interface PaymentMethodUpdated$1 {
1095
+ subscription?: Subscription$1;
1096
+ initiator?: HistoryActionInitiator$1;
1097
+ paymentMode?: PaymentMode$1;
1098
+ }
1099
+ declare enum PaymentMode$1 {
1100
+ NONE = "NONE",
1101
+ /** The latest invoice of the subscription will be charged. */
1102
+ CHARGE = "CHARGE",
1103
+ /** An authorization invoice with zero amount will be created. */
1104
+ AUTHORIZATION = "AUTHORIZATION"
1105
+ }
1106
+ interface SubscriptionCollectionMethodUpdated$1 {
1107
+ subscription?: Subscription$1;
1108
+ newCollectionMethod?: CollectionMethodEnumCollectionMethod$1;
1109
+ previousCollectionMethod?: CollectionMethodEnumCollectionMethod$1;
1110
+ }
1111
+ interface FreeTrailStarted$1 {
1112
+ subscription?: Subscription$1;
1113
+ }
1114
+ interface FreeTrailEnded$1 {
1115
+ subscription?: Subscription$1;
1116
+ }
1117
+ interface SubscriptionBackOfficeAction$1 {
1118
+ subscription?: Subscription$1;
1119
+ /** The backoffice method name */
1120
+ name?: string;
1121
+ /** json as string format, to store the flatted request object */
1122
+ params?: string;
1123
+ }
1124
+ /** Defines unknown events restored from the logs */
1125
+ interface UnknownSubscriptionEvent$1 {
1126
+ subscriptionAsString?: string | null;
947
1127
  }
948
1128
  interface PagingMetadataV2$1 {
949
1129
  /** Number of items returned in the response. */
@@ -963,6 +1143,100 @@ interface Cursors$1 {
963
1143
  /** Cursor pointing to the previous page in the list of results. */
964
1144
  prev?: string | null;
965
1145
  }
1146
+ interface GetSubscriptionRequest$1 {
1147
+ id: string;
1148
+ }
1149
+ interface GetSubscriptionResponse$1 {
1150
+ subscription?: Subscription$1;
1151
+ }
1152
+ interface CustomerCancelSubscriptionRequest$1 {
1153
+ id: string;
1154
+ /** Optional action reason message */
1155
+ reason?: string | null;
1156
+ }
1157
+ interface CustomerCancelSubscriptionResponse$1 {
1158
+ subscription?: Subscription$1;
1159
+ }
1160
+ interface CustomerTurnOnAutoRenewalRequest$1 {
1161
+ id: string;
1162
+ /** Optional action reason message */
1163
+ reason?: string | null;
1164
+ }
1165
+ interface CustomerTurnOnAutoRenewalResponse$1 {
1166
+ subscription?: Subscription$1;
1167
+ }
1168
+ interface CustomerTurnOffAutoRenewalRequest$1 {
1169
+ id: string;
1170
+ /** Optional action reason message */
1171
+ reason?: string | null;
1172
+ }
1173
+ interface CustomerTurnOffAutoRenewalResponse$1 {
1174
+ subscription?: Subscription$1;
1175
+ }
1176
+ interface CustomerExtendSubscriptionRequest$1 {
1177
+ /** The ID of the subscription to be extended */
1178
+ id: string;
1179
+ /** Optional action reason message */
1180
+ reason?: string | null;
1181
+ /** For termed - Subscription end date will be updated with the extension period and number of cycles will be added */
1182
+ billingCyclesToAdd: number | null;
1183
+ }
1184
+ interface CustomerExtendSubscriptionResponse$1 {
1185
+ /** The now extended subscription */
1186
+ subscription?: Subscription$1;
1187
+ }
1188
+ interface QuerySubscriptionsRequest$1 {
1189
+ query?: QueryV2$1;
1190
+ }
1191
+ interface QueryV2$1 extends QueryV2PagingMethodOneOf$1 {
1192
+ /** Paging options to limit and skip the number of items. */
1193
+ paging?: Paging$1;
1194
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
1195
+ cursorPaging?: CursorPaging$1;
1196
+ /**
1197
+ * Filter object.
1198
+ *
1199
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
1200
+ */
1201
+ filter?: Record<string, any> | null;
1202
+ /**
1203
+ * Sort object.
1204
+ *
1205
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
1206
+ */
1207
+ sort?: Sorting$1[];
1208
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
1209
+ fields?: string[];
1210
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
1211
+ fieldsets?: string[];
1212
+ }
1213
+ /** @oneof */
1214
+ interface QueryV2PagingMethodOneOf$1 {
1215
+ /** Paging options to limit and skip the number of items. */
1216
+ paging?: Paging$1;
1217
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
1218
+ cursorPaging?: CursorPaging$1;
1219
+ }
1220
+ interface Sorting$1 {
1221
+ /** Name of the field to sort by. */
1222
+ fieldName?: string;
1223
+ /** Sort order. */
1224
+ order?: SortOrder$1;
1225
+ }
1226
+ declare enum SortOrder$1 {
1227
+ ASC = "ASC",
1228
+ DESC = "DESC"
1229
+ }
1230
+ interface Paging$1 {
1231
+ /** Number of items to load. */
1232
+ limit?: number | null;
1233
+ /** Number of items to skip in the current sort order. */
1234
+ offset?: number | null;
1235
+ }
1236
+ interface QuerySubscriptionsResponse$1 {
1237
+ subscriptions?: Subscription$1[];
1238
+ metadata?: PagingMetadataV2$1;
1239
+ }
966
1240
  interface CountSubscriptionsRequest$1 {
967
1241
  /** Filters to specify which subscriptions are counted. */
968
1242
  filter?: CountSubscriptionFilter$1;
@@ -1010,7 +1284,6 @@ interface SubscriptionStatus$1 {
1010
1284
  statuses?: SubscriptionStatusEnumSubscriptionStatus$1[];
1011
1285
  }
1012
1286
  declare enum SubscriptionStatusGroup$1 {
1013
- UNKNOWN_STATUS_GROUP = "UNKNOWN_STATUS_GROUP",
1014
1287
  ALL = "ALL",
1015
1288
  /** Union of ACTIVE, PAUSED and PENDING */
1016
1289
  LIVE = "LIVE"
@@ -1266,13 +1539,6 @@ interface InitiatePaymentMethodSetupRequest$1 {
1266
1539
  paymentMode?: PaymentMode$1;
1267
1540
  paymentSettings?: PaymentSettings$1;
1268
1541
  }
1269
- declare enum PaymentMode$1 {
1270
- NONE = "NONE",
1271
- /** The latest invoice of the subscription will be charged. */
1272
- CHARGE = "CHARGE",
1273
- /** An authorization invoice with zero amount will be created. */
1274
- AUTHORIZATION = "AUTHORIZATION"
1275
- }
1276
1542
  interface PaymentSettings$1 {
1277
1543
  /** Allowed payment providers for Subscriptions, for example to limit subscriptions to be created only with "Wix Payments" provider. */
1278
1544
  allowedProviderIds?: string[];
@@ -1315,64 +1581,6 @@ interface PaymentOrigin$1 {
1315
1581
  interface InitiatePaymentMethodSetupResponse$1 {
1316
1582
  paymentOrderId?: string;
1317
1583
  }
1318
- interface PayCycleRequest$1 {
1319
- subscriptionId: string;
1320
- paymentTestMode?: PaymentTestMode$1;
1321
- tenantId: string;
1322
- }
1323
- declare enum PaymentTestMode$1 {
1324
- REGULAR = "REGULAR",
1325
- FAIL_TECHNICAL = "FAIL_TECHNICAL",
1326
- FAIL_DECLINE = "FAIL_DECLINE",
1327
- FAIL_RETRYABLE_DECLINE = "FAIL_RETRYABLE_DECLINE"
1328
- }
1329
- interface PayCycleResponse$1 {
1330
- invoiceId?: string;
1331
- paymentOrderId?: string | null;
1332
- subscription?: Subscription$1;
1333
- }
1334
- declare enum ActionInitiator$1 {
1335
- UNDEFINED = "UNDEFINED",
1336
- BUSINESS = "BUSINESS",
1337
- CUSTOMER = "CUSTOMER",
1338
- SYSTEM = "SYSTEM"
1339
- }
1340
- interface SubscriptionBillingCycleStarted$1 {
1341
- subscription?: Subscription$1;
1342
- /** Wix Pay transaction id, optional. Exists if event was triggered by a payment. */
1343
- paymentTransactionId?: string | null;
1344
- }
1345
- /**
1346
- * Sent each time a subscription status has been set to Active
1347
- * Active shows that a subscription is live and operational.
1348
- * For example:
1349
- * * For subscription with free trial, free trial start date is also the activation date.
1350
- * * For a subscription with future start date, the start date is also the activation date.
1351
- * * When a subscription is resumed from a pause status, the resume date is also the activation date.
1352
- */
1353
- interface SubscriptionActivated$1 {
1354
- subscription?: Subscription$1;
1355
- }
1356
- /**
1357
- * Sent each time a subscription status has been set to Ended
1358
- * Ended shows that a subscription reached its end date and ended its life cycle as a result of the agreement.
1359
- * This is different from a Canceled subscription which ends the subscription before a designated end date.
1360
- * Therefore, Ended and Canceled are mutually exclusive.
1361
- */
1362
- interface SubscriptionEnded$1 {
1363
- subscription?: Subscription$1;
1364
- }
1365
- interface SubscriptionInitialPurchaseCompleted$1 {
1366
- subscription?: Subscription$1;
1367
- actionDetails?: ActionDetails$1;
1368
- paymentTransactionId?: string | null;
1369
- }
1370
- interface SubscriptionCycleReadyToPay$1 {
1371
- subscription?: Subscription$1;
1372
- }
1373
- interface SubscriptionRevived$1 {
1374
- subscription?: Subscription$1;
1375
- }
1376
1584
  interface UpdateSubscriptionBillingDateRequest$1 {
1377
1585
  /** ID of the subscription to update the billing date for. */
1378
1586
  id: string;
@@ -1393,22 +1601,6 @@ interface UpdateSubscriptionBillingDateResponse$1 {
1393
1601
  /** Updated subscription. */
1394
1602
  subscription?: Subscription$1;
1395
1603
  }
1396
- interface SubscriptionBillingDateUpdated$1 {
1397
- subscription?: Subscription$1;
1398
- billingDate?: Date | null;
1399
- proration?: Proration$1;
1400
- }
1401
- declare enum UpdateAction$1 {
1402
- NONE = "NONE",
1403
- /** Update subscription immediately, please note proration for updates changing price are not yet supported */
1404
- IMMEDIATELY = "IMMEDIATELY",
1405
- /** Request updates that will take affect only at the start of the next billing cycle. */
1406
- NEXT_BILLING_CYCLE = "NEXT_BILLING_CYCLE",
1407
- /** Reset all pending updates */
1408
- RESET_PENDING_UPDATES = "RESET_PENDING_UPDATES",
1409
- /** Request updates that will take affect only at a specific date. */
1410
- SPECIFIC_DATE = "SPECIFIC_DATE"
1411
- }
1412
1604
  interface ScheduleAdditionalInfo$1 extends ScheduleAdditionalInfoParamOneOf$1 {
1413
1605
  /**
1414
1606
  * Future date when the update becomes effective in `YYYY-MM-DDThh:mm:ss.sssZ`
@@ -1457,6 +1649,12 @@ interface ActionContext$1 {
1457
1649
  /** Optional action reason message */
1458
1650
  reason?: string | null;
1459
1651
  }
1652
+ declare enum ActionInitiator$1 {
1653
+ UNDEFINED = "UNDEFINED",
1654
+ BUSINESS = "BUSINESS",
1655
+ CUSTOMER = "CUSTOMER",
1656
+ SYSTEM = "SYSTEM"
1657
+ }
1460
1658
  interface CancelSubscriptionResponse$1 {
1461
1659
  subscription?: Subscription$1;
1462
1660
  }
@@ -1473,21 +1671,6 @@ interface PauseSubscriptionRequest$1 {
1473
1671
  interface PauseSubscriptionResponse$1 {
1474
1672
  subscription?: Subscription$1;
1475
1673
  }
1476
- interface SubscriptionPaused$1 {
1477
- subscription?: Subscription$1;
1478
- pausePolicy?: PausePolicy$1;
1479
- actionDetails?: ActionDetails$1;
1480
- }
1481
- interface PauseSubscriptionRequested$1 {
1482
- subscription?: Subscription$1;
1483
- pauseAt?: PauseAt$1;
1484
- pausePolicy?: PausePolicy$1;
1485
- actionDetails?: ActionDetails$1;
1486
- }
1487
- interface ScheduledPauseCanceled$1 {
1488
- subscription?: Subscription$1;
1489
- actionDetails?: ActionDetails$1;
1490
- }
1491
1674
  interface ResumeSubscriptionRequest$1 {
1492
1675
  id: string;
1493
1676
  resumeAt?: ResumeAt$1;
@@ -1498,19 +1681,6 @@ interface ResumeSubscriptionRequest$1 {
1498
1681
  interface ResumeSubscriptionResponse$1 {
1499
1682
  subscription?: Subscription$1;
1500
1683
  }
1501
- interface SubscriptionResumed$1 {
1502
- subscription?: Subscription$1;
1503
- actionDetails?: ActionDetails$1;
1504
- }
1505
- interface ResumeSubscriptionRequested$1 {
1506
- subscription?: Subscription$1;
1507
- resumeAt?: ResumeAt$1;
1508
- actionDetails?: ActionDetails$1;
1509
- }
1510
- interface ScheduledResumeCanceled$1 {
1511
- subscription?: Subscription$1;
1512
- actionDetails?: ActionDetails$1;
1513
- }
1514
1684
  interface SearchSubscriptionsRequest$1 extends SearchSubscriptionsRequestPagingMethodOneOf$1 {
1515
1685
  /** Limit number of results and enable to skip rows. The default limit is 25. */
1516
1686
  paging?: Paging$1;
@@ -1542,10 +1712,6 @@ interface TurnOnSubscriptionAutoRenewalRequest$1 {
1542
1712
  interface TurnOnSubscriptionAutoRenewalResponse$1 {
1543
1713
  subscription?: Subscription$1;
1544
1714
  }
1545
- interface SubscriptionAutoRenewalTurnedOn$1 {
1546
- subscription?: Subscription$1;
1547
- actionDetails?: ActionDetails$1;
1548
- }
1549
1715
  interface TurnOffSubscriptionAutoRenewalRequest$1 {
1550
1716
  id: string;
1551
1717
  actionContext: ActionContext$1;
@@ -1553,10 +1719,6 @@ interface TurnOffSubscriptionAutoRenewalRequest$1 {
1553
1719
  interface TurnOffSubscriptionAutoRenewalResponse$1 {
1554
1720
  subscription?: Subscription$1;
1555
1721
  }
1556
- interface SubscriptionAutoRenewalTurnedOff$1 {
1557
- subscription?: Subscription$1;
1558
- actionDetails?: ActionDetails$1;
1559
- }
1560
1722
  interface MarkLatestInvoiceAsPaidRequest$1 {
1561
1723
  /** The ID of the offline subscription to mark as paid its latest invoice */
1562
1724
  subscriptionId: string;
@@ -1564,9 +1726,6 @@ interface MarkLatestInvoiceAsPaidRequest$1 {
1564
1726
  interface MarkLatestInvoiceAsPaidResponse$1 {
1565
1727
  subscription?: Subscription$1;
1566
1728
  }
1567
- interface LatestInvoiceMarkedAsPaid$1 {
1568
- subscription?: Subscription$1;
1569
- }
1570
1729
  interface GetSubscriptionsStatsRequest$1 {
1571
1730
  }
1572
1731
  interface GetSubscriptionsStatsResponse$1 {
@@ -1705,173 +1864,21 @@ interface SubscriptionCharges$1 {
1705
1864
  /** Charges for subscription. */
1706
1865
  charges?: Charge$1[];
1707
1866
  }
1708
- interface ListSubscriptionHistoryRequest$1 {
1867
+ interface PayCycleRequest$1 {
1709
1868
  subscriptionId: string;
1710
- /** Determines the type of view for the history: either a comprehensive backoffice view or a user-centric view. */
1711
- mode?: HistoryViewMode$1;
1712
- /** Cursor for efficient paging. If paging through results, pass this field from the previous search response to continue to the next page. */
1713
- cursor?: CursorPaging$1;
1714
- }
1715
- declare enum HistoryViewMode$1 {
1716
- UNKNOWN = "UNKNOWN",
1717
- /** Comprehensive view including all history events. */
1718
- BACKOFFICE = "BACKOFFICE",
1719
- /** User-centric view of the history. */
1720
- USER = "USER"
1721
- }
1722
- interface ListSubscriptionHistoryResponse$1 {
1723
- /** List of history entries for the subscription. */
1724
- historyEntries?: SubscriptionHistoryEntry$1[];
1725
- /** Paging metadata. A `next` cursor is returned if there are more results. */
1726
- pagingMetadata?: PagingMetadataV2$1;
1727
- }
1728
- interface SubscriptionHistoryEntry$1 {
1729
- entryId?: string;
1730
- /** TODO: add max length? it is not defined in domainevents, so should we? */
1731
- slug?: string;
1732
- entryTime?: Date | null;
1733
- event?: SubscriptionEvent$1;
1734
- }
1735
- interface SubscriptionEvent$1 extends SubscriptionEventPayloadOneOf$1 {
1736
- created?: SubscriptionCreated$1;
1737
- updated?: SubscriptionUpdated$1;
1738
- deleted?: SubscriptionDeleted$1;
1739
- activated?: SubscriptionActivated$1;
1740
- ended?: SubscriptionEnded$1;
1741
- canceled?: SubscriptionCanceled$1;
1742
- paused?: SubscriptionPaused$1;
1743
- resumed?: SubscriptionResumed$1;
1744
- pauseRequested?: PauseSubscriptionRequested$1;
1745
- resumeRequested?: ResumeSubscriptionRequested$1;
1746
- scheduledPauseCanceled?: ScheduledPauseCanceled$1;
1747
- scheduledResumeCanceled?: ScheduledResumeCanceled$1;
1748
- billingCycleStarted?: SubscriptionBillingCycleStarted$1;
1749
- autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn$1;
1750
- autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff$1;
1751
- cycleReadyToPay?: SubscriptionCycleReadyToPay$1;
1752
- extended?: SubscriptionExtended$1;
1753
- initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted$1;
1754
- latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid$1;
1755
- revived?: SubscriptionRevived$1;
1756
- billingDateUpdated?: SubscriptionBillingDateUpdated$1;
1757
- futureUpdatesRequested?: FutureUpdatesRequested$1;
1758
- updatesApplied?: UpdatesApplied$1;
1759
- resetPendingUpdates?: ResetPendingUpdates$1;
1760
- gracePeriodStarted?: GracePeriodStarted$1;
1761
- gracePeriodEnded?: GracePeriodEnded$1;
1762
- paymentMethodUpdated?: PaymentMethodUpdated$1;
1763
- collectionMethodUpdated?: SubscriptionCollectionMethodUpdated$1;
1764
- freeTrailStarted?: FreeTrailStarted$1;
1765
- freeTrailEnded?: FreeTrailEnded$1;
1766
- subscriptionBoAction?: SubscriptionBackOfficeAction$1;
1767
- unknown?: UnknownSubscriptionEvent$1;
1768
- }
1769
- /** @oneof */
1770
- interface SubscriptionEventPayloadOneOf$1 {
1771
- created?: SubscriptionCreated$1;
1772
- updated?: SubscriptionUpdated$1;
1773
- deleted?: SubscriptionDeleted$1;
1774
- activated?: SubscriptionActivated$1;
1775
- ended?: SubscriptionEnded$1;
1776
- canceled?: SubscriptionCanceled$1;
1777
- paused?: SubscriptionPaused$1;
1778
- resumed?: SubscriptionResumed$1;
1779
- pauseRequested?: PauseSubscriptionRequested$1;
1780
- resumeRequested?: ResumeSubscriptionRequested$1;
1781
- scheduledPauseCanceled?: ScheduledPauseCanceled$1;
1782
- scheduledResumeCanceled?: ScheduledResumeCanceled$1;
1783
- billingCycleStarted?: SubscriptionBillingCycleStarted$1;
1784
- autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn$1;
1785
- autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff$1;
1786
- cycleReadyToPay?: SubscriptionCycleReadyToPay$1;
1787
- extended?: SubscriptionExtended$1;
1788
- initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted$1;
1789
- latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid$1;
1790
- revived?: SubscriptionRevived$1;
1791
- billingDateUpdated?: SubscriptionBillingDateUpdated$1;
1792
- futureUpdatesRequested?: FutureUpdatesRequested$1;
1793
- updatesApplied?: UpdatesApplied$1;
1794
- resetPendingUpdates?: ResetPendingUpdates$1;
1795
- gracePeriodStarted?: GracePeriodStarted$1;
1796
- gracePeriodEnded?: GracePeriodEnded$1;
1797
- paymentMethodUpdated?: PaymentMethodUpdated$1;
1798
- collectionMethodUpdated?: SubscriptionCollectionMethodUpdated$1;
1799
- freeTrailStarted?: FreeTrailStarted$1;
1800
- freeTrailEnded?: FreeTrailEnded$1;
1801
- subscriptionBoAction?: SubscriptionBackOfficeAction$1;
1802
- unknown?: UnknownSubscriptionEvent$1;
1803
- }
1804
- interface SubscriptionCreated$1 {
1805
- subscription?: Subscription$1;
1806
- }
1807
- interface SubscriptionUpdated$1 {
1808
- current?: Subscription$1;
1809
- previous?: Subscription$1;
1810
- diff?: SubscriptionDiff$1;
1811
- }
1812
- interface SubscriptionDiff$1 {
1813
- added?: string | null;
1814
- changed?: string | null;
1815
- deleted?: string | null;
1816
- }
1817
- interface SubscriptionDeleted$1 {
1818
- subscriptionId?: string;
1819
- }
1820
- interface FutureUpdatesRequested$1 {
1821
- subscription?: Subscription$1;
1822
- requestedUpdateData?: SubscriptionUpdateData$1;
1823
- }
1824
- interface UpdatesApplied$1 {
1825
- subscription?: Subscription$1;
1826
- updateAction?: UpdateAction$1;
1827
- appliedUpdateData?: SubscriptionUpdateData$1;
1828
- }
1829
- interface ResetPendingUpdates$1 {
1830
- subscription?: Subscription$1;
1831
- }
1832
- interface GracePeriodStarted$1 {
1833
- subscription?: Subscription$1;
1834
- }
1835
- interface GracePeriodEnded$1 {
1836
- subscription?: Subscription$1;
1837
- /** Indication for the payment settlement method. */
1838
- paymentSettlementMethod?: PaymentSettlementMethod$1;
1839
- }
1840
- declare enum PaymentSettlementMethod$1 {
1841
- UNKNOWN = "UNKNOWN",
1842
- /** System-defined payment settlement. */
1843
- SYSTEM = "SYSTEM",
1844
- /** Manually mark the payment as paid. */
1845
- MARK_AS_PAID = "MARK_AS_PAID",
1846
- /** Require the customer to pay immediately, by insert a new payment method. */
1847
- CUSTOMER_PAY_NOW = "CUSTOMER_PAY_NOW"
1848
- }
1849
- interface PaymentMethodUpdated$1 {
1850
- subscription?: Subscription$1;
1851
- initiator?: HistoryActionInitiator$1;
1852
- paymentMode?: PaymentMode$1;
1853
- }
1854
- interface SubscriptionCollectionMethodUpdated$1 {
1855
- subscription?: Subscription$1;
1856
- newCollectionMethod?: CollectionMethodEnumCollectionMethod$1;
1857
- previousCollectionMethod?: CollectionMethodEnumCollectionMethod$1;
1858
- }
1859
- interface FreeTrailStarted$1 {
1860
- subscription?: Subscription$1;
1869
+ paymentTestMode?: PaymentTestMode$1;
1870
+ tenantId: string;
1861
1871
  }
1862
- interface FreeTrailEnded$1 {
1863
- subscription?: Subscription$1;
1872
+ declare enum PaymentTestMode$1 {
1873
+ REGULAR = "REGULAR",
1874
+ FAIL_TECHNICAL = "FAIL_TECHNICAL",
1875
+ FAIL_DECLINE = "FAIL_DECLINE",
1876
+ FAIL_RETRYABLE_DECLINE = "FAIL_RETRYABLE_DECLINE"
1864
1877
  }
1865
- interface SubscriptionBackOfficeAction$1 {
1878
+ interface PayCycleResponse$1 {
1879
+ invoiceId?: string;
1880
+ paymentOrderId?: string | null;
1866
1881
  subscription?: Subscription$1;
1867
- /** The backoffice method name */
1868
- name?: string;
1869
- /** json as string format, to store the flatted request object */
1870
- params?: string;
1871
- }
1872
- /** Defines unknown events restored from the logs */
1873
- interface UnknownSubscriptionEvent$1 {
1874
- subscriptionAsString?: string | null;
1875
1882
  }
1876
1883
  interface CustomerNonNullableFields$1 {
1877
1884
  visitorId: string;
@@ -2046,29 +2053,195 @@ interface SubscriptionNonNullableFields$1 {
2046
2053
  specificDatePendingUpdateData?: SpecificDateSubscriptionUpdateDataNonNullableFields$1;
2047
2054
  items: ItemNonNullableFields$1[];
2048
2055
  }
2049
- interface GetSubscriptionResponseNonNullableFields$1 {
2056
+ interface SubscriptionCreatedNonNullableFields$1 {
2050
2057
  subscription?: SubscriptionNonNullableFields$1;
2051
2058
  }
2052
- interface CustomerCancelSubscriptionResponseNonNullableFields$1 {
2059
+ interface SubscriptionUpdatedNonNullableFields$1 {
2060
+ current?: SubscriptionNonNullableFields$1;
2061
+ previous?: SubscriptionNonNullableFields$1;
2062
+ }
2063
+ interface SubscriptionDeletedNonNullableFields$1 {
2064
+ subscriptionId: string;
2065
+ }
2066
+ interface SubscriptionActivatedNonNullableFields$1 {
2053
2067
  subscription?: SubscriptionNonNullableFields$1;
2054
2068
  }
2055
- interface CustomerTurnOnAutoRenewalResponseNonNullableFields$1 {
2069
+ interface SubscriptionEndedNonNullableFields$1 {
2056
2070
  subscription?: SubscriptionNonNullableFields$1;
2057
2071
  }
2058
- interface CustomerTurnOffAutoRenewalResponseNonNullableFields$1 {
2072
+ interface ActionDetailsNonNullableFields$1 {
2073
+ initiator: HistoryActionInitiator$1;
2074
+ }
2075
+ interface SubscriptionCanceledNonNullableFields$1 {
2059
2076
  subscription?: SubscriptionNonNullableFields$1;
2077
+ actionDetails?: ActionDetailsNonNullableFields$1;
2060
2078
  }
2061
- interface CustomerExtendSubscriptionResponseNonNullableFields$1 {
2079
+ interface SubscriptionPausedNonNullableFields$1 {
2062
2080
  subscription?: SubscriptionNonNullableFields$1;
2081
+ pausePolicy: PausePolicy$1;
2082
+ actionDetails?: ActionDetailsNonNullableFields$1;
2063
2083
  }
2064
- interface QuerySubscriptionsResponseNonNullableFields$1 {
2065
- subscriptions: SubscriptionNonNullableFields$1[];
2084
+ interface SubscriptionResumedNonNullableFields$1 {
2085
+ subscription?: SubscriptionNonNullableFields$1;
2086
+ actionDetails?: ActionDetailsNonNullableFields$1;
2066
2087
  }
2067
- interface UpdateSubscriptionPaymentMethodResponseNonNullableFields$1 {
2088
+ interface PauseSubscriptionRequestedNonNullableFields$1 {
2068
2089
  subscription?: SubscriptionNonNullableFields$1;
2090
+ pauseAt: PauseAt$1;
2091
+ pausePolicy: PausePolicy$1;
2092
+ actionDetails?: ActionDetailsNonNullableFields$1;
2069
2093
  }
2070
- interface ActionNonNullableFields$1 {
2071
- actionType: ActionType$1;
2094
+ interface ResumeSubscriptionRequestedNonNullableFields$1 {
2095
+ subscription?: SubscriptionNonNullableFields$1;
2096
+ resumeAt: ResumeAt$1;
2097
+ actionDetails?: ActionDetailsNonNullableFields$1;
2098
+ }
2099
+ interface ScheduledPauseCanceledNonNullableFields$1 {
2100
+ subscription?: SubscriptionNonNullableFields$1;
2101
+ actionDetails?: ActionDetailsNonNullableFields$1;
2102
+ }
2103
+ interface ScheduledResumeCanceledNonNullableFields$1 {
2104
+ subscription?: SubscriptionNonNullableFields$1;
2105
+ actionDetails?: ActionDetailsNonNullableFields$1;
2106
+ }
2107
+ interface SubscriptionBillingCycleStartedNonNullableFields$1 {
2108
+ subscription?: SubscriptionNonNullableFields$1;
2109
+ }
2110
+ interface SubscriptionAutoRenewalTurnedOnNonNullableFields$1 {
2111
+ subscription?: SubscriptionNonNullableFields$1;
2112
+ actionDetails?: ActionDetailsNonNullableFields$1;
2113
+ }
2114
+ interface SubscriptionAutoRenewalTurnedOffNonNullableFields$1 {
2115
+ subscription?: SubscriptionNonNullableFields$1;
2116
+ actionDetails?: ActionDetailsNonNullableFields$1;
2117
+ }
2118
+ interface SubscriptionCycleReadyToPayNonNullableFields$1 {
2119
+ subscription?: SubscriptionNonNullableFields$1;
2120
+ }
2121
+ interface SubscriptionExtendedNonNullableFields$1 {
2122
+ extensionPeriod?: DurationNonNullableFields$1;
2123
+ extensionBillingCycles: number;
2124
+ subscription?: SubscriptionNonNullableFields$1;
2125
+ actionDetails?: ActionDetailsNonNullableFields$1;
2126
+ }
2127
+ interface SubscriptionInitialPurchaseCompletedNonNullableFields$1 {
2128
+ subscription?: SubscriptionNonNullableFields$1;
2129
+ actionDetails?: ActionDetailsNonNullableFields$1;
2130
+ }
2131
+ interface LatestInvoiceMarkedAsPaidNonNullableFields$1 {
2132
+ subscription?: SubscriptionNonNullableFields$1;
2133
+ }
2134
+ interface SubscriptionRevivedNonNullableFields$1 {
2135
+ subscription?: SubscriptionNonNullableFields$1;
2136
+ }
2137
+ interface SubscriptionBillingDateUpdatedNonNullableFields$1 {
2138
+ subscription?: SubscriptionNonNullableFields$1;
2139
+ proration?: ProrationNonNullableFields$1;
2140
+ }
2141
+ interface FutureUpdatesRequestedNonNullableFields$1 {
2142
+ subscription?: SubscriptionNonNullableFields$1;
2143
+ requestedUpdateData?: SubscriptionUpdateDataNonNullableFields$1;
2144
+ }
2145
+ interface UpdatesAppliedNonNullableFields$1 {
2146
+ subscription?: SubscriptionNonNullableFields$1;
2147
+ updateAction: UpdateAction$1;
2148
+ appliedUpdateData?: SubscriptionUpdateDataNonNullableFields$1;
2149
+ }
2150
+ interface ResetPendingUpdatesNonNullableFields$1 {
2151
+ subscription?: SubscriptionNonNullableFields$1;
2152
+ }
2153
+ interface GracePeriodStartedNonNullableFields$1 {
2154
+ subscription?: SubscriptionNonNullableFields$1;
2155
+ }
2156
+ interface GracePeriodEndedNonNullableFields$1 {
2157
+ subscription?: SubscriptionNonNullableFields$1;
2158
+ paymentSettlementMethod: PaymentSettlementMethod$1;
2159
+ }
2160
+ interface PaymentMethodUpdatedNonNullableFields$1 {
2161
+ subscription?: SubscriptionNonNullableFields$1;
2162
+ initiator: HistoryActionInitiator$1;
2163
+ paymentMode: PaymentMode$1;
2164
+ }
2165
+ interface SubscriptionCollectionMethodUpdatedNonNullableFields$1 {
2166
+ subscription?: SubscriptionNonNullableFields$1;
2167
+ newCollectionMethod: CollectionMethodEnumCollectionMethod$1;
2168
+ previousCollectionMethod: CollectionMethodEnumCollectionMethod$1;
2169
+ }
2170
+ interface FreeTrailStartedNonNullableFields$1 {
2171
+ subscription?: SubscriptionNonNullableFields$1;
2172
+ }
2173
+ interface FreeTrailEndedNonNullableFields$1 {
2174
+ subscription?: SubscriptionNonNullableFields$1;
2175
+ }
2176
+ interface SubscriptionBackOfficeActionNonNullableFields$1 {
2177
+ subscription?: SubscriptionNonNullableFields$1;
2178
+ name: string;
2179
+ params: string;
2180
+ }
2181
+ interface SubscriptionEventNonNullableFields$1 {
2182
+ created?: SubscriptionCreatedNonNullableFields$1;
2183
+ updated?: SubscriptionUpdatedNonNullableFields$1;
2184
+ deleted?: SubscriptionDeletedNonNullableFields$1;
2185
+ activated?: SubscriptionActivatedNonNullableFields$1;
2186
+ ended?: SubscriptionEndedNonNullableFields$1;
2187
+ canceled?: SubscriptionCanceledNonNullableFields$1;
2188
+ paused?: SubscriptionPausedNonNullableFields$1;
2189
+ resumed?: SubscriptionResumedNonNullableFields$1;
2190
+ pauseRequested?: PauseSubscriptionRequestedNonNullableFields$1;
2191
+ resumeRequested?: ResumeSubscriptionRequestedNonNullableFields$1;
2192
+ scheduledPauseCanceled?: ScheduledPauseCanceledNonNullableFields$1;
2193
+ scheduledResumeCanceled?: ScheduledResumeCanceledNonNullableFields$1;
2194
+ billingCycleStarted?: SubscriptionBillingCycleStartedNonNullableFields$1;
2195
+ autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOnNonNullableFields$1;
2196
+ autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOffNonNullableFields$1;
2197
+ cycleReadyToPay?: SubscriptionCycleReadyToPayNonNullableFields$1;
2198
+ extended?: SubscriptionExtendedNonNullableFields$1;
2199
+ initialPurchaseCompleted?: SubscriptionInitialPurchaseCompletedNonNullableFields$1;
2200
+ latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaidNonNullableFields$1;
2201
+ revived?: SubscriptionRevivedNonNullableFields$1;
2202
+ billingDateUpdated?: SubscriptionBillingDateUpdatedNonNullableFields$1;
2203
+ futureUpdatesRequested?: FutureUpdatesRequestedNonNullableFields$1;
2204
+ updatesApplied?: UpdatesAppliedNonNullableFields$1;
2205
+ resetPendingUpdates?: ResetPendingUpdatesNonNullableFields$1;
2206
+ gracePeriodStarted?: GracePeriodStartedNonNullableFields$1;
2207
+ gracePeriodEnded?: GracePeriodEndedNonNullableFields$1;
2208
+ paymentMethodUpdated?: PaymentMethodUpdatedNonNullableFields$1;
2209
+ collectionMethodUpdated?: SubscriptionCollectionMethodUpdatedNonNullableFields$1;
2210
+ freeTrailStarted?: FreeTrailStartedNonNullableFields$1;
2211
+ freeTrailEnded?: FreeTrailEndedNonNullableFields$1;
2212
+ subscriptionBoAction?: SubscriptionBackOfficeActionNonNullableFields$1;
2213
+ }
2214
+ interface SubscriptionHistoryEntryNonNullableFields$1 {
2215
+ entryId: string;
2216
+ slug: string;
2217
+ event?: SubscriptionEventNonNullableFields$1;
2218
+ }
2219
+ interface ListSubscriptionHistoryResponseNonNullableFields$1 {
2220
+ historyEntries: SubscriptionHistoryEntryNonNullableFields$1[];
2221
+ }
2222
+ interface GetSubscriptionResponseNonNullableFields$1 {
2223
+ subscription?: SubscriptionNonNullableFields$1;
2224
+ }
2225
+ interface CustomerCancelSubscriptionResponseNonNullableFields$1 {
2226
+ subscription?: SubscriptionNonNullableFields$1;
2227
+ }
2228
+ interface CustomerTurnOnAutoRenewalResponseNonNullableFields$1 {
2229
+ subscription?: SubscriptionNonNullableFields$1;
2230
+ }
2231
+ interface CustomerTurnOffAutoRenewalResponseNonNullableFields$1 {
2232
+ subscription?: SubscriptionNonNullableFields$1;
2233
+ }
2234
+ interface CustomerExtendSubscriptionResponseNonNullableFields$1 {
2235
+ subscription?: SubscriptionNonNullableFields$1;
2236
+ }
2237
+ interface QuerySubscriptionsResponseNonNullableFields$1 {
2238
+ subscriptions: SubscriptionNonNullableFields$1[];
2239
+ }
2240
+ interface UpdateSubscriptionPaymentMethodResponseNonNullableFields$1 {
2241
+ subscription?: SubscriptionNonNullableFields$1;
2242
+ }
2243
+ interface ActionNonNullableFields$1 {
2244
+ actionType: ActionType$1;
2072
2245
  pausePolicies: PausePolicy$1[];
2073
2246
  pauseAt: PauseAt$1[];
2074
2247
  resumeAt: ResumeAt$1[];
@@ -2132,10 +2305,6 @@ interface CustomerListUpcomingChargesResponseNonNullableFields$1 {
2132
2305
  interface InitiatePaymentMethodSetupResponseNonNullableFields$1 {
2133
2306
  paymentOrderId: string;
2134
2307
  }
2135
- interface PayCycleResponseNonNullableFields$1 {
2136
- invoiceId: string;
2137
- subscription?: SubscriptionNonNullableFields$1;
2138
- }
2139
2308
  interface UpdateSubscriptionBillingDateResponseNonNullableFields$1 {
2140
2309
  subscription?: SubscriptionNonNullableFields$1;
2141
2310
  }
@@ -2206,266 +2375,106 @@ interface SubscriptionChargesNonNullableFields$1 {
2206
2375
  interface PreviewSubscriptionsChargesResponseNonNullableFields$1 {
2207
2376
  subscriptionsCharges: SubscriptionChargesNonNullableFields$1[];
2208
2377
  }
2209
- interface SubscriptionCreatedNonNullableFields$1 {
2378
+ interface PayCycleResponseNonNullableFields$1 {
2379
+ invoiceId: string;
2210
2380
  subscription?: SubscriptionNonNullableFields$1;
2211
2381
  }
2212
- interface SubscriptionUpdatedNonNullableFields$1 {
2213
- current?: SubscriptionNonNullableFields$1;
2214
- previous?: SubscriptionNonNullableFields$1;
2215
- }
2216
- interface SubscriptionDeletedNonNullableFields$1 {
2217
- subscriptionId: string;
2218
- }
2219
- interface SubscriptionActivatedNonNullableFields$1 {
2220
- subscription?: SubscriptionNonNullableFields$1;
2221
- }
2222
- interface SubscriptionEndedNonNullableFields$1 {
2223
- subscription?: SubscriptionNonNullableFields$1;
2224
- }
2225
- interface ActionDetailsNonNullableFields$1 {
2226
- initiator: HistoryActionInitiator$1;
2227
- }
2228
- interface SubscriptionCanceledNonNullableFields$1 {
2229
- subscription?: SubscriptionNonNullableFields$1;
2230
- actionDetails?: ActionDetailsNonNullableFields$1;
2231
- }
2232
- interface SubscriptionPausedNonNullableFields$1 {
2233
- subscription?: SubscriptionNonNullableFields$1;
2234
- pausePolicy: PausePolicy$1;
2235
- actionDetails?: ActionDetailsNonNullableFields$1;
2236
- }
2237
- interface SubscriptionResumedNonNullableFields$1 {
2238
- subscription?: SubscriptionNonNullableFields$1;
2239
- actionDetails?: ActionDetailsNonNullableFields$1;
2240
- }
2241
- interface PauseSubscriptionRequestedNonNullableFields$1 {
2242
- subscription?: SubscriptionNonNullableFields$1;
2243
- pauseAt: PauseAt$1;
2244
- pausePolicy: PausePolicy$1;
2245
- actionDetails?: ActionDetailsNonNullableFields$1;
2246
- }
2247
- interface ResumeSubscriptionRequestedNonNullableFields$1 {
2248
- subscription?: SubscriptionNonNullableFields$1;
2249
- resumeAt: ResumeAt$1;
2250
- actionDetails?: ActionDetailsNonNullableFields$1;
2251
- }
2252
- interface ScheduledPauseCanceledNonNullableFields$1 {
2253
- subscription?: SubscriptionNonNullableFields$1;
2254
- actionDetails?: ActionDetailsNonNullableFields$1;
2255
- }
2256
- interface ScheduledResumeCanceledNonNullableFields$1 {
2257
- subscription?: SubscriptionNonNullableFields$1;
2258
- actionDetails?: ActionDetailsNonNullableFields$1;
2259
- }
2260
- interface SubscriptionBillingCycleStartedNonNullableFields$1 {
2261
- subscription?: SubscriptionNonNullableFields$1;
2262
- }
2263
- interface SubscriptionAutoRenewalTurnedOnNonNullableFields$1 {
2264
- subscription?: SubscriptionNonNullableFields$1;
2265
- actionDetails?: ActionDetailsNonNullableFields$1;
2266
- }
2267
- interface SubscriptionAutoRenewalTurnedOffNonNullableFields$1 {
2268
- subscription?: SubscriptionNonNullableFields$1;
2269
- actionDetails?: ActionDetailsNonNullableFields$1;
2270
- }
2271
- interface SubscriptionCycleReadyToPayNonNullableFields$1 {
2272
- subscription?: SubscriptionNonNullableFields$1;
2273
- }
2274
- interface SubscriptionExtendedNonNullableFields$1 {
2275
- extensionPeriod?: DurationNonNullableFields$1;
2276
- extensionBillingCycles: number;
2277
- subscription?: SubscriptionNonNullableFields$1;
2278
- actionDetails?: ActionDetailsNonNullableFields$1;
2279
- }
2280
- interface SubscriptionInitialPurchaseCompletedNonNullableFields$1 {
2281
- subscription?: SubscriptionNonNullableFields$1;
2282
- actionDetails?: ActionDetailsNonNullableFields$1;
2283
- }
2284
- interface LatestInvoiceMarkedAsPaidNonNullableFields$1 {
2285
- subscription?: SubscriptionNonNullableFields$1;
2286
- }
2287
- interface SubscriptionRevivedNonNullableFields$1 {
2288
- subscription?: SubscriptionNonNullableFields$1;
2289
- }
2290
- interface SubscriptionBillingDateUpdatedNonNullableFields$1 {
2291
- subscription?: SubscriptionNonNullableFields$1;
2292
- proration?: ProrationNonNullableFields$1;
2293
- }
2294
- interface FutureUpdatesRequestedNonNullableFields$1 {
2295
- subscription?: SubscriptionNonNullableFields$1;
2296
- requestedUpdateData?: SubscriptionUpdateDataNonNullableFields$1;
2297
- }
2298
- interface UpdatesAppliedNonNullableFields$1 {
2299
- subscription?: SubscriptionNonNullableFields$1;
2300
- updateAction: UpdateAction$1;
2301
- appliedUpdateData?: SubscriptionUpdateDataNonNullableFields$1;
2302
- }
2303
- interface ResetPendingUpdatesNonNullableFields$1 {
2304
- subscription?: SubscriptionNonNullableFields$1;
2305
- }
2306
- interface GracePeriodStartedNonNullableFields$1 {
2307
- subscription?: SubscriptionNonNullableFields$1;
2308
- }
2309
- interface GracePeriodEndedNonNullableFields$1 {
2310
- subscription?: SubscriptionNonNullableFields$1;
2311
- paymentSettlementMethod: PaymentSettlementMethod$1;
2312
- }
2313
- interface PaymentMethodUpdatedNonNullableFields$1 {
2314
- subscription?: SubscriptionNonNullableFields$1;
2315
- initiator: HistoryActionInitiator$1;
2316
- paymentMode: PaymentMode$1;
2317
- }
2318
- interface SubscriptionCollectionMethodUpdatedNonNullableFields$1 {
2319
- subscription?: SubscriptionNonNullableFields$1;
2320
- newCollectionMethod: CollectionMethodEnumCollectionMethod$1;
2321
- previousCollectionMethod: CollectionMethodEnumCollectionMethod$1;
2322
- }
2323
- interface FreeTrailStartedNonNullableFields$1 {
2324
- subscription?: SubscriptionNonNullableFields$1;
2325
- }
2326
- interface FreeTrailEndedNonNullableFields$1 {
2327
- subscription?: SubscriptionNonNullableFields$1;
2328
- }
2329
- interface SubscriptionBackOfficeActionNonNullableFields$1 {
2330
- subscription?: SubscriptionNonNullableFields$1;
2331
- name: string;
2332
- params: string;
2333
- }
2334
- interface SubscriptionEventNonNullableFields$1 {
2335
- created?: SubscriptionCreatedNonNullableFields$1;
2336
- updated?: SubscriptionUpdatedNonNullableFields$1;
2337
- deleted?: SubscriptionDeletedNonNullableFields$1;
2338
- activated?: SubscriptionActivatedNonNullableFields$1;
2339
- ended?: SubscriptionEndedNonNullableFields$1;
2340
- canceled?: SubscriptionCanceledNonNullableFields$1;
2341
- paused?: SubscriptionPausedNonNullableFields$1;
2342
- resumed?: SubscriptionResumedNonNullableFields$1;
2343
- pauseRequested?: PauseSubscriptionRequestedNonNullableFields$1;
2344
- resumeRequested?: ResumeSubscriptionRequestedNonNullableFields$1;
2345
- scheduledPauseCanceled?: ScheduledPauseCanceledNonNullableFields$1;
2346
- scheduledResumeCanceled?: ScheduledResumeCanceledNonNullableFields$1;
2347
- billingCycleStarted?: SubscriptionBillingCycleStartedNonNullableFields$1;
2348
- autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOnNonNullableFields$1;
2349
- autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOffNonNullableFields$1;
2350
- cycleReadyToPay?: SubscriptionCycleReadyToPayNonNullableFields$1;
2351
- extended?: SubscriptionExtendedNonNullableFields$1;
2352
- initialPurchaseCompleted?: SubscriptionInitialPurchaseCompletedNonNullableFields$1;
2353
- latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaidNonNullableFields$1;
2354
- revived?: SubscriptionRevivedNonNullableFields$1;
2355
- billingDateUpdated?: SubscriptionBillingDateUpdatedNonNullableFields$1;
2356
- futureUpdatesRequested?: FutureUpdatesRequestedNonNullableFields$1;
2357
- updatesApplied?: UpdatesAppliedNonNullableFields$1;
2358
- resetPendingUpdates?: ResetPendingUpdatesNonNullableFields$1;
2359
- gracePeriodStarted?: GracePeriodStartedNonNullableFields$1;
2360
- gracePeriodEnded?: GracePeriodEndedNonNullableFields$1;
2361
- paymentMethodUpdated?: PaymentMethodUpdatedNonNullableFields$1;
2362
- collectionMethodUpdated?: SubscriptionCollectionMethodUpdatedNonNullableFields$1;
2363
- freeTrailStarted?: FreeTrailStartedNonNullableFields$1;
2364
- freeTrailEnded?: FreeTrailEndedNonNullableFields$1;
2365
- subscriptionBoAction?: SubscriptionBackOfficeActionNonNullableFields$1;
2366
- }
2367
- interface SubscriptionHistoryEntryNonNullableFields$1 {
2368
- entryId: string;
2369
- slug: string;
2370
- event?: SubscriptionEventNonNullableFields$1;
2371
- }
2372
- interface ListSubscriptionHistoryResponseNonNullableFields$1 {
2373
- historyEntries: SubscriptionHistoryEntryNonNullableFields$1[];
2374
- }
2375
-
2376
- interface Subscription {
2377
- /**
2378
- * Subscription's unique id. Automatically generated and read-only.
2379
- * @readonly
2380
- */
2381
- _id?: string | null;
2382
- /**
2383
- * Date when subscription was created
2384
- * @readonly
2385
- */
2386
- _createdDate?: Date | null;
2387
- /**
2388
- * Date when subscription was updated
2389
- * @readonly
2390
- */
2391
- _updatedDate?: Date | null;
2392
- /**
2393
- * Revision of subscription. Increments upon changes
2394
- * @readonly
2395
- */
2396
- revision?: string | null;
2397
- /** Subscription name: minLength is 1, maxLength is 150 */
2398
- name?: string;
2399
- /** Subscription description. Optional. */
2400
- description?: string | null;
2401
- /**
2402
- * If start_date is set in the future: custom_billing_schedule.cycles_to_pay_on_creation should be set to 1
2403
- * in order to pay on creation for first cycle, Subscription will be then activated in the future.
2404
- * Future start_date is not supported for `SEND_INVOICE` CollectionMethod
2405
- * If start_date is set in past, it means subscription was already started.
2406
- */
2407
- startDate?: Date | null;
2408
- /**
2409
- * Represents when the subscription will end, relevant for subscriptions with a termed period.
2410
- * If not provided, will be calculated based on billing schedule. Should be empty for evergreen subscription.
2411
- * Note: A 13-hour tolerance is applied when validating the end date to handle for time zone differences and minor discrepancies.
2412
- */
2413
- endDate?: Date | null;
2414
- /** Business origin subscription is coming from. In site-level subscription it will be vertical app_id and entity_id */
2415
- origin?: BusinessOrigin;
2416
- /** Customer information like id and identity type (member or contact) */
2417
- customer?: Customer;
2418
- /**
2419
- * Status of subscription
2420
- * @readonly
2421
- */
2422
- status?: SubscriptionStatusEnumSubscriptionStatus;
2423
- /** Billing details parameters including schedule, currency, etc. */
2424
- billingSettings?: BillingSettings;
2425
- /**
2426
- * Includes many attributes about billing status of the subscription
2427
- * @readonly
2428
- */
2429
- billingStatus?: BillingStatus;
2430
- /** Shipping address associated with subscription. At the moment used only for payments. Optional. */
2431
- shippingAddress?: FullAddressDetails;
2432
- /** Restrictions on possible subscription actions. If not provided, default policies are all restrictions enabled. */
2433
- policies?: SubscriptionPolicies;
2434
- /**
2435
- * Information related to either paused subscription or scheduled for future pause
2436
- * @readonly
2437
- */
2438
- pauseInfo?: PauseInfo;
2439
- /**
2440
- * Information related to cancellation for already canceled subscription or scheduled for cancel
2441
- * @readonly
2442
- */
2443
- cancellationInfo?: CancellationInfo;
2444
- /**
2445
- * Pending update for the next billing cycle
2446
- * @readonly
2447
- */
2448
- pendingUpdateData?: SubscriptionUpdateData;
2449
- /**
2450
- * Key / Value store to keep up to 10 additional values related to the subscription.
2451
- * Key max length = 50, Value max length = 200. Value can not be empty.
2452
- * Should not include any sensitive or PII information.
2453
- */
2454
- metadata?: Record<string, string>;
2455
- /**
2456
- * Pending update for a specific date
2457
- * @readonly
2458
- */
2459
- specificDatePendingUpdateData?: SpecificDateSubscriptionUpdateData;
2460
- /**
2461
- * ChangesCounter of subscription. Increments upon every change to the domain
2462
- * @readonly
2463
- */
2464
- changesCounter?: string | null;
2465
- /** Billing order id. Optional. */
2466
- orderId?: string | null;
2467
- /** items, minSize is 1, maxSize is 100 */
2468
- items?: Item[];
2382
+
2383
+ interface Subscription {
2384
+ /**
2385
+ * Subscription's unique id. Automatically generated and read-only.
2386
+ * @readonly
2387
+ */
2388
+ _id?: string | null;
2389
+ /**
2390
+ * Date when subscription was created
2391
+ * @readonly
2392
+ */
2393
+ _createdDate?: Date | null;
2394
+ /**
2395
+ * Date when subscription was updated
2396
+ * @readonly
2397
+ */
2398
+ _updatedDate?: Date | null;
2399
+ /**
2400
+ * Revision of subscription. Increments upon changes
2401
+ * @readonly
2402
+ */
2403
+ revision?: string | null;
2404
+ /** Subscription name: minLength is 1, maxLength is 150 */
2405
+ name?: string;
2406
+ /** Subscription description. Optional. */
2407
+ description?: string | null;
2408
+ /**
2409
+ * If start_date is set in the future: custom_billing_schedule.cycles_to_pay_on_creation should be set to 1
2410
+ * in order to pay on creation for first cycle, Subscription will be then activated in the future.
2411
+ * Future start_date is not supported for `SEND_INVOICE` CollectionMethod
2412
+ * If start_date is set in past, it means subscription was already started.
2413
+ */
2414
+ startDate?: Date | null;
2415
+ /**
2416
+ * Represents when the subscription will end, relevant for subscriptions with a termed period.
2417
+ * If not provided, will be calculated based on billing schedule. Should be empty for evergreen subscription.
2418
+ * Note: A 13-hour tolerance is applied when validating the end date to handle for time zone differences and minor discrepancies.
2419
+ */
2420
+ endDate?: Date | null;
2421
+ /** Business origin subscription is coming from. In site-level subscription it will be vertical app_id and entity_id */
2422
+ origin?: BusinessOrigin;
2423
+ /** Customer information like id and identity type (member or contact) */
2424
+ customer?: Customer;
2425
+ /**
2426
+ * Status of subscription
2427
+ * @readonly
2428
+ */
2429
+ status?: SubscriptionStatusEnumSubscriptionStatus;
2430
+ /** Billing details parameters including schedule, currency, etc. */
2431
+ billingSettings?: BillingSettings;
2432
+ /**
2433
+ * Includes many attributes about billing status of the subscription
2434
+ * @readonly
2435
+ */
2436
+ billingStatus?: BillingStatus;
2437
+ /** Shipping address associated with subscription. At the moment used only for payments. Optional. */
2438
+ shippingAddress?: FullAddressDetails;
2439
+ /** Restrictions on possible subscription actions. If not provided, default policies are all restrictions enabled. */
2440
+ policies?: SubscriptionPolicies;
2441
+ /**
2442
+ * Information related to either paused subscription or scheduled for future pause
2443
+ * @readonly
2444
+ */
2445
+ pauseInfo?: PauseInfo;
2446
+ /**
2447
+ * Information related to cancellation for already canceled subscription or scheduled for cancel
2448
+ * @readonly
2449
+ */
2450
+ cancellationInfo?: CancellationInfo;
2451
+ /**
2452
+ * Pending update for the next billing cycle
2453
+ * @readonly
2454
+ */
2455
+ pendingUpdateData?: SubscriptionUpdateData;
2456
+ /**
2457
+ * Key / Value store to keep up to 10 additional values related to the subscription.
2458
+ * Key max length = 50, Value max length = 200. Value can not be empty.
2459
+ * Should not include any sensitive or PII information.
2460
+ */
2461
+ metadata?: Record<string, string>;
2462
+ /**
2463
+ * Pending update for a specific date
2464
+ * @readonly
2465
+ */
2466
+ specificDatePendingUpdateData?: SpecificDateSubscriptionUpdateData;
2467
+ /**
2468
+ * ChangesCounter of subscription. Increments upon every change to the domain
2469
+ * @readonly
2470
+ */
2471
+ changesCounter?: string | null;
2472
+ /** Billing order id. Optional. */
2473
+ orderId?: string | null;
2474
+ /** Platform origin subscription is coming from. */
2475
+ platformOrigin?: PlatformOrigin;
2476
+ /** items, minSize is 1, maxSize is 100 */
2477
+ items?: Item[];
2469
2478
  }
2470
2479
  interface BusinessOrigin {
2471
2480
  appId?: string | null;
@@ -2586,7 +2595,9 @@ declare enum CollectionMethodEnumCollectionMethod {
2586
2595
  /** Payment will be collected somehow. Billing only issues invoice per cycle. */
2587
2596
  SEND_INVOICE = "SEND_INVOICE",
2588
2597
  /** Payment will be collected externally */
2589
- EXTERNAL = "EXTERNAL"
2598
+ EXTERNAL = "EXTERNAL",
2599
+ /** Indicates the product has a zero amount, meaning its free with no payment required. */
2600
+ FREE = "FREE"
2590
2601
  }
2591
2602
  interface Duration {
2592
2603
  /** Duration unit: DAY, WEEK, MONTH, YEAR */
@@ -3102,92 +3113,417 @@ interface PricingModel extends PricingModelModelOneOf {
3102
3113
  /** Details about the fixed item price. */
3103
3114
  fixedPrice?: FixedPrice;
3104
3115
  }
3105
- /** @oneof */
3106
- interface PricingModelModelOneOf {
3107
- /** Details about the fixed item price. */
3108
- fixedPrice?: FixedPrice;
3116
+ /** @oneof */
3117
+ interface PricingModelModelOneOf {
3118
+ /** Details about the fixed item price. */
3119
+ fixedPrice?: FixedPrice;
3120
+ }
3121
+ interface FixedPrice {
3122
+ /**
3123
+ * Fixed item price with a period as a decimal separator. For example, `3.99`.
3124
+ * Price doesn't include tax, discounts, or application fee.
3125
+ *
3126
+ * Min: `0.01`
3127
+ */
3128
+ itemPrice?: string;
3129
+ }
3130
+ interface Item {
3131
+ /**
3132
+ * Unique identifier of subscription item. Automatically generated and read-only.
3133
+ * @readonly
3134
+ */
3135
+ _id?: string | null;
3136
+ /** Name of the item. Typically product name. */
3137
+ name?: string;
3138
+ /** Description of the item. */
3139
+ description?: string | null;
3140
+ /** References to external product catalog data known to client. */
3141
+ catalogReference?: CatalogReference;
3142
+ /** Category of item. Whether it is digital or physical one. */
3143
+ category?: ItemCategory;
3144
+ /** Amount of products */
3145
+ quantity?: number;
3146
+ /** Pricing model of the item. Whether fixed price or dynamic price models. */
3147
+ pricingModel?: PricingModel;
3148
+ /** Tax, positive value, optional */
3149
+ tax?: Tax;
3150
+ /** Discounts applied on item price */
3151
+ discounts?: Discount[];
3152
+ /** Application specific fee, positive value, optional (if application_fee == 0, don't include it to request). Only positive values. */
3153
+ applicationFee?: ApplicationFee;
3154
+ /**
3155
+ * External reference identifier for mapping item in consumer's system.
3156
+ * This allows the consumer to correlate the item in their system with the item in this API.
3157
+ */
3158
+ externalId?: string | null;
3159
+ /**
3160
+ * Key / Value store to keep up to 10 additional values related to the subscription item.
3161
+ * Key max length = 50, Value max length = 200. Value can not be empty.
3162
+ * Should not include any sensitive or PII information.
3163
+ */
3164
+ metadata?: Record<string, string>;
3165
+ }
3166
+ interface CatalogReference {
3167
+ /** Product ID from the external catalog. */
3168
+ catalogItemId?: string;
3169
+ /**
3170
+ * ID of the app that the product catalog belongs to.
3171
+ * When omitted, BASS assumes that the product belongs to the subscription's
3172
+ * `origin.appId`.
3173
+ *
3174
+ * Min: 1 character
3175
+ * Max: 50 characters
3176
+ */
3177
+ appId?: string | null;
3178
+ }
3179
+ declare enum ItemCategory {
3180
+ UNKNOWN = "UNKNOWN",
3181
+ PHYSICAL = "PHYSICAL",
3182
+ DIGITAL = "DIGITAL"
3183
+ }
3184
+ interface ApplicationFee extends ApplicationFeeValueOneOf {
3185
+ /** Amount of the application fee in `0.00` format. */
3186
+ amount?: string;
3187
+ /**
3188
+ * Discounts for the application fee.
3189
+ *
3190
+ * Max: 5 discounts
3191
+ */
3192
+ discounts?: Discount[];
3193
+ }
3194
+ /** @oneof */
3195
+ interface ApplicationFeeValueOneOf {
3196
+ /** Amount of the application fee in `0.00` format. */
3197
+ amount?: string;
3198
+ }
3199
+ interface SpecificDateSubscriptionUpdateData {
3200
+ updateData?: SubscriptionUpdateData;
3201
+ executionDate?: Date | null;
3202
+ }
3203
+ interface PlatformOrigin {
3204
+ appId?: string | null;
3205
+ entityId?: string | null;
3206
+ }
3207
+ interface ListSubscriptionHistoryRequest {
3208
+ subscriptionId: string;
3209
+ /** Determines the type of view for the history: either a comprehensive backoffice view or a user-centric view. */
3210
+ mode?: HistoryViewMode;
3211
+ /** Cursor for efficient paging. If paging through results, pass this field from the previous search response to continue to the next page. */
3212
+ cursor?: CursorPaging;
3213
+ }
3214
+ declare enum HistoryViewMode {
3215
+ UNKNOWN = "UNKNOWN",
3216
+ /** Comprehensive view including all history events. */
3217
+ BACKOFFICE = "BACKOFFICE",
3218
+ /** User-centric view of the history. */
3219
+ USER = "USER"
3220
+ }
3221
+ interface CursorPaging {
3222
+ /** Maximum number of items to return in the results. */
3223
+ limit?: number | null;
3224
+ /**
3225
+ * Pointer to the next or previous page in the list of results.
3226
+ *
3227
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
3228
+ * Not relevant for the first request.
3229
+ */
3230
+ cursor?: string | null;
3231
+ }
3232
+ interface ListSubscriptionHistoryResponse {
3233
+ /** List of history entries for the subscription. */
3234
+ historyEntries?: SubscriptionHistoryEntry[];
3235
+ /** Paging metadata. A `next` cursor is returned if there are more results. */
3236
+ pagingMetadata?: PagingMetadataV2;
3237
+ }
3238
+ interface SubscriptionHistoryEntry {
3239
+ entryId?: string;
3240
+ /** TODO: add max length? it is not defined in domainevents, so should we? */
3241
+ slug?: string;
3242
+ entryTime?: Date | null;
3243
+ event?: SubscriptionEvent;
3244
+ }
3245
+ interface SubscriptionEvent extends SubscriptionEventPayloadOneOf {
3246
+ created?: SubscriptionCreated;
3247
+ updated?: SubscriptionUpdated;
3248
+ deleted?: SubscriptionDeleted;
3249
+ activated?: SubscriptionActivated;
3250
+ ended?: SubscriptionEnded;
3251
+ canceled?: SubscriptionCanceled;
3252
+ paused?: SubscriptionPaused;
3253
+ resumed?: SubscriptionResumed;
3254
+ pauseRequested?: PauseSubscriptionRequested;
3255
+ resumeRequested?: ResumeSubscriptionRequested;
3256
+ scheduledPauseCanceled?: ScheduledPauseCanceled;
3257
+ scheduledResumeCanceled?: ScheduledResumeCanceled;
3258
+ billingCycleStarted?: SubscriptionBillingCycleStarted;
3259
+ autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn;
3260
+ autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff;
3261
+ cycleReadyToPay?: SubscriptionCycleReadyToPay;
3262
+ extended?: SubscriptionExtended;
3263
+ initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted;
3264
+ latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid;
3265
+ revived?: SubscriptionRevived;
3266
+ billingDateUpdated?: SubscriptionBillingDateUpdated;
3267
+ futureUpdatesRequested?: FutureUpdatesRequested;
3268
+ updatesApplied?: UpdatesApplied;
3269
+ resetPendingUpdates?: ResetPendingUpdates;
3270
+ gracePeriodStarted?: GracePeriodStarted;
3271
+ gracePeriodEnded?: GracePeriodEnded;
3272
+ paymentMethodUpdated?: PaymentMethodUpdated;
3273
+ collectionMethodUpdated?: SubscriptionCollectionMethodUpdated;
3274
+ freeTrailStarted?: FreeTrailStarted;
3275
+ freeTrailEnded?: FreeTrailEnded;
3276
+ subscriptionBoAction?: SubscriptionBackOfficeAction;
3277
+ unknown?: UnknownSubscriptionEvent;
3278
+ }
3279
+ /** @oneof */
3280
+ interface SubscriptionEventPayloadOneOf {
3281
+ created?: SubscriptionCreated;
3282
+ updated?: SubscriptionUpdated;
3283
+ deleted?: SubscriptionDeleted;
3284
+ activated?: SubscriptionActivated;
3285
+ ended?: SubscriptionEnded;
3286
+ canceled?: SubscriptionCanceled;
3287
+ paused?: SubscriptionPaused;
3288
+ resumed?: SubscriptionResumed;
3289
+ pauseRequested?: PauseSubscriptionRequested;
3290
+ resumeRequested?: ResumeSubscriptionRequested;
3291
+ scheduledPauseCanceled?: ScheduledPauseCanceled;
3292
+ scheduledResumeCanceled?: ScheduledResumeCanceled;
3293
+ billingCycleStarted?: SubscriptionBillingCycleStarted;
3294
+ autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn;
3295
+ autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff;
3296
+ cycleReadyToPay?: SubscriptionCycleReadyToPay;
3297
+ extended?: SubscriptionExtended;
3298
+ initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted;
3299
+ latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid;
3300
+ revived?: SubscriptionRevived;
3301
+ billingDateUpdated?: SubscriptionBillingDateUpdated;
3302
+ futureUpdatesRequested?: FutureUpdatesRequested;
3303
+ updatesApplied?: UpdatesApplied;
3304
+ resetPendingUpdates?: ResetPendingUpdates;
3305
+ gracePeriodStarted?: GracePeriodStarted;
3306
+ gracePeriodEnded?: GracePeriodEnded;
3307
+ paymentMethodUpdated?: PaymentMethodUpdated;
3308
+ collectionMethodUpdated?: SubscriptionCollectionMethodUpdated;
3309
+ freeTrailStarted?: FreeTrailStarted;
3310
+ freeTrailEnded?: FreeTrailEnded;
3311
+ subscriptionBoAction?: SubscriptionBackOfficeAction;
3312
+ unknown?: UnknownSubscriptionEvent;
3313
+ }
3314
+ interface SubscriptionCreated {
3315
+ subscription?: Subscription;
3316
+ }
3317
+ interface SubscriptionUpdated {
3318
+ current?: Subscription;
3319
+ previous?: Subscription;
3320
+ diff?: SubscriptionDiff;
3321
+ }
3322
+ interface SubscriptionDiff {
3323
+ added?: string | null;
3324
+ changed?: string | null;
3325
+ deleted?: string | null;
3326
+ }
3327
+ interface SubscriptionDeleted {
3328
+ subscriptionId?: string;
3329
+ }
3330
+ /**
3331
+ * Sent each time a subscription status has been set to Active
3332
+ * Active shows that a subscription is live and operational.
3333
+ * For example:
3334
+ * * For subscription with free trial, free trial start date is also the activation date.
3335
+ * * For a subscription with future start date, the start date is also the activation date.
3336
+ * * When a subscription is resumed from a pause status, the resume date is also the activation date.
3337
+ */
3338
+ interface SubscriptionActivated {
3339
+ subscription?: Subscription;
3340
+ }
3341
+ /**
3342
+ * Sent each time a subscription status has been set to Ended
3343
+ * Ended shows that a subscription reached its end date and ended its life cycle as a result of the agreement.
3344
+ * This is different from a Canceled subscription which ends the subscription before a designated end date.
3345
+ * Therefore, Ended and Canceled are mutually exclusive.
3346
+ */
3347
+ interface SubscriptionEnded {
3348
+ subscription?: Subscription;
3349
+ }
3350
+ /**
3351
+ * Sent each time a subscription status has been set to Canceled
3352
+ * Canceled shows that a subscription was canceled and ended its life cycle as a result of some intervention
3353
+ * For example:
3354
+ * * A user decided to cancel a subscription before the original end date
3355
+ * * A subscription is canceled due to bad payment
3356
+ */
3357
+ interface SubscriptionCanceled {
3358
+ subscription?: Subscription;
3359
+ actionDetails?: ActionDetails;
3360
+ }
3361
+ interface ActionDetails {
3362
+ initiator?: HistoryActionInitiator;
3363
+ reason?: string | null;
3364
+ }
3365
+ interface SubscriptionPaused {
3366
+ subscription?: Subscription;
3367
+ pausePolicy?: PausePolicy;
3368
+ actionDetails?: ActionDetails;
3369
+ }
3370
+ interface SubscriptionResumed {
3371
+ subscription?: Subscription;
3372
+ actionDetails?: ActionDetails;
3373
+ }
3374
+ interface PauseSubscriptionRequested {
3375
+ subscription?: Subscription;
3376
+ pauseAt?: PauseAt;
3377
+ pausePolicy?: PausePolicy;
3378
+ actionDetails?: ActionDetails;
3379
+ }
3380
+ interface ResumeSubscriptionRequested {
3381
+ subscription?: Subscription;
3382
+ resumeAt?: ResumeAt;
3383
+ actionDetails?: ActionDetails;
3384
+ }
3385
+ interface ScheduledPauseCanceled {
3386
+ subscription?: Subscription;
3387
+ actionDetails?: ActionDetails;
3388
+ }
3389
+ interface ScheduledResumeCanceled {
3390
+ subscription?: Subscription;
3391
+ actionDetails?: ActionDetails;
3392
+ }
3393
+ interface SubscriptionBillingCycleStarted {
3394
+ subscription?: Subscription;
3395
+ /** Wix Pay transaction id, optional. Exists if event was triggered by a payment. */
3396
+ paymentTransactionId?: string | null;
3397
+ }
3398
+ interface SubscriptionAutoRenewalTurnedOn {
3399
+ subscription?: Subscription;
3400
+ actionDetails?: ActionDetails;
3401
+ }
3402
+ interface SubscriptionAutoRenewalTurnedOff {
3403
+ subscription?: Subscription;
3404
+ actionDetails?: ActionDetails;
3405
+ }
3406
+ interface SubscriptionCycleReadyToPay {
3407
+ subscription?: Subscription;
3408
+ }
3409
+ interface SubscriptionExtended extends SubscriptionExtendedExtendPolicyOneOf {
3410
+ extensionPeriod?: Duration;
3411
+ extensionBillingCycles?: number;
3412
+ subscription?: Subscription;
3413
+ actionDetails?: ActionDetails;
3414
+ }
3415
+ /** @oneof */
3416
+ interface SubscriptionExtendedExtendPolicyOneOf {
3417
+ extensionPeriod?: Duration;
3418
+ extensionBillingCycles?: number;
3419
+ }
3420
+ interface SubscriptionInitialPurchaseCompleted {
3421
+ subscription?: Subscription;
3422
+ actionDetails?: ActionDetails;
3423
+ paymentTransactionId?: string | null;
3424
+ }
3425
+ interface LatestInvoiceMarkedAsPaid {
3426
+ subscription?: Subscription;
3427
+ }
3428
+ interface SubscriptionRevived {
3429
+ subscription?: Subscription;
3430
+ }
3431
+ interface SubscriptionBillingDateUpdated {
3432
+ subscription?: Subscription;
3433
+ billingDate?: Date | null;
3434
+ proration?: Proration;
3435
+ }
3436
+ interface FutureUpdatesRequested {
3437
+ subscription?: Subscription;
3438
+ requestedUpdateData?: SubscriptionUpdateData;
3439
+ }
3440
+ interface UpdatesApplied {
3441
+ subscription?: Subscription;
3442
+ updateAction?: UpdateAction;
3443
+ appliedUpdateData?: SubscriptionUpdateData;
3444
+ }
3445
+ declare enum UpdateAction {
3446
+ NONE = "NONE",
3447
+ /** Update subscription immediately, please note proration for updates changing price are not yet supported */
3448
+ IMMEDIATELY = "IMMEDIATELY",
3449
+ /** Request updates that will take affect only at the start of the next billing cycle. */
3450
+ NEXT_BILLING_CYCLE = "NEXT_BILLING_CYCLE",
3451
+ /** Reset all pending updates */
3452
+ RESET_PENDING_UPDATES = "RESET_PENDING_UPDATES",
3453
+ /** Request updates that will take affect only at a specific date. */
3454
+ SPECIFIC_DATE = "SPECIFIC_DATE"
3455
+ }
3456
+ interface ResetPendingUpdates {
3457
+ subscription?: Subscription;
3458
+ }
3459
+ interface GracePeriodStarted {
3460
+ subscription?: Subscription;
3461
+ }
3462
+ interface GracePeriodEnded {
3463
+ subscription?: Subscription;
3464
+ /** Indication for the payment settlement method. */
3465
+ paymentSettlementMethod?: PaymentSettlementMethod;
3466
+ }
3467
+ declare enum PaymentSettlementMethod {
3468
+ UNKNOWN = "UNKNOWN",
3469
+ /** System-defined payment settlement. */
3470
+ SYSTEM = "SYSTEM",
3471
+ /** Manually mark the payment as paid. */
3472
+ MARK_AS_PAID = "MARK_AS_PAID",
3473
+ /** Require the customer to pay immediately, by insert a new payment method. */
3474
+ CUSTOMER_PAY_NOW = "CUSTOMER_PAY_NOW"
3475
+ }
3476
+ interface PaymentMethodUpdated {
3477
+ subscription?: Subscription;
3478
+ initiator?: HistoryActionInitiator;
3479
+ paymentMode?: PaymentMode;
3480
+ }
3481
+ declare enum PaymentMode {
3482
+ NONE = "NONE",
3483
+ /** The latest invoice of the subscription will be charged. */
3484
+ CHARGE = "CHARGE",
3485
+ /** An authorization invoice with zero amount will be created. */
3486
+ AUTHORIZATION = "AUTHORIZATION"
3109
3487
  }
3110
- interface FixedPrice {
3111
- /**
3112
- * Fixed item price with a period as a decimal separator. For example, `3.99`.
3113
- * Price doesn't include tax, discounts, or application fee.
3114
- *
3115
- * Min: `0.01`
3116
- */
3117
- itemPrice?: string;
3488
+ interface SubscriptionCollectionMethodUpdated {
3489
+ subscription?: Subscription;
3490
+ newCollectionMethod?: CollectionMethodEnumCollectionMethod;
3491
+ previousCollectionMethod?: CollectionMethodEnumCollectionMethod;
3118
3492
  }
3119
- interface Item {
3120
- /**
3121
- * Unique identifier of subscription item. Automatically generated and read-only.
3122
- * @readonly
3123
- */
3124
- _id?: string | null;
3125
- /** Name of the item. Typically product name. */
3126
- name?: string;
3127
- /** Description of the item. */
3128
- description?: string | null;
3129
- /** References to external product catalog data known to client. */
3130
- catalogReference?: CatalogReference;
3131
- /** Category of item. Whether it is digital or physical one. */
3132
- category?: ItemCategory;
3133
- /** Amount of products */
3134
- quantity?: number;
3135
- /** Pricing model of the item. Whether fixed price or dynamic price models. */
3136
- pricingModel?: PricingModel;
3137
- /** Tax, positive value, optional */
3138
- tax?: Tax;
3139
- /** Discounts applied on item price */
3140
- discounts?: Discount[];
3141
- /** Application specific fee, positive value, optional (if application_fee == 0, don't include it to request). Only positive values. */
3142
- applicationFee?: ApplicationFee;
3143
- /**
3144
- * External reference identifier for mapping item in consumer's system.
3145
- * This allows the consumer to correlate the item in their system with the item in this API.
3146
- */
3147
- externalId?: string | null;
3148
- /**
3149
- * Key / Value store to keep up to 10 additional values related to the subscription item.
3150
- * Key max length = 50, Value max length = 200. Value can not be empty.
3151
- * Should not include any sensitive or PII information.
3152
- */
3153
- metadata?: Record<string, string>;
3493
+ interface FreeTrailStarted {
3494
+ subscription?: Subscription;
3154
3495
  }
3155
- interface CatalogReference {
3156
- /** Product ID from the external catalog. */
3157
- catalogItemId?: string;
3158
- /**
3159
- * ID of the app that the product catalog belongs to.
3160
- * When omitted, BASS assumes that the product belongs to the subscription's
3161
- * `origin.appId`.
3162
- *
3163
- * Min: 1 character
3164
- * Max: 50 characters
3165
- */
3166
- appId?: string | null;
3496
+ interface FreeTrailEnded {
3497
+ subscription?: Subscription;
3167
3498
  }
3168
- declare enum ItemCategory {
3169
- UNKNOWN = "UNKNOWN",
3170
- PHYSICAL = "PHYSICAL",
3171
- DIGITAL = "DIGITAL"
3499
+ interface SubscriptionBackOfficeAction {
3500
+ subscription?: Subscription;
3501
+ /** The backoffice method name */
3502
+ name?: string;
3503
+ /** json as string format, to store the flatted request object */
3504
+ params?: string;
3172
3505
  }
3173
- interface ApplicationFee extends ApplicationFeeValueOneOf {
3174
- /** Amount of the application fee in `0.00` format. */
3175
- amount?: string;
3176
- /**
3177
- * Discounts for the application fee.
3178
- *
3179
- * Max: 5 discounts
3180
- */
3181
- discounts?: Discount[];
3506
+ /** Defines unknown events restored from the logs */
3507
+ interface UnknownSubscriptionEvent {
3508
+ subscriptionAsString?: string | null;
3182
3509
  }
3183
- /** @oneof */
3184
- interface ApplicationFeeValueOneOf {
3185
- /** Amount of the application fee in `0.00` format. */
3186
- amount?: string;
3510
+ interface PagingMetadataV2 {
3511
+ /** Number of items returned in the response. */
3512
+ count?: number | null;
3513
+ /** Offset that was requested. */
3514
+ offset?: number | null;
3515
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
3516
+ total?: number | null;
3517
+ /** Flag that indicates the server failed to calculate the `total` field. */
3518
+ tooManyToCount?: boolean | null;
3519
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
3520
+ cursors?: Cursors;
3187
3521
  }
3188
- interface SpecificDateSubscriptionUpdateData {
3189
- updateData?: SubscriptionUpdateData;
3190
- executionDate?: Date | null;
3522
+ interface Cursors {
3523
+ /** Cursor string pointing to the next page in the list of results. */
3524
+ next?: string | null;
3525
+ /** Cursor pointing to the previous page in the list of results. */
3526
+ prev?: string | null;
3191
3527
  }
3192
3528
  interface GetSubscriptionRequest {
3193
3529
  _id: string;
@@ -3203,21 +3539,6 @@ interface CustomerCancelSubscriptionRequest {
3203
3539
  interface CustomerCancelSubscriptionResponse {
3204
3540
  subscription?: Subscription;
3205
3541
  }
3206
- /**
3207
- * Sent each time a subscription status has been set to Canceled
3208
- * Canceled shows that a subscription was canceled and ended its life cycle as a result of some intervention
3209
- * For example:
3210
- * * A user decided to cancel a subscription before the original end date
3211
- * * A subscription is canceled due to bad payment
3212
- */
3213
- interface SubscriptionCanceled {
3214
- subscription?: Subscription;
3215
- actionDetails?: ActionDetails;
3216
- }
3217
- interface ActionDetails {
3218
- initiator?: HistoryActionInitiator;
3219
- reason?: string | null;
3220
- }
3221
3542
  interface CustomerTurnOnAutoRenewalRequest {
3222
3543
  _id: string;
3223
3544
  /** Optional action reason message */
@@ -3246,17 +3567,6 @@ interface CustomerExtendSubscriptionResponse {
3246
3567
  /** The now extended subscription */
3247
3568
  subscription?: Subscription;
3248
3569
  }
3249
- interface SubscriptionExtended extends SubscriptionExtendedExtendPolicyOneOf {
3250
- extensionPeriod?: Duration;
3251
- extensionBillingCycles?: number;
3252
- subscription?: Subscription;
3253
- actionDetails?: ActionDetails;
3254
- }
3255
- /** @oneof */
3256
- interface SubscriptionExtendedExtendPolicyOneOf {
3257
- extensionPeriod?: Duration;
3258
- extensionBillingCycles?: number;
3259
- }
3260
3570
  interface QuerySubscriptionsRequest {
3261
3571
  query?: QueryV2;
3262
3572
  }
@@ -3305,39 +3615,10 @@ interface Paging {
3305
3615
  /** Number of items to skip in the current sort order. */
3306
3616
  offset?: number | null;
3307
3617
  }
3308
- interface CursorPaging {
3309
- /** Maximum number of items to return in the results. */
3310
- limit?: number | null;
3311
- /**
3312
- * Pointer to the next or previous page in the list of results.
3313
- *
3314
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
3315
- * Not relevant for the first request.
3316
- */
3317
- cursor?: string | null;
3318
- }
3319
3618
  interface QuerySubscriptionsResponse {
3320
3619
  subscriptions?: Subscription[];
3321
3620
  metadata?: PagingMetadataV2;
3322
3621
  }
3323
- interface PagingMetadataV2 {
3324
- /** Number of items returned in the response. */
3325
- count?: number | null;
3326
- /** Offset that was requested. */
3327
- offset?: number | null;
3328
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
3329
- total?: number | null;
3330
- /** Flag that indicates the server failed to calculate the `total` field. */
3331
- tooManyToCount?: boolean | null;
3332
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
3333
- cursors?: Cursors;
3334
- }
3335
- interface Cursors {
3336
- /** Cursor string pointing to the next page in the list of results. */
3337
- next?: string | null;
3338
- /** Cursor pointing to the previous page in the list of results. */
3339
- prev?: string | null;
3340
- }
3341
3622
  interface CountSubscriptionsRequest {
3342
3623
  /** Filters to specify which subscriptions are counted. */
3343
3624
  filter?: CountSubscriptionFilter;
@@ -3385,7 +3666,6 @@ interface SubscriptionStatus {
3385
3666
  statuses?: SubscriptionStatusEnumSubscriptionStatus[];
3386
3667
  }
3387
3668
  declare enum SubscriptionStatusGroup {
3388
- UNKNOWN_STATUS_GROUP = "UNKNOWN_STATUS_GROUP",
3389
3669
  ALL = "ALL",
3390
3670
  /** Union of ACTIVE, PAUSED and PENDING */
3391
3671
  LIVE = "LIVE"
@@ -3641,13 +3921,6 @@ interface InitiatePaymentMethodSetupRequest {
3641
3921
  paymentMode?: PaymentMode;
3642
3922
  paymentSettings?: PaymentSettings;
3643
3923
  }
3644
- declare enum PaymentMode {
3645
- NONE = "NONE",
3646
- /** The latest invoice of the subscription will be charged. */
3647
- CHARGE = "CHARGE",
3648
- /** An authorization invoice with zero amount will be created. */
3649
- AUTHORIZATION = "AUTHORIZATION"
3650
- }
3651
3924
  interface PaymentSettings {
3652
3925
  /** Allowed payment providers for Subscriptions, for example to limit subscriptions to be created only with "Wix Payments" provider. */
3653
3926
  allowedProviderIds?: string[];
@@ -3661,92 +3934,34 @@ interface PaymentSettings {
3661
3934
  * When set, the payment order will be created with the specified origin
3662
3935
  * instead of the default origin.
3663
3936
  */
3664
- paymentOrigin?: PaymentOrigin;
3665
- }
3666
- declare enum OrderMethod {
3667
- UNKNOWN = "UNKNOWN",
3668
- MOTO = "MOTO",
3669
- NOT_MOTO = "NOT_MOTO"
3670
- }
3671
- interface RedirectUrls {
3672
- /** URL to redirect buyer in case of approved (successful) transaction (required) */
3673
- successUrl?: string;
3674
- /** URL to redirect buyer in case of failed/rejected transaction (required) */
3675
- errorUrl?: string;
3676
- /** URL to redirect buyer in case of buyer canceled the transaction (optional, default: `{error_url}`) */
3677
- cancelUrl?: string;
3678
- /**
3679
- * URL to redirect buyer in case of pending transaction (that might take some time to process) (optional, default:
3680
- * `{success_url}`)
3681
- */
3682
- pendingUrl?: string;
3683
- }
3684
- interface PaymentOrigin {
3685
- /** ID of the app for which the Payment will create the order on. For example, Paypal. */
3686
- appId?: string;
3687
- /** Id of the entity that order will be created on */
3688
- instanceId?: string;
3689
- }
3690
- interface InitiatePaymentMethodSetupResponse {
3691
- paymentOrderId?: string;
3692
- }
3693
- interface PayCycleRequest {
3694
- subscriptionId: string;
3695
- paymentTestMode?: PaymentTestMode;
3696
- tenantId: string;
3697
- }
3698
- declare enum PaymentTestMode {
3699
- REGULAR = "REGULAR",
3700
- FAIL_TECHNICAL = "FAIL_TECHNICAL",
3701
- FAIL_DECLINE = "FAIL_DECLINE",
3702
- FAIL_RETRYABLE_DECLINE = "FAIL_RETRYABLE_DECLINE"
3703
- }
3704
- interface PayCycleResponse {
3705
- invoiceId?: string;
3706
- paymentOrderId?: string | null;
3707
- subscription?: Subscription;
3708
- }
3709
- declare enum ActionInitiator {
3710
- UNDEFINED = "UNDEFINED",
3711
- BUSINESS = "BUSINESS",
3712
- CUSTOMER = "CUSTOMER",
3713
- SYSTEM = "SYSTEM"
3714
- }
3715
- interface SubscriptionBillingCycleStarted {
3716
- subscription?: Subscription;
3717
- /** Wix Pay transaction id, optional. Exists if event was triggered by a payment. */
3718
- paymentTransactionId?: string | null;
3719
- }
3720
- /**
3721
- * Sent each time a subscription status has been set to Active
3722
- * Active shows that a subscription is live and operational.
3723
- * For example:
3724
- * * For subscription with free trial, free trial start date is also the activation date.
3725
- * * For a subscription with future start date, the start date is also the activation date.
3726
- * * When a subscription is resumed from a pause status, the resume date is also the activation date.
3727
- */
3728
- interface SubscriptionActivated {
3729
- subscription?: Subscription;
3730
- }
3731
- /**
3732
- * Sent each time a subscription status has been set to Ended
3733
- * Ended shows that a subscription reached its end date and ended its life cycle as a result of the agreement.
3734
- * This is different from a Canceled subscription which ends the subscription before a designated end date.
3735
- * Therefore, Ended and Canceled are mutually exclusive.
3736
- */
3737
- interface SubscriptionEnded {
3738
- subscription?: Subscription;
3937
+ paymentOrigin?: PaymentOrigin;
3739
3938
  }
3740
- interface SubscriptionInitialPurchaseCompleted {
3741
- subscription?: Subscription;
3742
- actionDetails?: ActionDetails;
3743
- paymentTransactionId?: string | null;
3939
+ declare enum OrderMethod {
3940
+ UNKNOWN = "UNKNOWN",
3941
+ MOTO = "MOTO",
3942
+ NOT_MOTO = "NOT_MOTO"
3744
3943
  }
3745
- interface SubscriptionCycleReadyToPay {
3746
- subscription?: Subscription;
3944
+ interface RedirectUrls {
3945
+ /** URL to redirect buyer in case of approved (successful) transaction (required) */
3946
+ successUrl?: string;
3947
+ /** URL to redirect buyer in case of failed/rejected transaction (required) */
3948
+ errorUrl?: string;
3949
+ /** URL to redirect buyer in case of buyer canceled the transaction (optional, default: `{error_url}`) */
3950
+ cancelUrl?: string;
3951
+ /**
3952
+ * URL to redirect buyer in case of pending transaction (that might take some time to process) (optional, default:
3953
+ * `{success_url}`)
3954
+ */
3955
+ pendingUrl?: string;
3747
3956
  }
3748
- interface SubscriptionRevived {
3749
- subscription?: Subscription;
3957
+ interface PaymentOrigin {
3958
+ /** ID of the app for which the Payment will create the order on. For example, Paypal. */
3959
+ appId?: string;
3960
+ /** Id of the entity that order will be created on */
3961
+ instanceId?: string;
3962
+ }
3963
+ interface InitiatePaymentMethodSetupResponse {
3964
+ paymentOrderId?: string;
3750
3965
  }
3751
3966
  interface UpdateSubscriptionBillingDateRequest {
3752
3967
  /** ID of the subscription to update the billing date for. */
@@ -3768,22 +3983,6 @@ interface UpdateSubscriptionBillingDateResponse {
3768
3983
  /** Updated subscription. */
3769
3984
  subscription?: Subscription;
3770
3985
  }
3771
- interface SubscriptionBillingDateUpdated {
3772
- subscription?: Subscription;
3773
- billingDate?: Date | null;
3774
- proration?: Proration;
3775
- }
3776
- declare enum UpdateAction {
3777
- NONE = "NONE",
3778
- /** Update subscription immediately, please note proration for updates changing price are not yet supported */
3779
- IMMEDIATELY = "IMMEDIATELY",
3780
- /** Request updates that will take affect only at the start of the next billing cycle. */
3781
- NEXT_BILLING_CYCLE = "NEXT_BILLING_CYCLE",
3782
- /** Reset all pending updates */
3783
- RESET_PENDING_UPDATES = "RESET_PENDING_UPDATES",
3784
- /** Request updates that will take affect only at a specific date. */
3785
- SPECIFIC_DATE = "SPECIFIC_DATE"
3786
- }
3787
3986
  interface ScheduleAdditionalInfo extends ScheduleAdditionalInfoParamOneOf {
3788
3987
  /**
3789
3988
  * Future date when the update becomes effective in `YYYY-MM-DDThh:mm:ss.sssZ`
@@ -3832,6 +4031,12 @@ interface ActionContext {
3832
4031
  /** Optional action reason message */
3833
4032
  reason?: string | null;
3834
4033
  }
4034
+ declare enum ActionInitiator {
4035
+ UNDEFINED = "UNDEFINED",
4036
+ BUSINESS = "BUSINESS",
4037
+ CUSTOMER = "CUSTOMER",
4038
+ SYSTEM = "SYSTEM"
4039
+ }
3835
4040
  interface CancelSubscriptionResponse {
3836
4041
  subscription?: Subscription;
3837
4042
  }
@@ -3848,21 +4053,6 @@ interface PauseSubscriptionRequest {
3848
4053
  interface PauseSubscriptionResponse {
3849
4054
  subscription?: Subscription;
3850
4055
  }
3851
- interface SubscriptionPaused {
3852
- subscription?: Subscription;
3853
- pausePolicy?: PausePolicy;
3854
- actionDetails?: ActionDetails;
3855
- }
3856
- interface PauseSubscriptionRequested {
3857
- subscription?: Subscription;
3858
- pauseAt?: PauseAt;
3859
- pausePolicy?: PausePolicy;
3860
- actionDetails?: ActionDetails;
3861
- }
3862
- interface ScheduledPauseCanceled {
3863
- subscription?: Subscription;
3864
- actionDetails?: ActionDetails;
3865
- }
3866
4056
  interface ResumeSubscriptionRequest {
3867
4057
  _id: string;
3868
4058
  resumeAt?: ResumeAt;
@@ -3873,19 +4063,6 @@ interface ResumeSubscriptionRequest {
3873
4063
  interface ResumeSubscriptionResponse {
3874
4064
  subscription?: Subscription;
3875
4065
  }
3876
- interface SubscriptionResumed {
3877
- subscription?: Subscription;
3878
- actionDetails?: ActionDetails;
3879
- }
3880
- interface ResumeSubscriptionRequested {
3881
- subscription?: Subscription;
3882
- resumeAt?: ResumeAt;
3883
- actionDetails?: ActionDetails;
3884
- }
3885
- interface ScheduledResumeCanceled {
3886
- subscription?: Subscription;
3887
- actionDetails?: ActionDetails;
3888
- }
3889
4066
  interface SearchSubscriptionsRequest extends SearchSubscriptionsRequestPagingMethodOneOf {
3890
4067
  /** Limit number of results and enable to skip rows. The default limit is 25. */
3891
4068
  paging?: Paging;
@@ -3917,10 +4094,6 @@ interface TurnOnSubscriptionAutoRenewalRequest {
3917
4094
  interface TurnOnSubscriptionAutoRenewalResponse {
3918
4095
  subscription?: Subscription;
3919
4096
  }
3920
- interface SubscriptionAutoRenewalTurnedOn {
3921
- subscription?: Subscription;
3922
- actionDetails?: ActionDetails;
3923
- }
3924
4097
  interface TurnOffSubscriptionAutoRenewalRequest {
3925
4098
  _id: string;
3926
4099
  actionContext: ActionContext;
@@ -3928,10 +4101,6 @@ interface TurnOffSubscriptionAutoRenewalRequest {
3928
4101
  interface TurnOffSubscriptionAutoRenewalResponse {
3929
4102
  subscription?: Subscription;
3930
4103
  }
3931
- interface SubscriptionAutoRenewalTurnedOff {
3932
- subscription?: Subscription;
3933
- actionDetails?: ActionDetails;
3934
- }
3935
4104
  interface MarkLatestInvoiceAsPaidRequest {
3936
4105
  /** The ID of the offline subscription to mark as paid its latest invoice */
3937
4106
  subscriptionId: string;
@@ -3939,9 +4108,6 @@ interface MarkLatestInvoiceAsPaidRequest {
3939
4108
  interface MarkLatestInvoiceAsPaidResponse {
3940
4109
  subscription?: Subscription;
3941
4110
  }
3942
- interface LatestInvoiceMarkedAsPaid {
3943
- subscription?: Subscription;
3944
- }
3945
4111
  interface GetSubscriptionsStatsRequest {
3946
4112
  }
3947
4113
  interface GetSubscriptionsStatsResponse {
@@ -4049,204 +4215,52 @@ interface PreviewSubscriptionsChargesRequest {
4049
4215
  * For instance, if a subscription costs $10 for the first 3 cycles, $12 for cycles 4 through 7,
4050
4216
  * $15 for cycles 8 through 10, and $20 for cycle 11 onwards:
4051
4217
  * - Sending "1" will calculate and return charges for cycles 4 through 7 since it's the first charge in the future.
4052
- * - Sending "2" will provide a response with charges for cycles 4 through 7 and cycles 8 through 10.
4053
- * - Sending "3" or more will include totals for cycles 4 through 7, cycles 8 through 10, and from cycle 11 onwards.
4054
- * If no value is provided, the response will include charges for all upcoming cycles, including the existing one,
4055
- * in this case, charges for cycle 1 through 3.
4056
- * If there is a single charge for a subscription, meaning that subscription price remains consistent across all cycles,
4057
- * then even if future_charges_count is set, it will be ignored and the only charge this subscription has will be returned.
4058
- */
4059
- numberOfNextRecurringCharges?: number | null;
4060
- }
4061
- interface SubscriptionBillingDetails {
4062
- /** External identifier of the subscription */
4063
- externalId?: string | null;
4064
- /** Billing details parameters including schedule, currency, etc. */
4065
- billingSettings?: BillingSettings;
4066
- /** Items, minSize is 1, maxSize is 100 */
4067
- items?: Item[];
4068
- /** Subscription start date, now if not set */
4069
- startDate?: Date | null;
4070
- /** Shipping address associated with subscription. At the moment used only for payments. Optional. */
4071
- shippingAddress?: FullAddressDetails;
4072
- }
4073
- interface PreviewSubscriptionsChargesResponse {
4074
- /** Charges for the subscriptions, including an identifier. */
4075
- subscriptionsCharges?: SubscriptionCharges[];
4076
- }
4077
- interface SubscriptionCharges {
4078
- /** External identifier of the subscription */
4079
- externalId?: string | null;
4080
- /** Charges for subscription. */
4081
- charges?: Charge[];
4082
- }
4083
- interface ListSubscriptionHistoryRequest {
4084
- subscriptionId: string;
4085
- /** Determines the type of view for the history: either a comprehensive backoffice view or a user-centric view. */
4086
- mode?: HistoryViewMode;
4087
- /** Cursor for efficient paging. If paging through results, pass this field from the previous search response to continue to the next page. */
4088
- cursor?: CursorPaging;
4089
- }
4090
- declare enum HistoryViewMode {
4091
- UNKNOWN = "UNKNOWN",
4092
- /** Comprehensive view including all history events. */
4093
- BACKOFFICE = "BACKOFFICE",
4094
- /** User-centric view of the history. */
4095
- USER = "USER"
4096
- }
4097
- interface ListSubscriptionHistoryResponse {
4098
- /** List of history entries for the subscription. */
4099
- historyEntries?: SubscriptionHistoryEntry[];
4100
- /** Paging metadata. A `next` cursor is returned if there are more results. */
4101
- pagingMetadata?: PagingMetadataV2;
4102
- }
4103
- interface SubscriptionHistoryEntry {
4104
- entryId?: string;
4105
- /** TODO: add max length? it is not defined in domainevents, so should we? */
4106
- slug?: string;
4107
- entryTime?: Date | null;
4108
- event?: SubscriptionEvent;
4109
- }
4110
- interface SubscriptionEvent extends SubscriptionEventPayloadOneOf {
4111
- created?: SubscriptionCreated;
4112
- updated?: SubscriptionUpdated;
4113
- deleted?: SubscriptionDeleted;
4114
- activated?: SubscriptionActivated;
4115
- ended?: SubscriptionEnded;
4116
- canceled?: SubscriptionCanceled;
4117
- paused?: SubscriptionPaused;
4118
- resumed?: SubscriptionResumed;
4119
- pauseRequested?: PauseSubscriptionRequested;
4120
- resumeRequested?: ResumeSubscriptionRequested;
4121
- scheduledPauseCanceled?: ScheduledPauseCanceled;
4122
- scheduledResumeCanceled?: ScheduledResumeCanceled;
4123
- billingCycleStarted?: SubscriptionBillingCycleStarted;
4124
- autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn;
4125
- autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff;
4126
- cycleReadyToPay?: SubscriptionCycleReadyToPay;
4127
- extended?: SubscriptionExtended;
4128
- initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted;
4129
- latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid;
4130
- revived?: SubscriptionRevived;
4131
- billingDateUpdated?: SubscriptionBillingDateUpdated;
4132
- futureUpdatesRequested?: FutureUpdatesRequested;
4133
- updatesApplied?: UpdatesApplied;
4134
- resetPendingUpdates?: ResetPendingUpdates;
4135
- gracePeriodStarted?: GracePeriodStarted;
4136
- gracePeriodEnded?: GracePeriodEnded;
4137
- paymentMethodUpdated?: PaymentMethodUpdated;
4138
- collectionMethodUpdated?: SubscriptionCollectionMethodUpdated;
4139
- freeTrailStarted?: FreeTrailStarted;
4140
- freeTrailEnded?: FreeTrailEnded;
4141
- subscriptionBoAction?: SubscriptionBackOfficeAction;
4142
- unknown?: UnknownSubscriptionEvent;
4143
- }
4144
- /** @oneof */
4145
- interface SubscriptionEventPayloadOneOf {
4146
- created?: SubscriptionCreated;
4147
- updated?: SubscriptionUpdated;
4148
- deleted?: SubscriptionDeleted;
4149
- activated?: SubscriptionActivated;
4150
- ended?: SubscriptionEnded;
4151
- canceled?: SubscriptionCanceled;
4152
- paused?: SubscriptionPaused;
4153
- resumed?: SubscriptionResumed;
4154
- pauseRequested?: PauseSubscriptionRequested;
4155
- resumeRequested?: ResumeSubscriptionRequested;
4156
- scheduledPauseCanceled?: ScheduledPauseCanceled;
4157
- scheduledResumeCanceled?: ScheduledResumeCanceled;
4158
- billingCycleStarted?: SubscriptionBillingCycleStarted;
4159
- autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn;
4160
- autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff;
4161
- cycleReadyToPay?: SubscriptionCycleReadyToPay;
4162
- extended?: SubscriptionExtended;
4163
- initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted;
4164
- latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid;
4165
- revived?: SubscriptionRevived;
4166
- billingDateUpdated?: SubscriptionBillingDateUpdated;
4167
- futureUpdatesRequested?: FutureUpdatesRequested;
4168
- updatesApplied?: UpdatesApplied;
4169
- resetPendingUpdates?: ResetPendingUpdates;
4170
- gracePeriodStarted?: GracePeriodStarted;
4171
- gracePeriodEnded?: GracePeriodEnded;
4172
- paymentMethodUpdated?: PaymentMethodUpdated;
4173
- collectionMethodUpdated?: SubscriptionCollectionMethodUpdated;
4174
- freeTrailStarted?: FreeTrailStarted;
4175
- freeTrailEnded?: FreeTrailEnded;
4176
- subscriptionBoAction?: SubscriptionBackOfficeAction;
4177
- unknown?: UnknownSubscriptionEvent;
4178
- }
4179
- interface SubscriptionCreated {
4180
- subscription?: Subscription;
4181
- }
4182
- interface SubscriptionUpdated {
4183
- current?: Subscription;
4184
- previous?: Subscription;
4185
- diff?: SubscriptionDiff;
4186
- }
4187
- interface SubscriptionDiff {
4188
- added?: string | null;
4189
- changed?: string | null;
4190
- deleted?: string | null;
4191
- }
4192
- interface SubscriptionDeleted {
4193
- subscriptionId?: string;
4194
- }
4195
- interface FutureUpdatesRequested {
4196
- subscription?: Subscription;
4197
- requestedUpdateData?: SubscriptionUpdateData;
4198
- }
4199
- interface UpdatesApplied {
4200
- subscription?: Subscription;
4201
- updateAction?: UpdateAction;
4202
- appliedUpdateData?: SubscriptionUpdateData;
4203
- }
4204
- interface ResetPendingUpdates {
4205
- subscription?: Subscription;
4206
- }
4207
- interface GracePeriodStarted {
4208
- subscription?: Subscription;
4209
- }
4210
- interface GracePeriodEnded {
4211
- subscription?: Subscription;
4212
- /** Indication for the payment settlement method. */
4213
- paymentSettlementMethod?: PaymentSettlementMethod;
4218
+ * - Sending "2" will provide a response with charges for cycles 4 through 7 and cycles 8 through 10.
4219
+ * - Sending "3" or more will include totals for cycles 4 through 7, cycles 8 through 10, and from cycle 11 onwards.
4220
+ * If no value is provided, the response will include charges for all upcoming cycles, including the existing one,
4221
+ * in this case, charges for cycle 1 through 3.
4222
+ * If there is a single charge for a subscription, meaning that subscription price remains consistent across all cycles,
4223
+ * then even if future_charges_count is set, it will be ignored and the only charge this subscription has will be returned.
4224
+ */
4225
+ numberOfNextRecurringCharges?: number | null;
4214
4226
  }
4215
- declare enum PaymentSettlementMethod {
4216
- UNKNOWN = "UNKNOWN",
4217
- /** System-defined payment settlement. */
4218
- SYSTEM = "SYSTEM",
4219
- /** Manually mark the payment as paid. */
4220
- MARK_AS_PAID = "MARK_AS_PAID",
4221
- /** Require the customer to pay immediately, by insert a new payment method. */
4222
- CUSTOMER_PAY_NOW = "CUSTOMER_PAY_NOW"
4227
+ interface SubscriptionBillingDetails {
4228
+ /** External identifier of the subscription */
4229
+ externalId?: string | null;
4230
+ /** Billing details parameters including schedule, currency, etc. */
4231
+ billingSettings?: BillingSettings;
4232
+ /** Items, minSize is 1, maxSize is 100 */
4233
+ items?: Item[];
4234
+ /** Subscription start date, now if not set */
4235
+ startDate?: Date | null;
4236
+ /** Shipping address associated with subscription. At the moment used only for payments. Optional. */
4237
+ shippingAddress?: FullAddressDetails;
4223
4238
  }
4224
- interface PaymentMethodUpdated {
4225
- subscription?: Subscription;
4226
- initiator?: HistoryActionInitiator;
4227
- paymentMode?: PaymentMode;
4239
+ interface PreviewSubscriptionsChargesResponse {
4240
+ /** Charges for the subscriptions, including an identifier. */
4241
+ subscriptionsCharges?: SubscriptionCharges[];
4228
4242
  }
4229
- interface SubscriptionCollectionMethodUpdated {
4230
- subscription?: Subscription;
4231
- newCollectionMethod?: CollectionMethodEnumCollectionMethod;
4232
- previousCollectionMethod?: CollectionMethodEnumCollectionMethod;
4243
+ interface SubscriptionCharges {
4244
+ /** External identifier of the subscription */
4245
+ externalId?: string | null;
4246
+ /** Charges for subscription. */
4247
+ charges?: Charge[];
4233
4248
  }
4234
- interface FreeTrailStarted {
4235
- subscription?: Subscription;
4249
+ interface PayCycleRequest {
4250
+ subscriptionId: string;
4251
+ paymentTestMode?: PaymentTestMode;
4252
+ tenantId: string;
4236
4253
  }
4237
- interface FreeTrailEnded {
4238
- subscription?: Subscription;
4254
+ declare enum PaymentTestMode {
4255
+ REGULAR = "REGULAR",
4256
+ FAIL_TECHNICAL = "FAIL_TECHNICAL",
4257
+ FAIL_DECLINE = "FAIL_DECLINE",
4258
+ FAIL_RETRYABLE_DECLINE = "FAIL_RETRYABLE_DECLINE"
4239
4259
  }
4240
- interface SubscriptionBackOfficeAction {
4260
+ interface PayCycleResponse {
4261
+ invoiceId?: string;
4262
+ paymentOrderId?: string | null;
4241
4263
  subscription?: Subscription;
4242
- /** The backoffice method name */
4243
- name?: string;
4244
- /** json as string format, to store the flatted request object */
4245
- params?: string;
4246
- }
4247
- /** Defines unknown events restored from the logs */
4248
- interface UnknownSubscriptionEvent {
4249
- subscriptionAsString?: string | null;
4250
4264
  }
4251
4265
  interface CustomerNonNullableFields {
4252
4266
  visitorId: string;
@@ -4351,235 +4365,75 @@ interface AutomaticRetryDataNonNullableFields {
4351
4365
  interface GracePeriodDataNonNullableFields {
4352
4366
  automaticRetryData?: AutomaticRetryDataNonNullableFields;
4353
4367
  }
4354
- interface BillingStatusNonNullableFields {
4355
- currentCycle: number;
4356
- latestPaymentData?: PaymentDataNonNullableFields;
4357
- updateBillingDateData?: UpdateBillingDateDataNonNullableFields;
4358
- gracePeriodData?: GracePeriodDataNonNullableFields;
4359
- }
4360
- interface SubscriptionPoliciesNonNullableFields {
4361
- customerCanCancel: boolean;
4362
- businessCanExtend: boolean;
4363
- allowEndOfCycleCancellation: boolean;
4364
- }
4365
- interface PauseInfoNonNullableFields {
4366
- pausePolicy: PausePolicy;
4367
- pauseAt: PauseAt;
4368
- resumeAt: ResumeAt;
4369
- }
4370
- interface CancellationInfoNonNullableFields {
4371
- initiator: HistoryActionInitiator;
4372
- }
4373
- interface FixedPriceNonNullableFields {
4374
- itemPrice: string;
4375
- }
4376
- interface PricingModelNonNullableFields {
4377
- fixedPrice?: FixedPriceNonNullableFields;
4378
- }
4379
- interface ItemChangeNonNullableFields {
4380
- _id: string;
4381
- pricingModel?: PricingModelNonNullableFields;
4382
- tax?: TaxNonNullableFields;
4383
- }
4384
- interface CatalogReferenceNonNullableFields {
4385
- catalogItemId: string;
4386
- }
4387
- interface ApplicationFeeNonNullableFields {
4388
- amount: string;
4389
- discounts: DiscountNonNullableFields[];
4390
- }
4391
- interface ItemNonNullableFields {
4392
- name: string;
4393
- catalogReference?: CatalogReferenceNonNullableFields;
4394
- category: ItemCategory;
4395
- quantity: number;
4396
- pricingModel?: PricingModelNonNullableFields;
4397
- tax?: TaxNonNullableFields;
4398
- discounts: DiscountNonNullableFields[];
4399
- applicationFee?: ApplicationFeeNonNullableFields;
4400
- }
4401
- interface SubscriptionUpdateDataNonNullableFields {
4402
- itemsToUpdate: ItemChangeNonNullableFields[];
4403
- itemsToAdd: ItemNonNullableFields[];
4404
- numberOfRequests: number;
4405
- }
4406
- interface SpecificDateSubscriptionUpdateDataNonNullableFields {
4407
- updateData?: SubscriptionUpdateDataNonNullableFields;
4408
- }
4409
- interface SubscriptionNonNullableFields {
4410
- name: string;
4411
- customer?: CustomerNonNullableFields;
4412
- status: SubscriptionStatusEnumSubscriptionStatus;
4413
- billingSettings?: BillingSettingsNonNullableFields;
4414
- billingStatus?: BillingStatusNonNullableFields;
4415
- shippingAddress?: FullAddressDetailsNonNullableFields;
4416
- policies?: SubscriptionPoliciesNonNullableFields;
4417
- pauseInfo?: PauseInfoNonNullableFields;
4418
- cancellationInfo?: CancellationInfoNonNullableFields;
4419
- pendingUpdateData?: SubscriptionUpdateDataNonNullableFields;
4420
- bassManaged: boolean;
4421
- specificDatePendingUpdateData?: SpecificDateSubscriptionUpdateDataNonNullableFields;
4422
- items: ItemNonNullableFields[];
4423
- }
4424
- interface GetSubscriptionResponseNonNullableFields {
4425
- subscription?: SubscriptionNonNullableFields;
4426
- }
4427
- interface CustomerCancelSubscriptionResponseNonNullableFields {
4428
- subscription?: SubscriptionNonNullableFields;
4429
- }
4430
- interface CustomerTurnOnAutoRenewalResponseNonNullableFields {
4431
- subscription?: SubscriptionNonNullableFields;
4432
- }
4433
- interface CustomerTurnOffAutoRenewalResponseNonNullableFields {
4434
- subscription?: SubscriptionNonNullableFields;
4435
- }
4436
- interface CustomerExtendSubscriptionResponseNonNullableFields {
4437
- subscription?: SubscriptionNonNullableFields;
4438
- }
4439
- interface QuerySubscriptionsResponseNonNullableFields {
4440
- subscriptions: SubscriptionNonNullableFields[];
4441
- }
4442
- interface UpdateSubscriptionPaymentMethodResponseNonNullableFields {
4443
- subscription?: SubscriptionNonNullableFields;
4444
- }
4445
- interface ActionNonNullableFields {
4446
- actionType: ActionType;
4447
- pausePolicies: PausePolicy[];
4448
- pauseAt: PauseAt[];
4449
- resumeAt: ResumeAt[];
4450
- extendPolicies: ExtendPolicyType[];
4451
- }
4452
- interface CustomerAllowedActionsResponseNonNullableFields {
4453
- actions: ActionNonNullableFields[];
4454
- }
4455
- interface RecurringNonNullableFields {
4456
- cycleNumber: number;
4457
- }
4458
- interface InvoiceDiscountNonNullableFields {
4459
- amount: string;
4460
- percentage: string;
4461
- origin?: DiscountOriginNonNullableFields;
4462
- }
4463
- interface InvoiceApplicationFeeNonNullableFields {
4464
- amount: string;
4465
- discount?: InvoiceDiscountNonNullableFields;
4466
- }
4467
- interface PriceDetailsNonNullableFields {
4468
- price: string;
4469
- tax?: TaxNonNullableFields;
4470
- discount?: InvoiceDiscountNonNullableFields;
4471
- applicationFeeDetails?: InvoiceApplicationFeeNonNullableFields;
4472
- }
4473
- interface LineItemTaxSummaryNonNullableFields {
4474
- aggregatedTaxAmount: string;
4475
- aggregatedTaxRate: string;
4476
- taxableAmount: string;
4477
- }
4478
- interface TaxBreakdownNonNullableFields {
4479
- taxType: string;
4480
- taxRate: string;
4481
- jurisdictionType: string;
4482
- }
4483
- interface ItemTaxDataNonNullableFields {
4484
- lineItemTaxSummary?: LineItemTaxSummaryNonNullableFields;
4485
- taxBreakdowns: TaxBreakdownNonNullableFields[];
4486
- }
4487
- interface InvoiceItemNonNullableFields {
4488
- recurring?: RecurringNonNullableFields;
4489
- _id: string;
4490
- name: string;
4491
- catalogReference?: CatalogReferenceNonNullableFields;
4492
- category: ItemCategory;
4493
- quantity: number;
4494
- priceDetails?: PriceDetailsNonNullableFields;
4495
- totals?: TotalsNonNullableFields;
4496
- taxData?: ItemTaxDataNonNullableFields;
4497
- }
4498
- interface SubscriptionChargeNonNullableFields {
4499
- cycle: number;
4500
- totals?: TotalsNonNullableFields;
4501
- invoiceItems: InvoiceItemNonNullableFields[];
4502
- discount?: InvoiceDiscountNonNullableFields;
4503
- }
4504
- interface CustomerListUpcomingChargesResponseNonNullableFields {
4505
- upcomingCharge?: SubscriptionChargeNonNullableFields;
4506
- }
4507
- interface InitiatePaymentMethodSetupResponseNonNullableFields {
4508
- paymentOrderId: string;
4509
- }
4510
- interface PayCycleResponseNonNullableFields {
4511
- invoiceId: string;
4512
- subscription?: SubscriptionNonNullableFields;
4513
- }
4514
- interface UpdateSubscriptionBillingDateResponseNonNullableFields {
4515
- subscription?: SubscriptionNonNullableFields;
4516
- }
4517
- interface CancelSubscriptionResponseNonNullableFields {
4518
- subscription?: SubscriptionNonNullableFields;
4519
- }
4520
- interface PauseSubscriptionResponseNonNullableFields {
4521
- subscription?: SubscriptionNonNullableFields;
4522
- }
4523
- interface ResumeSubscriptionResponseNonNullableFields {
4524
- subscription?: SubscriptionNonNullableFields;
4525
- }
4526
- interface SearchSubscriptionsResponseNonNullableFields {
4527
- subscriptions: SubscriptionNonNullableFields[];
4528
- }
4529
- interface CountByStatusNonNullableFields {
4530
- status: SubscriptionStatusEnumSubscriptionStatus;
4531
- count: number;
4532
- }
4533
- interface CountSubscriptionsResponseNonNullableFields {
4534
- countByStatus: CountByStatusNonNullableFields[];
4535
- total: number;
4536
- }
4537
- interface TurnOnSubscriptionAutoRenewalResponseNonNullableFields {
4538
- subscription?: SubscriptionNonNullableFields;
4539
- }
4540
- interface TurnOffSubscriptionAutoRenewalResponseNonNullableFields {
4541
- subscription?: SubscriptionNonNullableFields;
4368
+ interface BillingStatusNonNullableFields {
4369
+ currentCycle: number;
4370
+ latestPaymentData?: PaymentDataNonNullableFields;
4371
+ updateBillingDateData?: UpdateBillingDateDataNonNullableFields;
4372
+ gracePeriodData?: GracePeriodDataNonNullableFields;
4542
4373
  }
4543
- interface MarkLatestInvoiceAsPaidResponseNonNullableFields {
4544
- subscription?: SubscriptionNonNullableFields;
4374
+ interface SubscriptionPoliciesNonNullableFields {
4375
+ customerCanCancel: boolean;
4376
+ businessCanExtend: boolean;
4377
+ allowEndOfCycleCancellation: boolean;
4545
4378
  }
4546
- interface AmountByStatusNonNullableFields {
4547
- status: SubscriptionStatusEnumSubscriptionStatus;
4548
- amount: number;
4379
+ interface PauseInfoNonNullableFields {
4380
+ pausePolicy: PausePolicy;
4381
+ pauseAt: PauseAt;
4382
+ resumeAt: ResumeAt;
4549
4383
  }
4550
- interface GetSubscriptionsStatsResponseNonNullableFields {
4551
- amountByStatuses: AmountByStatusNonNullableFields[];
4552
- total: number;
4384
+ interface CancellationInfoNonNullableFields {
4385
+ initiator: HistoryActionInitiator;
4553
4386
  }
4554
- interface ExtendSubscriptionResponseNonNullableFields {
4555
- subscription?: SubscriptionNonNullableFields;
4387
+ interface FixedPriceNonNullableFields {
4388
+ itemPrice: string;
4556
4389
  }
4557
- interface UnsupportedReasonNonNullableFields {
4558
- code: string;
4390
+ interface PricingModelNonNullableFields {
4391
+ fixedPrice?: FixedPriceNonNullableFields;
4559
4392
  }
4560
- interface UnsupportedActionNonNullableFields {
4561
- actionType: ActionType;
4562
- reasons: UnsupportedReasonNonNullableFields[];
4393
+ interface ItemChangeNonNullableFields {
4394
+ _id: string;
4395
+ pricingModel?: PricingModelNonNullableFields;
4396
+ tax?: TaxNonNullableFields;
4563
4397
  }
4564
- interface AllowedActionsResponseNonNullableFields {
4565
- actions: ActionNonNullableFields[];
4566
- unsupportedActions: UnsupportedActionNonNullableFields[];
4398
+ interface CatalogReferenceNonNullableFields {
4399
+ catalogItemId: string;
4567
4400
  }
4568
- interface ListUpcomingChargesResponseNonNullableFields {
4569
- upcomingCharges: SubscriptionChargeNonNullableFields[];
4401
+ interface ApplicationFeeNonNullableFields {
4402
+ amount: string;
4403
+ discounts: DiscountNonNullableFields[];
4570
4404
  }
4571
- interface ChargeNonNullableFields {
4572
- cycleFrom: number;
4573
- totals?: TotalsNonNullableFields;
4405
+ interface ItemNonNullableFields {
4406
+ name: string;
4407
+ catalogReference?: CatalogReferenceNonNullableFields;
4408
+ category: ItemCategory;
4409
+ quantity: number;
4410
+ pricingModel?: PricingModelNonNullableFields;
4411
+ tax?: TaxNonNullableFields;
4412
+ discounts: DiscountNonNullableFields[];
4413
+ applicationFee?: ApplicationFeeNonNullableFields;
4574
4414
  }
4575
- interface PreviewSubscriptionChargesResponseNonNullableFields {
4576
- charges: ChargeNonNullableFields[];
4415
+ interface SubscriptionUpdateDataNonNullableFields {
4416
+ itemsToUpdate: ItemChangeNonNullableFields[];
4417
+ itemsToAdd: ItemNonNullableFields[];
4418
+ numberOfRequests: number;
4577
4419
  }
4578
- interface SubscriptionChargesNonNullableFields {
4579
- charges: ChargeNonNullableFields[];
4420
+ interface SpecificDateSubscriptionUpdateDataNonNullableFields {
4421
+ updateData?: SubscriptionUpdateDataNonNullableFields;
4580
4422
  }
4581
- interface PreviewSubscriptionsChargesResponseNonNullableFields {
4582
- subscriptionsCharges: SubscriptionChargesNonNullableFields[];
4423
+ interface SubscriptionNonNullableFields {
4424
+ name: string;
4425
+ customer?: CustomerNonNullableFields;
4426
+ status: SubscriptionStatusEnumSubscriptionStatus;
4427
+ billingSettings?: BillingSettingsNonNullableFields;
4428
+ billingStatus?: BillingStatusNonNullableFields;
4429
+ shippingAddress?: FullAddressDetailsNonNullableFields;
4430
+ policies?: SubscriptionPoliciesNonNullableFields;
4431
+ pauseInfo?: PauseInfoNonNullableFields;
4432
+ cancellationInfo?: CancellationInfoNonNullableFields;
4433
+ pendingUpdateData?: SubscriptionUpdateDataNonNullableFields;
4434
+ bassManaged: boolean;
4435
+ specificDatePendingUpdateData?: SpecificDateSubscriptionUpdateDataNonNullableFields;
4436
+ items: ItemNonNullableFields[];
4583
4437
  }
4584
4438
  interface SubscriptionCreatedNonNullableFields {
4585
4439
  subscription?: SubscriptionNonNullableFields;
@@ -4747,6 +4601,166 @@ interface SubscriptionHistoryEntryNonNullableFields {
4747
4601
  interface ListSubscriptionHistoryResponseNonNullableFields {
4748
4602
  historyEntries: SubscriptionHistoryEntryNonNullableFields[];
4749
4603
  }
4604
+ interface GetSubscriptionResponseNonNullableFields {
4605
+ subscription?: SubscriptionNonNullableFields;
4606
+ }
4607
+ interface CustomerCancelSubscriptionResponseNonNullableFields {
4608
+ subscription?: SubscriptionNonNullableFields;
4609
+ }
4610
+ interface CustomerTurnOnAutoRenewalResponseNonNullableFields {
4611
+ subscription?: SubscriptionNonNullableFields;
4612
+ }
4613
+ interface CustomerTurnOffAutoRenewalResponseNonNullableFields {
4614
+ subscription?: SubscriptionNonNullableFields;
4615
+ }
4616
+ interface CustomerExtendSubscriptionResponseNonNullableFields {
4617
+ subscription?: SubscriptionNonNullableFields;
4618
+ }
4619
+ interface QuerySubscriptionsResponseNonNullableFields {
4620
+ subscriptions: SubscriptionNonNullableFields[];
4621
+ }
4622
+ interface UpdateSubscriptionPaymentMethodResponseNonNullableFields {
4623
+ subscription?: SubscriptionNonNullableFields;
4624
+ }
4625
+ interface ActionNonNullableFields {
4626
+ actionType: ActionType;
4627
+ pausePolicies: PausePolicy[];
4628
+ pauseAt: PauseAt[];
4629
+ resumeAt: ResumeAt[];
4630
+ extendPolicies: ExtendPolicyType[];
4631
+ }
4632
+ interface CustomerAllowedActionsResponseNonNullableFields {
4633
+ actions: ActionNonNullableFields[];
4634
+ }
4635
+ interface RecurringNonNullableFields {
4636
+ cycleNumber: number;
4637
+ }
4638
+ interface InvoiceDiscountNonNullableFields {
4639
+ amount: string;
4640
+ percentage: string;
4641
+ origin?: DiscountOriginNonNullableFields;
4642
+ }
4643
+ interface InvoiceApplicationFeeNonNullableFields {
4644
+ amount: string;
4645
+ discount?: InvoiceDiscountNonNullableFields;
4646
+ }
4647
+ interface PriceDetailsNonNullableFields {
4648
+ price: string;
4649
+ tax?: TaxNonNullableFields;
4650
+ discount?: InvoiceDiscountNonNullableFields;
4651
+ applicationFeeDetails?: InvoiceApplicationFeeNonNullableFields;
4652
+ }
4653
+ interface LineItemTaxSummaryNonNullableFields {
4654
+ aggregatedTaxAmount: string;
4655
+ aggregatedTaxRate: string;
4656
+ taxableAmount: string;
4657
+ }
4658
+ interface TaxBreakdownNonNullableFields {
4659
+ taxType: string;
4660
+ taxRate: string;
4661
+ jurisdictionType: string;
4662
+ }
4663
+ interface ItemTaxDataNonNullableFields {
4664
+ lineItemTaxSummary?: LineItemTaxSummaryNonNullableFields;
4665
+ taxBreakdowns: TaxBreakdownNonNullableFields[];
4666
+ }
4667
+ interface InvoiceItemNonNullableFields {
4668
+ recurring?: RecurringNonNullableFields;
4669
+ _id: string;
4670
+ name: string;
4671
+ catalogReference?: CatalogReferenceNonNullableFields;
4672
+ category: ItemCategory;
4673
+ quantity: number;
4674
+ priceDetails?: PriceDetailsNonNullableFields;
4675
+ totals?: TotalsNonNullableFields;
4676
+ taxData?: ItemTaxDataNonNullableFields;
4677
+ }
4678
+ interface SubscriptionChargeNonNullableFields {
4679
+ cycle: number;
4680
+ totals?: TotalsNonNullableFields;
4681
+ invoiceItems: InvoiceItemNonNullableFields[];
4682
+ discount?: InvoiceDiscountNonNullableFields;
4683
+ }
4684
+ interface CustomerListUpcomingChargesResponseNonNullableFields {
4685
+ upcomingCharge?: SubscriptionChargeNonNullableFields;
4686
+ }
4687
+ interface InitiatePaymentMethodSetupResponseNonNullableFields {
4688
+ paymentOrderId: string;
4689
+ }
4690
+ interface UpdateSubscriptionBillingDateResponseNonNullableFields {
4691
+ subscription?: SubscriptionNonNullableFields;
4692
+ }
4693
+ interface CancelSubscriptionResponseNonNullableFields {
4694
+ subscription?: SubscriptionNonNullableFields;
4695
+ }
4696
+ interface PauseSubscriptionResponseNonNullableFields {
4697
+ subscription?: SubscriptionNonNullableFields;
4698
+ }
4699
+ interface ResumeSubscriptionResponseNonNullableFields {
4700
+ subscription?: SubscriptionNonNullableFields;
4701
+ }
4702
+ interface SearchSubscriptionsResponseNonNullableFields {
4703
+ subscriptions: SubscriptionNonNullableFields[];
4704
+ }
4705
+ interface CountByStatusNonNullableFields {
4706
+ status: SubscriptionStatusEnumSubscriptionStatus;
4707
+ count: number;
4708
+ }
4709
+ interface CountSubscriptionsResponseNonNullableFields {
4710
+ countByStatus: CountByStatusNonNullableFields[];
4711
+ total: number;
4712
+ }
4713
+ interface TurnOnSubscriptionAutoRenewalResponseNonNullableFields {
4714
+ subscription?: SubscriptionNonNullableFields;
4715
+ }
4716
+ interface TurnOffSubscriptionAutoRenewalResponseNonNullableFields {
4717
+ subscription?: SubscriptionNonNullableFields;
4718
+ }
4719
+ interface MarkLatestInvoiceAsPaidResponseNonNullableFields {
4720
+ subscription?: SubscriptionNonNullableFields;
4721
+ }
4722
+ interface AmountByStatusNonNullableFields {
4723
+ status: SubscriptionStatusEnumSubscriptionStatus;
4724
+ amount: number;
4725
+ }
4726
+ interface GetSubscriptionsStatsResponseNonNullableFields {
4727
+ amountByStatuses: AmountByStatusNonNullableFields[];
4728
+ total: number;
4729
+ }
4730
+ interface ExtendSubscriptionResponseNonNullableFields {
4731
+ subscription?: SubscriptionNonNullableFields;
4732
+ }
4733
+ interface UnsupportedReasonNonNullableFields {
4734
+ code: string;
4735
+ }
4736
+ interface UnsupportedActionNonNullableFields {
4737
+ actionType: ActionType;
4738
+ reasons: UnsupportedReasonNonNullableFields[];
4739
+ }
4740
+ interface AllowedActionsResponseNonNullableFields {
4741
+ actions: ActionNonNullableFields[];
4742
+ unsupportedActions: UnsupportedActionNonNullableFields[];
4743
+ }
4744
+ interface ListUpcomingChargesResponseNonNullableFields {
4745
+ upcomingCharges: SubscriptionChargeNonNullableFields[];
4746
+ }
4747
+ interface ChargeNonNullableFields {
4748
+ cycleFrom: number;
4749
+ totals?: TotalsNonNullableFields;
4750
+ }
4751
+ interface PreviewSubscriptionChargesResponseNonNullableFields {
4752
+ charges: ChargeNonNullableFields[];
4753
+ }
4754
+ interface SubscriptionChargesNonNullableFields {
4755
+ charges: ChargeNonNullableFields[];
4756
+ }
4757
+ interface PreviewSubscriptionsChargesResponseNonNullableFields {
4758
+ subscriptionsCharges: SubscriptionChargesNonNullableFields[];
4759
+ }
4760
+ interface PayCycleResponseNonNullableFields {
4761
+ invoiceId: string;
4762
+ subscription?: SubscriptionNonNullableFields;
4763
+ }
4750
4764
 
4751
4765
  type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4752
4766
  getUrl: (context: any) => string;
@@ -4758,6 +4772,9 @@ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q
4758
4772
  __responseType: Q;
4759
4773
  __originalResponseType: R;
4760
4774
  };
4775
+ declare function listSubscriptionHistory(): __PublicMethodMetaInfo<'GET', {
4776
+ subscriptionId: string;
4777
+ }, ListSubscriptionHistoryRequest, ListSubscriptionHistoryRequest$1, ListSubscriptionHistoryResponse & ListSubscriptionHistoryResponseNonNullableFields, ListSubscriptionHistoryResponse$1 & ListSubscriptionHistoryResponseNonNullableFields$1>;
4761
4778
  declare function customerGetSubscription(): __PublicMethodMetaInfo<'GET', {
4762
4779
  id: string;
4763
4780
  }, GetSubscriptionRequest, GetSubscriptionRequest$1, GetSubscriptionResponse & GetSubscriptionResponseNonNullableFields, GetSubscriptionResponse$1 & GetSubscriptionResponseNonNullableFields$1>;
@@ -4786,9 +4803,6 @@ declare function customerListUpcomingCharges(): __PublicMethodMetaInfo<'GET', {
4786
4803
  declare function customerInitiatePaymentMethodSetup(): __PublicMethodMetaInfo<'POST', {
4787
4804
  id: string;
4788
4805
  }, InitiatePaymentMethodSetupRequest, InitiatePaymentMethodSetupRequest$1, InitiatePaymentMethodSetupResponse & InitiatePaymentMethodSetupResponseNonNullableFields, InitiatePaymentMethodSetupResponse$1 & InitiatePaymentMethodSetupResponseNonNullableFields$1>;
4789
- declare function payCycle(): __PublicMethodMetaInfo<'POST', {
4790
- subscriptionId: string;
4791
- }, PayCycleRequest, PayCycleRequest$1, PayCycleResponse & PayCycleResponseNonNullableFields, PayCycleResponse$1 & PayCycleResponseNonNullableFields$1>;
4792
4806
  declare function getSubscription(): __PublicMethodMetaInfo<'GET', {
4793
4807
  id: string;
4794
4808
  }, GetSubscriptionRequest, GetSubscriptionRequest$1, GetSubscriptionResponse & GetSubscriptionResponseNonNullableFields, GetSubscriptionResponse$1 & GetSubscriptionResponseNonNullableFields$1>;
@@ -4834,9 +4848,9 @@ declare function previewSubscriptionsCharges(): __PublicMethodMetaInfo<'GET', {}
4834
4848
  declare function initiatePaymentMethodSetup(): __PublicMethodMetaInfo<'POST', {
4835
4849
  id: string;
4836
4850
  }, InitiatePaymentMethodSetupRequest, InitiatePaymentMethodSetupRequest$1, InitiatePaymentMethodSetupResponse & InitiatePaymentMethodSetupResponseNonNullableFields, InitiatePaymentMethodSetupResponse$1 & InitiatePaymentMethodSetupResponseNonNullableFields$1>;
4837
- declare function listSubscriptionHistory(): __PublicMethodMetaInfo<'GET', {
4851
+ declare function payCycle(): __PublicMethodMetaInfo<'POST', {
4838
4852
  subscriptionId: string;
4839
- }, ListSubscriptionHistoryRequest, ListSubscriptionHistoryRequest$1, ListSubscriptionHistoryResponse & ListSubscriptionHistoryResponseNonNullableFields, ListSubscriptionHistoryResponse$1 & ListSubscriptionHistoryResponseNonNullableFields$1>;
4853
+ }, PayCycleRequest, PayCycleRequest$1, PayCycleResponse & PayCycleResponseNonNullableFields, PayCycleResponse$1 & PayCycleResponseNonNullableFields$1>;
4840
4854
 
4841
4855
  type meta___PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = __PublicMethodMetaInfo<K, M, T, S, Q, R>;
4842
4856
  declare const meta_allowedActions: typeof allowedActions;