@wix/auto_sdk_subscription_subscriptions 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/build/cjs/index.d.ts +379 -1
  2. package/build/cjs/index.js +5651 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +4678 -1
  5. package/build/cjs/index.typings.js +4714 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +2373 -1
  8. package/build/cjs/meta.js +3612 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +379 -0
  11. package/build/es/index.mjs +5549 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/{internal/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts → es/index.typings.d.mts} +790 -1149
  14. package/build/es/index.typings.mjs +4625 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +2373 -0
  17. package/build/es/meta.mjs +3557 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +403 -1
  20. package/build/internal/cjs/index.js +5651 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +4702 -1
  23. package/build/internal/cjs/index.typings.js +4714 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +2373 -1
  26. package/build/internal/cjs/meta.js +3612 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +403 -0
  29. package/build/internal/es/index.mjs +5549 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/internal/es/{src/billing-v1-subscription-subscriptions.universal.d.ts → index.typings.d.mts} +793 -1128
  32. package/build/internal/es/index.typings.mjs +4625 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/internal/es/meta.d.mts +2373 -0
  35. package/build/internal/es/meta.mjs +3557 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +12 -10
  38. package/build/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +0 -99
  39. package/build/cjs/src/billing-v1-subscription-subscriptions.context.js +0 -142
  40. package/build/cjs/src/billing-v1-subscription-subscriptions.context.js.map +0 -1
  41. package/build/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +0 -134
  42. package/build/cjs/src/billing-v1-subscription-subscriptions.http.js +0 -3048
  43. package/build/cjs/src/billing-v1-subscription-subscriptions.http.js.map +0 -1
  44. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +0 -94
  45. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js +0 -636
  46. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +0 -1
  47. package/build/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +0 -273
  48. package/build/cjs/src/billing-v1-subscription-subscriptions.public.js +0 -769
  49. package/build/cjs/src/billing-v1-subscription-subscriptions.public.js.map +0 -1
  50. package/build/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +0 -4203
  51. package/build/cjs/src/billing-v1-subscription-subscriptions.types.js +0 -347
  52. package/build/cjs/src/billing-v1-subscription-subscriptions.types.js.map +0 -1
  53. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts +0 -5013
  54. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js +0 -1997
  55. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/src/billing-v1-subscription-subscriptions.context.d.ts +0 -99
  66. package/build/es/src/billing-v1-subscription-subscriptions.context.js +0 -101
  67. package/build/es/src/billing-v1-subscription-subscriptions.context.js.map +0 -1
  68. package/build/es/src/billing-v1-subscription-subscriptions.http.d.ts +0 -134
  69. package/build/es/src/billing-v1-subscription-subscriptions.http.js +0 -3013
  70. package/build/es/src/billing-v1-subscription-subscriptions.http.js.map +0 -1
  71. package/build/es/src/billing-v1-subscription-subscriptions.meta.d.ts +0 -94
  72. package/build/es/src/billing-v1-subscription-subscriptions.meta.js +0 -578
  73. package/build/es/src/billing-v1-subscription-subscriptions.meta.js.map +0 -1
  74. package/build/es/src/billing-v1-subscription-subscriptions.public.d.ts +0 -273
  75. package/build/es/src/billing-v1-subscription-subscriptions.public.js +0 -696
  76. package/build/es/src/billing-v1-subscription-subscriptions.public.js.map +0 -1
  77. package/build/es/src/billing-v1-subscription-subscriptions.types.d.ts +0 -4203
  78. package/build/es/src/billing-v1-subscription-subscriptions.types.js +0 -344
  79. package/build/es/src/billing-v1-subscription-subscriptions.types.js.map +0 -1
  80. package/build/es/src/billing-v1-subscription-subscriptions.universal.d.ts +0 -5013
  81. package/build/es/src/billing-v1-subscription-subscriptions.universal.js +0 -1938
  82. package/build/es/src/billing-v1-subscription-subscriptions.universal.js.map +0 -1
  83. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +0 -101
  84. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js +0 -142
  85. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js.map +0 -1
  86. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +0 -134
  87. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js +0 -3048
  88. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js.map +0 -1
  89. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +0 -94
  90. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js +0 -636
  91. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +0 -1
  92. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +0 -293
  93. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js +0 -769
  94. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js.map +0 -1
  95. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +0 -4203
  96. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js +0 -347
  97. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js.map +0 -1
  98. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js +0 -1997
  99. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +0 -1
  100. package/build/internal/es/index.d.ts +0 -1
  101. package/build/internal/es/index.js +0 -2
  102. package/build/internal/es/index.js.map +0 -1
  103. package/build/internal/es/index.typings.d.ts +0 -1
  104. package/build/internal/es/index.typings.js +0 -2
  105. package/build/internal/es/index.typings.js.map +0 -1
  106. package/build/internal/es/meta.d.ts +0 -1
  107. package/build/internal/es/meta.js +0 -2
  108. package/build/internal/es/meta.js.map +0 -1
  109. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.d.ts +0 -101
  110. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js +0 -101
  111. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js.map +0 -1
  112. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.d.ts +0 -134
  113. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js +0 -3013
  114. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js.map +0 -1
  115. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.d.ts +0 -94
  116. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js +0 -578
  117. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js.map +0 -1
  118. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.d.ts +0 -293
  119. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js +0 -696
  120. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js.map +0 -1
  121. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.d.ts +0 -4203
  122. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js +0 -344
  123. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js.map +0 -1
  124. package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js +0 -1938
  125. package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js.map +0 -1
@@ -1,1938 +0,0 @@
1
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
- import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
3
- import * as ambassadorWixBillingV1Subscription from './billing-v1-subscription-subscriptions.http.js';
4
- import { transformSDKAddressToRESTAddress } from '@wix/sdk-runtime/transformations/address';
5
- import { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';
6
- import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
7
- export var SubscriptionStatusEnumSubscriptionStatus;
8
- (function (SubscriptionStatusEnumSubscriptionStatus) {
9
- SubscriptionStatusEnumSubscriptionStatus["UNKNOWN"] = "UNKNOWN";
10
- /** Subscription created in this status, but hasn't been paid for yet. Filtered out from subscriptions querying. */
11
- SubscriptionStatusEnumSubscriptionStatus["DRAFT"] = "DRAFT";
12
- /** Subscription that will be active in future. */
13
- SubscriptionStatusEnumSubscriptionStatus["PENDING"] = "PENDING";
14
- /** Subscription is active */
15
- SubscriptionStatusEnumSubscriptionStatus["ACTIVE"] = "ACTIVE";
16
- /** Subscription is paused */
17
- SubscriptionStatusEnumSubscriptionStatus["PAUSED"] = "PAUSED";
18
- /** Subscription was ended */
19
- SubscriptionStatusEnumSubscriptionStatus["ENDED"] = "ENDED";
20
- /** Subscription was canceled or auto-renew off. Ended before its time. */
21
- SubscriptionStatusEnumSubscriptionStatus["CANCELED"] = "CANCELED";
22
- })(SubscriptionStatusEnumSubscriptionStatus || (SubscriptionStatusEnumSubscriptionStatus = {}));
23
- export var CollectionMethodEnumCollectionMethod;
24
- (function (CollectionMethodEnumCollectionMethod) {
25
- CollectionMethodEnumCollectionMethod["UNKNOWN"] = "UNKNOWN";
26
- /** Subscriber automatically charged */
27
- CollectionMethodEnumCollectionMethod["AUTO_CHARGE"] = "AUTO_CHARGE";
28
- /** Payments manually collected and managed by owner */
29
- CollectionMethodEnumCollectionMethod["OFFLINE"] = "OFFLINE";
30
- /** Payment will be collected somehow. Billing only issues invoice per cycle. */
31
- CollectionMethodEnumCollectionMethod["SEND_INVOICE"] = "SEND_INVOICE";
32
- /** Payment will be collected externally */
33
- CollectionMethodEnumCollectionMethod["EXTERNAL"] = "EXTERNAL";
34
- /** Indicates the product has a zero amount, meaning its free with no payment required. */
35
- CollectionMethodEnumCollectionMethod["FREE"] = "FREE";
36
- })(CollectionMethodEnumCollectionMethod || (CollectionMethodEnumCollectionMethod = {}));
37
- export var DurationUnit;
38
- (function (DurationUnit) {
39
- DurationUnit["UNKNOWN"] = "UNKNOWN";
40
- DurationUnit["DAY"] = "DAY";
41
- DurationUnit["WEEK"] = "WEEK";
42
- DurationUnit["MONTH"] = "MONTH";
43
- DurationUnit["YEAR"] = "YEAR";
44
- })(DurationUnit || (DurationUnit = {}));
45
- export var AdditionalFeeTrigger;
46
- (function (AdditionalFeeTrigger) {
47
- AdditionalFeeTrigger["UNKNOWN"] = "UNKNOWN";
48
- /** Charge upon subscription first payment */
49
- AdditionalFeeTrigger["FIRST_PAYMENT"] = "FIRST_PAYMENT";
50
- })(AdditionalFeeTrigger || (AdditionalFeeTrigger = {}));
51
- export var TaxableAddressType;
52
- (function (TaxableAddressType) {
53
- TaxableAddressType["UNKNOWN"] = "UNKNOWN";
54
- /** Tax will be calculated using a single address */
55
- TaxableAddressType["BUSINESS"] = "BUSINESS";
56
- /** Tax will be calculated using multiple address (from BUSINESS to BILLING) */
57
- TaxableAddressType["BILLING"] = "BILLING";
58
- /** Tax will be calculated using multiple address (from BUSINESS to SHIPPING) */
59
- TaxableAddressType["SHIPPING"] = "SHIPPING";
60
- })(TaxableAddressType || (TaxableAddressType = {}));
61
- export var PaymentStatus;
62
- (function (PaymentStatus) {
63
- /** Payment status unknown */
64
- PaymentStatus["UNKNOWN"] = "UNKNOWN";
65
- /** Payment has not been paid */
66
- PaymentStatus["UNPAID"] = "UNPAID";
67
- /** Payment has been paid // TODO: p13n review: we are not sending event when in SEND_INVOICE mode cycle was paid. should we and which event? */
68
- PaymentStatus["PAID"] = "PAID";
69
- /** Payment failed */
70
- PaymentStatus["FAILED"] = "FAILED";
71
- })(PaymentStatus || (PaymentStatus = {}));
72
- export var PausePolicy;
73
- (function (PausePolicy) {
74
- PausePolicy["NONE"] = "NONE";
75
- /** Pause the payment and the service. When resuming, the subscription end date is extended by the number of cycles postponed, and if the pause happened in a middle of a cycle, the payment date is postponed by the amount of days that already paid. */
76
- PausePolicy["SERVICE_AND_PAYMENTS"] = "SERVICE_AND_PAYMENTS";
77
- /** Pause the service and continue the billing. When resuming, extend the service by the time that was paused */
78
- PausePolicy["SERVICE_ONLY"] = "SERVICE_ONLY";
79
- })(PausePolicy || (PausePolicy = {}));
80
- export var PauseAt;
81
- (function (PauseAt) {
82
- /** Cancel scheduled pause */
83
- PauseAt["NONE"] = "NONE";
84
- /** Pause the subscription now */
85
- PauseAt["IMMEDIATELY"] = "IMMEDIATELY";
86
- /** Pause the subscription at the next billing date */
87
- PauseAt["NEXT_BILLING_DATE"] = "NEXT_BILLING_DATE";
88
- /** A specific date must be defined in Schedule.specific_date */
89
- PauseAt["SPECIFIC_DATE"] = "SPECIFIC_DATE";
90
- /** The number of cycles must be defined in Schedule.number_of_cycles */
91
- PauseAt["NUMBER_OF_CYCLES_FROM_TODAY"] = "NUMBER_OF_CYCLES_FROM_TODAY";
92
- })(PauseAt || (PauseAt = {}));
93
- export var ResumeAt;
94
- (function (ResumeAt) {
95
- /** Cancel scheduled resume */
96
- ResumeAt["NONE"] = "NONE";
97
- /** Resume the subscription now */
98
- ResumeAt["IMMEDIATELY"] = "IMMEDIATELY";
99
- /** Resume the subscription at the next billing date */
100
- ResumeAt["NEXT_BILLING_DATE"] = "NEXT_BILLING_DATE";
101
- /** A specific date must be defined in Schedule.specific_date */
102
- ResumeAt["SPECIFIC_DATE"] = "SPECIFIC_DATE";
103
- })(ResumeAt || (ResumeAt = {}));
104
- export var HistoryActionInitiator;
105
- (function (HistoryActionInitiator) {
106
- HistoryActionInitiator["UNDEFINED"] = "UNDEFINED";
107
- HistoryActionInitiator["BUSINESS"] = "BUSINESS";
108
- HistoryActionInitiator["CUSTOMER"] = "CUSTOMER";
109
- HistoryActionInitiator["SYSTEM"] = "SYSTEM";
110
- HistoryActionInitiator["PAYMENT_FAILURE"] = "PAYMENT_FAILURE";
111
- })(HistoryActionInitiator || (HistoryActionInitiator = {}));
112
- export var ItemCategory;
113
- (function (ItemCategory) {
114
- ItemCategory["UNKNOWN"] = "UNKNOWN";
115
- ItemCategory["PHYSICAL"] = "PHYSICAL";
116
- ItemCategory["DIGITAL"] = "DIGITAL";
117
- })(ItemCategory || (ItemCategory = {}));
118
- export var SortOrder;
119
- (function (SortOrder) {
120
- SortOrder["ASC"] = "ASC";
121
- SortOrder["DESC"] = "DESC";
122
- })(SortOrder || (SortOrder = {}));
123
- export var SubscriptionStatusGroup;
124
- (function (SubscriptionStatusGroup) {
125
- SubscriptionStatusGroup["ALL"] = "ALL";
126
- /** Union of ACTIVE, PAUSED and PENDING */
127
- SubscriptionStatusGroup["LIVE"] = "LIVE";
128
- })(SubscriptionStatusGroup || (SubscriptionStatusGroup = {}));
129
- export var ActionType;
130
- (function (ActionType) {
131
- ActionType["NONE"] = "NONE";
132
- ActionType["CREATION"] = "CREATION";
133
- ActionType["CANCEL"] = "CANCEL";
134
- ActionType["CYCLE_AUTO_RENEW_ON"] = "CYCLE_AUTO_RENEW_ON";
135
- ActionType["CYCLE_AUTO_RENEW_OFF"] = "CYCLE_AUTO_RENEW_OFF";
136
- ActionType["PAUSE"] = "PAUSE";
137
- ActionType["RESUME"] = "RESUME";
138
- ActionType["MARK_AS_PAID"] = "MARK_AS_PAID";
139
- ActionType["EXTEND"] = "EXTEND";
140
- ActionType["UPDATE"] = "UPDATE";
141
- ActionType["UPDATE_START_DATE"] = "UPDATE_START_DATE";
142
- ActionType["UPM"] = "UPM";
143
- ActionType["UPDATE_BILLING_DATE"] = "UPDATE_BILLING_DATE";
144
- ActionType["UPDATE_COLLECTION_METHOD"] = "UPDATE_COLLECTION_METHOD";
145
- })(ActionType || (ActionType = {}));
146
- export var ExtendPolicyType;
147
- (function (ExtendPolicyType) {
148
- ExtendPolicyType["PERIOD"] = "PERIOD";
149
- ExtendPolicyType["BILLING_CYCLE"] = "BILLING_CYCLE";
150
- })(ExtendPolicyType || (ExtendPolicyType = {}));
151
- export var PaymentMode;
152
- (function (PaymentMode) {
153
- PaymentMode["NONE"] = "NONE";
154
- /** The latest invoice of the subscription will be charged. */
155
- PaymentMode["CHARGE"] = "CHARGE";
156
- /** An authorization invoice with zero amount will be created. */
157
- PaymentMode["AUTHORIZATION"] = "AUTHORIZATION";
158
- })(PaymentMode || (PaymentMode = {}));
159
- export var OrderMethod;
160
- (function (OrderMethod) {
161
- OrderMethod["UNKNOWN"] = "UNKNOWN";
162
- OrderMethod["MOTO"] = "MOTO";
163
- OrderMethod["NOT_MOTO"] = "NOT_MOTO";
164
- })(OrderMethod || (OrderMethod = {}));
165
- export var WebhookIdentityType;
166
- (function (WebhookIdentityType) {
167
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
168
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
169
- WebhookIdentityType["MEMBER"] = "MEMBER";
170
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
171
- WebhookIdentityType["APP"] = "APP";
172
- })(WebhookIdentityType || (WebhookIdentityType = {}));
173
- export var PaymentTestMode;
174
- (function (PaymentTestMode) {
175
- PaymentTestMode["REGULAR"] = "REGULAR";
176
- PaymentTestMode["FAIL_TECHNICAL"] = "FAIL_TECHNICAL";
177
- PaymentTestMode["FAIL_DECLINE"] = "FAIL_DECLINE";
178
- PaymentTestMode["FAIL_RETRYABLE_DECLINE"] = "FAIL_RETRYABLE_DECLINE";
179
- })(PaymentTestMode || (PaymentTestMode = {}));
180
- export var RevivePolicy;
181
- (function (RevivePolicy) {
182
- RevivePolicy["SIMPLE"] = "SIMPLE";
183
- RevivePolicy["RESUME"] = "RESUME";
184
- })(RevivePolicy || (RevivePolicy = {}));
185
- export var ActionInitiator;
186
- (function (ActionInitiator) {
187
- ActionInitiator["UNDEFINED"] = "UNDEFINED";
188
- ActionInitiator["BUSINESS"] = "BUSINESS";
189
- ActionInitiator["CUSTOMER"] = "CUSTOMER";
190
- ActionInitiator["SYSTEM"] = "SYSTEM";
191
- })(ActionInitiator || (ActionInitiator = {}));
192
- export var UpdateAction;
193
- (function (UpdateAction) {
194
- UpdateAction["NONE"] = "NONE";
195
- /** Update subscription immediately, please note proration for updates changing price are not yet supported */
196
- UpdateAction["IMMEDIATELY"] = "IMMEDIATELY";
197
- /** Request updates that will take affect only at the start of the next billing cycle. */
198
- UpdateAction["NEXT_BILLING_CYCLE"] = "NEXT_BILLING_CYCLE";
199
- /** Reset all pending updates */
200
- UpdateAction["RESET_PENDING_UPDATES"] = "RESET_PENDING_UPDATES";
201
- /** Request updates that will take affect only at a specific date. */
202
- UpdateAction["SPECIFIC_DATE"] = "SPECIFIC_DATE";
203
- })(UpdateAction || (UpdateAction = {}));
204
- export var RequestedFields;
205
- (function (RequestedFields) {
206
- RequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
207
- /** Include unsupported action list, including the reasons for the lack of support */
208
- RequestedFields["UNSUPPORTED_ACTION"] = "UNSUPPORTED_ACTION";
209
- })(RequestedFields || (RequestedFields = {}));
210
- export var InvoiceStatus;
211
- (function (InvoiceStatus) {
212
- InvoiceStatus["UNKNOWN"] = "UNKNOWN";
213
- InvoiceStatus["OPEN"] = "OPEN";
214
- InvoiceStatus["PAID"] = "PAID";
215
- InvoiceStatus["FAILED"] = "FAILED";
216
- InvoiceStatus["ATTEMPT_FAILED"] = "ATTEMPT_FAILED";
217
- InvoiceStatus["CANCELED"] = "CANCELED";
218
- InvoiceStatus["REFUNDED"] = "REFUNDED";
219
- })(InvoiceStatus || (InvoiceStatus = {}));
220
- export var CollectionMethod;
221
- (function (CollectionMethod) {
222
- CollectionMethod["UNKNOWN"] = "UNKNOWN";
223
- CollectionMethod["AUTO_CHARGE"] = "AUTO_CHARGE";
224
- CollectionMethod["OFFLINE"] = "OFFLINE";
225
- CollectionMethod["SEND_INVOICE"] = "SEND_INVOICE";
226
- })(CollectionMethod || (CollectionMethod = {}));
227
- export var CreationMode;
228
- (function (CreationMode) {
229
- CreationMode["UNKNOWN"] = "UNKNOWN";
230
- CreationMode["SYSTEM"] = "SYSTEM";
231
- CreationMode["MANUAL"] = "MANUAL";
232
- })(CreationMode || (CreationMode = {}));
233
- export var PaymentAttemptStatus;
234
- (function (PaymentAttemptStatus) {
235
- PaymentAttemptStatus["UNKNOWN"] = "UNKNOWN";
236
- PaymentAttemptStatus["SCHEDULED"] = "SCHEDULED";
237
- PaymentAttemptStatus["IN_PROGRESS"] = "IN_PROGRESS";
238
- PaymentAttemptStatus["PAID"] = "PAID";
239
- PaymentAttemptStatus["DECLINED"] = "DECLINED";
240
- PaymentAttemptStatus["TECHNICAL_FAILURE"] = "TECHNICAL_FAILURE";
241
- PaymentAttemptStatus["CANCELED"] = "CANCELED";
242
- PaymentAttemptStatus["PENDING"] = "PENDING";
243
- })(PaymentAttemptStatus || (PaymentAttemptStatus = {}));
244
- export var RefundReason;
245
- (function (RefundReason) {
246
- RefundReason["UNKNOWN_REFUND_REASON"] = "UNKNOWN_REFUND_REASON";
247
- RefundReason["DUPLICATE_CHARGE"] = "DUPLICATE_CHARGE";
248
- RefundReason["FRAUDULENT"] = "FRAUDULENT";
249
- RefundReason["CUSTOMER_REQUEST"] = "CUSTOMER_REQUEST";
250
- RefundReason["PROVISION_FAILED"] = "PROVISION_FAILED";
251
- RefundReason["OTHER"] = "OTHER";
252
- })(RefundReason || (RefundReason = {}));
253
- export var IdentityType;
254
- (function (IdentityType) {
255
- /** Identity type undefined */
256
- IdentityType["UNDEFINED"] = "UNDEFINED";
257
- /** Subscription is associated with a member ID */
258
- IdentityType["MEMBER"] = "MEMBER";
259
- /** Subscriptions is associated with a contact ID */
260
- IdentityType["CONTACT"] = "CONTACT";
261
- })(IdentityType || (IdentityType = {}));
262
- export var SubscriptionType;
263
- (function (SubscriptionType) {
264
- SubscriptionType["UNDEFINED"] = "UNDEFINED";
265
- /** Payments made by the subscriber */
266
- SubscriptionType["ONLINE"] = "ONLINE";
267
- /** Payments managed manually by the site owner */
268
- SubscriptionType["OFFLINE"] = "OFFLINE";
269
- })(SubscriptionType || (SubscriptionType = {}));
270
- export var V1SubscriptionStatusEnumSubscriptionStatus;
271
- (function (V1SubscriptionStatusEnumSubscriptionStatus) {
272
- /** Subscription status undefined */
273
- V1SubscriptionStatusEnumSubscriptionStatus["UNDEFINED"] = "UNDEFINED";
274
- /** Subscription created, but hasn't been paid for yet. This status if filtered out in ListSubscriptions response by default. */
275
- V1SubscriptionStatusEnumSubscriptionStatus["DRAFT"] = "DRAFT";
276
- /** Subscription has been paid for, but the start date is in the future */
277
- V1SubscriptionStatusEnumSubscriptionStatus["PENDING"] = "PENDING";
278
- /** Subscription is active */
279
- V1SubscriptionStatusEnumSubscriptionStatus["ACTIVE"] = "ACTIVE";
280
- /** Subscription has expired */
281
- V1SubscriptionStatusEnumSubscriptionStatus["EXPIRED"] = "EXPIRED";
282
- /** Subscription has been canceled */
283
- V1SubscriptionStatusEnumSubscriptionStatus["CANCELED"] = "CANCELED";
284
- /** Subscription has been set to be canceled at a future date */
285
- V1SubscriptionStatusEnumSubscriptionStatus["PENDING_CANCELLATION"] = "PENDING_CANCELLATION";
286
- /** Subscription is suspended */
287
- V1SubscriptionStatusEnumSubscriptionStatus["SUSPENDED"] = "SUSPENDED";
288
- })(V1SubscriptionStatusEnumSubscriptionStatus || (V1SubscriptionStatusEnumSubscriptionStatus = {}));
289
- export var PaymentStatusEnumPaymentStatus;
290
- (function (PaymentStatusEnumPaymentStatus) {
291
- /** Payment status undefined */
292
- PaymentStatusEnumPaymentStatus["UNDEFINED"] = "UNDEFINED";
293
- /** Payment has been paid */
294
- PaymentStatusEnumPaymentStatus["PAID"] = "PAID";
295
- /** Payment has been refunded */
296
- PaymentStatusEnumPaymentStatus["REFUNDED"] = "REFUNDED";
297
- /** Recurring payment has failed */
298
- PaymentStatusEnumPaymentStatus["FAILED"] = "FAILED";
299
- /** Payment has not been paid */
300
- PaymentStatusEnumPaymentStatus["UNPAID"] = "UNPAID";
301
- /** Billing has been initialized, but actual charge is yet to be made. Can happen for free trial and PayPal */
302
- PaymentStatusEnumPaymentStatus["PENDING"] = "PENDING";
303
- })(PaymentStatusEnumPaymentStatus || (PaymentStatusEnumPaymentStatus = {}));
304
- /** Frequency unit of recurring payment */
305
- export var SubscriptionFrequency;
306
- (function (SubscriptionFrequency) {
307
- SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
308
- SubscriptionFrequency["DAY"] = "DAY";
309
- SubscriptionFrequency["WEEK"] = "WEEK";
310
- SubscriptionFrequency["MONTH"] = "MONTH";
311
- SubscriptionFrequency["YEAR"] = "YEAR";
312
- })(SubscriptionFrequency || (SubscriptionFrequency = {}));
313
- export var CancellationInitiator;
314
- (function (CancellationInitiator) {
315
- /** Cancellation initiator undefined */
316
- CancellationInitiator["UNDEFINED"] = "UNDEFINED";
317
- /** Subscription was canceled by site owner (default if canceled by user or service identity) */
318
- CancellationInitiator["OWNER"] = "OWNER";
319
- /** Subscription was canceled by member (default if canceled by member identity) */
320
- CancellationInitiator["MEMBER"] = "MEMBER";
321
- /** Subscription was canceled because of payment failure */
322
- CancellationInitiator["PAYMENT_FAILURE"] = "PAYMENT_FAILURE";
323
- /** Subscription was canceled because of payment setup failure */
324
- CancellationInitiator["SETUP_FAILURE"] = "SETUP_FAILURE";
325
- })(CancellationInitiator || (CancellationInitiator = {}));
326
- export var Status;
327
- (function (Status) {
328
- Status["UNDEFINED"] = "UNDEFINED";
329
- Status["ACTIVE"] = "ACTIVE";
330
- Status["ENDED"] = "ENDED";
331
- })(Status || (Status = {}));
332
- export var HistoryViewMode;
333
- (function (HistoryViewMode) {
334
- HistoryViewMode["UNKNOWN"] = "UNKNOWN";
335
- /** Comprehensive view including all history events. */
336
- HistoryViewMode["BACKOFFICE"] = "BACKOFFICE";
337
- /** User-centric view of the history. */
338
- HistoryViewMode["USER"] = "USER";
339
- })(HistoryViewMode || (HistoryViewMode = {}));
340
- export var PaymentSettlementMethod;
341
- (function (PaymentSettlementMethod) {
342
- PaymentSettlementMethod["UNKNOWN"] = "UNKNOWN";
343
- /** System-defined payment settlement. */
344
- PaymentSettlementMethod["SYSTEM"] = "SYSTEM";
345
- /** Manually mark the payment as paid. */
346
- PaymentSettlementMethod["MARK_AS_PAID"] = "MARK_AS_PAID";
347
- /** Require the customer to pay immediately, by insert a new payment method. */
348
- PaymentSettlementMethod["CUSTOMER_PAY_NOW"] = "CUSTOMER_PAY_NOW";
349
- })(PaymentSettlementMethod || (PaymentSettlementMethod = {}));
350
- /**
351
- * Identity must be a site member and customer subscription belongs to
352
- * @public
353
- * @documentationMaturity preview
354
- * @requiredField _id
355
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.GetSubscription
356
- */
357
- export async function customerGetSubscription(_id) {
358
- // @ts-ignore
359
- const { httpClient, sideEffects } = arguments[1];
360
- const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
361
- const reqOpts = ambassadorWixBillingV1Subscription.customerGetSubscription(payload);
362
- sideEffects?.onSiteCall?.();
363
- try {
364
- const result = await httpClient.request(reqOpts);
365
- sideEffects?.onSuccess?.(result);
366
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
367
- {
368
- transformFn: transformRESTAddressToSDKAddress,
369
- paths: [
370
- { path: 'subscription.billingSettings.billingAddress.address' },
371
- { path: 'subscription.shippingAddress.address' },
372
- ],
373
- },
374
- ]));
375
- }
376
- catch (err) {
377
- const transformedError = sdkTransformError(err, {
378
- spreadPathsToArguments: {},
379
- explicitPathsToArguments: { id: '$[0]' },
380
- singleArgumentUnchanged: false,
381
- }, ['_id']);
382
- sideEffects?.onError?.(err);
383
- throw transformedError;
384
- }
385
- }
386
- /**
387
- * Identity must be a site member and customer subscription belongs to
388
- * @public
389
- * @documentationMaturity preview
390
- * @requiredField _id
391
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CancelSubscription
392
- */
393
- export async function customerCancelSubscription(_id, options) {
394
- // @ts-ignore
395
- const { httpClient, sideEffects } = arguments[2];
396
- const payload = renameKeysFromSDKRequestToRESTRequest({
397
- id: _id,
398
- reason: options?.reason,
399
- });
400
- const reqOpts = ambassadorWixBillingV1Subscription.customerCancelSubscription(payload);
401
- sideEffects?.onSiteCall?.();
402
- try {
403
- const result = await httpClient.request(reqOpts);
404
- sideEffects?.onSuccess?.(result);
405
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
406
- {
407
- transformFn: transformRESTAddressToSDKAddress,
408
- paths: [
409
- { path: 'subscription.billingSettings.billingAddress.address' },
410
- { path: 'subscription.shippingAddress.address' },
411
- ],
412
- },
413
- ]));
414
- }
415
- catch (err) {
416
- const transformedError = sdkTransformError(err, {
417
- spreadPathsToArguments: {},
418
- explicitPathsToArguments: { id: '$[0]', reason: '$[1].reason' },
419
- singleArgumentUnchanged: false,
420
- }, ['_id', 'options']);
421
- sideEffects?.onError?.(err);
422
- throw transformedError;
423
- }
424
- }
425
- /**
426
- * Identity must be a site member and customer subscription belongs to
427
- * @public
428
- * @documentationMaturity preview
429
- * @requiredField _id
430
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.TurnOnSubscriptionAutoRenewal
431
- */
432
- export async function customerTurnOnSubscriptionAutoRenewal(_id, options) {
433
- // @ts-ignore
434
- const { httpClient, sideEffects } = arguments[2];
435
- const payload = renameKeysFromSDKRequestToRESTRequest({
436
- id: _id,
437
- reason: options?.reason,
438
- });
439
- const reqOpts = ambassadorWixBillingV1Subscription.customerTurnOnSubscriptionAutoRenewal(payload);
440
- sideEffects?.onSiteCall?.();
441
- try {
442
- const result = await httpClient.request(reqOpts);
443
- sideEffects?.onSuccess?.(result);
444
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
445
- {
446
- transformFn: transformRESTAddressToSDKAddress,
447
- paths: [
448
- { path: 'subscription.billingSettings.billingAddress.address' },
449
- { path: 'subscription.shippingAddress.address' },
450
- ],
451
- },
452
- ]));
453
- }
454
- catch (err) {
455
- const transformedError = sdkTransformError(err, {
456
- spreadPathsToArguments: {},
457
- explicitPathsToArguments: { id: '$[0]', reason: '$[1].reason' },
458
- singleArgumentUnchanged: false,
459
- }, ['_id', 'options']);
460
- sideEffects?.onError?.(err);
461
- throw transformedError;
462
- }
463
- }
464
- /**
465
- * Identity must be a site member and customer subscription belongs to
466
- * @public
467
- * @documentationMaturity preview
468
- * @requiredField _id
469
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.TurnOffSubscriptionAutoRenewal
470
- */
471
- export async function customerTurnOffSubscriptionAutoRenewal(_id, options) {
472
- // @ts-ignore
473
- const { httpClient, sideEffects } = arguments[2];
474
- const payload = renameKeysFromSDKRequestToRESTRequest({
475
- id: _id,
476
- reason: options?.reason,
477
- });
478
- const reqOpts = ambassadorWixBillingV1Subscription.customerTurnOffSubscriptionAutoRenewal(payload);
479
- sideEffects?.onSiteCall?.();
480
- try {
481
- const result = await httpClient.request(reqOpts);
482
- sideEffects?.onSuccess?.(result);
483
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
484
- {
485
- transformFn: transformRESTAddressToSDKAddress,
486
- paths: [
487
- { path: 'subscription.billingSettings.billingAddress.address' },
488
- { path: 'subscription.shippingAddress.address' },
489
- ],
490
- },
491
- ]));
492
- }
493
- catch (err) {
494
- const transformedError = sdkTransformError(err, {
495
- spreadPathsToArguments: {},
496
- explicitPathsToArguments: { id: '$[0]', reason: '$[1].reason' },
497
- singleArgumentUnchanged: false,
498
- }, ['_id', 'options']);
499
- sideEffects?.onError?.(err);
500
- throw transformedError;
501
- }
502
- }
503
- /** @param _id - The ID of the subscription to be extended
504
- * @public
505
- * @documentationMaturity preview
506
- * @requiredField _id
507
- * @requiredField options.billingCyclesToAdd
508
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.ExtendSubscription
509
- */
510
- export async function customerExtendSubscription(_id, options) {
511
- // @ts-ignore
512
- const { httpClient, sideEffects } = arguments[2];
513
- const payload = renameKeysFromSDKRequestToRESTRequest({
514
- id: _id,
515
- reason: options?.reason,
516
- billingCyclesToAdd: options?.billingCyclesToAdd,
517
- });
518
- const reqOpts = ambassadorWixBillingV1Subscription.customerExtendSubscription(payload);
519
- sideEffects?.onSiteCall?.();
520
- try {
521
- const result = await httpClient.request(reqOpts);
522
- sideEffects?.onSuccess?.(result);
523
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
524
- {
525
- transformFn: transformRESTAddressToSDKAddress,
526
- paths: [
527
- { path: 'subscription.billingSettings.billingAddress.address' },
528
- { path: 'subscription.shippingAddress.address' },
529
- ],
530
- },
531
- ]));
532
- }
533
- catch (err) {
534
- const transformedError = sdkTransformError(err, {
535
- spreadPathsToArguments: {},
536
- explicitPathsToArguments: {
537
- id: '$[0]',
538
- reason: '$[1].reason',
539
- billingCyclesToAdd: '$[1].billingCyclesToAdd',
540
- },
541
- singleArgumentUnchanged: false,
542
- }, ['_id', 'options']);
543
- sideEffects?.onError?.(err);
544
- throw transformedError;
545
- }
546
- }
547
- /**
548
- * identity must be a site member
549
- * @public
550
- * @documentationMaturity preview
551
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.QuerySubscriptions
552
- */
553
- export async function customerQuerySubscriptions(options) {
554
- // @ts-ignore
555
- const { httpClient, sideEffects } = arguments[1];
556
- const payload = renameKeysFromSDKRequestToRESTRequest({
557
- query: options?.query,
558
- });
559
- const reqOpts = ambassadorWixBillingV1Subscription.customerQuerySubscriptions(payload);
560
- sideEffects?.onSiteCall?.();
561
- try {
562
- const result = await httpClient.request(reqOpts);
563
- sideEffects?.onSuccess?.(result);
564
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
565
- {
566
- transformFn: transformRESTAddressToSDKAddress,
567
- paths: [
568
- { path: 'subscriptions.billingSettings.billingAddress.address' },
569
- { path: 'subscriptions.shippingAddress.address' },
570
- ],
571
- },
572
- ]));
573
- }
574
- catch (err) {
575
- const transformedError = sdkTransformError(err, {
576
- spreadPathsToArguments: {},
577
- explicitPathsToArguments: { query: '$[0].query' },
578
- singleArgumentUnchanged: false,
579
- }, ['options']);
580
- sideEffects?.onError?.(err);
581
- throw transformedError;
582
- }
583
- }
584
- /**
585
- * Update subscription's payment method.
586
- * Supported only for recurring subscriptions or one time subscriptions during free trial.
587
- * @param _id - Subscription ID
588
- * @public
589
- * @documentationMaturity preview
590
- * @requiredField _id
591
- * @requiredField paymentMethodId
592
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.UpdateSubscriptionPaymentMethod
593
- */
594
- export async function customerUpdateSubscriptionPaymentMethod(_id, paymentMethodId) {
595
- // @ts-ignore
596
- const { httpClient, sideEffects } = arguments[2];
597
- const payload = renameKeysFromSDKRequestToRESTRequest({
598
- id: _id,
599
- paymentMethodId: paymentMethodId,
600
- });
601
- const reqOpts = ambassadorWixBillingV1Subscription.customerUpdateSubscriptionPaymentMethod(payload);
602
- sideEffects?.onSiteCall?.();
603
- try {
604
- const result = await httpClient.request(reqOpts);
605
- sideEffects?.onSuccess?.(result);
606
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
607
- {
608
- transformFn: transformRESTAddressToSDKAddress,
609
- paths: [
610
- { path: 'subscription.billingSettings.billingAddress.address' },
611
- { path: 'subscription.shippingAddress.address' },
612
- ],
613
- },
614
- ]));
615
- }
616
- catch (err) {
617
- const transformedError = sdkTransformError(err, {
618
- spreadPathsToArguments: {},
619
- explicitPathsToArguments: { id: '$[0]', paymentMethodId: '$[1]' },
620
- singleArgumentUnchanged: false,
621
- }, ['_id', 'paymentMethodId']);
622
- sideEffects?.onError?.(err);
623
- throw transformedError;
624
- }
625
- }
626
- /** @public
627
- * @documentationMaturity preview
628
- * @requiredField _id
629
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.AllowedActions
630
- */
631
- export async function customerAllowedActions(_id) {
632
- // @ts-ignore
633
- const { httpClient, sideEffects } = arguments[1];
634
- const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
635
- const reqOpts = ambassadorWixBillingV1Subscription.customerAllowedActions(payload);
636
- sideEffects?.onSiteCall?.();
637
- try {
638
- const result = await httpClient.request(reqOpts);
639
- sideEffects?.onSuccess?.(result);
640
- return renameKeysFromRESTResponseToSDKResponse(result.data);
641
- }
642
- catch (err) {
643
- const transformedError = sdkTransformError(err, {
644
- spreadPathsToArguments: {},
645
- explicitPathsToArguments: { id: '$[0]' },
646
- singleArgumentUnchanged: false,
647
- }, ['_id']);
648
- sideEffects?.onError?.(err);
649
- throw transformedError;
650
- }
651
- }
652
- /**
653
- * List future subscriptions charges.
654
- * @param _id - Subscription id upcoming charge to be previewed for
655
- * @public
656
- * @documentationMaturity preview
657
- * @requiredField _id
658
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.ListUpcomingCharges
659
- */
660
- export async function customerListUpcomingCharges(_id) {
661
- // @ts-ignore
662
- const { httpClient, sideEffects } = arguments[1];
663
- const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
664
- const reqOpts = ambassadorWixBillingV1Subscription.customerListUpcomingCharges(payload);
665
- sideEffects?.onSiteCall?.();
666
- try {
667
- const result = await httpClient.request(reqOpts);
668
- sideEffects?.onSuccess?.(result);
669
- return renameKeysFromRESTResponseToSDKResponse(result.data);
670
- }
671
- catch (err) {
672
- const transformedError = sdkTransformError(err, {
673
- spreadPathsToArguments: {},
674
- explicitPathsToArguments: { id: '$[0]' },
675
- singleArgumentUnchanged: false,
676
- }, ['_id']);
677
- sideEffects?.onError?.(err);
678
- throw transformedError;
679
- }
680
- }
681
- /**
682
- * Creates auto-charge order that can be paid by customer
683
- * @public
684
- * @documentationMaturity preview
685
- * @requiredField _id
686
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.InitiatePaymentMethodSetup
687
- */
688
- export async function customerInitiatePaymentMethodSetup(_id, options) {
689
- // @ts-ignore
690
- const { httpClient, sideEffects } = arguments[2];
691
- const payload = renameKeysFromSDKRequestToRESTRequest({
692
- id: _id,
693
- paymentMode: options?.paymentMode,
694
- paymentSettings: options?.paymentSettings,
695
- });
696
- const reqOpts = ambassadorWixBillingV1Subscription.customerInitiatePaymentMethodSetup(payload);
697
- sideEffects?.onSiteCall?.();
698
- try {
699
- const result = await httpClient.request(reqOpts);
700
- sideEffects?.onSuccess?.(result);
701
- return renameKeysFromRESTResponseToSDKResponse(result.data);
702
- }
703
- catch (err) {
704
- const transformedError = sdkTransformError(err, {
705
- spreadPathsToArguments: {},
706
- explicitPathsToArguments: {
707
- id: '$[0]',
708
- paymentMode: '$[1].paymentMode',
709
- paymentSettings: '$[1].paymentSettings',
710
- },
711
- singleArgumentUnchanged: false,
712
- }, ['_id', 'options']);
713
- sideEffects?.onError?.(err);
714
- throw transformedError;
715
- }
716
- }
717
- /**
718
- * This used only for automation and permitted tenants (QA & testing)
719
- * @public
720
- * @documentationMaturity preview
721
- * @requiredField options.tenantId
722
- * @requiredField subscriptionId
723
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle
724
- */
725
- export async function payCycle(subscriptionId, options) {
726
- // @ts-ignore
727
- const { httpClient, sideEffects } = arguments[2];
728
- const payload = renameKeysFromSDKRequestToRESTRequest({
729
- subscriptionId: subscriptionId,
730
- paymentTestMode: options?.paymentTestMode,
731
- tenantId: options?.tenantId,
732
- });
733
- const reqOpts = ambassadorWixBillingV1Subscription.payCycle(payload);
734
- sideEffects?.onSiteCall?.();
735
- try {
736
- const result = await httpClient.request(reqOpts);
737
- sideEffects?.onSuccess?.(result);
738
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
739
- {
740
- transformFn: transformRESTAddressToSDKAddress,
741
- paths: [
742
- { path: 'subscription.billingSettings.billingAddress.address' },
743
- { path: 'subscription.shippingAddress.address' },
744
- ],
745
- },
746
- ]));
747
- }
748
- catch (err) {
749
- const transformedError = sdkTransformError(err, {
750
- spreadPathsToArguments: {},
751
- explicitPathsToArguments: {
752
- subscriptionId: '$[0]',
753
- paymentTestMode: '$[1].paymentTestMode',
754
- tenantId: '$[1].tenantId',
755
- },
756
- singleArgumentUnchanged: false,
757
- }, ['subscriptionId', 'options']);
758
- sideEffects?.onError?.(err);
759
- throw transformedError;
760
- }
761
- }
762
- /**
763
- * Returns a single subscription by its id
764
- * @public
765
- * @documentationMaturity preview
766
- * @requiredField _id
767
- * @permissionId subscriptions.view
768
- * @permissionScope Manage Events
769
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
770
- * @applicableIdentity APP
771
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.GetSubscription
772
- */
773
- export async function getSubscription(_id) {
774
- // @ts-ignore
775
- const { httpClient, sideEffects } = arguments[1];
776
- const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
777
- const reqOpts = ambassadorWixBillingV1Subscription.getSubscription(payload);
778
- sideEffects?.onSiteCall?.();
779
- try {
780
- const result = await httpClient.request(reqOpts);
781
- sideEffects?.onSuccess?.(result);
782
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
783
- {
784
- transformFn: transformRESTAddressToSDKAddress,
785
- paths: [
786
- { path: 'subscription.billingSettings.billingAddress.address' },
787
- { path: 'subscription.shippingAddress.address' },
788
- ],
789
- },
790
- ]));
791
- }
792
- catch (err) {
793
- const transformedError = sdkTransformError(err, {
794
- spreadPathsToArguments: {},
795
- explicitPathsToArguments: { id: '$[0]' },
796
- singleArgumentUnchanged: false,
797
- }, ['_id']);
798
- sideEffects?.onError?.(err);
799
- throw transformedError;
800
- }
801
- }
802
- /**
803
- * Update subscription's payment method.
804
- * Supported only for recurring subscriptions or one time subscriptions during free trial.
805
- * @param _id - Subscription ID
806
- * @public
807
- * @documentationMaturity preview
808
- * @requiredField _id
809
- * @requiredField paymentMethodId
810
- * @permissionId subscriptions.manage
811
- * @permissionScope Manage Orders
812
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
813
- * @applicableIdentity APP
814
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.UpdateSubscriptionPaymentMethod
815
- */
816
- export async function updateSubscriptionPaymentMethod(_id, paymentMethodId) {
817
- // @ts-ignore
818
- const { httpClient, sideEffects } = arguments[2];
819
- const payload = renameKeysFromSDKRequestToRESTRequest({
820
- id: _id,
821
- paymentMethodId: paymentMethodId,
822
- });
823
- const reqOpts = ambassadorWixBillingV1Subscription.updateSubscriptionPaymentMethod(payload);
824
- sideEffects?.onSiteCall?.();
825
- try {
826
- const result = await httpClient.request(reqOpts);
827
- sideEffects?.onSuccess?.(result);
828
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
829
- {
830
- transformFn: transformRESTAddressToSDKAddress,
831
- paths: [
832
- { path: 'subscription.billingSettings.billingAddress.address' },
833
- { path: 'subscription.shippingAddress.address' },
834
- ],
835
- },
836
- ]));
837
- }
838
- catch (err) {
839
- const transformedError = sdkTransformError(err, {
840
- spreadPathsToArguments: {},
841
- explicitPathsToArguments: { id: '$[0]', paymentMethodId: '$[1]' },
842
- singleArgumentUnchanged: false,
843
- }, ['_id', 'paymentMethodId']);
844
- sideEffects?.onError?.(err);
845
- throw transformedError;
846
- }
847
- }
848
- /**
849
- * Updates the next billing date for a subscription.
850
- *
851
- *
852
- * Updating the billing date may add a proration charge or credit to the next
853
- * invoice. The customer must pay more in case you extend the current billing
854
- * cycle. They pay less in case you shorten the current billing cycle. You can
855
- * choose whether BASS automatically calculates the proration amount based on
856
- * the number of days added to or removed from the current billing cycle.
857
- * Alternatively, you can pass a proration amount based on your own custom
858
- * calculation. The custom proration amount can't exceed the total of the
859
- * current billing cycle.
860
- * @param _id - ID of the subscription to update the billing date for.
861
- * @param billingDate - New billing date in `YYYY-MM-DDThh:mm:ss:sssZ` format.
862
- * @public
863
- * @documentationMaturity preview
864
- * @requiredField _id
865
- * @requiredField billingDate
866
- * @permissionId subscriptions.manage
867
- * @permissionScope Manage Orders
868
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
869
- * @applicableIdentity APP
870
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.UpdateSubscriptionBillingDate
871
- */
872
- export async function updateSubscriptionBillingDate(_id, billingDate, options) {
873
- // @ts-ignore
874
- const { httpClient, sideEffects } = arguments[3];
875
- const payload = renameKeysFromSDKRequestToRESTRequest({
876
- id: _id,
877
- billingDate: billingDate,
878
- proration: options?.proration,
879
- });
880
- const reqOpts = ambassadorWixBillingV1Subscription.updateSubscriptionBillingDate(payload);
881
- sideEffects?.onSiteCall?.();
882
- try {
883
- const result = await httpClient.request(reqOpts);
884
- sideEffects?.onSuccess?.(result);
885
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
886
- {
887
- transformFn: transformRESTAddressToSDKAddress,
888
- paths: [
889
- { path: 'subscription.billingSettings.billingAddress.address' },
890
- { path: 'subscription.shippingAddress.address' },
891
- ],
892
- },
893
- ]));
894
- }
895
- catch (err) {
896
- const transformedError = sdkTransformError(err, {
897
- spreadPathsToArguments: {},
898
- explicitPathsToArguments: {
899
- id: '$[0]',
900
- billingDate: '$[1]',
901
- proration: '$[2].proration',
902
- },
903
- singleArgumentUnchanged: false,
904
- }, ['_id', 'billingDate', 'options']);
905
- sideEffects?.onError?.(err);
906
- throw transformedError;
907
- }
908
- }
909
- /**
910
- * Cancels subscription immediately. Can be canceled by member if subscription policy allows it
911
- * Only PENDING, ACTIVE or PAUSED subscriptions can be canceled
912
- * @public
913
- * @documentationMaturity preview
914
- * @requiredField _id
915
- * @requiredField actionContext
916
- * @permissionId subscriptions.manage
917
- * @permissionScope Manage Orders
918
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
919
- * @applicableIdentity APP
920
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.CancelSubscription
921
- */
922
- export async function cancelSubscription(_id, actionContext) {
923
- // @ts-ignore
924
- const { httpClient, sideEffects } = arguments[2];
925
- const payload = renameKeysFromSDKRequestToRESTRequest({
926
- id: _id,
927
- actionContext: actionContext,
928
- });
929
- const reqOpts = ambassadorWixBillingV1Subscription.cancelSubscription(payload);
930
- sideEffects?.onSiteCall?.();
931
- try {
932
- const result = await httpClient.request(reqOpts);
933
- sideEffects?.onSuccess?.(result);
934
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
935
- {
936
- transformFn: transformRESTAddressToSDKAddress,
937
- paths: [
938
- { path: 'subscription.billingSettings.billingAddress.address' },
939
- { path: 'subscription.shippingAddress.address' },
940
- ],
941
- },
942
- ]));
943
- }
944
- catch (err) {
945
- const transformedError = sdkTransformError(err, {
946
- spreadPathsToArguments: {},
947
- explicitPathsToArguments: { id: '$[0]', actionContext: '$[1]' },
948
- singleArgumentUnchanged: false,
949
- }, ['_id', 'actionContext']);
950
- sideEffects?.onError?.(err);
951
- throw transformedError;
952
- }
953
- }
954
- /**
955
- * Pauses subscription now or in future. Possible to pause also payments schedule.
956
- * @public
957
- * @documentationMaturity preview
958
- * @requiredField _id
959
- * @requiredField options.actionContext
960
- * @permissionId subscriptions.manage
961
- * @permissionScope Manage Orders
962
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
963
- * @applicableIdentity APP
964
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PauseSubscription
965
- */
966
- export async function pauseSubscription(_id, options) {
967
- // @ts-ignore
968
- const { httpClient, sideEffects } = arguments[2];
969
- const payload = renameKeysFromSDKRequestToRESTRequest({
970
- id: _id,
971
- pausePolicy: options?.pausePolicy,
972
- pauseAt: options?.pauseAt,
973
- pauseAtSchedule: options?.pauseAtSchedule,
974
- autoResumeAtSchedule: options?.autoResumeAtSchedule,
975
- actionContext: options?.actionContext,
976
- });
977
- const reqOpts = ambassadorWixBillingV1Subscription.pauseSubscription(payload);
978
- sideEffects?.onSiteCall?.();
979
- try {
980
- const result = await httpClient.request(reqOpts);
981
- sideEffects?.onSuccess?.(result);
982
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
983
- {
984
- transformFn: transformRESTAddressToSDKAddress,
985
- paths: [
986
- { path: 'subscription.billingSettings.billingAddress.address' },
987
- { path: 'subscription.shippingAddress.address' },
988
- ],
989
- },
990
- ]));
991
- }
992
- catch (err) {
993
- const transformedError = sdkTransformError(err, {
994
- spreadPathsToArguments: {},
995
- explicitPathsToArguments: {
996
- id: '$[0]',
997
- pausePolicy: '$[1].pausePolicy',
998
- pauseAt: '$[1].pauseAt',
999
- pauseAtSchedule: '$[1].pauseAtSchedule',
1000
- autoResumeAtSchedule: '$[1].autoResumeAtSchedule',
1001
- actionContext: '$[1].actionContext',
1002
- },
1003
- singleArgumentUnchanged: false,
1004
- }, ['_id', 'options']);
1005
- sideEffects?.onError?.(err);
1006
- throw transformedError;
1007
- }
1008
- }
1009
- /**
1010
- * Resumes paused subscription now or in future.
1011
- * @public
1012
- * @documentationMaturity preview
1013
- * @requiredField _id
1014
- * @requiredField options.actionContext
1015
- * @permissionId subscriptions.manage
1016
- * @permissionScope Manage Orders
1017
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1018
- * @applicableIdentity APP
1019
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ResumeSubscription
1020
- */
1021
- export async function resumeSubscription(_id, options) {
1022
- // @ts-ignore
1023
- const { httpClient, sideEffects } = arguments[2];
1024
- const payload = renameKeysFromSDKRequestToRESTRequest({
1025
- id: _id,
1026
- resumeAt: options?.resumeAt,
1027
- resumeAtSchedule: options?.resumeAtSchedule,
1028
- actionContext: options?.actionContext,
1029
- });
1030
- const reqOpts = ambassadorWixBillingV1Subscription.resumeSubscription(payload);
1031
- sideEffects?.onSiteCall?.();
1032
- try {
1033
- const result = await httpClient.request(reqOpts);
1034
- sideEffects?.onSuccess?.(result);
1035
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1036
- {
1037
- transformFn: transformRESTAddressToSDKAddress,
1038
- paths: [
1039
- { path: 'subscription.billingSettings.billingAddress.address' },
1040
- { path: 'subscription.shippingAddress.address' },
1041
- ],
1042
- },
1043
- ]));
1044
- }
1045
- catch (err) {
1046
- const transformedError = sdkTransformError(err, {
1047
- spreadPathsToArguments: {},
1048
- explicitPathsToArguments: {
1049
- id: '$[0]',
1050
- resumeAt: '$[1].resumeAt',
1051
- resumeAtSchedule: '$[1].resumeAtSchedule',
1052
- actionContext: '$[1].actionContext',
1053
- },
1054
- singleArgumentUnchanged: false,
1055
- }, ['_id', 'options']);
1056
- sideEffects?.onError?.(err);
1057
- throw transformedError;
1058
- }
1059
- }
1060
- /**
1061
- * Lists subscriptions based on specified filters.
1062
- * By default non-draft subscriptions returned.
1063
- * @public
1064
- * @documentationMaturity preview
1065
- * @requiredField query
1066
- * @permissionId subscriptions.view
1067
- * @permissionScope Manage Events
1068
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1069
- * @applicableIdentity APP
1070
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.QuerySubscriptions
1071
- */
1072
- export async function querySubscriptions(query) {
1073
- // @ts-ignore
1074
- const { httpClient, sideEffects } = arguments[1];
1075
- const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });
1076
- const reqOpts = ambassadorWixBillingV1Subscription.querySubscriptions(payload);
1077
- sideEffects?.onSiteCall?.();
1078
- try {
1079
- const result = await httpClient.request(reqOpts);
1080
- sideEffects?.onSuccess?.(result);
1081
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1082
- {
1083
- transformFn: transformRESTAddressToSDKAddress,
1084
- paths: [
1085
- { path: 'subscriptions.billingSettings.billingAddress.address' },
1086
- { path: 'subscriptions.shippingAddress.address' },
1087
- ],
1088
- },
1089
- ]));
1090
- }
1091
- catch (err) {
1092
- const transformedError = sdkTransformError(err, {
1093
- spreadPathsToArguments: {},
1094
- explicitPathsToArguments: { query: '$[0]' },
1095
- singleArgumentUnchanged: false,
1096
- }, ['query']);
1097
- sideEffects?.onError?.(err);
1098
- throw transformedError;
1099
- }
1100
- }
1101
- /** @public
1102
- * @documentationMaturity preview
1103
- * @permissionId subscriptions.view
1104
- * @permissionScope Manage Events
1105
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1106
- * @applicableIdentity APP
1107
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.SearchSubscriptions
1108
- */
1109
- export async function searchSubscriptions(options) {
1110
- // @ts-ignore
1111
- const { httpClient, sideEffects } = arguments[1];
1112
- const payload = renameKeysFromSDKRequestToRESTRequest({
1113
- filter: options?.filter,
1114
- paging: options?.paging,
1115
- cursor: options?.cursor,
1116
- sorting: options?.sorting,
1117
- });
1118
- const reqOpts = ambassadorWixBillingV1Subscription.searchSubscriptions(payload);
1119
- sideEffects?.onSiteCall?.();
1120
- try {
1121
- const result = await httpClient.request(reqOpts);
1122
- sideEffects?.onSuccess?.(result);
1123
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1124
- {
1125
- transformFn: transformRESTAddressToSDKAddress,
1126
- paths: [
1127
- { path: 'subscriptions.billingSettings.billingAddress.address' },
1128
- { path: 'subscriptions.shippingAddress.address' },
1129
- ],
1130
- },
1131
- ]));
1132
- }
1133
- catch (err) {
1134
- const transformedError = sdkTransformError(err, {
1135
- spreadPathsToArguments: {},
1136
- explicitPathsToArguments: {
1137
- filter: '$[0].filter',
1138
- paging: '$[0].paging',
1139
- cursor: '$[0].cursor',
1140
- sorting: '$[0].sorting',
1141
- },
1142
- singleArgumentUnchanged: false,
1143
- }, ['options']);
1144
- sideEffects?.onError?.(err);
1145
- throw transformedError;
1146
- }
1147
- }
1148
- /**
1149
- * Counts subscriptions given the provided filters. Returns the total number
1150
- * of subscriptions matching the filters and a count per status.
1151
- *
1152
- *
1153
- * You can either pass a list of statuses or a `statusGroup`, which is a
1154
- * pre-defined combination of statuses.
1155
- *
1156
- * If you don't provide any filters, all subscription statuses with the
1157
- * exception of `"DRAFT"` are counted.
1158
- *
1159
- * You may also specify a `customerId` as filter. Then, only subscriptions for
1160
- * this customer are counted. When providing a `customerId`, you must also
1161
- * specify a `paymentMethodId`.
1162
- * @public
1163
- * @documentationMaturity preview
1164
- * @permissionId subscriptions.view
1165
- * @permissionScope Manage Events
1166
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1167
- * @applicableIdentity APP
1168
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.CountSubscriptions
1169
- */
1170
- export async function countSubscriptions(options) {
1171
- // @ts-ignore
1172
- const { httpClient, sideEffects } = arguments[1];
1173
- const payload = renameKeysFromSDKRequestToRESTRequest({
1174
- filter: options?.filter,
1175
- });
1176
- const reqOpts = ambassadorWixBillingV1Subscription.countSubscriptions(payload);
1177
- sideEffects?.onSiteCall?.();
1178
- try {
1179
- const result = await httpClient.request(reqOpts);
1180
- sideEffects?.onSuccess?.(result);
1181
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1182
- }
1183
- catch (err) {
1184
- const transformedError = sdkTransformError(err, {
1185
- spreadPathsToArguments: {},
1186
- explicitPathsToArguments: { filter: '$[0].filter' },
1187
- singleArgumentUnchanged: false,
1188
- }, ['options']);
1189
- sideEffects?.onError?.(err);
1190
- throw transformedError;
1191
- }
1192
- }
1193
- /**
1194
- * Turn on auto-renew subscription in case auto-renew was turned off. The operation changes back cycle_auto_renew
1195
- * to true, which will ensure subscription billing will continue. Also cancellation info holding information about
1196
- * auto renew off will be cleared.
1197
- * @public
1198
- * @documentationMaturity preview
1199
- * @requiredField _id
1200
- * @requiredField actionContext
1201
- * @permissionId subscriptions.manage
1202
- * @permissionScope Manage Orders
1203
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1204
- * @applicableIdentity APP
1205
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.TurnOnSubscriptionAutoRenewal
1206
- */
1207
- export async function turnOnSubscriptionAutoRenewal(_id, actionContext) {
1208
- // @ts-ignore
1209
- const { httpClient, sideEffects } = arguments[2];
1210
- const payload = renameKeysFromSDKRequestToRESTRequest({
1211
- id: _id,
1212
- actionContext: actionContext,
1213
- });
1214
- const reqOpts = ambassadorWixBillingV1Subscription.turnOnSubscriptionAutoRenewal(payload);
1215
- sideEffects?.onSiteCall?.();
1216
- try {
1217
- const result = await httpClient.request(reqOpts);
1218
- sideEffects?.onSuccess?.(result);
1219
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1220
- {
1221
- transformFn: transformRESTAddressToSDKAddress,
1222
- paths: [
1223
- { path: 'subscription.billingSettings.billingAddress.address' },
1224
- { path: 'subscription.shippingAddress.address' },
1225
- ],
1226
- },
1227
- ]));
1228
- }
1229
- catch (err) {
1230
- const transformedError = sdkTransformError(err, {
1231
- spreadPathsToArguments: {},
1232
- explicitPathsToArguments: { id: '$[0]', actionContext: '$[1]' },
1233
- singleArgumentUnchanged: false,
1234
- }, ['_id', 'actionContext']);
1235
- sideEffects?.onError?.(err);
1236
- throw transformedError;
1237
- }
1238
- }
1239
- /**
1240
- * Turn off auto-renew of subscription. At next billing date subscription will be canceled.
1241
- * Billing settings flag cycle_auto_renew is set to false and information about this operation stored
1242
- * in cancellation info for future usage in cancellation.
1243
- * @public
1244
- * @documentationMaturity preview
1245
- * @requiredField _id
1246
- * @requiredField actionContext
1247
- * @permissionId subscriptions.manage
1248
- * @permissionScope Manage Orders
1249
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1250
- * @applicableIdentity APP
1251
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.TurnOffSubscriptionAutoRenewal
1252
- */
1253
- export async function turnOffSubscriptionAutoRenewal(_id, actionContext) {
1254
- // @ts-ignore
1255
- const { httpClient, sideEffects } = arguments[2];
1256
- const payload = renameKeysFromSDKRequestToRESTRequest({
1257
- id: _id,
1258
- actionContext: actionContext,
1259
- });
1260
- const reqOpts = ambassadorWixBillingV1Subscription.turnOffSubscriptionAutoRenewal(payload);
1261
- sideEffects?.onSiteCall?.();
1262
- try {
1263
- const result = await httpClient.request(reqOpts);
1264
- sideEffects?.onSuccess?.(result);
1265
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1266
- {
1267
- transformFn: transformRESTAddressToSDKAddress,
1268
- paths: [
1269
- { path: 'subscription.billingSettings.billingAddress.address' },
1270
- { path: 'subscription.shippingAddress.address' },
1271
- ],
1272
- },
1273
- ]));
1274
- }
1275
- catch (err) {
1276
- const transformedError = sdkTransformError(err, {
1277
- spreadPathsToArguments: {},
1278
- explicitPathsToArguments: { id: '$[0]', actionContext: '$[1]' },
1279
- singleArgumentUnchanged: false,
1280
- }, ['_id', 'actionContext']);
1281
- sideEffects?.onError?.(err);
1282
- throw transformedError;
1283
- }
1284
- }
1285
- /**
1286
- * Marks the last invoice as paid used for the following scenarios:
1287
- * * Offline subscriptions.
1288
- * * Online subscriptions during grace period. The operation will convert invoice to offline, remove grace period
1289
- * and will send BillingCycleStarted event after invoice closing.
1290
- * * Online one time payment subscription with total price of zero during purchase flow.
1291
- * Activated event will be sent after invoice closing and subscription will be activated.
1292
- * @param subscriptionId - The ID of the offline subscription to mark as paid its latest invoice
1293
- * @public
1294
- * @documentationMaturity preview
1295
- * @requiredField subscriptionId
1296
- * @permissionId subscriptions.manage
1297
- * @permissionScope Manage Orders
1298
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1299
- * @applicableIdentity APP
1300
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkLatestInvoiceAsPaid
1301
- * @deprecated
1302
- * @replacedBy com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid
1303
- * @targetRemovalDate 2025-09-30
1304
- */
1305
- export async function markLatestInvoiceAsPaid(subscriptionId) {
1306
- // @ts-ignore
1307
- const { httpClient, sideEffects } = arguments[1];
1308
- const payload = renameKeysFromSDKRequestToRESTRequest({
1309
- subscriptionId: subscriptionId,
1310
- });
1311
- const reqOpts = ambassadorWixBillingV1Subscription.markLatestInvoiceAsPaid(payload);
1312
- sideEffects?.onSiteCall?.();
1313
- try {
1314
- const result = await httpClient.request(reqOpts);
1315
- sideEffects?.onSuccess?.(result);
1316
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1317
- {
1318
- transformFn: transformRESTAddressToSDKAddress,
1319
- paths: [
1320
- { path: 'subscription.billingSettings.billingAddress.address' },
1321
- { path: 'subscription.shippingAddress.address' },
1322
- ],
1323
- },
1324
- ]));
1325
- }
1326
- catch (err) {
1327
- const transformedError = sdkTransformError(err, {
1328
- spreadPathsToArguments: {},
1329
- explicitPathsToArguments: { subscriptionId: '$[0]' },
1330
- singleArgumentUnchanged: false,
1331
- }, ['subscriptionId']);
1332
- sideEffects?.onError?.(err);
1333
- throw transformedError;
1334
- }
1335
- }
1336
- /**
1337
- * Marks the invoice associated with given subscription cycle as paid for the following scenarios:
1338
- * If `paid_cycle` is left empty, the most recent invoice will be marked as paid.
1339
- * If the invoice contains items other than subscription items, an error will be thrown.
1340
- *
1341
- * Marks the invoice as paid for the following scenarios:
1342
- * 1. Offline subscriptions.
1343
- * 2. Online subscriptions during the grace period.
1344
- * This operation will convert the invoice to offline, remove the grace period,
1345
- * and send a BillingCycleStarted event after the invoice is closed.
1346
- * 3. Online one-time payment subscriptions with a total price of zero during the purchase flow.
1347
- * An Activated event will be sent after the invoice is closed, and the subscription will be activated.
1348
- * 4. For external subscriptions, where the payment occurs outside of BASS, an invoice is created and marked as paid
1349
- * @param subscriptionId - The ID of the subscription to mark as paid its invoice.
1350
- * @internal
1351
- * @documentationMaturity preview
1352
- * @requiredField subscriptionId
1353
- * @permissionId subscriptions.manage
1354
- * @permissionScope Manage Orders
1355
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1356
- * @applicableIdentity APP
1357
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkBillingCycleAsPaid
1358
- */
1359
- export async function markBillingCycleAsPaid(subscriptionId, options) {
1360
- // @ts-ignore
1361
- const { httpClient, sideEffects } = arguments[2];
1362
- const payload = renameKeysFromSDKRequestToRESTRequest({
1363
- subscriptionId: subscriptionId,
1364
- paidCycle: options?.paidCycle,
1365
- });
1366
- const reqOpts = ambassadorWixBillingV1Subscription.markBillingCycleAsPaid(payload);
1367
- sideEffects?.onSiteCall?.();
1368
- try {
1369
- const result = await httpClient.request(reqOpts);
1370
- sideEffects?.onSuccess?.(result);
1371
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1372
- {
1373
- transformFn: transformRESTAddressToSDKAddress,
1374
- paths: [
1375
- { path: 'subscription.billingSettings.billingAddress.address' },
1376
- { path: 'subscription.shippingAddress.address' },
1377
- ],
1378
- },
1379
- ]));
1380
- }
1381
- catch (err) {
1382
- const transformedError = sdkTransformError(err, {
1383
- spreadPathsToArguments: {},
1384
- explicitPathsToArguments: {
1385
- subscriptionId: '$[0]',
1386
- paidCycle: '$[1].paidCycle',
1387
- },
1388
- singleArgumentUnchanged: false,
1389
- }, ['subscriptionId', 'options']);
1390
- sideEffects?.onError?.(err);
1391
- throw transformedError;
1392
- }
1393
- }
1394
- /**
1395
- * Returns number of subscriptions in each state.
1396
- * @public
1397
- * @documentationMaturity preview
1398
- * @permissionId subscriptions.view
1399
- * @permissionScope Manage Events
1400
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1401
- * @applicableIdentity APP
1402
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.GetSubscriptionsStats
1403
- */
1404
- export async function getSubscriptionsStats() {
1405
- // @ts-ignore
1406
- const { httpClient, sideEffects } = arguments[0];
1407
- const payload = renameKeysFromSDKRequestToRESTRequest({});
1408
- const reqOpts = ambassadorWixBillingV1Subscription.getSubscriptionsStats(payload);
1409
- sideEffects?.onSiteCall?.();
1410
- try {
1411
- const result = await httpClient.request(reqOpts);
1412
- sideEffects?.onSuccess?.(result);
1413
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1414
- }
1415
- catch (err) {
1416
- const transformedError = sdkTransformError(err, {
1417
- spreadPathsToArguments: {},
1418
- explicitPathsToArguments: {},
1419
- singleArgumentUnchanged: false,
1420
- }, []);
1421
- sideEffects?.onError?.(err);
1422
- throw transformedError;
1423
- }
1424
- }
1425
- /**
1426
- * Extends subscription by moving end date with or without billing cycles addition.
1427
- * @param _id - The ID of the subscription to be extended
1428
- * @public
1429
- * @documentationMaturity preview
1430
- * @requiredField _id
1431
- * @requiredField actionContext
1432
- * @requiredField options
1433
- * @requiredField options.extendPolicy
1434
- * @permissionId subscriptions.manage
1435
- * @permissionScope Manage Orders
1436
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1437
- * @applicableIdentity APP
1438
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ExtendSubscription
1439
- */
1440
- export async function extendSubscription(_id, actionContext, options) {
1441
- // @ts-ignore
1442
- const { httpClient, sideEffects } = arguments[3];
1443
- const payload = renameKeysFromSDKRequestToRESTRequest({
1444
- id: _id,
1445
- actionContext: actionContext,
1446
- extensionPeriod: options?.extensionPeriod,
1447
- extensionBillingCycles: options?.extensionBillingCycles,
1448
- });
1449
- const reqOpts = ambassadorWixBillingV1Subscription.extendSubscription(payload);
1450
- sideEffects?.onSiteCall?.();
1451
- try {
1452
- const result = await httpClient.request(reqOpts);
1453
- sideEffects?.onSuccess?.(result);
1454
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1455
- {
1456
- transformFn: transformRESTAddressToSDKAddress,
1457
- paths: [
1458
- { path: 'subscription.billingSettings.billingAddress.address' },
1459
- { path: 'subscription.shippingAddress.address' },
1460
- ],
1461
- },
1462
- ]));
1463
- }
1464
- catch (err) {
1465
- const transformedError = sdkTransformError(err, {
1466
- spreadPathsToArguments: {},
1467
- explicitPathsToArguments: {
1468
- id: '$[0]',
1469
- actionContext: '$[1]',
1470
- extensionPeriod: '$[2].extensionPeriod',
1471
- extensionBillingCycles: '$[2].extensionBillingCycles',
1472
- },
1473
- singleArgumentUnchanged: false,
1474
- }, ['_id', 'actionContext', 'options']);
1475
- sideEffects?.onError?.(err);
1476
- throw transformedError;
1477
- }
1478
- }
1479
- /** @public
1480
- * @documentationMaturity preview
1481
- * @requiredField _id
1482
- * @permissionId subscriptions.manage
1483
- * @permissionScope Manage Orders
1484
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1485
- * @applicableIdentity APP
1486
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.AllowedActions
1487
- */
1488
- export async function allowedActions(_id, options) {
1489
- // @ts-ignore
1490
- const { httpClient, sideEffects } = arguments[2];
1491
- const payload = renameKeysFromSDKRequestToRESTRequest({
1492
- id: _id,
1493
- fields: options?.fields,
1494
- });
1495
- const reqOpts = ambassadorWixBillingV1Subscription.allowedActions(payload);
1496
- sideEffects?.onSiteCall?.();
1497
- try {
1498
- const result = await httpClient.request(reqOpts);
1499
- sideEffects?.onSuccess?.(result);
1500
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1501
- }
1502
- catch (err) {
1503
- const transformedError = sdkTransformError(err, {
1504
- spreadPathsToArguments: {},
1505
- explicitPathsToArguments: { id: '$[0]', fields: '$[1].fields' },
1506
- singleArgumentUnchanged: false,
1507
- }, ['_id', 'options']);
1508
- sideEffects?.onError?.(err);
1509
- throw transformedError;
1510
- }
1511
- }
1512
- /**
1513
- * List future subscriptions charges
1514
- * @param subscriptionId - Subscription id charges to be previewed for
1515
- * @public
1516
- * @documentationMaturity preview
1517
- * @requiredField subscriptionId
1518
- * @permissionId subscriptions.view
1519
- * @permissionScope Manage Events
1520
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1521
- * @applicableIdentity APP
1522
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ListUpcomingCharges
1523
- */
1524
- export async function listUpcomingCharges(subscriptionId, options) {
1525
- // @ts-ignore
1526
- const { httpClient, sideEffects } = arguments[2];
1527
- const payload = renameKeysFromSDKRequestToRESTRequest({
1528
- subscriptionId: subscriptionId,
1529
- customDuration: options?.customDuration,
1530
- nextBillingDate: options?.nextBillingDate,
1531
- });
1532
- const reqOpts = ambassadorWixBillingV1Subscription.listUpcomingCharges(payload);
1533
- sideEffects?.onSiteCall?.();
1534
- try {
1535
- const result = await httpClient.request(reqOpts);
1536
- sideEffects?.onSuccess?.(result);
1537
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1538
- }
1539
- catch (err) {
1540
- const transformedError = sdkTransformError(err, {
1541
- spreadPathsToArguments: {},
1542
- explicitPathsToArguments: {
1543
- subscriptionId: '$[0]',
1544
- customDuration: '$[1].customDuration',
1545
- nextBillingDate: '$[1].nextBillingDate',
1546
- },
1547
- singleArgumentUnchanged: false,
1548
- }, ['subscriptionId', 'options']);
1549
- sideEffects?.onError?.(err);
1550
- throw transformedError;
1551
- }
1552
- }
1553
- /**
1554
- * Retrieves the preview of subscription charges.
1555
- * Returns all the charges applicable to a subscription based on the provided subscription information.
1556
- * @public
1557
- * @documentationMaturity preview
1558
- * @requiredField options.subscription.subscriptionInfo
1559
- * @requiredField options.subscription.subscriptionInfo.billingSettings
1560
- * @requiredField options.subscription.subscriptionInfo.items
1561
- * @requiredField options.subscription.subscriptionInfo.items.pricingModel
1562
- * @permissionId subscriptions.view
1563
- * @permissionScope Manage Events
1564
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1565
- * @applicableIdentity APP
1566
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionCharges
1567
- * @deprecated
1568
- * @replacedBy com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionsCharges
1569
- * @targetRemovalDate 2025-06-30
1570
- */
1571
- export async function previewSubscriptionCharges(options) {
1572
- // @ts-ignore
1573
- const { httpClient, sideEffects } = arguments[1];
1574
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
1575
- subscriptionInfo: options?.subscriptionInfo,
1576
- }), [
1577
- {
1578
- transformFn: transformSDKAddressToRESTAddress,
1579
- paths: [
1580
- { path: 'subscriptionInfo.billingSettings.billingAddress.address' },
1581
- ],
1582
- },
1583
- ]);
1584
- const reqOpts = ambassadorWixBillingV1Subscription.previewSubscriptionCharges(payload);
1585
- sideEffects?.onSiteCall?.();
1586
- try {
1587
- const result = await httpClient.request(reqOpts);
1588
- sideEffects?.onSuccess?.(result);
1589
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1590
- }
1591
- catch (err) {
1592
- const transformedError = sdkTransformError(err, {
1593
- spreadPathsToArguments: {},
1594
- explicitPathsToArguments: { subscriptionInfo: '$[0].subscriptionInfo' },
1595
- singleArgumentUnchanged: false,
1596
- }, ['options']);
1597
- sideEffects?.onError?.(err);
1598
- throw transformedError;
1599
- }
1600
- }
1601
- /**
1602
- * Retrieves the preview of subscription charges for a bulk of subscriptions.
1603
- * Returns all the charges applicable to all subscriptions, based on the provided subscriptions information.
1604
- * @public
1605
- * @documentationMaturity preview
1606
- * @requiredField options.subscriptionsBillingDetails.billingSettings
1607
- * @requiredField options.subscriptionsBillingDetails.billingSettings.shippingCharges.tax.value
1608
- * @requiredField options.subscriptionsBillingDetails.externalId
1609
- * @requiredField options.subscriptionsBillingDetails.items
1610
- * @requiredField options.subscriptionsBillingDetails.items.pricingModel
1611
- * @requiredField options.subscriptionsBillingDetails.items.pricingModel.model
1612
- * @requiredField options.subscriptionsBillingDetails.items.tax.value
1613
- * @permissionId subscriptions.view
1614
- * @permissionScope Manage Events
1615
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1616
- * @applicableIdentity APP
1617
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionsCharges
1618
- */
1619
- export async function previewSubscriptionsCharges(options) {
1620
- // @ts-ignore
1621
- const { httpClient, sideEffects } = arguments[1];
1622
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
1623
- subscriptionsBillingDetails: options?.subscriptionsBillingDetails,
1624
- numberOfNextRecurringCharges: options?.numberOfNextRecurringCharges,
1625
- }), [
1626
- {
1627
- transformFn: transformSDKAddressToRESTAddress,
1628
- paths: [
1629
- {
1630
- path: 'subscriptionsBillingDetails.billingSettings.billingAddress.address',
1631
- },
1632
- { path: 'subscriptionsBillingDetails.shippingAddress.address' },
1633
- ],
1634
- },
1635
- ]);
1636
- const reqOpts = ambassadorWixBillingV1Subscription.previewSubscriptionsCharges(payload);
1637
- sideEffects?.onSiteCall?.();
1638
- try {
1639
- const result = await httpClient.request(reqOpts);
1640
- sideEffects?.onSuccess?.(result);
1641
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1642
- }
1643
- catch (err) {
1644
- const transformedError = sdkTransformError(err, {
1645
- spreadPathsToArguments: {},
1646
- explicitPathsToArguments: {
1647
- subscriptionsBillingDetails: '$[0].subscriptionsBillingDetails',
1648
- numberOfNextRecurringCharges: '$[0].numberOfNextRecurringCharges',
1649
- },
1650
- singleArgumentUnchanged: false,
1651
- }, ['options']);
1652
- sideEffects?.onError?.(err);
1653
- throw transformedError;
1654
- }
1655
- }
1656
- /**
1657
- * Creates authorization invoice with Moto settings in order to create
1658
- * @public
1659
- * @documentationMaturity preview
1660
- * @requiredField _id
1661
- * @permissionId subscriptions.manage
1662
- * @permissionScope Manage Orders
1663
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1664
- * @applicableIdentity APP
1665
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.InitiatePaymentMethodSetup
1666
- */
1667
- export async function initiatePaymentMethodSetup(_id, options) {
1668
- // @ts-ignore
1669
- const { httpClient, sideEffects } = arguments[2];
1670
- const payload = renameKeysFromSDKRequestToRESTRequest({
1671
- id: _id,
1672
- paymentMode: options?.paymentMode,
1673
- paymentSettings: options?.paymentSettings,
1674
- });
1675
- const reqOpts = ambassadorWixBillingV1Subscription.initiatePaymentMethodSetup(payload);
1676
- sideEffects?.onSiteCall?.();
1677
- try {
1678
- const result = await httpClient.request(reqOpts);
1679
- sideEffects?.onSuccess?.(result);
1680
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1681
- }
1682
- catch (err) {
1683
- const transformedError = sdkTransformError(err, {
1684
- spreadPathsToArguments: {},
1685
- explicitPathsToArguments: {
1686
- id: '$[0]',
1687
- paymentMode: '$[1].paymentMode',
1688
- paymentSettings: '$[1].paymentSettings',
1689
- },
1690
- singleArgumentUnchanged: false,
1691
- }, ['_id', 'options']);
1692
- sideEffects?.onError?.(err);
1693
- throw transformedError;
1694
- }
1695
- }
1696
- /** @public
1697
- * @documentationMaturity preview
1698
- * @requiredField subscriptionId
1699
- * @permissionId subscriptions.view
1700
- * @permissionScope Manage Events
1701
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1702
- * @applicableIdentity APP
1703
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionHistoryService.ListSubscriptionHistory
1704
- */
1705
- export async function listSubscriptionHistory(subscriptionId, options) {
1706
- // @ts-ignore
1707
- const { httpClient, sideEffects } = arguments[2];
1708
- const payload = renameKeysFromSDKRequestToRESTRequest({
1709
- subscriptionId: subscriptionId,
1710
- mode: options?.mode,
1711
- cursor: options?.cursor,
1712
- });
1713
- const reqOpts = ambassadorWixBillingV1Subscription.listSubscriptionHistory(payload);
1714
- sideEffects?.onSiteCall?.();
1715
- try {
1716
- const result = await httpClient.request(reqOpts);
1717
- sideEffects?.onSuccess?.(result);
1718
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1719
- {
1720
- transformFn: transformRESTAddressToSDKAddress,
1721
- paths: [
1722
- {
1723
- path: 'historyEntries.event.created.subscription.billingSettings.billingAddress.address',
1724
- },
1725
- {
1726
- path: 'historyEntries.event.created.subscription.shippingAddress.address',
1727
- },
1728
- {
1729
- path: 'historyEntries.event.updated.current.billingSettings.billingAddress.address',
1730
- },
1731
- {
1732
- path: 'historyEntries.event.updated.current.shippingAddress.address',
1733
- },
1734
- {
1735
- path: 'historyEntries.event.updated.previous.billingSettings.billingAddress.address',
1736
- },
1737
- {
1738
- path: 'historyEntries.event.updated.previous.shippingAddress.address',
1739
- },
1740
- {
1741
- path: 'historyEntries.event.activated.subscription.billingSettings.billingAddress.address',
1742
- },
1743
- {
1744
- path: 'historyEntries.event.activated.subscription.shippingAddress.address',
1745
- },
1746
- {
1747
- path: 'historyEntries.event.ended.subscription.billingSettings.billingAddress.address',
1748
- },
1749
- {
1750
- path: 'historyEntries.event.ended.subscription.shippingAddress.address',
1751
- },
1752
- {
1753
- path: 'historyEntries.event.canceled.subscription.billingSettings.billingAddress.address',
1754
- },
1755
- {
1756
- path: 'historyEntries.event.canceled.subscription.shippingAddress.address',
1757
- },
1758
- {
1759
- path: 'historyEntries.event.paused.subscription.billingSettings.billingAddress.address',
1760
- },
1761
- {
1762
- path: 'historyEntries.event.paused.subscription.shippingAddress.address',
1763
- },
1764
- {
1765
- path: 'historyEntries.event.resumed.subscription.billingSettings.billingAddress.address',
1766
- },
1767
- {
1768
- path: 'historyEntries.event.resumed.subscription.shippingAddress.address',
1769
- },
1770
- {
1771
- path: 'historyEntries.event.pauseRequested.subscription.billingSettings.billingAddress.address',
1772
- },
1773
- {
1774
- path: 'historyEntries.event.pauseRequested.subscription.shippingAddress.address',
1775
- },
1776
- {
1777
- path: 'historyEntries.event.resumeRequested.subscription.billingSettings.billingAddress.address',
1778
- },
1779
- {
1780
- path: 'historyEntries.event.resumeRequested.subscription.shippingAddress.address',
1781
- },
1782
- {
1783
- path: 'historyEntries.event.scheduledPauseCanceled.subscription.billingSettings.billingAddress.address',
1784
- },
1785
- {
1786
- path: 'historyEntries.event.scheduledPauseCanceled.subscription.shippingAddress.address',
1787
- },
1788
- {
1789
- path: 'historyEntries.event.scheduledResumeCanceled.subscription.billingSettings.billingAddress.address',
1790
- },
1791
- {
1792
- path: 'historyEntries.event.scheduledResumeCanceled.subscription.shippingAddress.address',
1793
- },
1794
- {
1795
- path: 'historyEntries.event.billingCycleStarted.subscription.billingSettings.billingAddress.address',
1796
- },
1797
- {
1798
- path: 'historyEntries.event.billingCycleStarted.subscription.shippingAddress.address',
1799
- },
1800
- {
1801
- path: 'historyEntries.event.autoRenewalTurnedOn.subscription.billingSettings.billingAddress.address',
1802
- },
1803
- {
1804
- path: 'historyEntries.event.autoRenewalTurnedOn.subscription.shippingAddress.address',
1805
- },
1806
- {
1807
- path: 'historyEntries.event.autoRenewalTurnedOff.subscription.billingSettings.billingAddress.address',
1808
- },
1809
- {
1810
- path: 'historyEntries.event.autoRenewalTurnedOff.subscription.shippingAddress.address',
1811
- },
1812
- {
1813
- path: 'historyEntries.event.cycleReadyToPay.subscription.billingSettings.billingAddress.address',
1814
- },
1815
- {
1816
- path: 'historyEntries.event.cycleReadyToPay.subscription.shippingAddress.address',
1817
- },
1818
- {
1819
- path: 'historyEntries.event.extended.subscription.billingSettings.billingAddress.address',
1820
- },
1821
- {
1822
- path: 'historyEntries.event.extended.subscription.shippingAddress.address',
1823
- },
1824
- {
1825
- path: 'historyEntries.event.initialPurchaseCompleted.subscription.billingSettings.billingAddress.address',
1826
- },
1827
- {
1828
- path: 'historyEntries.event.initialPurchaseCompleted.subscription.shippingAddress.address',
1829
- },
1830
- {
1831
- path: 'historyEntries.event.latestInvoiceMarkedAsPaid.subscription.billingSettings.billingAddress.address',
1832
- },
1833
- {
1834
- path: 'historyEntries.event.latestInvoiceMarkedAsPaid.subscription.shippingAddress.address',
1835
- },
1836
- {
1837
- path: 'historyEntries.event.revived.subscription.billingSettings.billingAddress.address',
1838
- },
1839
- {
1840
- path: 'historyEntries.event.revived.subscription.shippingAddress.address',
1841
- },
1842
- {
1843
- path: 'historyEntries.event.billingDateUpdated.subscription.billingSettings.billingAddress.address',
1844
- },
1845
- {
1846
- path: 'historyEntries.event.billingDateUpdated.subscription.shippingAddress.address',
1847
- },
1848
- {
1849
- path: 'historyEntries.event.futureUpdatesRequested.subscription.billingSettings.billingAddress.address',
1850
- },
1851
- {
1852
- path: 'historyEntries.event.futureUpdatesRequested.subscription.shippingAddress.address',
1853
- },
1854
- {
1855
- path: 'historyEntries.event.updatesApplied.subscription.billingSettings.billingAddress.address',
1856
- },
1857
- {
1858
- path: 'historyEntries.event.updatesApplied.subscription.shippingAddress.address',
1859
- },
1860
- {
1861
- path: 'historyEntries.event.resetPendingUpdates.subscription.billingSettings.billingAddress.address',
1862
- },
1863
- {
1864
- path: 'historyEntries.event.resetPendingUpdates.subscription.shippingAddress.address',
1865
- },
1866
- {
1867
- path: 'historyEntries.event.gracePeriodStarted.subscription.billingSettings.billingAddress.address',
1868
- },
1869
- {
1870
- path: 'historyEntries.event.gracePeriodStarted.subscription.shippingAddress.address',
1871
- },
1872
- {
1873
- path: 'historyEntries.event.gracePeriodEnded.subscription.billingSettings.billingAddress.address',
1874
- },
1875
- {
1876
- path: 'historyEntries.event.gracePeriodEnded.subscription.shippingAddress.address',
1877
- },
1878
- {
1879
- path: 'historyEntries.event.paymentMethodUpdated.subscription.billingSettings.billingAddress.address',
1880
- },
1881
- {
1882
- path: 'historyEntries.event.paymentMethodUpdated.subscription.shippingAddress.address',
1883
- },
1884
- {
1885
- path: 'historyEntries.event.collectionMethodUpdated.subscription.billingSettings.billingAddress.address',
1886
- },
1887
- {
1888
- path: 'historyEntries.event.collectionMethodUpdated.subscription.shippingAddress.address',
1889
- },
1890
- {
1891
- path: 'historyEntries.event.freeTrailStarted.subscription.billingSettings.billingAddress.address',
1892
- },
1893
- {
1894
- path: 'historyEntries.event.freeTrailStarted.subscription.shippingAddress.address',
1895
- },
1896
- {
1897
- path: 'historyEntries.event.freeTrailEnded.subscription.billingSettings.billingAddress.address',
1898
- },
1899
- {
1900
- path: 'historyEntries.event.freeTrailEnded.subscription.shippingAddress.address',
1901
- },
1902
- {
1903
- path: 'historyEntries.event.billingCyclePaid.subscription.billingSettings.billingAddress.address',
1904
- },
1905
- {
1906
- path: 'historyEntries.event.billingCyclePaid.subscription.shippingAddress.address',
1907
- },
1908
- {
1909
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingSettings.billingAddress.address',
1910
- },
1911
- {
1912
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.shippingAddress.address',
1913
- },
1914
- {
1915
- path: 'historyEntries.event.subscriptionBoAction.subscription.billingSettings.billingAddress.address',
1916
- },
1917
- {
1918
- path: 'historyEntries.event.subscriptionBoAction.subscription.shippingAddress.address',
1919
- },
1920
- ],
1921
- },
1922
- ]));
1923
- }
1924
- catch (err) {
1925
- const transformedError = sdkTransformError(err, {
1926
- spreadPathsToArguments: {},
1927
- explicitPathsToArguments: {
1928
- subscriptionId: '$[0]',
1929
- mode: '$[1].mode',
1930
- cursor: '$[1].cursor',
1931
- },
1932
- singleArgumentUnchanged: false,
1933
- }, ['subscriptionId', 'options']);
1934
- sideEffects?.onError?.(err);
1935
- throw transformedError;
1936
- }
1937
- }
1938
- //# sourceMappingURL=billing-v1-subscription-subscriptions.universal.js.map