@wix/auto_sdk_subscription_subscriptions 1.0.0 → 1.0.2

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 (73) hide show
  1. package/build/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +5 -5
  2. package/build/cjs/src/billing-v1-subscription-subscriptions.context.js +12 -12
  3. package/build/cjs/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
  4. package/build/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +5 -5
  5. package/build/cjs/src/billing-v1-subscription-subscriptions.http.js +1848 -1848
  6. package/build/cjs/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
  7. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +7 -7
  8. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js +29 -29
  9. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
  10. package/build/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +12 -12
  11. package/build/cjs/src/billing-v1-subscription-subscriptions.public.js +13 -13
  12. package/build/cjs/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
  13. package/build/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +1995 -1464
  14. package/build/cjs/src/billing-v1-subscription-subscriptions.types.js +59 -59
  15. package/build/cjs/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
  16. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts +2085 -1482
  17. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js +341 -340
  18. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
  19. package/build/es/src/billing-v1-subscription-subscriptions.context.d.ts +5 -5
  20. package/build/es/src/billing-v1-subscription-subscriptions.context.js +5 -5
  21. package/build/es/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
  22. package/build/es/src/billing-v1-subscription-subscriptions.http.d.ts +5 -5
  23. package/build/es/src/billing-v1-subscription-subscriptions.http.js +1720 -1720
  24. package/build/es/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
  25. package/build/es/src/billing-v1-subscription-subscriptions.meta.d.ts +7 -7
  26. package/build/es/src/billing-v1-subscription-subscriptions.meta.js +25 -25
  27. package/build/es/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
  28. package/build/es/src/billing-v1-subscription-subscriptions.public.d.ts +12 -12
  29. package/build/es/src/billing-v1-subscription-subscriptions.public.js +10 -10
  30. package/build/es/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
  31. package/build/es/src/billing-v1-subscription-subscriptions.types.d.ts +1995 -1464
  32. package/build/es/src/billing-v1-subscription-subscriptions.types.js +58 -58
  33. package/build/es/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
  34. package/build/es/src/billing-v1-subscription-subscriptions.universal.d.ts +2085 -1482
  35. package/build/es/src/billing-v1-subscription-subscriptions.universal.js +338 -337
  36. package/build/es/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
  37. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +6 -6
  38. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js +12 -12
  39. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
  40. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +5 -5
  41. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js +1848 -1848
  42. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
  43. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +7 -7
  44. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js +29 -29
  45. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
  46. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +17 -17
  47. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js +13 -13
  48. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
  49. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +1995 -1464
  50. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js +59 -59
  51. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
  52. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts +2088 -1485
  53. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js +341 -340
  54. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
  55. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.d.ts +6 -6
  56. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js +5 -5
  57. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
  58. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.d.ts +5 -5
  59. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js +1720 -1720
  60. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
  61. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.d.ts +7 -7
  62. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js +25 -25
  63. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
  64. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.d.ts +17 -17
  65. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js +10 -10
  66. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
  67. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.d.ts +1995 -1464
  68. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js +58 -58
  69. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
  70. package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.d.ts +2088 -1485
  71. package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js +338 -337
  72. package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
  73. package/package.json +2 -2
@@ -3,7 +3,7 @@ import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transform
3
3
  import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
4
4
  import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
5
5
  import { resolveUrl } from '@wix/sdk-runtime/rest-modules';
6
- function resolveComWixpressBillingSubscriptionsApiV1SubscriptionsBackOfficeServiceUrl(opts) {
6
+ function resolveComWixpressBillingSubscriptionsApiV1SubscriptionHistoryServiceUrl(opts) {
7
7
  const domainToMappings = {
8
8
  'www._base_domain_': [
9
9
  {
@@ -73,7 +73,7 @@ function resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl(opts
73
73
  };
74
74
  return resolveUrl(Object.assign(opts, { domainToMappings }));
75
75
  }
76
- function resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(opts) {
76
+ function resolveComWixpressBillingSubscriptionsApiV1SubscriptionsBackOfficeServiceUrl(opts) {
77
77
  const domainToMappings = {
78
78
  'www._base_domain_': [
79
79
  {
@@ -108,7 +108,7 @@ function resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsService
108
108
  };
109
109
  return resolveUrl(Object.assign(opts, { domainToMappings }));
110
110
  }
111
- function resolveComWixpressBillingSubscriptionsApiV1SubscriptionHistoryServiceUrl(opts) {
111
+ function resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(opts) {
112
112
  const domainToMappings = {
113
113
  'www._base_domain_': [
114
114
  {
@@ -144,264 +144,1587 @@ function resolveComWixpressBillingSubscriptionsApiV1SubscriptionHistoryServiceUr
144
144
  return resolveUrl(Object.assign(opts, { domainToMappings }));
145
145
  }
146
146
  const PACKAGE_NAME = '@wix/auto_sdk_subscription_subscriptions';
147
- export function listSubscriptionHistory(payload) {
148
- function __listSubscriptionHistory({ host }) {
147
+ /** Identity must be a site member and customer subscription belongs to */
148
+ export function customerGetSubscription(payload) {
149
+ function __customerGetSubscription({ host }) {
149
150
  const metadata = {
150
151
  entityFqdn: 'wix.billing.v1.subscription',
151
152
  method: 'GET',
152
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionHistoryService.ListSubscriptionHistory',
153
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.GetSubscription',
153
154
  packageName: PACKAGE_NAME,
154
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionHistoryServiceUrl({
155
- protoPath: '/v1/subscriptions/{subscriptionId}/history',
156
- data: payload,
157
- host,
158
- }),
155
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({ protoPath: '/v1/customer_subscriptions/{id}', data: payload, host }),
159
156
  params: toURLSearchParams(payload),
160
157
  transformResponse: (payload) => transformPaths(payload, [
161
158
  {
162
159
  transformFn: transformRESTTimestampToSDKTimestamp,
163
160
  paths: [
164
- { path: 'historyEntries.entryTime' },
165
- { path: 'historyEntries.event.created.subscription.createdDate' },
166
- { path: 'historyEntries.event.created.subscription.updatedDate' },
167
- { path: 'historyEntries.event.created.subscription.startDate' },
168
- { path: 'historyEntries.event.created.subscription.endDate' },
161
+ { path: 'subscription.createdDate' },
162
+ { path: 'subscription.updatedDate' },
163
+ { path: 'subscription.startDate' },
164
+ { path: 'subscription.endDate' },
165
+ { path: 'subscription.billingStatus.nextBillingDate' },
166
+ { path: 'subscription.billingStatus.previousBillingDate' },
169
167
  {
170
- path: 'historyEntries.event.created.subscription.billingStatus.nextBillingDate',
168
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
171
169
  },
170
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
171
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
172
172
  {
173
- path: 'historyEntries.event.created.subscription.billingStatus.previousBillingDate',
173
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
174
174
  },
175
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
176
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
177
+ { path: 'subscription.pauseInfo.startDate' },
178
+ { path: 'subscription.pauseInfo.resumeDate' },
179
+ { path: 'subscription.cancellationInfo.cancellationDate' },
175
180
  {
176
- path: 'historyEntries.event.created.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
181
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
177
182
  },
183
+ ],
184
+ },
185
+ ]),
186
+ };
187
+ return metadata;
188
+ }
189
+ return __customerGetSubscription;
190
+ }
191
+ /** Identity must be a site member and customer subscription belongs to */
192
+ export function customerCancelSubscription(payload) {
193
+ function __customerCancelSubscription({ host }) {
194
+ const metadata = {
195
+ entityFqdn: 'wix.billing.v1.subscription',
196
+ method: 'POST',
197
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CancelSubscription',
198
+ packageName: PACKAGE_NAME,
199
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
200
+ protoPath: '/v1/customer_subscriptions/{id}/cancel',
201
+ data: payload,
202
+ host,
203
+ }),
204
+ data: payload,
205
+ transformResponse: (payload) => transformPaths(payload, [
206
+ {
207
+ transformFn: transformRESTTimestampToSDKTimestamp,
208
+ paths: [
209
+ { path: 'subscription.createdDate' },
210
+ { path: 'subscription.updatedDate' },
211
+ { path: 'subscription.startDate' },
212
+ { path: 'subscription.endDate' },
213
+ { path: 'subscription.billingStatus.nextBillingDate' },
214
+ { path: 'subscription.billingStatus.previousBillingDate' },
178
215
  {
179
- path: 'historyEntries.event.created.subscription.billingStatus.freeTrialData.startDate',
216
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
180
217
  },
218
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
219
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
181
220
  {
182
- path: 'historyEntries.event.created.subscription.billingStatus.freeTrialData.endDate',
221
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
183
222
  },
223
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
224
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
225
+ { path: 'subscription.pauseInfo.startDate' },
226
+ { path: 'subscription.pauseInfo.resumeDate' },
227
+ { path: 'subscription.cancellationInfo.cancellationDate' },
184
228
  {
185
- path: 'historyEntries.event.created.subscription.billingStatus.updateBillingDateData.paidUntil',
229
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
186
230
  },
231
+ ],
232
+ },
233
+ ]),
234
+ };
235
+ return metadata;
236
+ }
237
+ return __customerCancelSubscription;
238
+ }
239
+ /** Identity must be a site member and customer subscription belongs to */
240
+ export function customerTurnOnSubscriptionAutoRenewal(payload) {
241
+ function __customerTurnOnSubscriptionAutoRenewal({ host }) {
242
+ const metadata = {
243
+ entityFqdn: 'wix.billing.v1.subscription',
244
+ method: 'POST',
245
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.TurnOnSubscriptionAutoRenewal',
246
+ packageName: PACKAGE_NAME,
247
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
248
+ protoPath: '/v1/customer_subscriptions/{id}/turn_on_auto_renewal',
249
+ data: payload,
250
+ host,
251
+ }),
252
+ data: payload,
253
+ transformResponse: (payload) => transformPaths(payload, [
254
+ {
255
+ transformFn: transformRESTTimestampToSDKTimestamp,
256
+ paths: [
257
+ { path: 'subscription.createdDate' },
258
+ { path: 'subscription.updatedDate' },
259
+ { path: 'subscription.startDate' },
260
+ { path: 'subscription.endDate' },
261
+ { path: 'subscription.billingStatus.nextBillingDate' },
262
+ { path: 'subscription.billingStatus.previousBillingDate' },
187
263
  {
188
- path: 'historyEntries.event.created.subscription.billingStatus.gracePeriodData.startDate',
264
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
189
265
  },
266
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
267
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
190
268
  {
191
- path: 'historyEntries.event.created.subscription.billingStatus.gracePeriodData.endDate',
269
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
192
270
  },
271
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
272
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
273
+ { path: 'subscription.pauseInfo.startDate' },
274
+ { path: 'subscription.pauseInfo.resumeDate' },
275
+ { path: 'subscription.cancellationInfo.cancellationDate' },
193
276
  {
194
- path: 'historyEntries.event.created.subscription.pauseInfo.startDate',
277
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
195
278
  },
279
+ ],
280
+ },
281
+ ]),
282
+ };
283
+ return metadata;
284
+ }
285
+ return __customerTurnOnSubscriptionAutoRenewal;
286
+ }
287
+ /** Identity must be a site member and customer subscription belongs to */
288
+ export function customerTurnOffSubscriptionAutoRenewal(payload) {
289
+ function __customerTurnOffSubscriptionAutoRenewal({ host }) {
290
+ const metadata = {
291
+ entityFqdn: 'wix.billing.v1.subscription',
292
+ method: 'POST',
293
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.TurnOffSubscriptionAutoRenewal',
294
+ packageName: PACKAGE_NAME,
295
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
296
+ protoPath: '/v1/customer_subscriptions/{id}/turn_off_auto_renewal',
297
+ data: payload,
298
+ host,
299
+ }),
300
+ data: payload,
301
+ transformResponse: (payload) => transformPaths(payload, [
302
+ {
303
+ transformFn: transformRESTTimestampToSDKTimestamp,
304
+ paths: [
305
+ { path: 'subscription.createdDate' },
306
+ { path: 'subscription.updatedDate' },
307
+ { path: 'subscription.startDate' },
308
+ { path: 'subscription.endDate' },
309
+ { path: 'subscription.billingStatus.nextBillingDate' },
310
+ { path: 'subscription.billingStatus.previousBillingDate' },
196
311
  {
197
- path: 'historyEntries.event.created.subscription.pauseInfo.resumeDate',
312
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
198
313
  },
314
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
315
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
199
316
  {
200
- path: 'historyEntries.event.created.subscription.cancellationInfo.cancellationDate',
317
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
201
318
  },
319
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
320
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
321
+ { path: 'subscription.pauseInfo.startDate' },
322
+ { path: 'subscription.pauseInfo.resumeDate' },
323
+ { path: 'subscription.cancellationInfo.cancellationDate' },
202
324
  {
203
- path: 'historyEntries.event.created.subscription.specificDatePendingUpdateData.executionDate',
325
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
204
326
  },
205
- { path: 'historyEntries.event.updated.current.createdDate' },
206
- { path: 'historyEntries.event.updated.current.updatedDate' },
207
- { path: 'historyEntries.event.updated.current.startDate' },
208
- { path: 'historyEntries.event.updated.current.endDate' },
327
+ ],
328
+ },
329
+ ]),
330
+ };
331
+ return metadata;
332
+ }
333
+ return __customerTurnOffSubscriptionAutoRenewal;
334
+ }
335
+ export function customerExtendSubscription(payload) {
336
+ function __customerExtendSubscription({ host }) {
337
+ const metadata = {
338
+ entityFqdn: 'wix.billing.v1.subscription',
339
+ method: 'PATCH',
340
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.ExtendSubscription',
341
+ packageName: PACKAGE_NAME,
342
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
343
+ protoPath: '/v1/customer_subscriptions/{id}/extend',
344
+ data: payload,
345
+ host,
346
+ }),
347
+ data: payload,
348
+ transformResponse: (payload) => transformPaths(payload, [
349
+ {
350
+ transformFn: transformRESTTimestampToSDKTimestamp,
351
+ paths: [
352
+ { path: 'subscription.createdDate' },
353
+ { path: 'subscription.updatedDate' },
354
+ { path: 'subscription.startDate' },
355
+ { path: 'subscription.endDate' },
356
+ { path: 'subscription.billingStatus.nextBillingDate' },
357
+ { path: 'subscription.billingStatus.previousBillingDate' },
209
358
  {
210
- path: 'historyEntries.event.updated.current.billingStatus.nextBillingDate',
359
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
211
360
  },
361
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
362
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
212
363
  {
213
- path: 'historyEntries.event.updated.current.billingStatus.previousBillingDate',
364
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
214
365
  },
366
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
367
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
368
+ { path: 'subscription.pauseInfo.startDate' },
369
+ { path: 'subscription.pauseInfo.resumeDate' },
370
+ { path: 'subscription.cancellationInfo.cancellationDate' },
215
371
  {
216
- path: 'historyEntries.event.updated.current.billingStatus.latestPaymentData.initialFailedPaymentDate',
372
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
217
373
  },
374
+ ],
375
+ },
376
+ ]),
377
+ };
378
+ return metadata;
379
+ }
380
+ return __customerExtendSubscription;
381
+ }
382
+ /** identity must be a site member */
383
+ export function customerQuerySubscriptions(payload) {
384
+ function __customerQuerySubscriptions({ host }) {
385
+ const metadata = {
386
+ entityFqdn: 'wix.billing.v1.subscription',
387
+ method: 'POST',
388
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.QuerySubscriptions',
389
+ packageName: PACKAGE_NAME,
390
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({ protoPath: '/v1/customer_subscriptions/query', data: payload, host }),
391
+ data: payload,
392
+ transformResponse: (payload) => transformPaths(payload, [
393
+ {
394
+ transformFn: transformRESTTimestampToSDKTimestamp,
395
+ paths: [
396
+ { path: 'subscriptions.createdDate' },
397
+ { path: 'subscriptions.updatedDate' },
398
+ { path: 'subscriptions.startDate' },
399
+ { path: 'subscriptions.endDate' },
400
+ { path: 'subscriptions.billingStatus.nextBillingDate' },
401
+ { path: 'subscriptions.billingStatus.previousBillingDate' },
218
402
  {
219
- path: 'historyEntries.event.updated.current.billingStatus.freeTrialData.startDate',
403
+ path: 'subscriptions.billingStatus.latestPaymentData.initialFailedPaymentDate',
220
404
  },
405
+ { path: 'subscriptions.billingStatus.freeTrialData.startDate' },
406
+ { path: 'subscriptions.billingStatus.freeTrialData.endDate' },
221
407
  {
222
- path: 'historyEntries.event.updated.current.billingStatus.freeTrialData.endDate',
408
+ path: 'subscriptions.billingStatus.updateBillingDateData.paidUntil',
223
409
  },
410
+ { path: 'subscriptions.billingStatus.gracePeriodData.startDate' },
411
+ { path: 'subscriptions.billingStatus.gracePeriodData.endDate' },
412
+ { path: 'subscriptions.pauseInfo.startDate' },
413
+ { path: 'subscriptions.pauseInfo.resumeDate' },
414
+ { path: 'subscriptions.cancellationInfo.cancellationDate' },
224
415
  {
225
- path: 'historyEntries.event.updated.current.billingStatus.updateBillingDateData.paidUntil',
416
+ path: 'subscriptions.specificDatePendingUpdateData.executionDate',
226
417
  },
418
+ ],
419
+ },
420
+ ]),
421
+ };
422
+ return metadata;
423
+ }
424
+ return __customerQuerySubscriptions;
425
+ }
426
+ /**
427
+ * Update subscription's payment method.
428
+ * Supported only for recurring subscriptions or one time subscriptions during free trial.
429
+ */
430
+ export function customerUpdateSubscriptionPaymentMethod(payload) {
431
+ function __customerUpdateSubscriptionPaymentMethod({ host }) {
432
+ const metadata = {
433
+ entityFqdn: 'wix.billing.v1.subscription',
434
+ method: 'PATCH',
435
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.UpdateSubscriptionPaymentMethod',
436
+ packageName: PACKAGE_NAME,
437
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
438
+ protoPath: '/v1/customer_subscriptions/{id}/payment_method',
439
+ data: payload,
440
+ host,
441
+ }),
442
+ data: payload,
443
+ transformResponse: (payload) => transformPaths(payload, [
444
+ {
445
+ transformFn: transformRESTTimestampToSDKTimestamp,
446
+ paths: [
447
+ { path: 'subscription.createdDate' },
448
+ { path: 'subscription.updatedDate' },
449
+ { path: 'subscription.startDate' },
450
+ { path: 'subscription.endDate' },
451
+ { path: 'subscription.billingStatus.nextBillingDate' },
452
+ { path: 'subscription.billingStatus.previousBillingDate' },
227
453
  {
228
- path: 'historyEntries.event.updated.current.billingStatus.gracePeriodData.startDate',
454
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
229
455
  },
456
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
457
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
230
458
  {
231
- path: 'historyEntries.event.updated.current.billingStatus.gracePeriodData.endDate',
459
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
232
460
  },
461
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
462
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
463
+ { path: 'subscription.pauseInfo.startDate' },
464
+ { path: 'subscription.pauseInfo.resumeDate' },
465
+ { path: 'subscription.cancellationInfo.cancellationDate' },
233
466
  {
234
- path: 'historyEntries.event.updated.current.pauseInfo.startDate',
467
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
235
468
  },
469
+ ],
470
+ },
471
+ ]),
472
+ };
473
+ return metadata;
474
+ }
475
+ return __customerUpdateSubscriptionPaymentMethod;
476
+ }
477
+ export function customerAllowedActions(payload) {
478
+ function __customerAllowedActions({ host }) {
479
+ const metadata = {
480
+ entityFqdn: 'wix.billing.v1.subscription',
481
+ method: 'GET',
482
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.AllowedActions',
483
+ packageName: PACKAGE_NAME,
484
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
485
+ protoPath: '/v1/customer_subscriptions/{id}/allowed_actions',
486
+ data: payload,
487
+ host,
488
+ }),
489
+ params: toURLSearchParams(payload),
490
+ };
491
+ return metadata;
492
+ }
493
+ return __customerAllowedActions;
494
+ }
495
+ /** List future subscriptions charges. */
496
+ export function customerListUpcomingCharges(payload) {
497
+ function __customerListUpcomingCharges({ host }) {
498
+ const metadata = {
499
+ entityFqdn: 'wix.billing.v1.subscription',
500
+ method: 'GET',
501
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.ListUpcomingCharges',
502
+ packageName: PACKAGE_NAME,
503
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
504
+ protoPath: '/v1/customer_subscriptions/{id}/upcoming_charges',
505
+ data: payload,
506
+ host,
507
+ }),
508
+ params: toURLSearchParams(payload),
509
+ transformResponse: (payload) => transformPaths(payload, [
510
+ {
511
+ transformFn: transformRESTTimestampToSDKTimestamp,
512
+ paths: [{ path: 'upcomingCharge.billingDate' }],
513
+ },
514
+ ]),
515
+ };
516
+ return metadata;
517
+ }
518
+ return __customerListUpcomingCharges;
519
+ }
520
+ /** Creates auto-charge order that can be paid by customer */
521
+ export function customerInitiatePaymentMethodSetup(payload) {
522
+ function __customerInitiatePaymentMethodSetup({ host }) {
523
+ const metadata = {
524
+ entityFqdn: 'wix.billing.v1.subscription',
525
+ method: 'POST',
526
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.InitiatePaymentMethodSetup',
527
+ packageName: PACKAGE_NAME,
528
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
529
+ protoPath: '/v1/customer_subscriptions/{id}/payment_method_setup',
530
+ data: payload,
531
+ host,
532
+ }),
533
+ data: payload,
534
+ };
535
+ return metadata;
536
+ }
537
+ return __customerInitiatePaymentMethodSetup;
538
+ }
539
+ /** This used only for automation and permitted tenants (QA & testing) */
540
+ export function payCycle(payload) {
541
+ function __payCycle({ host }) {
542
+ const metadata = {
543
+ entityFqdn: 'wix.billing.v1.subscription',
544
+ method: 'POST',
545
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle',
546
+ packageName: PACKAGE_NAME,
547
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsBackOfficeServiceUrl({
548
+ protoPath: '/v1/subscriptions-bo/{subscriptionId}/pay-cycle',
549
+ data: payload,
550
+ host,
551
+ }),
552
+ data: payload,
553
+ transformResponse: (payload) => transformPaths(payload, [
554
+ {
555
+ transformFn: transformRESTTimestampToSDKTimestamp,
556
+ paths: [
557
+ { path: 'subscription.createdDate' },
558
+ { path: 'subscription.updatedDate' },
559
+ { path: 'subscription.startDate' },
560
+ { path: 'subscription.endDate' },
561
+ { path: 'subscription.billingStatus.nextBillingDate' },
562
+ { path: 'subscription.billingStatus.previousBillingDate' },
236
563
  {
237
- path: 'historyEntries.event.updated.current.pauseInfo.resumeDate',
564
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
238
565
  },
566
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
567
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
239
568
  {
240
- path: 'historyEntries.event.updated.current.cancellationInfo.cancellationDate',
569
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
241
570
  },
571
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
572
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
573
+ { path: 'subscription.pauseInfo.startDate' },
574
+ { path: 'subscription.pauseInfo.resumeDate' },
575
+ { path: 'subscription.cancellationInfo.cancellationDate' },
242
576
  {
243
- path: 'historyEntries.event.updated.current.specificDatePendingUpdateData.executionDate',
577
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
244
578
  },
245
- { path: 'historyEntries.event.updated.previous.createdDate' },
246
- { path: 'historyEntries.event.updated.previous.updatedDate' },
247
- { path: 'historyEntries.event.updated.previous.startDate' },
248
- { path: 'historyEntries.event.updated.previous.endDate' },
579
+ ],
580
+ },
581
+ ]),
582
+ };
583
+ return metadata;
584
+ }
585
+ return __payCycle;
586
+ }
587
+ /** Returns a single subscription by its id */
588
+ export function getSubscription(payload) {
589
+ function __getSubscription({ host }) {
590
+ const metadata = {
591
+ entityFqdn: 'wix.billing.v1.subscription',
592
+ method: 'GET',
593
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.GetSubscription',
594
+ packageName: PACKAGE_NAME,
595
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
596
+ protoPath: '/v1/subscriptions/{id}',
597
+ data: payload,
598
+ host,
599
+ }),
600
+ params: toURLSearchParams(payload),
601
+ transformResponse: (payload) => transformPaths(payload, [
602
+ {
603
+ transformFn: transformRESTTimestampToSDKTimestamp,
604
+ paths: [
605
+ { path: 'subscription.createdDate' },
606
+ { path: 'subscription.updatedDate' },
607
+ { path: 'subscription.startDate' },
608
+ { path: 'subscription.endDate' },
609
+ { path: 'subscription.billingStatus.nextBillingDate' },
610
+ { path: 'subscription.billingStatus.previousBillingDate' },
249
611
  {
250
- path: 'historyEntries.event.updated.previous.billingStatus.nextBillingDate',
612
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
251
613
  },
614
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
615
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
252
616
  {
253
- path: 'historyEntries.event.updated.previous.billingStatus.previousBillingDate',
617
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
254
618
  },
619
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
620
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
621
+ { path: 'subscription.pauseInfo.startDate' },
622
+ { path: 'subscription.pauseInfo.resumeDate' },
623
+ { path: 'subscription.cancellationInfo.cancellationDate' },
255
624
  {
256
- path: 'historyEntries.event.updated.previous.billingStatus.latestPaymentData.initialFailedPaymentDate',
625
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
257
626
  },
627
+ ],
628
+ },
629
+ ]),
630
+ };
631
+ return metadata;
632
+ }
633
+ return __getSubscription;
634
+ }
635
+ /**
636
+ * Update subscription's payment method.
637
+ * Supported only for recurring subscriptions or one time subscriptions during free trial.
638
+ */
639
+ export function updateSubscriptionPaymentMethod(payload) {
640
+ function __updateSubscriptionPaymentMethod({ host }) {
641
+ const metadata = {
642
+ entityFqdn: 'wix.billing.v1.subscription',
643
+ method: 'PATCH',
644
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.UpdateSubscriptionPaymentMethod',
645
+ packageName: PACKAGE_NAME,
646
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
647
+ protoPath: '/v1/subscriptions/{id}/payment_method',
648
+ data: payload,
649
+ host,
650
+ }),
651
+ data: payload,
652
+ transformResponse: (payload) => transformPaths(payload, [
653
+ {
654
+ transformFn: transformRESTTimestampToSDKTimestamp,
655
+ paths: [
656
+ { path: 'subscription.createdDate' },
657
+ { path: 'subscription.updatedDate' },
658
+ { path: 'subscription.startDate' },
659
+ { path: 'subscription.endDate' },
660
+ { path: 'subscription.billingStatus.nextBillingDate' },
661
+ { path: 'subscription.billingStatus.previousBillingDate' },
258
662
  {
259
- path: 'historyEntries.event.updated.previous.billingStatus.freeTrialData.startDate',
663
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
260
664
  },
665
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
666
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
261
667
  {
262
- path: 'historyEntries.event.updated.previous.billingStatus.freeTrialData.endDate',
668
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
263
669
  },
670
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
671
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
672
+ { path: 'subscription.pauseInfo.startDate' },
673
+ { path: 'subscription.pauseInfo.resumeDate' },
674
+ { path: 'subscription.cancellationInfo.cancellationDate' },
264
675
  {
265
- path: 'historyEntries.event.updated.previous.billingStatus.updateBillingDateData.paidUntil',
266
- },
267
- {
268
- path: 'historyEntries.event.updated.previous.billingStatus.gracePeriodData.startDate',
269
- },
270
- {
271
- path: 'historyEntries.event.updated.previous.billingStatus.gracePeriodData.endDate',
272
- },
273
- {
274
- path: 'historyEntries.event.updated.previous.pauseInfo.startDate',
275
- },
276
- {
277
- path: 'historyEntries.event.updated.previous.pauseInfo.resumeDate',
278
- },
279
- {
280
- path: 'historyEntries.event.updated.previous.cancellationInfo.cancellationDate',
281
- },
282
- {
283
- path: 'historyEntries.event.updated.previous.specificDatePendingUpdateData.executionDate',
284
- },
285
- {
286
- path: 'historyEntries.event.activated.subscription.createdDate',
287
- },
288
- {
289
- path: 'historyEntries.event.activated.subscription.updatedDate',
290
- },
291
- { path: 'historyEntries.event.activated.subscription.startDate' },
292
- { path: 'historyEntries.event.activated.subscription.endDate' },
293
- {
294
- path: 'historyEntries.event.activated.subscription.billingStatus.nextBillingDate',
676
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
295
677
  },
678
+ ],
679
+ },
680
+ ]),
681
+ };
682
+ return metadata;
683
+ }
684
+ return __updateSubscriptionPaymentMethod;
685
+ }
686
+ /**
687
+ * Updates the next billing date for a subscription.
688
+ *
689
+ *
690
+ * Updating the billing date may add a proration charge or credit to the next
691
+ * invoice. The customer must pay more in case you extend the current billing
692
+ * cycle. They pay less in case you shorten the current billing cycle. You can
693
+ * choose whether BASS automatically calculates the proration amount based on
694
+ * the number of days added to or removed from the current billing cycle.
695
+ * Alternatively, you can pass a proration amount based on your own custom
696
+ * calculation. The custom proration amount can't exceed the total of the
697
+ * current billing cycle.
698
+ */
699
+ export function updateSubscriptionBillingDate(payload) {
700
+ function __updateSubscriptionBillingDate({ host }) {
701
+ const serializedData = transformPaths(payload, [
702
+ {
703
+ transformFn: transformSDKTimestampToRESTTimestamp,
704
+ paths: [{ path: 'billingDate' }],
705
+ },
706
+ ]);
707
+ const metadata = {
708
+ entityFqdn: 'wix.billing.v1.subscription',
709
+ method: 'PATCH',
710
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.UpdateSubscriptionBillingDate',
711
+ packageName: PACKAGE_NAME,
712
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
713
+ protoPath: '/v1/subscriptions/{id}/update-billing-date',
714
+ data: serializedData,
715
+ host,
716
+ }),
717
+ data: serializedData,
718
+ transformResponse: (payload) => transformPaths(payload, [
719
+ {
720
+ transformFn: transformRESTTimestampToSDKTimestamp,
721
+ paths: [
722
+ { path: 'subscription.createdDate' },
723
+ { path: 'subscription.updatedDate' },
724
+ { path: 'subscription.startDate' },
725
+ { path: 'subscription.endDate' },
726
+ { path: 'subscription.billingStatus.nextBillingDate' },
727
+ { path: 'subscription.billingStatus.previousBillingDate' },
296
728
  {
297
- path: 'historyEntries.event.activated.subscription.billingStatus.previousBillingDate',
729
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
298
730
  },
731
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
732
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
299
733
  {
300
- path: 'historyEntries.event.activated.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
734
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
301
735
  },
736
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
737
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
738
+ { path: 'subscription.pauseInfo.startDate' },
739
+ { path: 'subscription.pauseInfo.resumeDate' },
740
+ { path: 'subscription.cancellationInfo.cancellationDate' },
302
741
  {
303
- path: 'historyEntries.event.activated.subscription.billingStatus.freeTrialData.startDate',
742
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
304
743
  },
744
+ ],
745
+ },
746
+ ]),
747
+ };
748
+ return metadata;
749
+ }
750
+ return __updateSubscriptionBillingDate;
751
+ }
752
+ /**
753
+ * Cancels subscription immediately. Can be canceled by member if subscription policy allows it
754
+ * Only PENDING, ACTIVE or PAUSED subscriptions can be canceled
755
+ */
756
+ export function cancelSubscription(payload) {
757
+ function __cancelSubscription({ host }) {
758
+ const metadata = {
759
+ entityFqdn: 'wix.billing.v1.subscription',
760
+ method: 'POST',
761
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.CancelSubscription',
762
+ packageName: PACKAGE_NAME,
763
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
764
+ protoPath: '/v1/subscriptions/{id}/cancel',
765
+ data: payload,
766
+ host,
767
+ }),
768
+ data: payload,
769
+ transformResponse: (payload) => transformPaths(payload, [
770
+ {
771
+ transformFn: transformRESTTimestampToSDKTimestamp,
772
+ paths: [
773
+ { path: 'subscription.createdDate' },
774
+ { path: 'subscription.updatedDate' },
775
+ { path: 'subscription.startDate' },
776
+ { path: 'subscription.endDate' },
777
+ { path: 'subscription.billingStatus.nextBillingDate' },
778
+ { path: 'subscription.billingStatus.previousBillingDate' },
305
779
  {
306
- path: 'historyEntries.event.activated.subscription.billingStatus.freeTrialData.endDate',
780
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
307
781
  },
782
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
783
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
308
784
  {
309
- path: 'historyEntries.event.activated.subscription.billingStatus.updateBillingDateData.paidUntil',
785
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
310
786
  },
787
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
788
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
789
+ { path: 'subscription.pauseInfo.startDate' },
790
+ { path: 'subscription.pauseInfo.resumeDate' },
791
+ { path: 'subscription.cancellationInfo.cancellationDate' },
311
792
  {
312
- path: 'historyEntries.event.activated.subscription.billingStatus.gracePeriodData.startDate',
793
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
313
794
  },
795
+ ],
796
+ },
797
+ ]),
798
+ };
799
+ return metadata;
800
+ }
801
+ return __cancelSubscription;
802
+ }
803
+ /** Pauses subscription now or in future. Possible to pause also payments schedule. */
804
+ export function pauseSubscription(payload) {
805
+ function __pauseSubscription({ host }) {
806
+ const serializedData = transformPaths(payload, [
807
+ {
808
+ transformFn: transformSDKTimestampToRESTTimestamp,
809
+ paths: [
810
+ { path: 'pauseAtSchedule.specificDate' },
811
+ { path: 'autoResumeAtSchedule.specificDate' },
812
+ ],
813
+ },
814
+ ]);
815
+ const metadata = {
816
+ entityFqdn: 'wix.billing.v1.subscription',
817
+ method: 'POST',
818
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PauseSubscription',
819
+ packageName: PACKAGE_NAME,
820
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
821
+ protoPath: '/v1/subscriptions/{id}/pause',
822
+ data: serializedData,
823
+ host,
824
+ }),
825
+ data: serializedData,
826
+ transformResponse: (payload) => transformPaths(payload, [
827
+ {
828
+ transformFn: transformRESTTimestampToSDKTimestamp,
829
+ paths: [
830
+ { path: 'subscription.createdDate' },
831
+ { path: 'subscription.updatedDate' },
832
+ { path: 'subscription.startDate' },
833
+ { path: 'subscription.endDate' },
834
+ { path: 'subscription.billingStatus.nextBillingDate' },
835
+ { path: 'subscription.billingStatus.previousBillingDate' },
314
836
  {
315
- path: 'historyEntries.event.activated.subscription.billingStatus.gracePeriodData.endDate',
837
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
316
838
  },
839
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
840
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
317
841
  {
318
- path: 'historyEntries.event.activated.subscription.pauseInfo.startDate',
842
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
319
843
  },
844
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
845
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
846
+ { path: 'subscription.pauseInfo.startDate' },
847
+ { path: 'subscription.pauseInfo.resumeDate' },
848
+ { path: 'subscription.cancellationInfo.cancellationDate' },
320
849
  {
321
- path: 'historyEntries.event.activated.subscription.pauseInfo.resumeDate',
850
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
322
851
  },
852
+ ],
853
+ },
854
+ ]),
855
+ };
856
+ return metadata;
857
+ }
858
+ return __pauseSubscription;
859
+ }
860
+ /** Resumes paused subscription now or in future. */
861
+ export function resumeSubscription(payload) {
862
+ function __resumeSubscription({ host }) {
863
+ const serializedData = transformPaths(payload, [
864
+ {
865
+ transformFn: transformSDKTimestampToRESTTimestamp,
866
+ paths: [{ path: 'resumeAtSchedule.specificDate' }],
867
+ },
868
+ ]);
869
+ const metadata = {
870
+ entityFqdn: 'wix.billing.v1.subscription',
871
+ method: 'POST',
872
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ResumeSubscription',
873
+ packageName: PACKAGE_NAME,
874
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
875
+ protoPath: '/v1/subscriptions/{id}/resume',
876
+ data: serializedData,
877
+ host,
878
+ }),
879
+ data: serializedData,
880
+ transformResponse: (payload) => transformPaths(payload, [
881
+ {
882
+ transformFn: transformRESTTimestampToSDKTimestamp,
883
+ paths: [
884
+ { path: 'subscription.createdDate' },
885
+ { path: 'subscription.updatedDate' },
886
+ { path: 'subscription.startDate' },
887
+ { path: 'subscription.endDate' },
888
+ { path: 'subscription.billingStatus.nextBillingDate' },
889
+ { path: 'subscription.billingStatus.previousBillingDate' },
323
890
  {
324
- path: 'historyEntries.event.activated.subscription.cancellationInfo.cancellationDate',
891
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
325
892
  },
893
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
894
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
326
895
  {
327
- path: 'historyEntries.event.activated.subscription.specificDatePendingUpdateData.executionDate',
896
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
328
897
  },
329
- { path: 'historyEntries.event.ended.subscription.createdDate' },
330
- { path: 'historyEntries.event.ended.subscription.updatedDate' },
331
- { path: 'historyEntries.event.ended.subscription.startDate' },
332
- { path: 'historyEntries.event.ended.subscription.endDate' },
898
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
899
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
900
+ { path: 'subscription.pauseInfo.startDate' },
901
+ { path: 'subscription.pauseInfo.resumeDate' },
902
+ { path: 'subscription.cancellationInfo.cancellationDate' },
333
903
  {
334
- path: 'historyEntries.event.ended.subscription.billingStatus.nextBillingDate',
335
- },
336
- {
337
- path: 'historyEntries.event.ended.subscription.billingStatus.previousBillingDate',
338
- },
339
- {
340
- path: 'historyEntries.event.ended.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
341
- },
342
- {
343
- path: 'historyEntries.event.ended.subscription.billingStatus.freeTrialData.startDate',
344
- },
345
- {
346
- path: 'historyEntries.event.ended.subscription.billingStatus.freeTrialData.endDate',
347
- },
348
- {
349
- path: 'historyEntries.event.ended.subscription.billingStatus.updateBillingDateData.paidUntil',
350
- },
351
- {
352
- path: 'historyEntries.event.ended.subscription.billingStatus.gracePeriodData.startDate',
353
- },
354
- {
355
- path: 'historyEntries.event.ended.subscription.billingStatus.gracePeriodData.endDate',
356
- },
357
- {
358
- path: 'historyEntries.event.ended.subscription.pauseInfo.startDate',
359
- },
360
- {
361
- path: 'historyEntries.event.ended.subscription.pauseInfo.resumeDate',
362
- },
363
- {
364
- path: 'historyEntries.event.ended.subscription.cancellationInfo.cancellationDate',
904
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
365
905
  },
906
+ ],
907
+ },
908
+ ]),
909
+ };
910
+ return metadata;
911
+ }
912
+ return __resumeSubscription;
913
+ }
914
+ /**
915
+ * Lists subscriptions based on specified filters.
916
+ * By default non-draft subscriptions returned.
917
+ */
918
+ export function querySubscriptions(payload) {
919
+ function __querySubscriptions({ host }) {
920
+ const metadata = {
921
+ entityFqdn: 'wix.billing.v1.subscription',
922
+ method: 'POST',
923
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.QuerySubscriptions',
924
+ packageName: PACKAGE_NAME,
925
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
926
+ protoPath: '/v1/subscriptions/query',
927
+ data: payload,
928
+ host,
929
+ }),
930
+ data: payload,
931
+ transformResponse: (payload) => transformPaths(payload, [
932
+ {
933
+ transformFn: transformRESTTimestampToSDKTimestamp,
934
+ paths: [
935
+ { path: 'subscriptions.createdDate' },
936
+ { path: 'subscriptions.updatedDate' },
937
+ { path: 'subscriptions.startDate' },
938
+ { path: 'subscriptions.endDate' },
939
+ { path: 'subscriptions.billingStatus.nextBillingDate' },
940
+ { path: 'subscriptions.billingStatus.previousBillingDate' },
366
941
  {
367
- path: 'historyEntries.event.ended.subscription.specificDatePendingUpdateData.executionDate',
942
+ path: 'subscriptions.billingStatus.latestPaymentData.initialFailedPaymentDate',
368
943
  },
944
+ { path: 'subscriptions.billingStatus.freeTrialData.startDate' },
945
+ { path: 'subscriptions.billingStatus.freeTrialData.endDate' },
369
946
  {
370
- path: 'historyEntries.event.canceled.subscription.createdDate',
947
+ path: 'subscriptions.billingStatus.updateBillingDateData.paidUntil',
371
948
  },
949
+ { path: 'subscriptions.billingStatus.gracePeriodData.startDate' },
950
+ { path: 'subscriptions.billingStatus.gracePeriodData.endDate' },
951
+ { path: 'subscriptions.pauseInfo.startDate' },
952
+ { path: 'subscriptions.pauseInfo.resumeDate' },
953
+ { path: 'subscriptions.cancellationInfo.cancellationDate' },
372
954
  {
373
- path: 'historyEntries.event.canceled.subscription.updatedDate',
955
+ path: 'subscriptions.specificDatePendingUpdateData.executionDate',
374
956
  },
375
- { path: 'historyEntries.event.canceled.subscription.startDate' },
376
- { path: 'historyEntries.event.canceled.subscription.endDate' },
957
+ ],
958
+ },
959
+ ]),
960
+ };
961
+ return metadata;
962
+ }
963
+ return __querySubscriptions;
964
+ }
965
+ export function searchSubscriptions(payload) {
966
+ function __searchSubscriptions({ host }) {
967
+ const metadata = {
968
+ entityFqdn: 'wix.billing.v1.subscription',
969
+ method: 'POST',
970
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.SearchSubscriptions',
971
+ packageName: PACKAGE_NAME,
972
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
973
+ protoPath: '/v1/subscriptions/search',
974
+ data: payload,
975
+ host,
976
+ }),
977
+ data: payload,
978
+ transformResponse: (payload) => transformPaths(payload, [
979
+ {
980
+ transformFn: transformRESTTimestampToSDKTimestamp,
981
+ paths: [
982
+ { path: 'subscriptions.createdDate' },
983
+ { path: 'subscriptions.updatedDate' },
984
+ { path: 'subscriptions.startDate' },
985
+ { path: 'subscriptions.endDate' },
986
+ { path: 'subscriptions.billingStatus.nextBillingDate' },
987
+ { path: 'subscriptions.billingStatus.previousBillingDate' },
377
988
  {
378
- path: 'historyEntries.event.canceled.subscription.billingStatus.nextBillingDate',
989
+ path: 'subscriptions.billingStatus.latestPaymentData.initialFailedPaymentDate',
379
990
  },
991
+ { path: 'subscriptions.billingStatus.freeTrialData.startDate' },
992
+ { path: 'subscriptions.billingStatus.freeTrialData.endDate' },
380
993
  {
381
- path: 'historyEntries.event.canceled.subscription.billingStatus.previousBillingDate',
994
+ path: 'subscriptions.billingStatus.updateBillingDateData.paidUntil',
382
995
  },
996
+ { path: 'subscriptions.billingStatus.gracePeriodData.startDate' },
997
+ { path: 'subscriptions.billingStatus.gracePeriodData.endDate' },
998
+ { path: 'subscriptions.pauseInfo.startDate' },
999
+ { path: 'subscriptions.pauseInfo.resumeDate' },
1000
+ { path: 'subscriptions.cancellationInfo.cancellationDate' },
383
1001
  {
384
- path: 'historyEntries.event.canceled.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1002
+ path: 'subscriptions.specificDatePendingUpdateData.executionDate',
385
1003
  },
1004
+ ],
1005
+ },
1006
+ ]),
1007
+ };
1008
+ return metadata;
1009
+ }
1010
+ return __searchSubscriptions;
1011
+ }
1012
+ /**
1013
+ * Counts subscriptions given the provided filters. Returns the total number
1014
+ * of subscriptions matching the filters and a count per status.
1015
+ *
1016
+ *
1017
+ * You can either pass a list of statuses or a `statusGroup`, which is a
1018
+ * pre-defined combination of statuses.
1019
+ *
1020
+ * If you don't provide any filters, all subscription statuses with the
1021
+ * exception of `"DRAFT"` are counted.
1022
+ *
1023
+ * You may also specify a `customerId` as filter. Then, only subscriptions for
1024
+ * this customer are counted. When providing a `customerId`, you must also
1025
+ * specify a `paymentMethodId`.
1026
+ */
1027
+ export function countSubscriptions(payload) {
1028
+ function __countSubscriptions({ host }) {
1029
+ const metadata = {
1030
+ entityFqdn: 'wix.billing.v1.subscription',
1031
+ method: 'POST',
1032
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.CountSubscriptions',
1033
+ packageName: PACKAGE_NAME,
1034
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1035
+ protoPath: '/v1/subscriptions/count',
1036
+ data: payload,
1037
+ host,
1038
+ }),
1039
+ data: payload,
1040
+ };
1041
+ return metadata;
1042
+ }
1043
+ return __countSubscriptions;
1044
+ }
1045
+ /**
1046
+ * Turn on auto-renew subscription in case auto-renew was turned off. The operation changes back cycle_auto_renew
1047
+ * to true, which will ensure subscription billing will continue. Also cancellation info holding information about
1048
+ * auto renew off will be cleared.
1049
+ */
1050
+ export function turnOnSubscriptionAutoRenewal(payload) {
1051
+ function __turnOnSubscriptionAutoRenewal({ host }) {
1052
+ const metadata = {
1053
+ entityFqdn: 'wix.billing.v1.subscription',
1054
+ method: 'PATCH',
1055
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.TurnOnSubscriptionAutoRenewal',
1056
+ packageName: PACKAGE_NAME,
1057
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1058
+ protoPath: '/v1/subscriptions/{id}/turn_on_auto_renewal',
1059
+ data: payload,
1060
+ host,
1061
+ }),
1062
+ data: payload,
1063
+ transformResponse: (payload) => transformPaths(payload, [
1064
+ {
1065
+ transformFn: transformRESTTimestampToSDKTimestamp,
1066
+ paths: [
1067
+ { path: 'subscription.createdDate' },
1068
+ { path: 'subscription.updatedDate' },
1069
+ { path: 'subscription.startDate' },
1070
+ { path: 'subscription.endDate' },
1071
+ { path: 'subscription.billingStatus.nextBillingDate' },
1072
+ { path: 'subscription.billingStatus.previousBillingDate' },
386
1073
  {
387
- path: 'historyEntries.event.canceled.subscription.billingStatus.freeTrialData.startDate',
1074
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
388
1075
  },
1076
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
1077
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
389
1078
  {
390
- path: 'historyEntries.event.canceled.subscription.billingStatus.freeTrialData.endDate',
1079
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
391
1080
  },
1081
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
1082
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
1083
+ { path: 'subscription.pauseInfo.startDate' },
1084
+ { path: 'subscription.pauseInfo.resumeDate' },
1085
+ { path: 'subscription.cancellationInfo.cancellationDate' },
392
1086
  {
393
- path: 'historyEntries.event.canceled.subscription.billingStatus.updateBillingDateData.paidUntil',
1087
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
394
1088
  },
1089
+ ],
1090
+ },
1091
+ ]),
1092
+ };
1093
+ return metadata;
1094
+ }
1095
+ return __turnOnSubscriptionAutoRenewal;
1096
+ }
1097
+ /**
1098
+ * Turn off auto-renew of subscription. At next billing date subscription will be canceled.
1099
+ * Billing settings flag cycle_auto_renew is set to false and information about this operation stored
1100
+ * in cancellation info for future usage in cancellation.
1101
+ */
1102
+ export function turnOffSubscriptionAutoRenewal(payload) {
1103
+ function __turnOffSubscriptionAutoRenewal({ host }) {
1104
+ const metadata = {
1105
+ entityFqdn: 'wix.billing.v1.subscription',
1106
+ method: 'PATCH',
1107
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.TurnOffSubscriptionAutoRenewal',
1108
+ packageName: PACKAGE_NAME,
1109
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1110
+ protoPath: '/v1/subscriptions/{id}/turn_off_auto_renewal',
1111
+ data: payload,
1112
+ host,
1113
+ }),
1114
+ data: payload,
1115
+ transformResponse: (payload) => transformPaths(payload, [
1116
+ {
1117
+ transformFn: transformRESTTimestampToSDKTimestamp,
1118
+ paths: [
1119
+ { path: 'subscription.createdDate' },
1120
+ { path: 'subscription.updatedDate' },
1121
+ { path: 'subscription.startDate' },
1122
+ { path: 'subscription.endDate' },
1123
+ { path: 'subscription.billingStatus.nextBillingDate' },
1124
+ { path: 'subscription.billingStatus.previousBillingDate' },
395
1125
  {
396
- path: 'historyEntries.event.canceled.subscription.billingStatus.gracePeriodData.startDate',
1126
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
397
1127
  },
1128
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
1129
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
398
1130
  {
399
- path: 'historyEntries.event.canceled.subscription.billingStatus.gracePeriodData.endDate',
1131
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
400
1132
  },
1133
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
1134
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
1135
+ { path: 'subscription.pauseInfo.startDate' },
1136
+ { path: 'subscription.pauseInfo.resumeDate' },
1137
+ { path: 'subscription.cancellationInfo.cancellationDate' },
401
1138
  {
402
- path: 'historyEntries.event.canceled.subscription.pauseInfo.startDate',
1139
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
403
1140
  },
404
- {
1141
+ ],
1142
+ },
1143
+ ]),
1144
+ };
1145
+ return metadata;
1146
+ }
1147
+ return __turnOffSubscriptionAutoRenewal;
1148
+ }
1149
+ /**
1150
+ * Marks the last invoice as paid used for the following scenarios:
1151
+ * * Offline subscriptions.
1152
+ * * Online subscriptions during grace period. The operation will convert invoice to offline, remove grace period
1153
+ * and will send BillingCycleStarted event after invoice closing.
1154
+ * * Online one time payment subscription with total price of zero during purchase flow.
1155
+ * Activated event will be sent after invoice closing and subscription will be activated.
1156
+ * @deprecated It has been replaced with com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid(), and will be removed on 2025-09-30.
1157
+ */
1158
+ export function markLatestInvoiceAsPaid(payload) {
1159
+ function __markLatestInvoiceAsPaid({ host }) {
1160
+ const metadata = {
1161
+ entityFqdn: 'wix.billing.v1.subscription',
1162
+ method: 'POST',
1163
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkLatestInvoiceAsPaid',
1164
+ packageName: PACKAGE_NAME,
1165
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1166
+ protoPath: '/v1/subscriptions/{subscriptionId}/mark-latest-invoice-as-paid',
1167
+ data: payload,
1168
+ host,
1169
+ }),
1170
+ data: payload,
1171
+ transformResponse: (payload) => transformPaths(payload, [
1172
+ {
1173
+ transformFn: transformRESTTimestampToSDKTimestamp,
1174
+ paths: [
1175
+ { path: 'subscription.createdDate' },
1176
+ { path: 'subscription.updatedDate' },
1177
+ { path: 'subscription.startDate' },
1178
+ { path: 'subscription.endDate' },
1179
+ { path: 'subscription.billingStatus.nextBillingDate' },
1180
+ { path: 'subscription.billingStatus.previousBillingDate' },
1181
+ {
1182
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1183
+ },
1184
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
1185
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
1186
+ {
1187
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
1188
+ },
1189
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
1190
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
1191
+ { path: 'subscription.pauseInfo.startDate' },
1192
+ { path: 'subscription.pauseInfo.resumeDate' },
1193
+ { path: 'subscription.cancellationInfo.cancellationDate' },
1194
+ {
1195
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
1196
+ },
1197
+ ],
1198
+ },
1199
+ ]),
1200
+ };
1201
+ return metadata;
1202
+ }
1203
+ return __markLatestInvoiceAsPaid;
1204
+ }
1205
+ /**
1206
+ * Marks the invoice associated with given subscription cycle as paid for the following scenarios:
1207
+ * If `paid_cycle` is left empty, the most recent invoice will be marked as paid.
1208
+ * If the invoice contains items other than subscription items, an error will be thrown.
1209
+ *
1210
+ * Marks the invoice as paid for the following scenarios:
1211
+ * 1. Offline subscriptions.
1212
+ * 2. Online subscriptions during the grace period.
1213
+ * This operation will convert the invoice to offline, remove the grace period,
1214
+ * and send a BillingCycleStarted event after the invoice is closed.
1215
+ * 3. Online one-time payment subscriptions with a total price of zero during the purchase flow.
1216
+ * An Activated event will be sent after the invoice is closed, and the subscription will be activated.
1217
+ * 4. For external subscriptions, where the payment occurs outside of BASS, an invoice is created and marked as paid
1218
+ */
1219
+ export function markBillingCycleAsPaid(payload) {
1220
+ function __markBillingCycleAsPaid({ host }) {
1221
+ const metadata = {
1222
+ entityFqdn: 'wix.billing.v1.subscription',
1223
+ method: 'POST',
1224
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkBillingCycleAsPaid',
1225
+ packageName: PACKAGE_NAME,
1226
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1227
+ protoPath: '/v1/subscriptions/{subscriptionId}/mark-cycle-as-paid',
1228
+ data: payload,
1229
+ host,
1230
+ }),
1231
+ data: payload,
1232
+ transformResponse: (payload) => transformPaths(payload, [
1233
+ {
1234
+ transformFn: transformRESTTimestampToSDKTimestamp,
1235
+ paths: [
1236
+ { path: 'subscription.createdDate' },
1237
+ { path: 'subscription.updatedDate' },
1238
+ { path: 'subscription.startDate' },
1239
+ { path: 'subscription.endDate' },
1240
+ { path: 'subscription.billingStatus.nextBillingDate' },
1241
+ { path: 'subscription.billingStatus.previousBillingDate' },
1242
+ {
1243
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1244
+ },
1245
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
1246
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
1247
+ {
1248
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
1249
+ },
1250
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
1251
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
1252
+ { path: 'subscription.pauseInfo.startDate' },
1253
+ { path: 'subscription.pauseInfo.resumeDate' },
1254
+ { path: 'subscription.cancellationInfo.cancellationDate' },
1255
+ {
1256
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
1257
+ },
1258
+ ],
1259
+ },
1260
+ ]),
1261
+ };
1262
+ return metadata;
1263
+ }
1264
+ return __markBillingCycleAsPaid;
1265
+ }
1266
+ /** Returns number of subscriptions in each state. */
1267
+ export function getSubscriptionsStats(payload) {
1268
+ function __getSubscriptionsStats({ host }) {
1269
+ const metadata = {
1270
+ entityFqdn: 'wix.billing.v1.subscription',
1271
+ method: 'GET',
1272
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.GetSubscriptionsStats',
1273
+ packageName: PACKAGE_NAME,
1274
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1275
+ protoPath: '/v1/subscriptions/stats',
1276
+ data: payload,
1277
+ host,
1278
+ }),
1279
+ params: toURLSearchParams(payload),
1280
+ };
1281
+ return metadata;
1282
+ }
1283
+ return __getSubscriptionsStats;
1284
+ }
1285
+ /** Extends subscription by moving end date with or without billing cycles addition. */
1286
+ export function extendSubscription(payload) {
1287
+ function __extendSubscription({ host }) {
1288
+ const metadata = {
1289
+ entityFqdn: 'wix.billing.v1.subscription',
1290
+ method: 'PATCH',
1291
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ExtendSubscription',
1292
+ packageName: PACKAGE_NAME,
1293
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1294
+ protoPath: '/v1/subscriptions/{id}/extend',
1295
+ data: payload,
1296
+ host,
1297
+ }),
1298
+ data: payload,
1299
+ transformResponse: (payload) => transformPaths(payload, [
1300
+ {
1301
+ transformFn: transformRESTTimestampToSDKTimestamp,
1302
+ paths: [
1303
+ { path: 'subscription.createdDate' },
1304
+ { path: 'subscription.updatedDate' },
1305
+ { path: 'subscription.startDate' },
1306
+ { path: 'subscription.endDate' },
1307
+ { path: 'subscription.billingStatus.nextBillingDate' },
1308
+ { path: 'subscription.billingStatus.previousBillingDate' },
1309
+ {
1310
+ path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1311
+ },
1312
+ { path: 'subscription.billingStatus.freeTrialData.startDate' },
1313
+ { path: 'subscription.billingStatus.freeTrialData.endDate' },
1314
+ {
1315
+ path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
1316
+ },
1317
+ { path: 'subscription.billingStatus.gracePeriodData.startDate' },
1318
+ { path: 'subscription.billingStatus.gracePeriodData.endDate' },
1319
+ { path: 'subscription.pauseInfo.startDate' },
1320
+ { path: 'subscription.pauseInfo.resumeDate' },
1321
+ { path: 'subscription.cancellationInfo.cancellationDate' },
1322
+ {
1323
+ path: 'subscription.specificDatePendingUpdateData.executionDate',
1324
+ },
1325
+ ],
1326
+ },
1327
+ ]),
1328
+ };
1329
+ return metadata;
1330
+ }
1331
+ return __extendSubscription;
1332
+ }
1333
+ export function allowedActions(payload) {
1334
+ function __allowedActions({ host }) {
1335
+ const metadata = {
1336
+ entityFqdn: 'wix.billing.v1.subscription',
1337
+ method: 'GET',
1338
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.AllowedActions',
1339
+ packageName: PACKAGE_NAME,
1340
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1341
+ protoPath: '/v1/subscriptions/{id}/allowed_actions',
1342
+ data: payload,
1343
+ host,
1344
+ }),
1345
+ params: toURLSearchParams(payload),
1346
+ };
1347
+ return metadata;
1348
+ }
1349
+ return __allowedActions;
1350
+ }
1351
+ /** List future subscriptions charges */
1352
+ export function listUpcomingCharges(payload) {
1353
+ function __listUpcomingCharges({ host }) {
1354
+ const serializedData = transformPaths(payload, [
1355
+ {
1356
+ transformFn: transformSDKTimestampToRESTTimestamp,
1357
+ paths: [{ path: 'nextBillingDate' }],
1358
+ },
1359
+ ]);
1360
+ const metadata = {
1361
+ entityFqdn: 'wix.billing.v1.subscription',
1362
+ method: 'GET',
1363
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ListUpcomingCharges',
1364
+ packageName: PACKAGE_NAME,
1365
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1366
+ protoPath: '/v1/subscriptions/{subscriptionId}/upcoming_charges',
1367
+ data: serializedData,
1368
+ host,
1369
+ }),
1370
+ params: toURLSearchParams(serializedData),
1371
+ transformResponse: (payload) => transformPaths(payload, [
1372
+ {
1373
+ transformFn: transformRESTTimestampToSDKTimestamp,
1374
+ paths: [{ path: 'upcomingCharges.billingDate' }],
1375
+ },
1376
+ ]),
1377
+ };
1378
+ return metadata;
1379
+ }
1380
+ return __listUpcomingCharges;
1381
+ }
1382
+ /**
1383
+ * Retrieves the preview of subscription charges.
1384
+ * Returns all the charges applicable to a subscription based on the provided subscription information.
1385
+ * @deprecated It has been replaced with com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionsCharges(), and will be removed on 2025-06-30.
1386
+ */
1387
+ export function previewSubscriptionCharges(payload) {
1388
+ function __previewSubscriptionCharges({ host }) {
1389
+ const serializedData = transformPaths(payload, [
1390
+ {
1391
+ transformFn: transformSDKTimestampToRESTTimestamp,
1392
+ paths: [{ path: 'subscriptionInfo.startDate' }],
1393
+ },
1394
+ ]);
1395
+ const metadata = {
1396
+ entityFqdn: 'wix.billing.v1.subscription',
1397
+ method: 'GET',
1398
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionCharges',
1399
+ packageName: PACKAGE_NAME,
1400
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1401
+ protoPath: '/v1/subscriptions/preview_charges',
1402
+ data: serializedData,
1403
+ host,
1404
+ }),
1405
+ params: toURLSearchParams(serializedData),
1406
+ transformResponse: (payload) => transformPaths(payload, [
1407
+ {
1408
+ transformFn: transformRESTTimestampToSDKTimestamp,
1409
+ paths: [{ path: 'charges.cycleBillingDate' }],
1410
+ },
1411
+ ]),
1412
+ };
1413
+ return metadata;
1414
+ }
1415
+ return __previewSubscriptionCharges;
1416
+ }
1417
+ /**
1418
+ * Retrieves the preview of subscription charges for a bulk of subscriptions.
1419
+ * Returns all the charges applicable to all subscriptions, based on the provided subscriptions information.
1420
+ */
1421
+ export function previewSubscriptionsCharges(payload) {
1422
+ function __previewSubscriptionsCharges({ host }) {
1423
+ const serializedData = transformPaths(payload, [
1424
+ {
1425
+ transformFn: transformSDKTimestampToRESTTimestamp,
1426
+ paths: [{ path: 'subscriptionsBillingDetails.startDate' }],
1427
+ },
1428
+ ]);
1429
+ const metadata = {
1430
+ entityFqdn: 'wix.billing.v1.subscription',
1431
+ method: 'GET',
1432
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionsCharges',
1433
+ packageName: PACKAGE_NAME,
1434
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1435
+ protoPath: '/v1/subscriptions/preview-subscriptions-charges',
1436
+ data: serializedData,
1437
+ host,
1438
+ }),
1439
+ params: toURLSearchParams(serializedData),
1440
+ transformResponse: (payload) => transformPaths(payload, [
1441
+ {
1442
+ transformFn: transformRESTTimestampToSDKTimestamp,
1443
+ paths: [{ path: 'subscriptionsCharges.charges.cycleBillingDate' }],
1444
+ },
1445
+ ]),
1446
+ };
1447
+ return metadata;
1448
+ }
1449
+ return __previewSubscriptionsCharges;
1450
+ }
1451
+ /** Creates authorization invoice with Moto settings in order to create */
1452
+ export function initiatePaymentMethodSetup(payload) {
1453
+ function __initiatePaymentMethodSetup({ host }) {
1454
+ const metadata = {
1455
+ entityFqdn: 'wix.billing.v1.subscription',
1456
+ method: 'POST',
1457
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.InitiatePaymentMethodSetup',
1458
+ packageName: PACKAGE_NAME,
1459
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1460
+ protoPath: '/v1/subscriptions/{id}/payment_method_setup',
1461
+ data: payload,
1462
+ host,
1463
+ }),
1464
+ data: payload,
1465
+ };
1466
+ return metadata;
1467
+ }
1468
+ return __initiatePaymentMethodSetup;
1469
+ }
1470
+ export function listSubscriptionHistory(payload) {
1471
+ function __listSubscriptionHistory({ host }) {
1472
+ const metadata = {
1473
+ entityFqdn: 'wix.billing.v1.subscription',
1474
+ method: 'GET',
1475
+ methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionHistoryService.ListSubscriptionHistory',
1476
+ packageName: PACKAGE_NAME,
1477
+ url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionHistoryServiceUrl({
1478
+ protoPath: '/v1/subscriptions/{subscriptionId}/history',
1479
+ data: payload,
1480
+ host,
1481
+ }),
1482
+ params: toURLSearchParams(payload),
1483
+ transformResponse: (payload) => transformPaths(payload, [
1484
+ {
1485
+ transformFn: transformRESTTimestampToSDKTimestamp,
1486
+ paths: [
1487
+ { path: 'historyEntries.entryTime' },
1488
+ { path: 'historyEntries.event.created.subscription.createdDate' },
1489
+ { path: 'historyEntries.event.created.subscription.updatedDate' },
1490
+ { path: 'historyEntries.event.created.subscription.startDate' },
1491
+ { path: 'historyEntries.event.created.subscription.endDate' },
1492
+ {
1493
+ path: 'historyEntries.event.created.subscription.billingStatus.nextBillingDate',
1494
+ },
1495
+ {
1496
+ path: 'historyEntries.event.created.subscription.billingStatus.previousBillingDate',
1497
+ },
1498
+ {
1499
+ path: 'historyEntries.event.created.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1500
+ },
1501
+ {
1502
+ path: 'historyEntries.event.created.subscription.billingStatus.freeTrialData.startDate',
1503
+ },
1504
+ {
1505
+ path: 'historyEntries.event.created.subscription.billingStatus.freeTrialData.endDate',
1506
+ },
1507
+ {
1508
+ path: 'historyEntries.event.created.subscription.billingStatus.updateBillingDateData.paidUntil',
1509
+ },
1510
+ {
1511
+ path: 'historyEntries.event.created.subscription.billingStatus.gracePeriodData.startDate',
1512
+ },
1513
+ {
1514
+ path: 'historyEntries.event.created.subscription.billingStatus.gracePeriodData.endDate',
1515
+ },
1516
+ {
1517
+ path: 'historyEntries.event.created.subscription.pauseInfo.startDate',
1518
+ },
1519
+ {
1520
+ path: 'historyEntries.event.created.subscription.pauseInfo.resumeDate',
1521
+ },
1522
+ {
1523
+ path: 'historyEntries.event.created.subscription.cancellationInfo.cancellationDate',
1524
+ },
1525
+ {
1526
+ path: 'historyEntries.event.created.subscription.specificDatePendingUpdateData.executionDate',
1527
+ },
1528
+ { path: 'historyEntries.event.updated.current.createdDate' },
1529
+ { path: 'historyEntries.event.updated.current.updatedDate' },
1530
+ { path: 'historyEntries.event.updated.current.startDate' },
1531
+ { path: 'historyEntries.event.updated.current.endDate' },
1532
+ {
1533
+ path: 'historyEntries.event.updated.current.billingStatus.nextBillingDate',
1534
+ },
1535
+ {
1536
+ path: 'historyEntries.event.updated.current.billingStatus.previousBillingDate',
1537
+ },
1538
+ {
1539
+ path: 'historyEntries.event.updated.current.billingStatus.latestPaymentData.initialFailedPaymentDate',
1540
+ },
1541
+ {
1542
+ path: 'historyEntries.event.updated.current.billingStatus.freeTrialData.startDate',
1543
+ },
1544
+ {
1545
+ path: 'historyEntries.event.updated.current.billingStatus.freeTrialData.endDate',
1546
+ },
1547
+ {
1548
+ path: 'historyEntries.event.updated.current.billingStatus.updateBillingDateData.paidUntil',
1549
+ },
1550
+ {
1551
+ path: 'historyEntries.event.updated.current.billingStatus.gracePeriodData.startDate',
1552
+ },
1553
+ {
1554
+ path: 'historyEntries.event.updated.current.billingStatus.gracePeriodData.endDate',
1555
+ },
1556
+ {
1557
+ path: 'historyEntries.event.updated.current.pauseInfo.startDate',
1558
+ },
1559
+ {
1560
+ path: 'historyEntries.event.updated.current.pauseInfo.resumeDate',
1561
+ },
1562
+ {
1563
+ path: 'historyEntries.event.updated.current.cancellationInfo.cancellationDate',
1564
+ },
1565
+ {
1566
+ path: 'historyEntries.event.updated.current.specificDatePendingUpdateData.executionDate',
1567
+ },
1568
+ { path: 'historyEntries.event.updated.previous.createdDate' },
1569
+ { path: 'historyEntries.event.updated.previous.updatedDate' },
1570
+ { path: 'historyEntries.event.updated.previous.startDate' },
1571
+ { path: 'historyEntries.event.updated.previous.endDate' },
1572
+ {
1573
+ path: 'historyEntries.event.updated.previous.billingStatus.nextBillingDate',
1574
+ },
1575
+ {
1576
+ path: 'historyEntries.event.updated.previous.billingStatus.previousBillingDate',
1577
+ },
1578
+ {
1579
+ path: 'historyEntries.event.updated.previous.billingStatus.latestPaymentData.initialFailedPaymentDate',
1580
+ },
1581
+ {
1582
+ path: 'historyEntries.event.updated.previous.billingStatus.freeTrialData.startDate',
1583
+ },
1584
+ {
1585
+ path: 'historyEntries.event.updated.previous.billingStatus.freeTrialData.endDate',
1586
+ },
1587
+ {
1588
+ path: 'historyEntries.event.updated.previous.billingStatus.updateBillingDateData.paidUntil',
1589
+ },
1590
+ {
1591
+ path: 'historyEntries.event.updated.previous.billingStatus.gracePeriodData.startDate',
1592
+ },
1593
+ {
1594
+ path: 'historyEntries.event.updated.previous.billingStatus.gracePeriodData.endDate',
1595
+ },
1596
+ {
1597
+ path: 'historyEntries.event.updated.previous.pauseInfo.startDate',
1598
+ },
1599
+ {
1600
+ path: 'historyEntries.event.updated.previous.pauseInfo.resumeDate',
1601
+ },
1602
+ {
1603
+ path: 'historyEntries.event.updated.previous.cancellationInfo.cancellationDate',
1604
+ },
1605
+ {
1606
+ path: 'historyEntries.event.updated.previous.specificDatePendingUpdateData.executionDate',
1607
+ },
1608
+ {
1609
+ path: 'historyEntries.event.activated.subscription.createdDate',
1610
+ },
1611
+ {
1612
+ path: 'historyEntries.event.activated.subscription.updatedDate',
1613
+ },
1614
+ { path: 'historyEntries.event.activated.subscription.startDate' },
1615
+ { path: 'historyEntries.event.activated.subscription.endDate' },
1616
+ {
1617
+ path: 'historyEntries.event.activated.subscription.billingStatus.nextBillingDate',
1618
+ },
1619
+ {
1620
+ path: 'historyEntries.event.activated.subscription.billingStatus.previousBillingDate',
1621
+ },
1622
+ {
1623
+ path: 'historyEntries.event.activated.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1624
+ },
1625
+ {
1626
+ path: 'historyEntries.event.activated.subscription.billingStatus.freeTrialData.startDate',
1627
+ },
1628
+ {
1629
+ path: 'historyEntries.event.activated.subscription.billingStatus.freeTrialData.endDate',
1630
+ },
1631
+ {
1632
+ path: 'historyEntries.event.activated.subscription.billingStatus.updateBillingDateData.paidUntil',
1633
+ },
1634
+ {
1635
+ path: 'historyEntries.event.activated.subscription.billingStatus.gracePeriodData.startDate',
1636
+ },
1637
+ {
1638
+ path: 'historyEntries.event.activated.subscription.billingStatus.gracePeriodData.endDate',
1639
+ },
1640
+ {
1641
+ path: 'historyEntries.event.activated.subscription.pauseInfo.startDate',
1642
+ },
1643
+ {
1644
+ path: 'historyEntries.event.activated.subscription.pauseInfo.resumeDate',
1645
+ },
1646
+ {
1647
+ path: 'historyEntries.event.activated.subscription.cancellationInfo.cancellationDate',
1648
+ },
1649
+ {
1650
+ path: 'historyEntries.event.activated.subscription.specificDatePendingUpdateData.executionDate',
1651
+ },
1652
+ { path: 'historyEntries.event.ended.subscription.createdDate' },
1653
+ { path: 'historyEntries.event.ended.subscription.updatedDate' },
1654
+ { path: 'historyEntries.event.ended.subscription.startDate' },
1655
+ { path: 'historyEntries.event.ended.subscription.endDate' },
1656
+ {
1657
+ path: 'historyEntries.event.ended.subscription.billingStatus.nextBillingDate',
1658
+ },
1659
+ {
1660
+ path: 'historyEntries.event.ended.subscription.billingStatus.previousBillingDate',
1661
+ },
1662
+ {
1663
+ path: 'historyEntries.event.ended.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1664
+ },
1665
+ {
1666
+ path: 'historyEntries.event.ended.subscription.billingStatus.freeTrialData.startDate',
1667
+ },
1668
+ {
1669
+ path: 'historyEntries.event.ended.subscription.billingStatus.freeTrialData.endDate',
1670
+ },
1671
+ {
1672
+ path: 'historyEntries.event.ended.subscription.billingStatus.updateBillingDateData.paidUntil',
1673
+ },
1674
+ {
1675
+ path: 'historyEntries.event.ended.subscription.billingStatus.gracePeriodData.startDate',
1676
+ },
1677
+ {
1678
+ path: 'historyEntries.event.ended.subscription.billingStatus.gracePeriodData.endDate',
1679
+ },
1680
+ {
1681
+ path: 'historyEntries.event.ended.subscription.pauseInfo.startDate',
1682
+ },
1683
+ {
1684
+ path: 'historyEntries.event.ended.subscription.pauseInfo.resumeDate',
1685
+ },
1686
+ {
1687
+ path: 'historyEntries.event.ended.subscription.cancellationInfo.cancellationDate',
1688
+ },
1689
+ {
1690
+ path: 'historyEntries.event.ended.subscription.specificDatePendingUpdateData.executionDate',
1691
+ },
1692
+ {
1693
+ path: 'historyEntries.event.canceled.subscription.createdDate',
1694
+ },
1695
+ {
1696
+ path: 'historyEntries.event.canceled.subscription.updatedDate',
1697
+ },
1698
+ { path: 'historyEntries.event.canceled.subscription.startDate' },
1699
+ { path: 'historyEntries.event.canceled.subscription.endDate' },
1700
+ {
1701
+ path: 'historyEntries.event.canceled.subscription.billingStatus.nextBillingDate',
1702
+ },
1703
+ {
1704
+ path: 'historyEntries.event.canceled.subscription.billingStatus.previousBillingDate',
1705
+ },
1706
+ {
1707
+ path: 'historyEntries.event.canceled.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1708
+ },
1709
+ {
1710
+ path: 'historyEntries.event.canceled.subscription.billingStatus.freeTrialData.startDate',
1711
+ },
1712
+ {
1713
+ path: 'historyEntries.event.canceled.subscription.billingStatus.freeTrialData.endDate',
1714
+ },
1715
+ {
1716
+ path: 'historyEntries.event.canceled.subscription.billingStatus.updateBillingDateData.paidUntil',
1717
+ },
1718
+ {
1719
+ path: 'historyEntries.event.canceled.subscription.billingStatus.gracePeriodData.startDate',
1720
+ },
1721
+ {
1722
+ path: 'historyEntries.event.canceled.subscription.billingStatus.gracePeriodData.endDate',
1723
+ },
1724
+ {
1725
+ path: 'historyEntries.event.canceled.subscription.pauseInfo.startDate',
1726
+ },
1727
+ {
405
1728
  path: 'historyEntries.event.canceled.subscription.pauseInfo.resumeDate',
406
1729
  },
407
1730
  {
@@ -1059,1948 +2382,625 @@ export function listSubscriptionHistory(payload) {
1059
2382
  path: 'historyEntries.event.billingDateUpdated.subscription.createdDate',
1060
2383
  },
1061
2384
  {
1062
- path: 'historyEntries.event.billingDateUpdated.subscription.updatedDate',
1063
- },
1064
- {
1065
- path: 'historyEntries.event.billingDateUpdated.subscription.startDate',
1066
- },
1067
- {
1068
- path: 'historyEntries.event.billingDateUpdated.subscription.endDate',
1069
- },
1070
- {
1071
- path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.nextBillingDate',
1072
- },
1073
- {
1074
- path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.previousBillingDate',
1075
- },
1076
- {
1077
- path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1078
- },
1079
- {
1080
- path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.freeTrialData.startDate',
1081
- },
1082
- {
1083
- path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.freeTrialData.endDate',
1084
- },
1085
- {
1086
- path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.updateBillingDateData.paidUntil',
1087
- },
1088
- {
1089
- path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.gracePeriodData.startDate',
1090
- },
1091
- {
1092
- path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.gracePeriodData.endDate',
1093
- },
1094
- {
1095
- path: 'historyEntries.event.billingDateUpdated.subscription.pauseInfo.startDate',
1096
- },
1097
- {
1098
- path: 'historyEntries.event.billingDateUpdated.subscription.pauseInfo.resumeDate',
1099
- },
1100
- {
1101
- path: 'historyEntries.event.billingDateUpdated.subscription.cancellationInfo.cancellationDate',
1102
- },
1103
- {
1104
- path: 'historyEntries.event.billingDateUpdated.subscription.specificDatePendingUpdateData.executionDate',
1105
- },
1106
- {
1107
- path: 'historyEntries.event.futureUpdatesRequested.subscription.createdDate',
1108
- },
1109
- {
1110
- path: 'historyEntries.event.futureUpdatesRequested.subscription.updatedDate',
1111
- },
1112
- {
1113
- path: 'historyEntries.event.futureUpdatesRequested.subscription.startDate',
1114
- },
1115
- {
1116
- path: 'historyEntries.event.futureUpdatesRequested.subscription.endDate',
1117
- },
1118
- {
1119
- path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.nextBillingDate',
1120
- },
1121
- {
1122
- path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.previousBillingDate',
1123
- },
1124
- {
1125
- path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1126
- },
1127
- {
1128
- path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.freeTrialData.startDate',
1129
- },
1130
- {
1131
- path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.freeTrialData.endDate',
1132
- },
1133
- {
1134
- path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.updateBillingDateData.paidUntil',
1135
- },
1136
- {
1137
- path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.gracePeriodData.startDate',
1138
- },
1139
- {
1140
- path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.gracePeriodData.endDate',
1141
- },
1142
- {
1143
- path: 'historyEntries.event.futureUpdatesRequested.subscription.pauseInfo.startDate',
1144
- },
1145
- {
1146
- path: 'historyEntries.event.futureUpdatesRequested.subscription.pauseInfo.resumeDate',
1147
- },
1148
- {
1149
- path: 'historyEntries.event.futureUpdatesRequested.subscription.cancellationInfo.cancellationDate',
1150
- },
1151
- {
1152
- path: 'historyEntries.event.futureUpdatesRequested.subscription.specificDatePendingUpdateData.executionDate',
1153
- },
1154
- {
1155
- path: 'historyEntries.event.updatesApplied.subscription.createdDate',
1156
- },
1157
- {
1158
- path: 'historyEntries.event.updatesApplied.subscription.updatedDate',
1159
- },
1160
- {
1161
- path: 'historyEntries.event.updatesApplied.subscription.startDate',
1162
- },
1163
- {
1164
- path: 'historyEntries.event.updatesApplied.subscription.endDate',
1165
- },
1166
- {
1167
- path: 'historyEntries.event.updatesApplied.subscription.billingStatus.nextBillingDate',
1168
- },
1169
- {
1170
- path: 'historyEntries.event.updatesApplied.subscription.billingStatus.previousBillingDate',
1171
- },
1172
- {
1173
- path: 'historyEntries.event.updatesApplied.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1174
- },
1175
- {
1176
- path: 'historyEntries.event.updatesApplied.subscription.billingStatus.freeTrialData.startDate',
1177
- },
1178
- {
1179
- path: 'historyEntries.event.updatesApplied.subscription.billingStatus.freeTrialData.endDate',
1180
- },
1181
- {
1182
- path: 'historyEntries.event.updatesApplied.subscription.billingStatus.updateBillingDateData.paidUntil',
1183
- },
1184
- {
1185
- path: 'historyEntries.event.updatesApplied.subscription.billingStatus.gracePeriodData.startDate',
1186
- },
1187
- {
1188
- path: 'historyEntries.event.updatesApplied.subscription.billingStatus.gracePeriodData.endDate',
1189
- },
1190
- {
1191
- path: 'historyEntries.event.updatesApplied.subscription.pauseInfo.startDate',
1192
- },
1193
- {
1194
- path: 'historyEntries.event.updatesApplied.subscription.pauseInfo.resumeDate',
1195
- },
1196
- {
1197
- path: 'historyEntries.event.updatesApplied.subscription.cancellationInfo.cancellationDate',
1198
- },
1199
- {
1200
- path: 'historyEntries.event.updatesApplied.subscription.specificDatePendingUpdateData.executionDate',
1201
- },
1202
- {
1203
- path: 'historyEntries.event.resetPendingUpdates.subscription.createdDate',
1204
- },
1205
- {
1206
- path: 'historyEntries.event.resetPendingUpdates.subscription.updatedDate',
1207
- },
1208
- {
1209
- path: 'historyEntries.event.resetPendingUpdates.subscription.startDate',
1210
- },
1211
- {
1212
- path: 'historyEntries.event.resetPendingUpdates.subscription.endDate',
1213
- },
1214
- {
1215
- path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.nextBillingDate',
1216
- },
1217
- {
1218
- path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.previousBillingDate',
1219
- },
1220
- {
1221
- path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1222
- },
1223
- {
1224
- path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.freeTrialData.startDate',
1225
- },
1226
- {
1227
- path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.freeTrialData.endDate',
1228
- },
1229
- {
1230
- path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.updateBillingDateData.paidUntil',
1231
- },
1232
- {
1233
- path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.gracePeriodData.startDate',
1234
- },
1235
- {
1236
- path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.gracePeriodData.endDate',
1237
- },
1238
- {
1239
- path: 'historyEntries.event.resetPendingUpdates.subscription.pauseInfo.startDate',
1240
- },
1241
- {
1242
- path: 'historyEntries.event.resetPendingUpdates.subscription.pauseInfo.resumeDate',
1243
- },
1244
- {
1245
- path: 'historyEntries.event.resetPendingUpdates.subscription.cancellationInfo.cancellationDate',
1246
- },
1247
- {
1248
- path: 'historyEntries.event.resetPendingUpdates.subscription.specificDatePendingUpdateData.executionDate',
1249
- },
1250
- {
1251
- path: 'historyEntries.event.gracePeriodStarted.subscription.createdDate',
1252
- },
1253
- {
1254
- path: 'historyEntries.event.gracePeriodStarted.subscription.updatedDate',
1255
- },
1256
- {
1257
- path: 'historyEntries.event.gracePeriodStarted.subscription.startDate',
1258
- },
1259
- {
1260
- path: 'historyEntries.event.gracePeriodStarted.subscription.endDate',
1261
- },
1262
- {
1263
- path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.nextBillingDate',
1264
- },
1265
- {
1266
- path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.previousBillingDate',
1267
- },
1268
- {
1269
- path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1270
- },
1271
- {
1272
- path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.freeTrialData.startDate',
1273
- },
1274
- {
1275
- path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.freeTrialData.endDate',
1276
- },
1277
- {
1278
- path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.updateBillingDateData.paidUntil',
1279
- },
1280
- {
1281
- path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.gracePeriodData.startDate',
1282
- },
1283
- {
1284
- path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.gracePeriodData.endDate',
1285
- },
1286
- {
1287
- path: 'historyEntries.event.gracePeriodStarted.subscription.pauseInfo.startDate',
1288
- },
1289
- {
1290
- path: 'historyEntries.event.gracePeriodStarted.subscription.pauseInfo.resumeDate',
1291
- },
1292
- {
1293
- path: 'historyEntries.event.gracePeriodStarted.subscription.cancellationInfo.cancellationDate',
1294
- },
1295
- {
1296
- path: 'historyEntries.event.gracePeriodStarted.subscription.specificDatePendingUpdateData.executionDate',
1297
- },
1298
- {
1299
- path: 'historyEntries.event.gracePeriodEnded.subscription.createdDate',
1300
- },
1301
- {
1302
- path: 'historyEntries.event.gracePeriodEnded.subscription.updatedDate',
1303
- },
1304
- {
1305
- path: 'historyEntries.event.gracePeriodEnded.subscription.startDate',
1306
- },
1307
- {
1308
- path: 'historyEntries.event.gracePeriodEnded.subscription.endDate',
1309
- },
1310
- {
1311
- path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.nextBillingDate',
1312
- },
1313
- {
1314
- path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.previousBillingDate',
1315
- },
1316
- {
1317
- path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2385
+ path: 'historyEntries.event.billingDateUpdated.subscription.updatedDate',
1318
2386
  },
1319
2387
  {
1320
- path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.freeTrialData.startDate',
2388
+ path: 'historyEntries.event.billingDateUpdated.subscription.startDate',
1321
2389
  },
1322
2390
  {
1323
- path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.freeTrialData.endDate',
2391
+ path: 'historyEntries.event.billingDateUpdated.subscription.endDate',
1324
2392
  },
1325
2393
  {
1326
- path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.updateBillingDateData.paidUntil',
2394
+ path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.nextBillingDate',
1327
2395
  },
1328
2396
  {
1329
- path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.gracePeriodData.startDate',
2397
+ path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.previousBillingDate',
1330
2398
  },
1331
2399
  {
1332
- path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.gracePeriodData.endDate',
2400
+ path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1333
2401
  },
1334
2402
  {
1335
- path: 'historyEntries.event.gracePeriodEnded.subscription.pauseInfo.startDate',
2403
+ path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.freeTrialData.startDate',
1336
2404
  },
1337
2405
  {
1338
- path: 'historyEntries.event.gracePeriodEnded.subscription.pauseInfo.resumeDate',
2406
+ path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.freeTrialData.endDate',
1339
2407
  },
1340
2408
  {
1341
- path: 'historyEntries.event.gracePeriodEnded.subscription.cancellationInfo.cancellationDate',
2409
+ path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.updateBillingDateData.paidUntil',
1342
2410
  },
1343
2411
  {
1344
- path: 'historyEntries.event.gracePeriodEnded.subscription.specificDatePendingUpdateData.executionDate',
2412
+ path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.gracePeriodData.startDate',
1345
2413
  },
1346
2414
  {
1347
- path: 'historyEntries.event.paymentMethodUpdated.subscription.createdDate',
2415
+ path: 'historyEntries.event.billingDateUpdated.subscription.billingStatus.gracePeriodData.endDate',
1348
2416
  },
1349
2417
  {
1350
- path: 'historyEntries.event.paymentMethodUpdated.subscription.updatedDate',
2418
+ path: 'historyEntries.event.billingDateUpdated.subscription.pauseInfo.startDate',
1351
2419
  },
1352
2420
  {
1353
- path: 'historyEntries.event.paymentMethodUpdated.subscription.startDate',
2421
+ path: 'historyEntries.event.billingDateUpdated.subscription.pauseInfo.resumeDate',
1354
2422
  },
1355
2423
  {
1356
- path: 'historyEntries.event.paymentMethodUpdated.subscription.endDate',
2424
+ path: 'historyEntries.event.billingDateUpdated.subscription.cancellationInfo.cancellationDate',
1357
2425
  },
1358
2426
  {
1359
- path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.nextBillingDate',
2427
+ path: 'historyEntries.event.billingDateUpdated.subscription.specificDatePendingUpdateData.executionDate',
1360
2428
  },
1361
2429
  {
1362
- path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.previousBillingDate',
2430
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.createdDate',
1363
2431
  },
1364
2432
  {
1365
- path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2433
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.updatedDate',
1366
2434
  },
1367
2435
  {
1368
- path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.freeTrialData.startDate',
2436
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.startDate',
1369
2437
  },
1370
2438
  {
1371
- path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.freeTrialData.endDate',
2439
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.endDate',
1372
2440
  },
1373
2441
  {
1374
- path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.updateBillingDateData.paidUntil',
2442
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.nextBillingDate',
1375
2443
  },
1376
2444
  {
1377
- path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.gracePeriodData.startDate',
2445
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.previousBillingDate',
1378
2446
  },
1379
2447
  {
1380
- path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.gracePeriodData.endDate',
2448
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1381
2449
  },
1382
2450
  {
1383
- path: 'historyEntries.event.paymentMethodUpdated.subscription.pauseInfo.startDate',
2451
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.freeTrialData.startDate',
1384
2452
  },
1385
2453
  {
1386
- path: 'historyEntries.event.paymentMethodUpdated.subscription.pauseInfo.resumeDate',
2454
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.freeTrialData.endDate',
1387
2455
  },
1388
2456
  {
1389
- path: 'historyEntries.event.paymentMethodUpdated.subscription.cancellationInfo.cancellationDate',
2457
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.updateBillingDateData.paidUntil',
1390
2458
  },
1391
2459
  {
1392
- path: 'historyEntries.event.paymentMethodUpdated.subscription.specificDatePendingUpdateData.executionDate',
2460
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.gracePeriodData.startDate',
1393
2461
  },
1394
2462
  {
1395
- path: 'historyEntries.event.collectionMethodUpdated.subscription.createdDate',
2463
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.billingStatus.gracePeriodData.endDate',
1396
2464
  },
1397
2465
  {
1398
- path: 'historyEntries.event.collectionMethodUpdated.subscription.updatedDate',
2466
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.pauseInfo.startDate',
1399
2467
  },
1400
2468
  {
1401
- path: 'historyEntries.event.collectionMethodUpdated.subscription.startDate',
2469
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.pauseInfo.resumeDate',
1402
2470
  },
1403
2471
  {
1404
- path: 'historyEntries.event.collectionMethodUpdated.subscription.endDate',
2472
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.cancellationInfo.cancellationDate',
1405
2473
  },
1406
2474
  {
1407
- path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.nextBillingDate',
2475
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.specificDatePendingUpdateData.executionDate',
1408
2476
  },
1409
2477
  {
1410
- path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.previousBillingDate',
2478
+ path: 'historyEntries.event.updatesApplied.subscription.createdDate',
1411
2479
  },
1412
2480
  {
1413
- path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2481
+ path: 'historyEntries.event.updatesApplied.subscription.updatedDate',
1414
2482
  },
1415
2483
  {
1416
- path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.freeTrialData.startDate',
2484
+ path: 'historyEntries.event.updatesApplied.subscription.startDate',
1417
2485
  },
1418
2486
  {
1419
- path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.freeTrialData.endDate',
2487
+ path: 'historyEntries.event.updatesApplied.subscription.endDate',
1420
2488
  },
1421
2489
  {
1422
- path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.updateBillingDateData.paidUntil',
2490
+ path: 'historyEntries.event.updatesApplied.subscription.billingStatus.nextBillingDate',
1423
2491
  },
1424
2492
  {
1425
- path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.gracePeriodData.startDate',
2493
+ path: 'historyEntries.event.updatesApplied.subscription.billingStatus.previousBillingDate',
1426
2494
  },
1427
2495
  {
1428
- path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.gracePeriodData.endDate',
2496
+ path: 'historyEntries.event.updatesApplied.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1429
2497
  },
1430
2498
  {
1431
- path: 'historyEntries.event.collectionMethodUpdated.subscription.pauseInfo.startDate',
2499
+ path: 'historyEntries.event.updatesApplied.subscription.billingStatus.freeTrialData.startDate',
1432
2500
  },
1433
2501
  {
1434
- path: 'historyEntries.event.collectionMethodUpdated.subscription.pauseInfo.resumeDate',
2502
+ path: 'historyEntries.event.updatesApplied.subscription.billingStatus.freeTrialData.endDate',
1435
2503
  },
1436
2504
  {
1437
- path: 'historyEntries.event.collectionMethodUpdated.subscription.cancellationInfo.cancellationDate',
2505
+ path: 'historyEntries.event.updatesApplied.subscription.billingStatus.updateBillingDateData.paidUntil',
1438
2506
  },
1439
2507
  {
1440
- path: 'historyEntries.event.collectionMethodUpdated.subscription.specificDatePendingUpdateData.executionDate',
2508
+ path: 'historyEntries.event.updatesApplied.subscription.billingStatus.gracePeriodData.startDate',
1441
2509
  },
1442
2510
  {
1443
- path: 'historyEntries.event.freeTrailStarted.subscription.createdDate',
2511
+ path: 'historyEntries.event.updatesApplied.subscription.billingStatus.gracePeriodData.endDate',
1444
2512
  },
1445
2513
  {
1446
- path: 'historyEntries.event.freeTrailStarted.subscription.updatedDate',
2514
+ path: 'historyEntries.event.updatesApplied.subscription.pauseInfo.startDate',
1447
2515
  },
1448
2516
  {
1449
- path: 'historyEntries.event.freeTrailStarted.subscription.startDate',
2517
+ path: 'historyEntries.event.updatesApplied.subscription.pauseInfo.resumeDate',
1450
2518
  },
1451
2519
  {
1452
- path: 'historyEntries.event.freeTrailStarted.subscription.endDate',
2520
+ path: 'historyEntries.event.updatesApplied.subscription.cancellationInfo.cancellationDate',
1453
2521
  },
1454
2522
  {
1455
- path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.nextBillingDate',
2523
+ path: 'historyEntries.event.updatesApplied.subscription.specificDatePendingUpdateData.executionDate',
1456
2524
  },
1457
2525
  {
1458
- path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.previousBillingDate',
2526
+ path: 'historyEntries.event.resetPendingUpdates.subscription.createdDate',
1459
2527
  },
1460
2528
  {
1461
- path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2529
+ path: 'historyEntries.event.resetPendingUpdates.subscription.updatedDate',
1462
2530
  },
1463
2531
  {
1464
- path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.freeTrialData.startDate',
2532
+ path: 'historyEntries.event.resetPendingUpdates.subscription.startDate',
1465
2533
  },
1466
2534
  {
1467
- path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.freeTrialData.endDate',
2535
+ path: 'historyEntries.event.resetPendingUpdates.subscription.endDate',
1468
2536
  },
1469
2537
  {
1470
- path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.updateBillingDateData.paidUntil',
2538
+ path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.nextBillingDate',
1471
2539
  },
1472
2540
  {
1473
- path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.gracePeriodData.startDate',
2541
+ path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.previousBillingDate',
1474
2542
  },
1475
2543
  {
1476
- path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.gracePeriodData.endDate',
2544
+ path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1477
2545
  },
1478
2546
  {
1479
- path: 'historyEntries.event.freeTrailStarted.subscription.pauseInfo.startDate',
2547
+ path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.freeTrialData.startDate',
1480
2548
  },
1481
2549
  {
1482
- path: 'historyEntries.event.freeTrailStarted.subscription.pauseInfo.resumeDate',
2550
+ path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.freeTrialData.endDate',
1483
2551
  },
1484
2552
  {
1485
- path: 'historyEntries.event.freeTrailStarted.subscription.cancellationInfo.cancellationDate',
2553
+ path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.updateBillingDateData.paidUntil',
1486
2554
  },
1487
2555
  {
1488
- path: 'historyEntries.event.freeTrailStarted.subscription.specificDatePendingUpdateData.executionDate',
2556
+ path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.gracePeriodData.startDate',
1489
2557
  },
1490
2558
  {
1491
- path: 'historyEntries.event.freeTrailEnded.subscription.createdDate',
2559
+ path: 'historyEntries.event.resetPendingUpdates.subscription.billingStatus.gracePeriodData.endDate',
1492
2560
  },
1493
2561
  {
1494
- path: 'historyEntries.event.freeTrailEnded.subscription.updatedDate',
2562
+ path: 'historyEntries.event.resetPendingUpdates.subscription.pauseInfo.startDate',
1495
2563
  },
1496
2564
  {
1497
- path: 'historyEntries.event.freeTrailEnded.subscription.startDate',
2565
+ path: 'historyEntries.event.resetPendingUpdates.subscription.pauseInfo.resumeDate',
1498
2566
  },
1499
2567
  {
1500
- path: 'historyEntries.event.freeTrailEnded.subscription.endDate',
2568
+ path: 'historyEntries.event.resetPendingUpdates.subscription.cancellationInfo.cancellationDate',
1501
2569
  },
1502
2570
  {
1503
- path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.nextBillingDate',
2571
+ path: 'historyEntries.event.resetPendingUpdates.subscription.specificDatePendingUpdateData.executionDate',
1504
2572
  },
1505
2573
  {
1506
- path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.previousBillingDate',
2574
+ path: 'historyEntries.event.gracePeriodStarted.subscription.createdDate',
1507
2575
  },
1508
2576
  {
1509
- path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2577
+ path: 'historyEntries.event.gracePeriodStarted.subscription.updatedDate',
1510
2578
  },
1511
2579
  {
1512
- path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.freeTrialData.startDate',
2580
+ path: 'historyEntries.event.gracePeriodStarted.subscription.startDate',
1513
2581
  },
1514
2582
  {
1515
- path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.freeTrialData.endDate',
2583
+ path: 'historyEntries.event.gracePeriodStarted.subscription.endDate',
1516
2584
  },
1517
2585
  {
1518
- path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.updateBillingDateData.paidUntil',
2586
+ path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.nextBillingDate',
1519
2587
  },
1520
2588
  {
1521
- path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.gracePeriodData.startDate',
2589
+ path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.previousBillingDate',
1522
2590
  },
1523
2591
  {
1524
- path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.gracePeriodData.endDate',
2592
+ path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1525
2593
  },
1526
2594
  {
1527
- path: 'historyEntries.event.freeTrailEnded.subscription.pauseInfo.startDate',
2595
+ path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.freeTrialData.startDate',
1528
2596
  },
1529
2597
  {
1530
- path: 'historyEntries.event.freeTrailEnded.subscription.pauseInfo.resumeDate',
2598
+ path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.freeTrialData.endDate',
1531
2599
  },
1532
2600
  {
1533
- path: 'historyEntries.event.freeTrailEnded.subscription.cancellationInfo.cancellationDate',
2601
+ path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.updateBillingDateData.paidUntil',
1534
2602
  },
1535
2603
  {
1536
- path: 'historyEntries.event.freeTrailEnded.subscription.specificDatePendingUpdateData.executionDate',
2604
+ path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.gracePeriodData.startDate',
1537
2605
  },
1538
2606
  {
1539
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.createdDate',
2607
+ path: 'historyEntries.event.gracePeriodStarted.subscription.billingStatus.gracePeriodData.endDate',
1540
2608
  },
1541
2609
  {
1542
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.updatedDate',
2610
+ path: 'historyEntries.event.gracePeriodStarted.subscription.pauseInfo.startDate',
1543
2611
  },
1544
2612
  {
1545
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.startDate',
2613
+ path: 'historyEntries.event.gracePeriodStarted.subscription.pauseInfo.resumeDate',
1546
2614
  },
1547
2615
  {
1548
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.endDate',
2616
+ path: 'historyEntries.event.gracePeriodStarted.subscription.cancellationInfo.cancellationDate',
1549
2617
  },
1550
2618
  {
1551
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.billingStatus.nextBillingDate',
2619
+ path: 'historyEntries.event.gracePeriodStarted.subscription.specificDatePendingUpdateData.executionDate',
1552
2620
  },
1553
2621
  {
1554
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.billingStatus.previousBillingDate',
2622
+ path: 'historyEntries.event.gracePeriodEnded.subscription.createdDate',
1555
2623
  },
1556
2624
  {
1557
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2625
+ path: 'historyEntries.event.gracePeriodEnded.subscription.updatedDate',
1558
2626
  },
1559
2627
  {
1560
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.billingStatus.freeTrialData.startDate',
2628
+ path: 'historyEntries.event.gracePeriodEnded.subscription.startDate',
1561
2629
  },
1562
2630
  {
1563
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.billingStatus.freeTrialData.endDate',
2631
+ path: 'historyEntries.event.gracePeriodEnded.subscription.endDate',
1564
2632
  },
1565
2633
  {
1566
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.billingStatus.updateBillingDateData.paidUntil',
2634
+ path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.nextBillingDate',
1567
2635
  },
1568
2636
  {
1569
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.billingStatus.gracePeriodData.startDate',
2637
+ path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.previousBillingDate',
1570
2638
  },
1571
2639
  {
1572
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.billingStatus.gracePeriodData.endDate',
2640
+ path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1573
2641
  },
1574
2642
  {
1575
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.pauseInfo.startDate',
2643
+ path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.freeTrialData.startDate',
1576
2644
  },
1577
2645
  {
1578
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.pauseInfo.resumeDate',
2646
+ path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.freeTrialData.endDate',
1579
2647
  },
1580
2648
  {
1581
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.cancellationInfo.cancellationDate',
2649
+ path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.updateBillingDateData.paidUntil',
1582
2650
  },
1583
2651
  {
1584
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.specificDatePendingUpdateData.executionDate',
2652
+ path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.gracePeriodData.startDate',
1585
2653
  },
1586
2654
  {
1587
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.createdDate',
2655
+ path: 'historyEntries.event.gracePeriodEnded.subscription.billingStatus.gracePeriodData.endDate',
1588
2656
  },
1589
2657
  {
1590
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.updatedDate',
2658
+ path: 'historyEntries.event.gracePeriodEnded.subscription.pauseInfo.startDate',
1591
2659
  },
1592
2660
  {
1593
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.startDate',
2661
+ path: 'historyEntries.event.gracePeriodEnded.subscription.pauseInfo.resumeDate',
1594
2662
  },
1595
2663
  {
1596
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.endDate',
2664
+ path: 'historyEntries.event.gracePeriodEnded.subscription.cancellationInfo.cancellationDate',
1597
2665
  },
1598
2666
  {
1599
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.nextBillingDate',
2667
+ path: 'historyEntries.event.gracePeriodEnded.subscription.specificDatePendingUpdateData.executionDate',
1600
2668
  },
1601
2669
  {
1602
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.previousBillingDate',
2670
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.createdDate',
1603
2671
  },
1604
2672
  {
1605
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2673
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.updatedDate',
1606
2674
  },
1607
2675
  {
1608
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.freeTrialData.startDate',
2676
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.startDate',
1609
2677
  },
1610
2678
  {
1611
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.freeTrialData.endDate',
2679
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.endDate',
1612
2680
  },
1613
2681
  {
1614
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.updateBillingDateData.paidUntil',
2682
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.nextBillingDate',
1615
2683
  },
1616
2684
  {
1617
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.gracePeriodData.startDate',
2685
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.previousBillingDate',
1618
2686
  },
1619
2687
  {
1620
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.gracePeriodData.endDate',
2688
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1621
2689
  },
1622
2690
  {
1623
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.pauseInfo.startDate',
2691
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.freeTrialData.startDate',
1624
2692
  },
1625
2693
  {
1626
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.pauseInfo.resumeDate',
2694
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.freeTrialData.endDate',
1627
2695
  },
1628
2696
  {
1629
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.cancellationInfo.cancellationDate',
2697
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.updateBillingDateData.paidUntil',
1630
2698
  },
1631
2699
  {
1632
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.specificDatePendingUpdateData.executionDate',
2700
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.gracePeriodData.startDate',
1633
2701
  },
1634
2702
  {
1635
- path: 'historyEntries.event.subscriptionBoAction.subscription.createdDate',
2703
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.billingStatus.gracePeriodData.endDate',
1636
2704
  },
1637
2705
  {
1638
- path: 'historyEntries.event.subscriptionBoAction.subscription.updatedDate',
2706
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.pauseInfo.startDate',
1639
2707
  },
1640
2708
  {
1641
- path: 'historyEntries.event.subscriptionBoAction.subscription.startDate',
2709
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.pauseInfo.resumeDate',
1642
2710
  },
1643
2711
  {
1644
- path: 'historyEntries.event.subscriptionBoAction.subscription.endDate',
2712
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.cancellationInfo.cancellationDate',
1645
2713
  },
1646
2714
  {
1647
- path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.nextBillingDate',
2715
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.specificDatePendingUpdateData.executionDate',
1648
2716
  },
1649
2717
  {
1650
- path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.previousBillingDate',
2718
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.createdDate',
1651
2719
  },
1652
2720
  {
1653
- path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2721
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.updatedDate',
1654
2722
  },
1655
2723
  {
1656
- path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.freeTrialData.startDate',
2724
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.startDate',
1657
2725
  },
1658
2726
  {
1659
- path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.freeTrialData.endDate',
2727
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.endDate',
1660
2728
  },
1661
2729
  {
1662
- path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.updateBillingDateData.paidUntil',
2730
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.nextBillingDate',
1663
2731
  },
1664
2732
  {
1665
- path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.gracePeriodData.startDate',
2733
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.previousBillingDate',
1666
2734
  },
1667
2735
  {
1668
- path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.gracePeriodData.endDate',
2736
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1669
2737
  },
1670
2738
  {
1671
- path: 'historyEntries.event.subscriptionBoAction.subscription.pauseInfo.startDate',
2739
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.freeTrialData.startDate',
1672
2740
  },
1673
2741
  {
1674
- path: 'historyEntries.event.subscriptionBoAction.subscription.pauseInfo.resumeDate',
2742
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.freeTrialData.endDate',
1675
2743
  },
1676
2744
  {
1677
- path: 'historyEntries.event.subscriptionBoAction.subscription.cancellationInfo.cancellationDate',
2745
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.updateBillingDateData.paidUntil',
1678
2746
  },
1679
2747
  {
1680
- path: 'historyEntries.event.subscriptionBoAction.subscription.specificDatePendingUpdateData.executionDate',
1681
- },
1682
- ],
1683
- },
1684
- ]),
1685
- };
1686
- return metadata;
1687
- }
1688
- return __listSubscriptionHistory;
1689
- }
1690
- /** Identity must be a site member and customer subscription belongs to */
1691
- export function customerGetSubscription(payload) {
1692
- function __customerGetSubscription({ host }) {
1693
- const metadata = {
1694
- entityFqdn: 'wix.billing.v1.subscription',
1695
- method: 'GET',
1696
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.GetSubscription',
1697
- packageName: PACKAGE_NAME,
1698
- url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({ protoPath: '/v1/customer_subscriptions/{id}', data: payload, host }),
1699
- params: toURLSearchParams(payload),
1700
- transformResponse: (payload) => transformPaths(payload, [
1701
- {
1702
- transformFn: transformRESTTimestampToSDKTimestamp,
1703
- paths: [
1704
- { path: 'subscription.createdDate' },
1705
- { path: 'subscription.updatedDate' },
1706
- { path: 'subscription.startDate' },
1707
- { path: 'subscription.endDate' },
1708
- { path: 'subscription.billingStatus.nextBillingDate' },
1709
- { path: 'subscription.billingStatus.previousBillingDate' },
2748
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.gracePeriodData.startDate',
2749
+ },
1710
2750
  {
1711
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2751
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.billingStatus.gracePeriodData.endDate',
1712
2752
  },
1713
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
1714
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
1715
2753
  {
1716
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2754
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.pauseInfo.startDate',
1717
2755
  },
1718
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
1719
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
1720
- { path: 'subscription.pauseInfo.startDate' },
1721
- { path: 'subscription.pauseInfo.resumeDate' },
1722
- { path: 'subscription.cancellationInfo.cancellationDate' },
1723
2756
  {
1724
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2757
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.pauseInfo.resumeDate',
1725
2758
  },
1726
- ],
1727
- },
1728
- ]),
1729
- };
1730
- return metadata;
1731
- }
1732
- return __customerGetSubscription;
1733
- }
1734
- /** Identity must be a site member and customer subscription belongs to */
1735
- export function customerCancelSubscription(payload) {
1736
- function __customerCancelSubscription({ host }) {
1737
- const metadata = {
1738
- entityFqdn: 'wix.billing.v1.subscription',
1739
- method: 'POST',
1740
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CancelSubscription',
1741
- packageName: PACKAGE_NAME,
1742
- url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
1743
- protoPath: '/v1/customer_subscriptions/{id}/cancel',
1744
- data: payload,
1745
- host,
1746
- }),
1747
- data: payload,
1748
- transformResponse: (payload) => transformPaths(payload, [
1749
- {
1750
- transformFn: transformRESTTimestampToSDKTimestamp,
1751
- paths: [
1752
- { path: 'subscription.createdDate' },
1753
- { path: 'subscription.updatedDate' },
1754
- { path: 'subscription.startDate' },
1755
- { path: 'subscription.endDate' },
1756
- { path: 'subscription.billingStatus.nextBillingDate' },
1757
- { path: 'subscription.billingStatus.previousBillingDate' },
1758
2759
  {
1759
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2760
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.cancellationInfo.cancellationDate',
1760
2761
  },
1761
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
1762
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
1763
2762
  {
1764
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2763
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.specificDatePendingUpdateData.executionDate',
1765
2764
  },
1766
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
1767
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
1768
- { path: 'subscription.pauseInfo.startDate' },
1769
- { path: 'subscription.pauseInfo.resumeDate' },
1770
- { path: 'subscription.cancellationInfo.cancellationDate' },
1771
2765
  {
1772
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2766
+ path: 'historyEntries.event.freeTrailStarted.subscription.createdDate',
1773
2767
  },
1774
- ],
1775
- },
1776
- ]),
1777
- };
1778
- return metadata;
1779
- }
1780
- return __customerCancelSubscription;
1781
- }
1782
- /** Identity must be a site member and customer subscription belongs to */
1783
- export function customerTurnOnSubscriptionAutoRenewal(payload) {
1784
- function __customerTurnOnSubscriptionAutoRenewal({ host }) {
1785
- const metadata = {
1786
- entityFqdn: 'wix.billing.v1.subscription',
1787
- method: 'POST',
1788
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.TurnOnSubscriptionAutoRenewal',
1789
- packageName: PACKAGE_NAME,
1790
- url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
1791
- protoPath: '/v1/customer_subscriptions/{id}/turn_on_auto_renewal',
1792
- data: payload,
1793
- host,
1794
- }),
1795
- data: payload,
1796
- transformResponse: (payload) => transformPaths(payload, [
1797
- {
1798
- transformFn: transformRESTTimestampToSDKTimestamp,
1799
- paths: [
1800
- { path: 'subscription.createdDate' },
1801
- { path: 'subscription.updatedDate' },
1802
- { path: 'subscription.startDate' },
1803
- { path: 'subscription.endDate' },
1804
- { path: 'subscription.billingStatus.nextBillingDate' },
1805
- { path: 'subscription.billingStatus.previousBillingDate' },
1806
2768
  {
1807
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2769
+ path: 'historyEntries.event.freeTrailStarted.subscription.updatedDate',
1808
2770
  },
1809
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
1810
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
1811
2771
  {
1812
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2772
+ path: 'historyEntries.event.freeTrailStarted.subscription.startDate',
1813
2773
  },
1814
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
1815
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
1816
- { path: 'subscription.pauseInfo.startDate' },
1817
- { path: 'subscription.pauseInfo.resumeDate' },
1818
- { path: 'subscription.cancellationInfo.cancellationDate' },
1819
2774
  {
1820
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2775
+ path: 'historyEntries.event.freeTrailStarted.subscription.endDate',
1821
2776
  },
1822
- ],
1823
- },
1824
- ]),
1825
- };
1826
- return metadata;
1827
- }
1828
- return __customerTurnOnSubscriptionAutoRenewal;
1829
- }
1830
- /** Identity must be a site member and customer subscription belongs to */
1831
- export function customerTurnOffSubscriptionAutoRenewal(payload) {
1832
- function __customerTurnOffSubscriptionAutoRenewal({ host }) {
1833
- const metadata = {
1834
- entityFqdn: 'wix.billing.v1.subscription',
1835
- method: 'POST',
1836
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.TurnOffSubscriptionAutoRenewal',
1837
- packageName: PACKAGE_NAME,
1838
- url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
1839
- protoPath: '/v1/customer_subscriptions/{id}/turn_off_auto_renewal',
1840
- data: payload,
1841
- host,
1842
- }),
1843
- data: payload,
1844
- transformResponse: (payload) => transformPaths(payload, [
1845
- {
1846
- transformFn: transformRESTTimestampToSDKTimestamp,
1847
- paths: [
1848
- { path: 'subscription.createdDate' },
1849
- { path: 'subscription.updatedDate' },
1850
- { path: 'subscription.startDate' },
1851
- { path: 'subscription.endDate' },
1852
- { path: 'subscription.billingStatus.nextBillingDate' },
1853
- { path: 'subscription.billingStatus.previousBillingDate' },
1854
2777
  {
1855
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2778
+ path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.nextBillingDate',
1856
2779
  },
1857
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
1858
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
1859
2780
  {
1860
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2781
+ path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.previousBillingDate',
1861
2782
  },
1862
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
1863
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
1864
- { path: 'subscription.pauseInfo.startDate' },
1865
- { path: 'subscription.pauseInfo.resumeDate' },
1866
- { path: 'subscription.cancellationInfo.cancellationDate' },
1867
2783
  {
1868
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2784
+ path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
1869
2785
  },
1870
- ],
1871
- },
1872
- ]),
1873
- };
1874
- return metadata;
1875
- }
1876
- return __customerTurnOffSubscriptionAutoRenewal;
1877
- }
1878
- export function customerExtendSubscription(payload) {
1879
- function __customerExtendSubscription({ host }) {
1880
- const metadata = {
1881
- entityFqdn: 'wix.billing.v1.subscription',
1882
- method: 'PATCH',
1883
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.ExtendSubscription',
1884
- packageName: PACKAGE_NAME,
1885
- url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
1886
- protoPath: '/v1/customer_subscriptions/{id}/extend',
1887
- data: payload,
1888
- host,
1889
- }),
1890
- data: payload,
1891
- transformResponse: (payload) => transformPaths(payload, [
1892
- {
1893
- transformFn: transformRESTTimestampToSDKTimestamp,
1894
- paths: [
1895
- { path: 'subscription.createdDate' },
1896
- { path: 'subscription.updatedDate' },
1897
- { path: 'subscription.startDate' },
1898
- { path: 'subscription.endDate' },
1899
- { path: 'subscription.billingStatus.nextBillingDate' },
1900
- { path: 'subscription.billingStatus.previousBillingDate' },
1901
2786
  {
1902
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2787
+ path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.freeTrialData.startDate',
1903
2788
  },
1904
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
1905
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
1906
2789
  {
1907
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2790
+ path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.freeTrialData.endDate',
1908
2791
  },
1909
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
1910
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
1911
- { path: 'subscription.pauseInfo.startDate' },
1912
- { path: 'subscription.pauseInfo.resumeDate' },
1913
- { path: 'subscription.cancellationInfo.cancellationDate' },
1914
2792
  {
1915
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2793
+ path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.updateBillingDateData.paidUntil',
1916
2794
  },
1917
- ],
1918
- },
1919
- ]),
1920
- };
1921
- return metadata;
1922
- }
1923
- return __customerExtendSubscription;
1924
- }
1925
- /** identity must be a site member */
1926
- export function customerQuerySubscriptions(payload) {
1927
- function __customerQuerySubscriptions({ host }) {
1928
- const metadata = {
1929
- entityFqdn: 'wix.billing.v1.subscription',
1930
- method: 'POST',
1931
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.QuerySubscriptions',
1932
- packageName: PACKAGE_NAME,
1933
- url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({ protoPath: '/v1/customer_subscriptions/query', data: payload, host }),
1934
- data: payload,
1935
- transformResponse: (payload) => transformPaths(payload, [
1936
- {
1937
- transformFn: transformRESTTimestampToSDKTimestamp,
1938
- paths: [
1939
- { path: 'subscriptions.createdDate' },
1940
- { path: 'subscriptions.updatedDate' },
1941
- { path: 'subscriptions.startDate' },
1942
- { path: 'subscriptions.endDate' },
1943
- { path: 'subscriptions.billingStatus.nextBillingDate' },
1944
- { path: 'subscriptions.billingStatus.previousBillingDate' },
1945
2795
  {
1946
- path: 'subscriptions.billingStatus.latestPaymentData.initialFailedPaymentDate',
2796
+ path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.gracePeriodData.startDate',
1947
2797
  },
1948
- { path: 'subscriptions.billingStatus.freeTrialData.startDate' },
1949
- { path: 'subscriptions.billingStatus.freeTrialData.endDate' },
1950
2798
  {
1951
- path: 'subscriptions.billingStatus.updateBillingDateData.paidUntil',
2799
+ path: 'historyEntries.event.freeTrailStarted.subscription.billingStatus.gracePeriodData.endDate',
2800
+ },
2801
+ {
2802
+ path: 'historyEntries.event.freeTrailStarted.subscription.pauseInfo.startDate',
2803
+ },
2804
+ {
2805
+ path: 'historyEntries.event.freeTrailStarted.subscription.pauseInfo.resumeDate',
2806
+ },
2807
+ {
2808
+ path: 'historyEntries.event.freeTrailStarted.subscription.cancellationInfo.cancellationDate',
2809
+ },
2810
+ {
2811
+ path: 'historyEntries.event.freeTrailStarted.subscription.specificDatePendingUpdateData.executionDate',
2812
+ },
2813
+ {
2814
+ path: 'historyEntries.event.freeTrailEnded.subscription.createdDate',
2815
+ },
2816
+ {
2817
+ path: 'historyEntries.event.freeTrailEnded.subscription.updatedDate',
2818
+ },
2819
+ {
2820
+ path: 'historyEntries.event.freeTrailEnded.subscription.startDate',
2821
+ },
2822
+ {
2823
+ path: 'historyEntries.event.freeTrailEnded.subscription.endDate',
1952
2824
  },
1953
- { path: 'subscriptions.billingStatus.gracePeriodData.startDate' },
1954
- { path: 'subscriptions.billingStatus.gracePeriodData.endDate' },
1955
- { path: 'subscriptions.pauseInfo.startDate' },
1956
- { path: 'subscriptions.pauseInfo.resumeDate' },
1957
- { path: 'subscriptions.cancellationInfo.cancellationDate' },
1958
2825
  {
1959
- path: 'subscriptions.specificDatePendingUpdateData.executionDate',
2826
+ path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.nextBillingDate',
1960
2827
  },
1961
- ],
1962
- },
1963
- ]),
1964
- };
1965
- return metadata;
1966
- }
1967
- return __customerQuerySubscriptions;
1968
- }
1969
- /**
1970
- * Update subscription's payment method.
1971
- * Supported only for recurring subscriptions or one time subscriptions during free trial.
1972
- */
1973
- export function customerUpdateSubscriptionPaymentMethod(payload) {
1974
- function __customerUpdateSubscriptionPaymentMethod({ host }) {
1975
- const metadata = {
1976
- entityFqdn: 'wix.billing.v1.subscription',
1977
- method: 'PATCH',
1978
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.UpdateSubscriptionPaymentMethod',
1979
- packageName: PACKAGE_NAME,
1980
- url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
1981
- protoPath: '/v1/customer_subscriptions/{id}/payment_method',
1982
- data: payload,
1983
- host,
1984
- }),
1985
- data: payload,
1986
- transformResponse: (payload) => transformPaths(payload, [
1987
- {
1988
- transformFn: transformRESTTimestampToSDKTimestamp,
1989
- paths: [
1990
- { path: 'subscription.createdDate' },
1991
- { path: 'subscription.updatedDate' },
1992
- { path: 'subscription.startDate' },
1993
- { path: 'subscription.endDate' },
1994
- { path: 'subscription.billingStatus.nextBillingDate' },
1995
- { path: 'subscription.billingStatus.previousBillingDate' },
1996
2828
  {
1997
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2829
+ path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.previousBillingDate',
1998
2830
  },
1999
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2000
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2001
2831
  {
2002
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2832
+ path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2003
2833
  },
2004
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2005
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2006
- { path: 'subscription.pauseInfo.startDate' },
2007
- { path: 'subscription.pauseInfo.resumeDate' },
2008
- { path: 'subscription.cancellationInfo.cancellationDate' },
2009
2834
  {
2010
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2835
+ path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.freeTrialData.startDate',
2011
2836
  },
2012
- ],
2013
- },
2014
- ]),
2015
- };
2016
- return metadata;
2017
- }
2018
- return __customerUpdateSubscriptionPaymentMethod;
2019
- }
2020
- export function customerAllowedActions(payload) {
2021
- function __customerAllowedActions({ host }) {
2022
- const metadata = {
2023
- entityFqdn: 'wix.billing.v1.subscription',
2024
- method: 'GET',
2025
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.AllowedActions',
2026
- packageName: PACKAGE_NAME,
2027
- url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
2028
- protoPath: '/v1/customer_subscriptions/{id}/allowed_actions',
2029
- data: payload,
2030
- host,
2031
- }),
2032
- params: toURLSearchParams(payload),
2033
- };
2034
- return metadata;
2035
- }
2036
- return __customerAllowedActions;
2037
- }
2038
- /** List future subscriptions charges. */
2039
- export function customerListUpcomingCharges(payload) {
2040
- function __customerListUpcomingCharges({ host }) {
2041
- const metadata = {
2042
- entityFqdn: 'wix.billing.v1.subscription',
2043
- method: 'GET',
2044
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.ListUpcomingCharges',
2045
- packageName: PACKAGE_NAME,
2046
- url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
2047
- protoPath: '/v1/customer_subscriptions/{id}/upcoming_charges',
2048
- data: payload,
2049
- host,
2050
- }),
2051
- params: toURLSearchParams(payload),
2052
- transformResponse: (payload) => transformPaths(payload, [
2053
- {
2054
- transformFn: transformRESTTimestampToSDKTimestamp,
2055
- paths: [{ path: 'upcomingCharge.billingDate' }],
2056
- },
2057
- ]),
2058
- };
2059
- return metadata;
2060
- }
2061
- return __customerListUpcomingCharges;
2062
- }
2063
- /** Creates auto-charge order that can be paid by customer */
2064
- export function customerInitiatePaymentMethodSetup(payload) {
2065
- function __customerInitiatePaymentMethodSetup({ host }) {
2066
- const metadata = {
2067
- entityFqdn: 'wix.billing.v1.subscription',
2068
- method: 'POST',
2069
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.InitiatePaymentMethodSetup',
2070
- packageName: PACKAGE_NAME,
2071
- url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl({
2072
- protoPath: '/v1/customer_subscriptions/{id}/payment_method_setup',
2073
- data: payload,
2074
- host,
2075
- }),
2076
- data: payload,
2077
- };
2078
- return metadata;
2079
- }
2080
- return __customerInitiatePaymentMethodSetup;
2081
- }
2082
- /** Returns a single subscription by its id */
2083
- export function getSubscription(payload) {
2084
- function __getSubscription({ host }) {
2085
- const metadata = {
2086
- entityFqdn: 'wix.billing.v1.subscription',
2087
- method: 'GET',
2088
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.GetSubscription',
2089
- packageName: PACKAGE_NAME,
2090
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2091
- protoPath: '/v1/subscriptions/{id}',
2092
- data: payload,
2093
- host,
2094
- }),
2095
- params: toURLSearchParams(payload),
2096
- transformResponse: (payload) => transformPaths(payload, [
2097
- {
2098
- transformFn: transformRESTTimestampToSDKTimestamp,
2099
- paths: [
2100
- { path: 'subscription.createdDate' },
2101
- { path: 'subscription.updatedDate' },
2102
- { path: 'subscription.startDate' },
2103
- { path: 'subscription.endDate' },
2104
- { path: 'subscription.billingStatus.nextBillingDate' },
2105
- { path: 'subscription.billingStatus.previousBillingDate' },
2106
2837
  {
2107
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2838
+ path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.freeTrialData.endDate',
2108
2839
  },
2109
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2110
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2111
2840
  {
2112
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2841
+ path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.updateBillingDateData.paidUntil',
2113
2842
  },
2114
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2115
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2116
- { path: 'subscription.pauseInfo.startDate' },
2117
- { path: 'subscription.pauseInfo.resumeDate' },
2118
- { path: 'subscription.cancellationInfo.cancellationDate' },
2119
2843
  {
2120
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2844
+ path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.gracePeriodData.startDate',
2121
2845
  },
2122
- ],
2123
- },
2124
- ]),
2125
- };
2126
- return metadata;
2127
- }
2128
- return __getSubscription;
2129
- }
2130
- /**
2131
- * Update subscription's payment method.
2132
- * Supported only for recurring subscriptions or one time subscriptions during free trial.
2133
- */
2134
- export function updateSubscriptionPaymentMethod(payload) {
2135
- function __updateSubscriptionPaymentMethod({ host }) {
2136
- const metadata = {
2137
- entityFqdn: 'wix.billing.v1.subscription',
2138
- method: 'PATCH',
2139
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.UpdateSubscriptionPaymentMethod',
2140
- packageName: PACKAGE_NAME,
2141
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2142
- protoPath: '/v1/subscriptions/{id}/payment_method',
2143
- data: payload,
2144
- host,
2145
- }),
2146
- data: payload,
2147
- transformResponse: (payload) => transformPaths(payload, [
2148
- {
2149
- transformFn: transformRESTTimestampToSDKTimestamp,
2150
- paths: [
2151
- { path: 'subscription.createdDate' },
2152
- { path: 'subscription.updatedDate' },
2153
- { path: 'subscription.startDate' },
2154
- { path: 'subscription.endDate' },
2155
- { path: 'subscription.billingStatus.nextBillingDate' },
2156
- { path: 'subscription.billingStatus.previousBillingDate' },
2157
2846
  {
2158
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2847
+ path: 'historyEntries.event.freeTrailEnded.subscription.billingStatus.gracePeriodData.endDate',
2159
2848
  },
2160
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2161
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2162
2849
  {
2163
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2850
+ path: 'historyEntries.event.freeTrailEnded.subscription.pauseInfo.startDate',
2164
2851
  },
2165
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2166
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2167
- { path: 'subscription.pauseInfo.startDate' },
2168
- { path: 'subscription.pauseInfo.resumeDate' },
2169
- { path: 'subscription.cancellationInfo.cancellationDate' },
2170
2852
  {
2171
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2853
+ path: 'historyEntries.event.freeTrailEnded.subscription.pauseInfo.resumeDate',
2172
2854
  },
2173
- ],
2174
- },
2175
- ]),
2176
- };
2177
- return metadata;
2178
- }
2179
- return __updateSubscriptionPaymentMethod;
2180
- }
2181
- /**
2182
- * Updates the next billing date for a subscription.
2183
- *
2184
- *
2185
- * Updating the billing date may add a proration charge or credit to the next
2186
- * invoice. The customer must pay more in case you extend the current billing
2187
- * cycle. They pay less in case you shorten the current billing cycle. You can
2188
- * choose whether BASS automatically calculates the proration amount based on
2189
- * the number of days added to or removed from the current billing cycle.
2190
- * Alternatively, you can pass a proration amount based on your own custom
2191
- * calculation. The custom proration amount can't exceed the total of the
2192
- * current billing cycle.
2193
- */
2194
- export function updateSubscriptionBillingDate(payload) {
2195
- function __updateSubscriptionBillingDate({ host }) {
2196
- const serializedData = transformPaths(payload, [
2197
- {
2198
- transformFn: transformSDKTimestampToRESTTimestamp,
2199
- paths: [{ path: 'billingDate' }],
2200
- },
2201
- ]);
2202
- const metadata = {
2203
- entityFqdn: 'wix.billing.v1.subscription',
2204
- method: 'PATCH',
2205
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.UpdateSubscriptionBillingDate',
2206
- packageName: PACKAGE_NAME,
2207
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2208
- protoPath: '/v1/subscriptions/{id}/update-billing-date',
2209
- data: serializedData,
2210
- host,
2211
- }),
2212
- data: serializedData,
2213
- transformResponse: (payload) => transformPaths(payload, [
2214
- {
2215
- transformFn: transformRESTTimestampToSDKTimestamp,
2216
- paths: [
2217
- { path: 'subscription.createdDate' },
2218
- { path: 'subscription.updatedDate' },
2219
- { path: 'subscription.startDate' },
2220
- { path: 'subscription.endDate' },
2221
- { path: 'subscription.billingStatus.nextBillingDate' },
2222
- { path: 'subscription.billingStatus.previousBillingDate' },
2223
2855
  {
2224
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2856
+ path: 'historyEntries.event.freeTrailEnded.subscription.cancellationInfo.cancellationDate',
2225
2857
  },
2226
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2227
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2228
2858
  {
2229
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2859
+ path: 'historyEntries.event.freeTrailEnded.subscription.specificDatePendingUpdateData.executionDate',
2230
2860
  },
2231
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2232
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2233
- { path: 'subscription.pauseInfo.startDate' },
2234
- { path: 'subscription.pauseInfo.resumeDate' },
2235
- { path: 'subscription.cancellationInfo.cancellationDate' },
2236
2861
  {
2237
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2862
+ path: 'historyEntries.event.billingCyclePaid.subscription.createdDate',
2238
2863
  },
2239
- ],
2240
- },
2241
- ]),
2242
- };
2243
- return metadata;
2244
- }
2245
- return __updateSubscriptionBillingDate;
2246
- }
2247
- /**
2248
- * Cancels subscription immediately. Can be canceled by member if subscription policy allows it
2249
- * Only PENDING, ACTIVE or PAUSED subscriptions can be canceled
2250
- */
2251
- export function cancelSubscription(payload) {
2252
- function __cancelSubscription({ host }) {
2253
- const metadata = {
2254
- entityFqdn: 'wix.billing.v1.subscription',
2255
- method: 'POST',
2256
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.CancelSubscription',
2257
- packageName: PACKAGE_NAME,
2258
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2259
- protoPath: '/v1/subscriptions/{id}/cancel',
2260
- data: payload,
2261
- host,
2262
- }),
2263
- data: payload,
2264
- transformResponse: (payload) => transformPaths(payload, [
2265
- {
2266
- transformFn: transformRESTTimestampToSDKTimestamp,
2267
- paths: [
2268
- { path: 'subscription.createdDate' },
2269
- { path: 'subscription.updatedDate' },
2270
- { path: 'subscription.startDate' },
2271
- { path: 'subscription.endDate' },
2272
- { path: 'subscription.billingStatus.nextBillingDate' },
2273
- { path: 'subscription.billingStatus.previousBillingDate' },
2274
2864
  {
2275
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2865
+ path: 'historyEntries.event.billingCyclePaid.subscription.updatedDate',
2276
2866
  },
2277
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2278
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2279
2867
  {
2280
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2868
+ path: 'historyEntries.event.billingCyclePaid.subscription.startDate',
2281
2869
  },
2282
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2283
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2284
- { path: 'subscription.pauseInfo.startDate' },
2285
- { path: 'subscription.pauseInfo.resumeDate' },
2286
- { path: 'subscription.cancellationInfo.cancellationDate' },
2287
2870
  {
2288
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2871
+ path: 'historyEntries.event.billingCyclePaid.subscription.endDate',
2289
2872
  },
2290
- ],
2291
- },
2292
- ]),
2293
- };
2294
- return metadata;
2295
- }
2296
- return __cancelSubscription;
2297
- }
2298
- /** Pauses subscription now or in future. Possible to pause also payments schedule. */
2299
- export function pauseSubscription(payload) {
2300
- function __pauseSubscription({ host }) {
2301
- const serializedData = transformPaths(payload, [
2302
- {
2303
- transformFn: transformSDKTimestampToRESTTimestamp,
2304
- paths: [
2305
- { path: 'pauseAtSchedule.specificDate' },
2306
- { path: 'autoResumeAtSchedule.specificDate' },
2307
- ],
2308
- },
2309
- ]);
2310
- const metadata = {
2311
- entityFqdn: 'wix.billing.v1.subscription',
2312
- method: 'POST',
2313
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PauseSubscription',
2314
- packageName: PACKAGE_NAME,
2315
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2316
- protoPath: '/v1/subscriptions/{id}/pause',
2317
- data: serializedData,
2318
- host,
2319
- }),
2320
- data: serializedData,
2321
- transformResponse: (payload) => transformPaths(payload, [
2322
- {
2323
- transformFn: transformRESTTimestampToSDKTimestamp,
2324
- paths: [
2325
- { path: 'subscription.createdDate' },
2326
- { path: 'subscription.updatedDate' },
2327
- { path: 'subscription.startDate' },
2328
- { path: 'subscription.endDate' },
2329
- { path: 'subscription.billingStatus.nextBillingDate' },
2330
- { path: 'subscription.billingStatus.previousBillingDate' },
2331
2873
  {
2332
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2874
+ path: 'historyEntries.event.billingCyclePaid.subscription.billingStatus.nextBillingDate',
2333
2875
  },
2334
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2335
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2336
2876
  {
2337
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2877
+ path: 'historyEntries.event.billingCyclePaid.subscription.billingStatus.previousBillingDate',
2338
2878
  },
2339
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2340
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2341
- { path: 'subscription.pauseInfo.startDate' },
2342
- { path: 'subscription.pauseInfo.resumeDate' },
2343
- { path: 'subscription.cancellationInfo.cancellationDate' },
2344
2879
  {
2345
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2880
+ path: 'historyEntries.event.billingCyclePaid.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2346
2881
  },
2347
- ],
2348
- },
2349
- ]),
2350
- };
2351
- return metadata;
2352
- }
2353
- return __pauseSubscription;
2354
- }
2355
- /** Resumes paused subscription now or in future. */
2356
- export function resumeSubscription(payload) {
2357
- function __resumeSubscription({ host }) {
2358
- const serializedData = transformPaths(payload, [
2359
- {
2360
- transformFn: transformSDKTimestampToRESTTimestamp,
2361
- paths: [{ path: 'resumeAtSchedule.specificDate' }],
2362
- },
2363
- ]);
2364
- const metadata = {
2365
- entityFqdn: 'wix.billing.v1.subscription',
2366
- method: 'POST',
2367
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ResumeSubscription',
2368
- packageName: PACKAGE_NAME,
2369
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2370
- protoPath: '/v1/subscriptions/{id}/resume',
2371
- data: serializedData,
2372
- host,
2373
- }),
2374
- data: serializedData,
2375
- transformResponse: (payload) => transformPaths(payload, [
2376
- {
2377
- transformFn: transformRESTTimestampToSDKTimestamp,
2378
- paths: [
2379
- { path: 'subscription.createdDate' },
2380
- { path: 'subscription.updatedDate' },
2381
- { path: 'subscription.startDate' },
2382
- { path: 'subscription.endDate' },
2383
- { path: 'subscription.billingStatus.nextBillingDate' },
2384
- { path: 'subscription.billingStatus.previousBillingDate' },
2385
2882
  {
2386
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2883
+ path: 'historyEntries.event.billingCyclePaid.subscription.billingStatus.freeTrialData.startDate',
2387
2884
  },
2388
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2389
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2390
2885
  {
2391
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2886
+ path: 'historyEntries.event.billingCyclePaid.subscription.billingStatus.freeTrialData.endDate',
2392
2887
  },
2393
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2394
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2395
- { path: 'subscription.pauseInfo.startDate' },
2396
- { path: 'subscription.pauseInfo.resumeDate' },
2397
- { path: 'subscription.cancellationInfo.cancellationDate' },
2398
2888
  {
2399
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2889
+ path: 'historyEntries.event.billingCyclePaid.subscription.billingStatus.updateBillingDateData.paidUntil',
2400
2890
  },
2401
- ],
2402
- },
2403
- ]),
2404
- };
2405
- return metadata;
2406
- }
2407
- return __resumeSubscription;
2408
- }
2409
- /**
2410
- * Lists subscriptions based on specified filters.
2411
- * By default non-draft subscriptions returned.
2412
- */
2413
- export function querySubscriptions(payload) {
2414
- function __querySubscriptions({ host }) {
2415
- const metadata = {
2416
- entityFqdn: 'wix.billing.v1.subscription',
2417
- method: 'POST',
2418
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.QuerySubscriptions',
2419
- packageName: PACKAGE_NAME,
2420
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2421
- protoPath: '/v1/subscriptions/query',
2422
- data: payload,
2423
- host,
2424
- }),
2425
- data: payload,
2426
- transformResponse: (payload) => transformPaths(payload, [
2427
- {
2428
- transformFn: transformRESTTimestampToSDKTimestamp,
2429
- paths: [
2430
- { path: 'subscriptions.createdDate' },
2431
- { path: 'subscriptions.updatedDate' },
2432
- { path: 'subscriptions.startDate' },
2433
- { path: 'subscriptions.endDate' },
2434
- { path: 'subscriptions.billingStatus.nextBillingDate' },
2435
- { path: 'subscriptions.billingStatus.previousBillingDate' },
2436
2891
  {
2437
- path: 'subscriptions.billingStatus.latestPaymentData.initialFailedPaymentDate',
2892
+ path: 'historyEntries.event.billingCyclePaid.subscription.billingStatus.gracePeriodData.startDate',
2438
2893
  },
2439
- { path: 'subscriptions.billingStatus.freeTrialData.startDate' },
2440
- { path: 'subscriptions.billingStatus.freeTrialData.endDate' },
2441
2894
  {
2442
- path: 'subscriptions.billingStatus.updateBillingDateData.paidUntil',
2895
+ path: 'historyEntries.event.billingCyclePaid.subscription.billingStatus.gracePeriodData.endDate',
2443
2896
  },
2444
- { path: 'subscriptions.billingStatus.gracePeriodData.startDate' },
2445
- { path: 'subscriptions.billingStatus.gracePeriodData.endDate' },
2446
- { path: 'subscriptions.pauseInfo.startDate' },
2447
- { path: 'subscriptions.pauseInfo.resumeDate' },
2448
- { path: 'subscriptions.cancellationInfo.cancellationDate' },
2449
2897
  {
2450
- path: 'subscriptions.specificDatePendingUpdateData.executionDate',
2898
+ path: 'historyEntries.event.billingCyclePaid.subscription.pauseInfo.startDate',
2899
+ },
2900
+ {
2901
+ path: 'historyEntries.event.billingCyclePaid.subscription.pauseInfo.resumeDate',
2902
+ },
2903
+ {
2904
+ path: 'historyEntries.event.billingCyclePaid.subscription.cancellationInfo.cancellationDate',
2905
+ },
2906
+ {
2907
+ path: 'historyEntries.event.billingCyclePaid.subscription.specificDatePendingUpdateData.executionDate',
2908
+ },
2909
+ {
2910
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.createdDate',
2911
+ },
2912
+ {
2913
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.updatedDate',
2914
+ },
2915
+ {
2916
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.startDate',
2917
+ },
2918
+ {
2919
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.endDate',
2920
+ },
2921
+ {
2922
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.nextBillingDate',
2923
+ },
2924
+ {
2925
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.previousBillingDate',
2451
2926
  },
2452
- ],
2453
- },
2454
- ]),
2455
- };
2456
- return metadata;
2457
- }
2458
- return __querySubscriptions;
2459
- }
2460
- export function searchSubscriptions(payload) {
2461
- function __searchSubscriptions({ host }) {
2462
- const metadata = {
2463
- entityFqdn: 'wix.billing.v1.subscription',
2464
- method: 'POST',
2465
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.SearchSubscriptions',
2466
- packageName: PACKAGE_NAME,
2467
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2468
- protoPath: '/v1/subscriptions/search',
2469
- data: payload,
2470
- host,
2471
- }),
2472
- data: payload,
2473
- transformResponse: (payload) => transformPaths(payload, [
2474
- {
2475
- transformFn: transformRESTTimestampToSDKTimestamp,
2476
- paths: [
2477
- { path: 'subscriptions.createdDate' },
2478
- { path: 'subscriptions.updatedDate' },
2479
- { path: 'subscriptions.startDate' },
2480
- { path: 'subscriptions.endDate' },
2481
- { path: 'subscriptions.billingStatus.nextBillingDate' },
2482
- { path: 'subscriptions.billingStatus.previousBillingDate' },
2483
2927
  {
2484
- path: 'subscriptions.billingStatus.latestPaymentData.initialFailedPaymentDate',
2928
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2485
2929
  },
2486
- { path: 'subscriptions.billingStatus.freeTrialData.startDate' },
2487
- { path: 'subscriptions.billingStatus.freeTrialData.endDate' },
2488
2930
  {
2489
- path: 'subscriptions.billingStatus.updateBillingDateData.paidUntil',
2931
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.freeTrialData.startDate',
2490
2932
  },
2491
- { path: 'subscriptions.billingStatus.gracePeriodData.startDate' },
2492
- { path: 'subscriptions.billingStatus.gracePeriodData.endDate' },
2493
- { path: 'subscriptions.pauseInfo.startDate' },
2494
- { path: 'subscriptions.pauseInfo.resumeDate' },
2495
- { path: 'subscriptions.cancellationInfo.cancellationDate' },
2496
2933
  {
2497
- path: 'subscriptions.specificDatePendingUpdateData.executionDate',
2934
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.freeTrialData.endDate',
2498
2935
  },
2499
- ],
2500
- },
2501
- ]),
2502
- };
2503
- return metadata;
2504
- }
2505
- return __searchSubscriptions;
2506
- }
2507
- /**
2508
- * Counts subscriptions given the provided filters. Returns the total number
2509
- * of subscriptions matching the filters and a count per status.
2510
- *
2511
- *
2512
- * You can either pass a list of statuses or a `statusGroup`, which is a
2513
- * pre-defined combination of statuses.
2514
- *
2515
- * If you don't provide any filters, all subscription statuses with the
2516
- * exception of `"DRAFT"` are counted.
2517
- *
2518
- * You may also specify a `customerId` as filter. Then, only subscriptions for
2519
- * this customer are counted. When providing a `customerId`, you must also
2520
- * specify a `paymentMethodId`.
2521
- */
2522
- export function countSubscriptions(payload) {
2523
- function __countSubscriptions({ host }) {
2524
- const metadata = {
2525
- entityFqdn: 'wix.billing.v1.subscription',
2526
- method: 'POST',
2527
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.CountSubscriptions',
2528
- packageName: PACKAGE_NAME,
2529
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2530
- protoPath: '/v1/subscriptions/count',
2531
- data: payload,
2532
- host,
2533
- }),
2534
- data: payload,
2535
- };
2536
- return metadata;
2537
- }
2538
- return __countSubscriptions;
2539
- }
2540
- /**
2541
- * Turn on auto-renew subscription in case auto-renew was turned off. The operation changes back cycle_auto_renew
2542
- * to true, which will ensure subscription billing will continue. Also cancellation info holding information about
2543
- * auto renew off will be cleared.
2544
- */
2545
- export function turnOnSubscriptionAutoRenewal(payload) {
2546
- function __turnOnSubscriptionAutoRenewal({ host }) {
2547
- const metadata = {
2548
- entityFqdn: 'wix.billing.v1.subscription',
2549
- method: 'PATCH',
2550
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.TurnOnSubscriptionAutoRenewal',
2551
- packageName: PACKAGE_NAME,
2552
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2553
- protoPath: '/v1/subscriptions/{id}/turn_on_auto_renewal',
2554
- data: payload,
2555
- host,
2556
- }),
2557
- data: payload,
2558
- transformResponse: (payload) => transformPaths(payload, [
2559
- {
2560
- transformFn: transformRESTTimestampToSDKTimestamp,
2561
- paths: [
2562
- { path: 'subscription.createdDate' },
2563
- { path: 'subscription.updatedDate' },
2564
- { path: 'subscription.startDate' },
2565
- { path: 'subscription.endDate' },
2566
- { path: 'subscription.billingStatus.nextBillingDate' },
2567
- { path: 'subscription.billingStatus.previousBillingDate' },
2568
2936
  {
2569
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2937
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.updateBillingDateData.paidUntil',
2570
2938
  },
2571
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2572
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2573
2939
  {
2574
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2940
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.gracePeriodData.startDate',
2575
2941
  },
2576
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2577
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2578
- { path: 'subscription.pauseInfo.startDate' },
2579
- { path: 'subscription.pauseInfo.resumeDate' },
2580
- { path: 'subscription.cancellationInfo.cancellationDate' },
2581
2942
  {
2582
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2943
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingStatus.gracePeriodData.endDate',
2583
2944
  },
2584
- ],
2585
- },
2586
- ]),
2587
- };
2588
- return metadata;
2589
- }
2590
- return __turnOnSubscriptionAutoRenewal;
2591
- }
2592
- /**
2593
- * Turn off auto-renew of subscription. At next billing date subscription will be canceled.
2594
- * Billing settings flag cycle_auto_renew is set to false and information about this operation stored
2595
- * in cancellation info for future usage in cancellation.
2596
- */
2597
- export function turnOffSubscriptionAutoRenewal(payload) {
2598
- function __turnOffSubscriptionAutoRenewal({ host }) {
2599
- const metadata = {
2600
- entityFqdn: 'wix.billing.v1.subscription',
2601
- method: 'PATCH',
2602
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.TurnOffSubscriptionAutoRenewal',
2603
- packageName: PACKAGE_NAME,
2604
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2605
- protoPath: '/v1/subscriptions/{id}/turn_off_auto_renewal',
2606
- data: payload,
2607
- host,
2608
- }),
2609
- data: payload,
2610
- transformResponse: (payload) => transformPaths(payload, [
2611
- {
2612
- transformFn: transformRESTTimestampToSDKTimestamp,
2613
- paths: [
2614
- { path: 'subscription.createdDate' },
2615
- { path: 'subscription.updatedDate' },
2616
- { path: 'subscription.startDate' },
2617
- { path: 'subscription.endDate' },
2618
- { path: 'subscription.billingStatus.nextBillingDate' },
2619
- { path: 'subscription.billingStatus.previousBillingDate' },
2620
2945
  {
2621
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2946
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.pauseInfo.startDate',
2622
2947
  },
2623
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2624
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2625
2948
  {
2626
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2949
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.pauseInfo.resumeDate',
2627
2950
  },
2628
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2629
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2630
- { path: 'subscription.pauseInfo.startDate' },
2631
- { path: 'subscription.pauseInfo.resumeDate' },
2632
- { path: 'subscription.cancellationInfo.cancellationDate' },
2633
2951
  {
2634
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2952
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.cancellationInfo.cancellationDate',
2635
2953
  },
2636
- ],
2637
- },
2638
- ]),
2639
- };
2640
- return metadata;
2641
- }
2642
- return __turnOffSubscriptionAutoRenewal;
2643
- }
2644
- /**
2645
- * Marks the last invoice as paid used for the following scenarios:
2646
- * * Offline subscriptions.
2647
- * * Online subscriptions during grace period. The operation will convert invoice to offline, remove grace period
2648
- * and will send BillingCycleStarted event after invoice closing.
2649
- * * Online one time payment subscription with total price of zero during purchase flow.
2650
- * Activated event will be sent after invoice closing and subscription will be activated.
2651
- * @deprecated It has been replaced with com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid(), and will be removed on 2025-09-30.
2652
- */
2653
- export function markLatestInvoiceAsPaid(payload) {
2654
- function __markLatestInvoiceAsPaid({ host }) {
2655
- const metadata = {
2656
- entityFqdn: 'wix.billing.v1.subscription',
2657
- method: 'POST',
2658
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkLatestInvoiceAsPaid',
2659
- packageName: PACKAGE_NAME,
2660
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2661
- protoPath: '/v1/subscriptions/{subscriptionId}/mark-latest-invoice-as-paid',
2662
- data: payload,
2663
- host,
2664
- }),
2665
- data: payload,
2666
- transformResponse: (payload) => transformPaths(payload, [
2667
- {
2668
- transformFn: transformRESTTimestampToSDKTimestamp,
2669
- paths: [
2670
- { path: 'subscription.createdDate' },
2671
- { path: 'subscription.updatedDate' },
2672
- { path: 'subscription.startDate' },
2673
- { path: 'subscription.endDate' },
2674
- { path: 'subscription.billingStatus.nextBillingDate' },
2675
- { path: 'subscription.billingStatus.previousBillingDate' },
2676
2954
  {
2677
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2955
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.specificDatePendingUpdateData.executionDate',
2678
2956
  },
2679
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2680
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2681
2957
  {
2682
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2958
+ path: 'historyEntries.event.subscriptionBoAction.subscription.createdDate',
2683
2959
  },
2684
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2685
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2686
- { path: 'subscription.pauseInfo.startDate' },
2687
- { path: 'subscription.pauseInfo.resumeDate' },
2688
- { path: 'subscription.cancellationInfo.cancellationDate' },
2689
2960
  {
2690
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2961
+ path: 'historyEntries.event.subscriptionBoAction.subscription.updatedDate',
2691
2962
  },
2692
- ],
2693
- },
2694
- ]),
2695
- };
2696
- return metadata;
2697
- }
2698
- return __markLatestInvoiceAsPaid;
2699
- }
2700
- /**
2701
- * Marks the invoice associated with the subscription in the specified cycle as paid.
2702
- * If `paid_cycle` is left empty, the most recent invoice will be marked as paid.
2703
- * If the invoice contains items other than subscription items, an error will be thrown.
2704
- *
2705
- * Marks the invoice as paid for the following scenarios:
2706
- * 1. Offline subscriptions.
2707
- * 2. Online subscriptions during the grace period.
2708
- * This operation will convert the invoice to offline, remove the grace period,
2709
- * and send a BillingCycleStarted event after the invoice is closed.
2710
- * 3. Online one-time payment subscriptions with a total price of zero during the purchase flow.
2711
- * An Activated event will be sent after the invoice is closed, and the subscription will be activated.
2712
- * 4. For external subscriptions, where the payment occurs outside of BASS, an invoice is created and marked as paid
2713
- */
2714
- export function markInvoiceAsPaid(payload) {
2715
- function __markInvoiceAsPaid({ host }) {
2716
- const metadata = {
2717
- entityFqdn: 'wix.billing.v1.subscription',
2718
- method: 'POST',
2719
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid',
2720
- packageName: PACKAGE_NAME,
2721
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2722
- protoPath: '/v1/subscriptions/{subscriptionId}/mark-invoice-as-paid',
2723
- data: payload,
2724
- host,
2725
- }),
2726
- data: payload,
2727
- transformResponse: (payload) => transformPaths(payload, [
2728
- {
2729
- transformFn: transformRESTTimestampToSDKTimestamp,
2730
- paths: [
2731
- { path: 'subscription.createdDate' },
2732
- { path: 'subscription.updatedDate' },
2733
- { path: 'subscription.startDate' },
2734
- { path: 'subscription.endDate' },
2735
- { path: 'subscription.billingStatus.nextBillingDate' },
2736
- { path: 'subscription.billingStatus.previousBillingDate' },
2737
2963
  {
2738
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2964
+ path: 'historyEntries.event.subscriptionBoAction.subscription.startDate',
2965
+ },
2966
+ {
2967
+ path: 'historyEntries.event.subscriptionBoAction.subscription.endDate',
2968
+ },
2969
+ {
2970
+ path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.nextBillingDate',
2971
+ },
2972
+ {
2973
+ path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.previousBillingDate',
2974
+ },
2975
+ {
2976
+ path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2977
+ },
2978
+ {
2979
+ path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.freeTrialData.startDate',
2739
2980
  },
2740
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2741
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2742
2981
  {
2743
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2982
+ path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.freeTrialData.endDate',
2744
2983
  },
2745
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2746
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2747
- { path: 'subscription.pauseInfo.startDate' },
2748
- { path: 'subscription.pauseInfo.resumeDate' },
2749
- { path: 'subscription.cancellationInfo.cancellationDate' },
2750
2984
  {
2751
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2985
+ path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.updateBillingDateData.paidUntil',
2752
2986
  },
2753
- ],
2754
- },
2755
- ]),
2756
- };
2757
- return metadata;
2758
- }
2759
- return __markInvoiceAsPaid;
2760
- }
2761
- /** Returns number of subscriptions in each state. */
2762
- export function getSubscriptionsStats(payload) {
2763
- function __getSubscriptionsStats({ host }) {
2764
- const metadata = {
2765
- entityFqdn: 'wix.billing.v1.subscription',
2766
- method: 'GET',
2767
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.GetSubscriptionsStats',
2768
- packageName: PACKAGE_NAME,
2769
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2770
- protoPath: '/v1/subscriptions/stats',
2771
- data: payload,
2772
- host,
2773
- }),
2774
- params: toURLSearchParams(payload),
2775
- };
2776
- return metadata;
2777
- }
2778
- return __getSubscriptionsStats;
2779
- }
2780
- /** Extends subscription by moving end date with or without billing cycles addition. */
2781
- export function extendSubscription(payload) {
2782
- function __extendSubscription({ host }) {
2783
- const metadata = {
2784
- entityFqdn: 'wix.billing.v1.subscription',
2785
- method: 'PATCH',
2786
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ExtendSubscription',
2787
- packageName: PACKAGE_NAME,
2788
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2789
- protoPath: '/v1/subscriptions/{id}/extend',
2790
- data: payload,
2791
- host,
2792
- }),
2793
- data: payload,
2794
- transformResponse: (payload) => transformPaths(payload, [
2795
- {
2796
- transformFn: transformRESTTimestampToSDKTimestamp,
2797
- paths: [
2798
- { path: 'subscription.createdDate' },
2799
- { path: 'subscription.updatedDate' },
2800
- { path: 'subscription.startDate' },
2801
- { path: 'subscription.endDate' },
2802
- { path: 'subscription.billingStatus.nextBillingDate' },
2803
- { path: 'subscription.billingStatus.previousBillingDate' },
2804
2987
  {
2805
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2988
+ path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.gracePeriodData.startDate',
2806
2989
  },
2807
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2808
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2809
2990
  {
2810
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
2991
+ path: 'historyEntries.event.subscriptionBoAction.subscription.billingStatus.gracePeriodData.endDate',
2811
2992
  },
2812
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2813
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2814
- { path: 'subscription.pauseInfo.startDate' },
2815
- { path: 'subscription.pauseInfo.resumeDate' },
2816
- { path: 'subscription.cancellationInfo.cancellationDate' },
2817
2993
  {
2818
- path: 'subscription.specificDatePendingUpdateData.executionDate',
2994
+ path: 'historyEntries.event.subscriptionBoAction.subscription.pauseInfo.startDate',
2819
2995
  },
2820
- ],
2821
- },
2822
- ]),
2823
- };
2824
- return metadata;
2825
- }
2826
- return __extendSubscription;
2827
- }
2828
- export function allowedActions(payload) {
2829
- function __allowedActions({ host }) {
2830
- const metadata = {
2831
- entityFqdn: 'wix.billing.v1.subscription',
2832
- method: 'GET',
2833
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.AllowedActions',
2834
- packageName: PACKAGE_NAME,
2835
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2836
- protoPath: '/v1/subscriptions/{id}/allowed_actions',
2837
- data: payload,
2838
- host,
2839
- }),
2840
- params: toURLSearchParams(payload),
2841
- };
2842
- return metadata;
2843
- }
2844
- return __allowedActions;
2845
- }
2846
- /** List future subscriptions charges */
2847
- export function listUpcomingCharges(payload) {
2848
- function __listUpcomingCharges({ host }) {
2849
- const serializedData = transformPaths(payload, [
2850
- {
2851
- transformFn: transformSDKTimestampToRESTTimestamp,
2852
- paths: [{ path: 'nextBillingDate' }],
2853
- },
2854
- ]);
2855
- const metadata = {
2856
- entityFqdn: 'wix.billing.v1.subscription',
2857
- method: 'GET',
2858
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ListUpcomingCharges',
2859
- packageName: PACKAGE_NAME,
2860
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2861
- protoPath: '/v1/subscriptions/{subscriptionId}/upcoming_charges',
2862
- data: serializedData,
2863
- host,
2864
- }),
2865
- params: toURLSearchParams(serializedData),
2866
- transformResponse: (payload) => transformPaths(payload, [
2867
- {
2868
- transformFn: transformRESTTimestampToSDKTimestamp,
2869
- paths: [{ path: 'upcomingCharges.billingDate' }],
2870
- },
2871
- ]),
2872
- };
2873
- return metadata;
2874
- }
2875
- return __listUpcomingCharges;
2876
- }
2877
- /**
2878
- * Retrieves the preview of subscription charges.
2879
- * Returns all the charges applicable to a subscription based on the provided subscription information.
2880
- * @deprecated It has been replaced with com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionsCharges(), and will be removed on 2025-06-30.
2881
- */
2882
- export function previewSubscriptionCharges(payload) {
2883
- function __previewSubscriptionCharges({ host }) {
2884
- const serializedData = transformPaths(payload, [
2885
- {
2886
- transformFn: transformSDKTimestampToRESTTimestamp,
2887
- paths: [{ path: 'subscriptionInfo.startDate' }],
2888
- },
2889
- ]);
2890
- const metadata = {
2891
- entityFqdn: 'wix.billing.v1.subscription',
2892
- method: 'GET',
2893
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionCharges',
2894
- packageName: PACKAGE_NAME,
2895
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2896
- protoPath: '/v1/subscriptions/preview_charges',
2897
- data: serializedData,
2898
- host,
2899
- }),
2900
- params: toURLSearchParams(serializedData),
2901
- transformResponse: (payload) => transformPaths(payload, [
2902
- {
2903
- transformFn: transformRESTTimestampToSDKTimestamp,
2904
- paths: [{ path: 'charges.cycleBillingDate' }],
2905
- },
2906
- ]),
2907
- };
2908
- return metadata;
2909
- }
2910
- return __previewSubscriptionCharges;
2911
- }
2912
- /**
2913
- * Retrieves the preview of subscription charges for a bulk of subscriptions.
2914
- * Returns all the charges applicable to all subscriptions, based on the provided subscriptions information.
2915
- */
2916
- export function previewSubscriptionsCharges(payload) {
2917
- function __previewSubscriptionsCharges({ host }) {
2918
- const serializedData = transformPaths(payload, [
2919
- {
2920
- transformFn: transformSDKTimestampToRESTTimestamp,
2921
- paths: [{ path: 'subscriptionsBillingDetails.startDate' }],
2922
- },
2923
- ]);
2924
- const metadata = {
2925
- entityFqdn: 'wix.billing.v1.subscription',
2926
- method: 'GET',
2927
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionsCharges',
2928
- packageName: PACKAGE_NAME,
2929
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2930
- protoPath: '/v1/subscriptions/preview-subscriptions-charges',
2931
- data: serializedData,
2932
- host,
2933
- }),
2934
- params: toURLSearchParams(serializedData),
2935
- transformResponse: (payload) => transformPaths(payload, [
2936
- {
2937
- transformFn: transformRESTTimestampToSDKTimestamp,
2938
- paths: [{ path: 'subscriptionsCharges.charges.cycleBillingDate' }],
2939
- },
2940
- ]),
2941
- };
2942
- return metadata;
2943
- }
2944
- return __previewSubscriptionsCharges;
2945
- }
2946
- /** Creates authorization invoice with Moto settings in order to create */
2947
- export function initiatePaymentMethodSetup(payload) {
2948
- function __initiatePaymentMethodSetup({ host }) {
2949
- const metadata = {
2950
- entityFqdn: 'wix.billing.v1.subscription',
2951
- method: 'POST',
2952
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.InitiatePaymentMethodSetup',
2953
- packageName: PACKAGE_NAME,
2954
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
2955
- protoPath: '/v1/subscriptions/{id}/payment_method_setup',
2956
- data: payload,
2957
- host,
2958
- }),
2959
- data: payload,
2960
- };
2961
- return metadata;
2962
- }
2963
- return __initiatePaymentMethodSetup;
2964
- }
2965
- /** This used only for automation and permitted tenants (QA & testing) */
2966
- export function payCycle(payload) {
2967
- function __payCycle({ host }) {
2968
- const metadata = {
2969
- entityFqdn: 'wix.billing.v1.subscription',
2970
- method: 'POST',
2971
- methodFqn: 'com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle',
2972
- packageName: PACKAGE_NAME,
2973
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsBackOfficeServiceUrl({
2974
- protoPath: '/v1/subscriptions-bo/{subscriptionId}/pay-cycle',
2975
- data: payload,
2976
- host,
2977
- }),
2978
- data: payload,
2979
- transformResponse: (payload) => transformPaths(payload, [
2980
- {
2981
- transformFn: transformRESTTimestampToSDKTimestamp,
2982
- paths: [
2983
- { path: 'subscription.createdDate' },
2984
- { path: 'subscription.updatedDate' },
2985
- { path: 'subscription.startDate' },
2986
- { path: 'subscription.endDate' },
2987
- { path: 'subscription.billingStatus.nextBillingDate' },
2988
- { path: 'subscription.billingStatus.previousBillingDate' },
2989
2996
  {
2990
- path: 'subscription.billingStatus.latestPaymentData.initialFailedPaymentDate',
2997
+ path: 'historyEntries.event.subscriptionBoAction.subscription.pauseInfo.resumeDate',
2991
2998
  },
2992
- { path: 'subscription.billingStatus.freeTrialData.startDate' },
2993
- { path: 'subscription.billingStatus.freeTrialData.endDate' },
2994
2999
  {
2995
- path: 'subscription.billingStatus.updateBillingDateData.paidUntil',
3000
+ path: 'historyEntries.event.subscriptionBoAction.subscription.cancellationInfo.cancellationDate',
2996
3001
  },
2997
- { path: 'subscription.billingStatus.gracePeriodData.startDate' },
2998
- { path: 'subscription.billingStatus.gracePeriodData.endDate' },
2999
- { path: 'subscription.pauseInfo.startDate' },
3000
- { path: 'subscription.pauseInfo.resumeDate' },
3001
- { path: 'subscription.cancellationInfo.cancellationDate' },
3002
3002
  {
3003
- path: 'subscription.specificDatePendingUpdateData.executionDate',
3003
+ path: 'historyEntries.event.subscriptionBoAction.subscription.specificDatePendingUpdateData.executionDate',
3004
3004
  },
3005
3005
  ],
3006
3006
  },
@@ -3008,6 +3008,6 @@ export function payCycle(payload) {
3008
3008
  };
3009
3009
  return metadata;
3010
3010
  }
3011
- return __payCycle;
3011
+ return __listSubscriptionHistory;
3012
3012
  }
3013
3013
  //# sourceMappingURL=billing-v1-subscription-subscriptions.http.js.map