@outseta/api-client 0.3.3 → 0.3.5

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 (25) hide show
  1. package/dist/index.js +302 -0
  2. package/package.json +1 -1
  3. package/src/generated/activity/activity.ts +1 -1
  4. package/src/generated/attribute/attribute.ts +2 -2
  5. package/src/generated/billing/billing.ts +1639 -430
  6. package/src/generated/crm/crm.ts +9 -6
  7. package/src/generated/email/email.ts +4 -3
  8. package/src/generated/models/discountCouponGetAllDiscountCouponsParams.ts +18 -0
  9. package/src/generated/models/discountCouponGetDiscountCouponByCodeParams.ts +9 -0
  10. package/src/generated/models/discountCouponGetDiscountCouponRedemptionsParams.ts +14 -0
  11. package/src/generated/models/discountCouponUpdateDiscountCouponBody.ts +7 -0
  12. package/src/generated/models/index.ts +13 -2
  13. package/src/generated/models/planAddPlanBody.ts +7 -0
  14. package/src/generated/models/planFamilyAddPlanFamilyBody.ts +7 -0
  15. package/src/generated/models/planFamilyUpdatePlanFamilyBody.ts +7 -0
  16. package/src/generated/models/planUpdatePlanBody.ts +7 -0
  17. package/src/generated/models/subscriptionAddOnAddSubscriptionAddOnPreviewBody.ts +7 -0
  18. package/src/generated/models/subscriptionAddOnGetAllSubscriptionsAddOnsParams.ts +9 -0
  19. package/src/generated/models/subscriptionAddOnSetAddOnUpgradeRequiredBody.ts +7 -0
  20. package/src/generated/models/subscriptionGetAllSubscriptionsParams.ts +14 -0
  21. package/src/generated/models/twoFactorVerifyRequest.ts +25 -0
  22. package/src/generated/public/public.ts +17 -82
  23. package/src/generated/support/support.ts +6 -5
  24. package/src/generated/models/authRefreshTokenParams.ts +0 -8
  25. package/src/generated/models/authVerifyTwoFactorTokenParams.ts +0 -8
@@ -2,15 +2,28 @@
2
2
  import type {
3
3
  DiscountCoupon,
4
4
  DiscountCouponAddDiscountCouponBody,
5
+ DiscountCouponGetAllDiscountCouponsParams,
6
+ DiscountCouponGetDiscountCouponByCodeParams,
7
+ DiscountCouponGetDiscountCouponRedemptionsParams,
8
+ DiscountCouponSubscription,
9
+ DiscountCouponUpdateDiscountCouponBody,
5
10
  Invoice,
6
11
  InvoiceAddInvoiceBody,
7
12
  InvoiceUpdateInvoiceBody,
8
13
  PaymentInformation,
9
14
  PaymentInformationSavePaymentInformationBody,
10
15
  Plan,
16
+ PlanAddPlanBody,
11
17
  PlanFamily,
18
+ PlanFamilyAddPlanFamilyBody,
19
+ PlanFamilyUpdatePlanFamilyBody,
20
+ PlanUpdatePlanBody,
12
21
  Subscription,
22
+ SubscriptionAddOn,
13
23
  SubscriptionAddOnAddSubscriptionAddOnBody,
24
+ SubscriptionAddOnAddSubscriptionAddOnPreviewBody,
25
+ SubscriptionAddOnGetAllSubscriptionsAddOnsParams,
26
+ SubscriptionAddOnSetAddOnUpgradeRequiredBody,
14
27
  SubscriptionChangeSubscriptionBody,
15
28
  SubscriptionChangeSubscriptionParams,
16
29
  SubscriptionChangeSubscriptionPreviewBody,
@@ -18,6 +31,7 @@ import type {
18
31
  SubscriptionFirstTimeSubscriptionBody,
19
32
  SubscriptionFirstTimeSubscriptionPreviewBody,
20
33
  SubscriptionFirstTimeSubscriptionPreviewParams,
34
+ SubscriptionGetAllSubscriptionsParams,
21
35
  SubscriptionSetSubscriptionUpgradeRequiredBody,
22
36
  Transaction,
23
37
  TransactionsAddPaymentTransactionBody,
@@ -55,309 +69,368 @@ type NonReadonly<T> = [T] extends [UnionToIntersection<T>] ? {
55
69
 
56
70
 
57
71
  /**
58
- * Only one of AmountOff or PercentOff should be set.
59
- Duration values: 1 = Forever, 2 = Once, 3 = Repeating (DurationInMonths must be set).
60
- * @summary Add a new discount coupon.
72
+ * Used during registration to confirm that a coupon code can still be applied to a plan.
73
+ Returns the coupon when valid, 404 when no coupon matches the code, or a validation
74
+ error when the coupon cannot be applied.
75
+ * @summary Retrieve a discount coupon by code.
61
76
  */
62
- export type discountCouponAddDiscountCouponResponse200 = {
77
+ export type discountCouponGetDiscountCouponByCodeResponse200 = {
63
78
  data: DiscountCoupon
64
79
  status: 200
65
80
  }
66
81
 
67
- export type discountCouponAddDiscountCouponResponse401 = {
82
+ export type discountCouponGetDiscountCouponByCodeResponse400 = {
68
83
  data: void
69
- status: 401
84
+ status: 400
85
+ }
86
+
87
+ export type discountCouponGetDiscountCouponByCodeResponse404 = {
88
+ data: void
89
+ status: 404
70
90
  }
71
91
 
72
- export type discountCouponAddDiscountCouponResponseSuccess = (discountCouponAddDiscountCouponResponse200) & {
92
+ export type discountCouponGetDiscountCouponByCodeResponseSuccess = (discountCouponGetDiscountCouponByCodeResponse200) & {
73
93
  headers: Headers;
74
94
  };
75
- export type discountCouponAddDiscountCouponResponseError = (discountCouponAddDiscountCouponResponse401) & {
95
+ export type discountCouponGetDiscountCouponByCodeResponseError = (discountCouponGetDiscountCouponByCodeResponse400 | discountCouponGetDiscountCouponByCodeResponse404) & {
76
96
  headers: Headers;
77
97
  };
78
98
 
79
- export type discountCouponAddDiscountCouponResponse = (discountCouponAddDiscountCouponResponseSuccess | discountCouponAddDiscountCouponResponseError)
99
+ export type discountCouponGetDiscountCouponByCodeResponse = (discountCouponGetDiscountCouponByCodeResponseSuccess | discountCouponGetDiscountCouponByCodeResponseError)
80
100
 
81
- export const getDiscountCouponAddDiscountCouponUrl = () => {
101
+ export const getDiscountCouponGetDiscountCouponByCodeUrl = (code: string | null,
102
+ params: DiscountCouponGetDiscountCouponByCodeParams,) => {
103
+ const normalizedParams = new URLSearchParams();
82
104
 
105
+ Object.entries(params || {}).forEach(([key, value]) => {
106
+
107
+ if (value !== undefined) {
108
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
109
+ }
110
+ });
83
111
 
84
-
112
+ const stringifiedParams = normalizedParams.toString();
85
113
 
86
- return `/api/v1/billing/discountcoupons`
114
+ return stringifiedParams.length > 0 ? `/api/v1/public/billing/discountcoupons/${code}?${stringifiedParams}` : `/api/v1/public/billing/discountcoupons/${code}`
87
115
  }
88
116
 
89
- export const discountCouponAddDiscountCoupon = async (discountCouponAddDiscountCouponBody: NonReadonly<DiscountCouponAddDiscountCouponBody>, options?: RequestInit): Promise<discountCouponAddDiscountCouponResponse> => {
117
+ export const discountCouponGetDiscountCouponByCode = async (code: string | null,
118
+ params: DiscountCouponGetDiscountCouponByCodeParams, options?: RequestInit): Promise<discountCouponGetDiscountCouponByCodeResponse> => {
90
119
 
91
- return customFetch<discountCouponAddDiscountCouponResponse>(getDiscountCouponAddDiscountCouponUrl(),
120
+ return customFetch<discountCouponGetDiscountCouponByCodeResponse>(getDiscountCouponGetDiscountCouponByCodeUrl(code,params),
92
121
  {
93
122
  ...options,
94
- method: 'POST',
95
- headers: { 'Content-Type': 'application/json', ...options?.headers },
96
- body: JSON.stringify(
97
- discountCouponAddDiscountCouponBody,)
123
+ method: 'GET'
124
+
125
+
98
126
  }
99
127
  );}
100
128
 
101
129
 
102
130
  /**
103
- * @summary Add a usage entry for an add-on that bills for usage at the end of the month.
131
+ * @summary Retrieve all discount coupons.
104
132
  */
105
- export type usageAddUsageResponse200 = {
106
- data: Usage
133
+ export type discountCouponGetAllDiscountCouponsResponse200 = {
134
+ data: DiscountCoupon[]
107
135
  status: 200
108
136
  }
109
137
 
110
- export type usageAddUsageResponse401 = {
138
+ export type discountCouponGetAllDiscountCouponsResponse400 = {
139
+ data: void
140
+ status: 400
141
+ }
142
+
143
+ export type discountCouponGetAllDiscountCouponsResponse401 = {
111
144
  data: void
112
145
  status: 401
113
146
  }
114
147
 
115
- export type usageAddUsageResponseSuccess = (usageAddUsageResponse200) & {
148
+ export type discountCouponGetAllDiscountCouponsResponseSuccess = (discountCouponGetAllDiscountCouponsResponse200) & {
116
149
  headers: Headers;
117
150
  };
118
- export type usageAddUsageResponseError = (usageAddUsageResponse401) & {
151
+ export type discountCouponGetAllDiscountCouponsResponseError = (discountCouponGetAllDiscountCouponsResponse400 | discountCouponGetAllDiscountCouponsResponse401) & {
119
152
  headers: Headers;
120
153
  };
121
154
 
122
- export type usageAddUsageResponse = (usageAddUsageResponseSuccess | usageAddUsageResponseError)
155
+ export type discountCouponGetAllDiscountCouponsResponse = (discountCouponGetAllDiscountCouponsResponseSuccess | discountCouponGetAllDiscountCouponsResponseError)
123
156
 
124
- export const getUsageAddUsageUrl = () => {
157
+ export const getDiscountCouponGetAllDiscountCouponsUrl = (params?: DiscountCouponGetAllDiscountCouponsParams,) => {
158
+ const normalizedParams = new URLSearchParams();
125
159
 
160
+ Object.entries(params || {}).forEach(([key, value]) => {
161
+
162
+ if (value !== undefined) {
163
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
164
+ }
165
+ });
126
166
 
127
-
167
+ const stringifiedParams = normalizedParams.toString();
128
168
 
129
- return `/api/v1/billing/usage`
169
+ return stringifiedParams.length > 0 ? `/api/v1/billing/discountcoupons?${stringifiedParams}` : `/api/v1/billing/discountcoupons`
130
170
  }
131
171
 
132
- export const usageAddUsage = async (usageAddUsageBody: NonReadonly<UsageAddUsageBody>, options?: RequestInit): Promise<usageAddUsageResponse> => {
172
+ export const discountCouponGetAllDiscountCoupons = async (params?: DiscountCouponGetAllDiscountCouponsParams, options?: RequestInit): Promise<discountCouponGetAllDiscountCouponsResponse> => {
133
173
 
134
- return customFetch<usageAddUsageResponse>(getUsageAddUsageUrl(),
174
+ return customFetch<discountCouponGetAllDiscountCouponsResponse>(getDiscountCouponGetAllDiscountCouponsUrl(params),
135
175
  {
136
176
  ...options,
137
- method: 'POST',
138
- headers: { 'Content-Type': 'application/json', ...options?.headers },
139
- body: JSON.stringify(
140
- usageAddUsageBody,)
177
+ method: 'GET'
178
+
179
+
141
180
  }
142
181
  );}
143
182
 
144
183
 
145
184
  /**
146
- * Transactions are tied to accounts and invoices.
147
- BillingTransactionType: Invoice = 1, Payment = 2, Credit = 3, Refund = 4, Chargeback = 5.
148
- * @summary Retrieve all transactions for a given account.
185
+ * Only one of AmountOff or PercentOff should be set.
186
+ Duration values: 1 = Forever, 2 = Once, 3 = Repeating (DurationInMonths must be set).
187
+ * @summary Add a new discount coupon.
149
188
  */
150
- export type transactionsGetAllTransactionsByAccountIdResponse200 = {
151
- data: Transaction[]
189
+ export type discountCouponAddDiscountCouponResponse200 = {
190
+ data: DiscountCoupon
152
191
  status: 200
153
192
  }
154
193
 
155
- export type transactionsGetAllTransactionsByAccountIdResponse400 = {
156
- data: void
157
- status: 400
158
- }
159
-
160
- export type transactionsGetAllTransactionsByAccountIdResponse401 = {
194
+ export type discountCouponAddDiscountCouponResponse401 = {
161
195
  data: void
162
196
  status: 401
163
197
  }
164
198
 
165
- export type transactionsGetAllTransactionsByAccountIdResponseSuccess = (transactionsGetAllTransactionsByAccountIdResponse200) & {
199
+ export type discountCouponAddDiscountCouponResponseSuccess = (discountCouponAddDiscountCouponResponse200) & {
166
200
  headers: Headers;
167
201
  };
168
- export type transactionsGetAllTransactionsByAccountIdResponseError = (transactionsGetAllTransactionsByAccountIdResponse400 | transactionsGetAllTransactionsByAccountIdResponse401) & {
202
+ export type discountCouponAddDiscountCouponResponseError = (discountCouponAddDiscountCouponResponse401) & {
169
203
  headers: Headers;
170
204
  };
171
205
 
172
- export type transactionsGetAllTransactionsByAccountIdResponse = (transactionsGetAllTransactionsByAccountIdResponseSuccess | transactionsGetAllTransactionsByAccountIdResponseError)
206
+ export type discountCouponAddDiscountCouponResponse = (discountCouponAddDiscountCouponResponseSuccess | discountCouponAddDiscountCouponResponseError)
173
207
 
174
- export const getTransactionsGetAllTransactionsByAccountIdUrl = (accountUid: string | null,) => {
208
+ export const getDiscountCouponAddDiscountCouponUrl = () => {
175
209
 
176
210
 
177
211
 
178
212
 
179
- return `/api/v1/billing/transactions/${accountUid}`
213
+ return `/api/v1/billing/discountcoupons`
180
214
  }
181
215
 
182
- export const transactionsGetAllTransactionsByAccountId = async (accountUid: string | null, options?: RequestInit): Promise<transactionsGetAllTransactionsByAccountIdResponse> => {
216
+ export const discountCouponAddDiscountCoupon = async (discountCouponAddDiscountCouponBody: NonReadonly<DiscountCouponAddDiscountCouponBody>, options?: RequestInit): Promise<discountCouponAddDiscountCouponResponse> => {
183
217
 
184
- return customFetch<transactionsGetAllTransactionsByAccountIdResponse>(getTransactionsGetAllTransactionsByAccountIdUrl(accountUid),
218
+ return customFetch<discountCouponAddDiscountCouponResponse>(getDiscountCouponAddDiscountCouponUrl(),
185
219
  {
186
220
  ...options,
187
- method: 'GET'
188
-
189
-
221
+ method: 'POST',
222
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
223
+ body: JSON.stringify(
224
+ discountCouponAddDiscountCouponBody,)
190
225
  }
191
226
  );}
192
227
 
193
228
 
194
229
  /**
195
- * If the amount matches the outstanding amount of the invoice, the invoice will be marked
196
- as Paid.
197
- * @summary Add a payment to an invoice.
230
+ * @summary Retrieve a discount coupon.
198
231
  */
199
- export type transactionsAddPaymentTransactionResponse200 = {
200
- data: Transaction
232
+ export type discountCouponGetDiscountCouponResponse200 = {
233
+ data: DiscountCoupon
201
234
  status: 200
202
235
  }
203
236
 
204
- export type transactionsAddPaymentTransactionResponse401 = {
237
+ export type discountCouponGetDiscountCouponResponse400 = {
238
+ data: void
239
+ status: 400
240
+ }
241
+
242
+ export type discountCouponGetDiscountCouponResponse401 = {
205
243
  data: void
206
244
  status: 401
207
245
  }
246
+
247
+ export type discountCouponGetDiscountCouponResponse404 = {
248
+ data: void
249
+ status: 404
250
+ }
208
251
 
209
- export type transactionsAddPaymentTransactionResponseSuccess = (transactionsAddPaymentTransactionResponse200) & {
252
+ export type discountCouponGetDiscountCouponResponseSuccess = (discountCouponGetDiscountCouponResponse200) & {
210
253
  headers: Headers;
211
254
  };
212
- export type transactionsAddPaymentTransactionResponseError = (transactionsAddPaymentTransactionResponse401) & {
255
+ export type discountCouponGetDiscountCouponResponseError = (discountCouponGetDiscountCouponResponse400 | discountCouponGetDiscountCouponResponse401 | discountCouponGetDiscountCouponResponse404) & {
213
256
  headers: Headers;
214
257
  };
215
258
 
216
- export type transactionsAddPaymentTransactionResponse = (transactionsAddPaymentTransactionResponseSuccess | transactionsAddPaymentTransactionResponseError)
259
+ export type discountCouponGetDiscountCouponResponse = (discountCouponGetDiscountCouponResponseSuccess | discountCouponGetDiscountCouponResponseError)
217
260
 
218
- export const getTransactionsAddPaymentTransactionUrl = () => {
261
+ export const getDiscountCouponGetDiscountCouponUrl = (discountCouponUid: string | null,) => {
219
262
 
220
263
 
221
264
 
222
265
 
223
- return `/api/v1/billing/transactions/payment`
266
+ return `/api/v1/billing/discountcoupons/${discountCouponUid}`
224
267
  }
225
268
 
226
- export const transactionsAddPaymentTransaction = async (transactionsAddPaymentTransactionBody: NonReadonly<TransactionsAddPaymentTransactionBody>, options?: RequestInit): Promise<transactionsAddPaymentTransactionResponse> => {
269
+ export const discountCouponGetDiscountCoupon = async (discountCouponUid: string | null, options?: RequestInit): Promise<discountCouponGetDiscountCouponResponse> => {
227
270
 
228
- return customFetch<transactionsAddPaymentTransactionResponse>(getTransactionsAddPaymentTransactionUrl(),
271
+ return customFetch<discountCouponGetDiscountCouponResponse>(getDiscountCouponGetDiscountCouponUrl(discountCouponUid),
229
272
  {
230
273
  ...options,
231
- method: 'POST',
232
- headers: { 'Content-Type': 'application/json', ...options?.headers },
233
- body: JSON.stringify(
234
- transactionsAddPaymentTransactionBody,)
274
+ method: 'GET'
275
+
276
+
235
277
  }
236
278
  );}
237
279
 
238
280
 
239
281
  /**
240
- * @summary Update payment information for an account.
282
+ * @summary Update a discount coupon.
241
283
  */
242
- export type paymentInformationSavePaymentInformationResponse200 = {
243
- data: PaymentInformation
284
+ export type discountCouponUpdateDiscountCouponResponse200 = {
285
+ data: DiscountCoupon
244
286
  status: 200
245
287
  }
246
288
 
247
- export type paymentInformationSavePaymentInformationResponse401 = {
289
+ export type discountCouponUpdateDiscountCouponResponse400 = {
290
+ data: void
291
+ status: 400
292
+ }
293
+
294
+ export type discountCouponUpdateDiscountCouponResponse401 = {
248
295
  data: void
249
296
  status: 401
250
297
  }
298
+
299
+ export type discountCouponUpdateDiscountCouponResponse404 = {
300
+ data: void
301
+ status: 404
302
+ }
251
303
 
252
- export type paymentInformationSavePaymentInformationResponseSuccess = (paymentInformationSavePaymentInformationResponse200) & {
304
+ export type discountCouponUpdateDiscountCouponResponseSuccess = (discountCouponUpdateDiscountCouponResponse200) & {
253
305
  headers: Headers;
254
306
  };
255
- export type paymentInformationSavePaymentInformationResponseError = (paymentInformationSavePaymentInformationResponse401) & {
307
+ export type discountCouponUpdateDiscountCouponResponseError = (discountCouponUpdateDiscountCouponResponse400 | discountCouponUpdateDiscountCouponResponse401 | discountCouponUpdateDiscountCouponResponse404) & {
256
308
  headers: Headers;
257
309
  };
258
310
 
259
- export type paymentInformationSavePaymentInformationResponse = (paymentInformationSavePaymentInformationResponseSuccess | paymentInformationSavePaymentInformationResponseError)
311
+ export type discountCouponUpdateDiscountCouponResponse = (discountCouponUpdateDiscountCouponResponseSuccess | discountCouponUpdateDiscountCouponResponseError)
260
312
 
261
- export const getPaymentInformationSavePaymentInformationUrl = () => {
313
+ export const getDiscountCouponUpdateDiscountCouponUrl = (discountCouponUid: string | null,) => {
262
314
 
263
315
 
264
316
 
265
317
 
266
- return `/api/v1/billing/paymentinformation`
318
+ return `/api/v1/billing/discountcoupons/${discountCouponUid}`
267
319
  }
268
320
 
269
- export const paymentInformationSavePaymentInformation = async (paymentInformationSavePaymentInformationBody: NonReadonly<PaymentInformationSavePaymentInformationBody>, options?: RequestInit): Promise<paymentInformationSavePaymentInformationResponse> => {
321
+ export const discountCouponUpdateDiscountCoupon = async (discountCouponUid: string | null,
322
+ discountCouponUpdateDiscountCouponBody: NonReadonly<DiscountCouponUpdateDiscountCouponBody>, options?: RequestInit): Promise<discountCouponUpdateDiscountCouponResponse> => {
270
323
 
271
- return customFetch<paymentInformationSavePaymentInformationResponse>(getPaymentInformationSavePaymentInformationUrl(),
324
+ return customFetch<discountCouponUpdateDiscountCouponResponse>(getDiscountCouponUpdateDiscountCouponUrl(discountCouponUid),
272
325
  {
273
326
  ...options,
274
- method: 'POST',
327
+ method: 'PUT',
275
328
  headers: { 'Content-Type': 'application/json', ...options?.headers },
276
329
  body: JSON.stringify(
277
- paymentInformationSavePaymentInformationBody,)
330
+ discountCouponUpdateDiscountCouponBody,)
278
331
  }
279
332
  );}
280
333
 
281
334
 
282
335
  /**
283
- * @summary Add an add-on to a subscription.
336
+ * @summary Delete a discount coupon.
284
337
  */
285
- export type subscriptionAddOnAddSubscriptionAddOnResponse200 = {
338
+ export type discountCouponDeleteDiscountCouponResponse200 = {
286
339
  data: Blob
287
340
  status: 200
288
341
  }
289
342
 
290
- export type subscriptionAddOnAddSubscriptionAddOnResponse401 = {
343
+ export type discountCouponDeleteDiscountCouponResponse400 = {
344
+ data: void
345
+ status: 400
346
+ }
347
+
348
+ export type discountCouponDeleteDiscountCouponResponse401 = {
291
349
  data: void
292
350
  status: 401
293
351
  }
352
+
353
+ export type discountCouponDeleteDiscountCouponResponse404 = {
354
+ data: void
355
+ status: 404
356
+ }
294
357
 
295
- export type subscriptionAddOnAddSubscriptionAddOnResponseSuccess = (subscriptionAddOnAddSubscriptionAddOnResponse200) & {
358
+ export type discountCouponDeleteDiscountCouponResponseSuccess = (discountCouponDeleteDiscountCouponResponse200) & {
296
359
  headers: Headers;
297
360
  };
298
- export type subscriptionAddOnAddSubscriptionAddOnResponseError = (subscriptionAddOnAddSubscriptionAddOnResponse401) & {
361
+ export type discountCouponDeleteDiscountCouponResponseError = (discountCouponDeleteDiscountCouponResponse400 | discountCouponDeleteDiscountCouponResponse401 | discountCouponDeleteDiscountCouponResponse404) & {
299
362
  headers: Headers;
300
363
  };
301
364
 
302
- export type subscriptionAddOnAddSubscriptionAddOnResponse = (subscriptionAddOnAddSubscriptionAddOnResponseSuccess | subscriptionAddOnAddSubscriptionAddOnResponseError)
365
+ export type discountCouponDeleteDiscountCouponResponse = (discountCouponDeleteDiscountCouponResponseSuccess | discountCouponDeleteDiscountCouponResponseError)
303
366
 
304
- export const getSubscriptionAddOnAddSubscriptionAddOnUrl = () => {
367
+ export const getDiscountCouponDeleteDiscountCouponUrl = (discountCouponUid: string | null,) => {
305
368
 
306
369
 
307
370
 
308
371
 
309
- return `/api/v1/billing/subscriptionaddons`
372
+ return `/api/v1/billing/discountcoupons/${discountCouponUid}`
310
373
  }
311
374
 
312
- export const subscriptionAddOnAddSubscriptionAddOn = async (subscriptionAddOnAddSubscriptionAddOnBody: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>, options?: RequestInit): Promise<subscriptionAddOnAddSubscriptionAddOnResponse> => {
375
+ export const discountCouponDeleteDiscountCoupon = async (discountCouponUid: string | null, options?: RequestInit): Promise<discountCouponDeleteDiscountCouponResponse> => {
313
376
 
314
- return customFetch<subscriptionAddOnAddSubscriptionAddOnResponse>(getSubscriptionAddOnAddSubscriptionAddOnUrl(),
377
+ return customFetch<discountCouponDeleteDiscountCouponResponse>(getDiscountCouponDeleteDiscountCouponUrl(discountCouponUid),
315
378
  {
316
379
  ...options,
317
- method: 'POST',
318
- headers: { 'Content-Type': 'application/json', ...options?.headers },
319
- body: JSON.stringify(
320
- subscriptionAddOnAddSubscriptionAddOnBody,)
380
+ method: 'DELETE'
381
+
382
+
321
383
  }
322
384
  );}
323
385
 
324
386
 
325
387
  /**
326
- * Admins and API key callers see every invoice. Non-admin users see only invoices
327
- belonging to the account they are the primary contact of.
328
- Pass excludeInvoiceUid as a query parameter to omit a specific invoice from the result set.
329
- * @summary Returns all invoices, optionally restricted to the requester's account.
388
+ * @summary Retrieve the redemptions of a discount coupon.
330
389
  */
331
- export type invoiceGetAllInvoicesResponse200 = {
332
- data: Invoice[]
390
+ export type discountCouponGetDiscountCouponRedemptionsResponse200 = {
391
+ data: DiscountCouponSubscription[]
333
392
  status: 200
334
393
  }
335
394
 
336
- export type invoiceGetAllInvoicesResponse401 = {
395
+ export type discountCouponGetDiscountCouponRedemptionsResponse400 = {
396
+ data: void
397
+ status: 400
398
+ }
399
+
400
+ export type discountCouponGetDiscountCouponRedemptionsResponse401 = {
337
401
  data: void
338
402
  status: 401
339
403
  }
340
404
 
341
- export type invoiceGetAllInvoicesResponseSuccess = (invoiceGetAllInvoicesResponse200) & {
405
+ export type discountCouponGetDiscountCouponRedemptionsResponseSuccess = (discountCouponGetDiscountCouponRedemptionsResponse200) & {
342
406
  headers: Headers;
343
407
  };
344
- export type invoiceGetAllInvoicesResponseError = (invoiceGetAllInvoicesResponse401) & {
408
+ export type discountCouponGetDiscountCouponRedemptionsResponseError = (discountCouponGetDiscountCouponRedemptionsResponse400 | discountCouponGetDiscountCouponRedemptionsResponse401) & {
345
409
  headers: Headers;
346
410
  };
347
411
 
348
- export type invoiceGetAllInvoicesResponse = (invoiceGetAllInvoicesResponseSuccess | invoiceGetAllInvoicesResponseError)
412
+ export type discountCouponGetDiscountCouponRedemptionsResponse = (discountCouponGetDiscountCouponRedemptionsResponseSuccess | discountCouponGetDiscountCouponRedemptionsResponseError)
349
413
 
350
- export const getInvoiceGetAllInvoicesUrl = () => {
414
+ export const getDiscountCouponGetDiscountCouponRedemptionsUrl = (discountCouponUid: string | null,
415
+ params?: DiscountCouponGetDiscountCouponRedemptionsParams,) => {
416
+ const normalizedParams = new URLSearchParams();
351
417
 
418
+ Object.entries(params || {}).forEach(([key, value]) => {
419
+
420
+ if (value !== undefined) {
421
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
422
+ }
423
+ });
352
424
 
353
-
425
+ const stringifiedParams = normalizedParams.toString();
354
426
 
355
- return `/api/v1/billing/invoices`
427
+ return stringifiedParams.length > 0 ? `/api/v1/billing/discountcoupons/${discountCouponUid}/redemptions?${stringifiedParams}` : `/api/v1/billing/discountcoupons/${discountCouponUid}/redemptions`
356
428
  }
357
429
 
358
- export const invoiceGetAllInvoices = async ( options?: RequestInit): Promise<invoiceGetAllInvoicesResponse> => {
430
+ export const discountCouponGetDiscountCouponRedemptions = async (discountCouponUid: string | null,
431
+ params?: DiscountCouponGetDiscountCouponRedemptionsParams, options?: RequestInit): Promise<discountCouponGetDiscountCouponRedemptionsResponse> => {
359
432
 
360
- return customFetch<invoiceGetAllInvoicesResponse>(getInvoiceGetAllInvoicesUrl(),
433
+ return customFetch<discountCouponGetDiscountCouponRedemptionsResponse>(getDiscountCouponGetDiscountCouponRedemptionsUrl(discountCouponUid,params),
361
434
  {
362
435
  ...options,
363
436
  method: 'GET'
@@ -368,91 +441,88 @@ export const invoiceGetAllInvoices = async ( options?: RequestInit): Promise<inv
368
441
 
369
442
 
370
443
  /**
371
- * @summary Create an ad-hoc invoice for a given account.
444
+ * @summary Add a usage entry for an add-on that bills for usage at the end of the month.
372
445
  */
373
- export type invoiceAddInvoiceResponse200 = {
374
- data: Invoice
446
+ export type usageAddUsageResponse200 = {
447
+ data: Usage
375
448
  status: 200
376
449
  }
377
450
 
378
- export type invoiceAddInvoiceResponse401 = {
451
+ export type usageAddUsageResponse401 = {
379
452
  data: void
380
453
  status: 401
381
454
  }
382
455
 
383
- export type invoiceAddInvoiceResponseSuccess = (invoiceAddInvoiceResponse200) & {
456
+ export type usageAddUsageResponseSuccess = (usageAddUsageResponse200) & {
384
457
  headers: Headers;
385
458
  };
386
- export type invoiceAddInvoiceResponseError = (invoiceAddInvoiceResponse401) & {
459
+ export type usageAddUsageResponseError = (usageAddUsageResponse401) & {
387
460
  headers: Headers;
388
461
  };
389
462
 
390
- export type invoiceAddInvoiceResponse = (invoiceAddInvoiceResponseSuccess | invoiceAddInvoiceResponseError)
463
+ export type usageAddUsageResponse = (usageAddUsageResponseSuccess | usageAddUsageResponseError)
391
464
 
392
- export const getInvoiceAddInvoiceUrl = () => {
465
+ export const getUsageAddUsageUrl = () => {
393
466
 
394
467
 
395
468
 
396
469
 
397
- return `/api/v1/billing/invoices`
470
+ return `/api/v1/billing/usage`
398
471
  }
399
472
 
400
- export const invoiceAddInvoice = async (invoiceAddInvoiceBody: NonReadonly<InvoiceAddInvoiceBody>, options?: RequestInit): Promise<invoiceAddInvoiceResponse> => {
473
+ export const usageAddUsage = async (usageAddUsageBody: NonReadonly<UsageAddUsageBody>, options?: RequestInit): Promise<usageAddUsageResponse> => {
401
474
 
402
- return customFetch<invoiceAddInvoiceResponse>(getInvoiceAddInvoiceUrl(),
475
+ return customFetch<usageAddUsageResponse>(getUsageAddUsageUrl(),
403
476
  {
404
477
  ...options,
405
478
  method: 'POST',
406
479
  headers: { 'Content-Type': 'application/json', ...options?.headers },
407
480
  body: JSON.stringify(
408
- invoiceAddInvoiceBody,)
481
+ usageAddUsageBody,)
409
482
  }
410
483
  );}
411
484
 
412
485
 
413
486
  /**
414
- * @summary Returns a single invoice by UID.
487
+ * Transactions for a given account, tied to accounts and invoices.
488
+ BillingTransactionType: Invoice = 1, Payment = 2, Credit = 3, Refund = 4, Chargeback = 5.
489
+ * @summary Retrieve all transactions.
415
490
  */
416
- export type invoiceGetInvoiceResponse200 = {
417
- data: Invoice
491
+ export type transactionsGetAllTransactionsByAccountIdResponse200 = {
492
+ data: Transaction[]
418
493
  status: 200
419
494
  }
420
495
 
421
- export type invoiceGetInvoiceResponse400 = {
496
+ export type transactionsGetAllTransactionsByAccountIdResponse400 = {
422
497
  data: void
423
498
  status: 400
424
499
  }
425
500
 
426
- export type invoiceGetInvoiceResponse401 = {
501
+ export type transactionsGetAllTransactionsByAccountIdResponse401 = {
427
502
  data: void
428
503
  status: 401
429
504
  }
430
-
431
- export type invoiceGetInvoiceResponse404 = {
432
- data: void
433
- status: 404
434
- }
435
505
 
436
- export type invoiceGetInvoiceResponseSuccess = (invoiceGetInvoiceResponse200) & {
506
+ export type transactionsGetAllTransactionsByAccountIdResponseSuccess = (transactionsGetAllTransactionsByAccountIdResponse200) & {
437
507
  headers: Headers;
438
508
  };
439
- export type invoiceGetInvoiceResponseError = (invoiceGetInvoiceResponse400 | invoiceGetInvoiceResponse401 | invoiceGetInvoiceResponse404) & {
509
+ export type transactionsGetAllTransactionsByAccountIdResponseError = (transactionsGetAllTransactionsByAccountIdResponse400 | transactionsGetAllTransactionsByAccountIdResponse401) & {
440
510
  headers: Headers;
441
511
  };
442
512
 
443
- export type invoiceGetInvoiceResponse = (invoiceGetInvoiceResponseSuccess | invoiceGetInvoiceResponseError)
513
+ export type transactionsGetAllTransactionsByAccountIdResponse = (transactionsGetAllTransactionsByAccountIdResponseSuccess | transactionsGetAllTransactionsByAccountIdResponseError)
444
514
 
445
- export const getInvoiceGetInvoiceUrl = (invoiceUid: string | null,) => {
515
+ export const getTransactionsGetAllTransactionsByAccountIdUrl = (accountUid: string | null,) => {
446
516
 
447
517
 
448
518
 
449
519
 
450
- return `/api/v1/billing/invoices/${invoiceUid}`
520
+ return `/api/v1/billing/transactions/${accountUid}`
451
521
  }
452
522
 
453
- export const invoiceGetInvoice = async (invoiceUid: string | null, options?: RequestInit): Promise<invoiceGetInvoiceResponse> => {
523
+ export const transactionsGetAllTransactionsByAccountId = async (accountUid: string | null, options?: RequestInit): Promise<transactionsGetAllTransactionsByAccountIdResponse> => {
454
524
 
455
- return customFetch<invoiceGetInvoiceResponse>(getInvoiceGetInvoiceUrl(invoiceUid),
525
+ return customFetch<transactionsGetAllTransactionsByAccountIdResponse>(getTransactionsGetAllTransactionsByAccountIdUrl(accountUid),
456
526
  {
457
527
  ...options,
458
528
  method: 'GET'
@@ -463,108 +533,231 @@ export const invoiceGetInvoice = async (invoiceUid: string | null, options?: Req
463
533
 
464
534
 
465
535
  /**
466
- * Only invoices created manually via the API or admin UI can be updated; invoices
467
- generated by a subscription's billing cycle are immutable and will return a
468
- validation error.
469
- * @summary Update an ad-hoc (manually created) invoice.
536
+ * If the amount matches the outstanding amount of the invoice, the invoice will be marked
537
+ as Paid.
538
+ * @summary Add a payment to an invoice.
470
539
  */
471
- export type invoiceUpdateInvoiceResponse200 = {
472
- data: Invoice
540
+ export type transactionsAddPaymentTransactionResponse200 = {
541
+ data: Transaction
473
542
  status: 200
474
543
  }
475
544
 
476
- export type invoiceUpdateInvoiceResponse400 = {
545
+ export type transactionsAddPaymentTransactionResponse401 = {
477
546
  data: void
478
- status: 400
547
+ status: 401
479
548
  }
549
+
550
+ export type transactionsAddPaymentTransactionResponseSuccess = (transactionsAddPaymentTransactionResponse200) & {
551
+ headers: Headers;
552
+ };
553
+ export type transactionsAddPaymentTransactionResponseError = (transactionsAddPaymentTransactionResponse401) & {
554
+ headers: Headers;
555
+ };
480
556
 
481
- export type invoiceUpdateInvoiceResponse401 = {
557
+ export type transactionsAddPaymentTransactionResponse = (transactionsAddPaymentTransactionResponseSuccess | transactionsAddPaymentTransactionResponseError)
558
+
559
+ export const getTransactionsAddPaymentTransactionUrl = () => {
560
+
561
+
562
+
563
+
564
+ return `/api/v1/billing/transactions/payment`
565
+ }
566
+
567
+ export const transactionsAddPaymentTransaction = async (transactionsAddPaymentTransactionBody: NonReadonly<TransactionsAddPaymentTransactionBody>, options?: RequestInit): Promise<transactionsAddPaymentTransactionResponse> => {
568
+
569
+ return customFetch<transactionsAddPaymentTransactionResponse>(getTransactionsAddPaymentTransactionUrl(),
570
+ {
571
+ ...options,
572
+ method: 'POST',
573
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
574
+ body: JSON.stringify(
575
+ transactionsAddPaymentTransactionBody,)
576
+ }
577
+ );}
578
+
579
+
580
+ /**
581
+ * @summary Update payment information for an account.
582
+ */
583
+ export type paymentInformationSavePaymentInformationResponse200 = {
584
+ data: PaymentInformation
585
+ status: 200
586
+ }
587
+
588
+ export type paymentInformationSavePaymentInformationResponse401 = {
482
589
  data: void
483
590
  status: 401
484
591
  }
592
+
593
+ export type paymentInformationSavePaymentInformationResponseSuccess = (paymentInformationSavePaymentInformationResponse200) & {
594
+ headers: Headers;
595
+ };
596
+ export type paymentInformationSavePaymentInformationResponseError = (paymentInformationSavePaymentInformationResponse401) & {
597
+ headers: Headers;
598
+ };
485
599
 
486
- export type invoiceUpdateInvoiceResponse404 = {
600
+ export type paymentInformationSavePaymentInformationResponse = (paymentInformationSavePaymentInformationResponseSuccess | paymentInformationSavePaymentInformationResponseError)
601
+
602
+ export const getPaymentInformationSavePaymentInformationUrl = () => {
603
+
604
+
605
+
606
+
607
+ return `/api/v1/billing/paymentinformation`
608
+ }
609
+
610
+ export const paymentInformationSavePaymentInformation = async (paymentInformationSavePaymentInformationBody: NonReadonly<PaymentInformationSavePaymentInformationBody>, options?: RequestInit): Promise<paymentInformationSavePaymentInformationResponse> => {
611
+
612
+ return customFetch<paymentInformationSavePaymentInformationResponse>(getPaymentInformationSavePaymentInformationUrl(),
613
+ {
614
+ ...options,
615
+ method: 'POST',
616
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
617
+ body: JSON.stringify(
618
+ paymentInformationSavePaymentInformationBody,)
619
+ }
620
+ );}
621
+
622
+
623
+ /**
624
+ * @summary Retrieve all subscription add-ons.
625
+ */
626
+ export type subscriptionAddOnGetAllSubscriptionsAddOnsResponse200 = {
627
+ data: SubscriptionAddOn[]
628
+ status: 200
629
+ }
630
+
631
+ export type subscriptionAddOnGetAllSubscriptionsAddOnsResponse401 = {
487
632
  data: void
488
- status: 404
633
+ status: 401
489
634
  }
490
635
 
491
- export type invoiceUpdateInvoiceResponseSuccess = (invoiceUpdateInvoiceResponse200) & {
636
+ export type subscriptionAddOnGetAllSubscriptionsAddOnsResponseSuccess = (subscriptionAddOnGetAllSubscriptionsAddOnsResponse200) & {
492
637
  headers: Headers;
493
638
  };
494
- export type invoiceUpdateInvoiceResponseError = (invoiceUpdateInvoiceResponse400 | invoiceUpdateInvoiceResponse401 | invoiceUpdateInvoiceResponse404) & {
639
+ export type subscriptionAddOnGetAllSubscriptionsAddOnsResponseError = (subscriptionAddOnGetAllSubscriptionsAddOnsResponse401) & {
495
640
  headers: Headers;
496
641
  };
497
642
 
498
- export type invoiceUpdateInvoiceResponse = (invoiceUpdateInvoiceResponseSuccess | invoiceUpdateInvoiceResponseError)
643
+ export type subscriptionAddOnGetAllSubscriptionsAddOnsResponse = (subscriptionAddOnGetAllSubscriptionsAddOnsResponseSuccess | subscriptionAddOnGetAllSubscriptionsAddOnsResponseError)
499
644
 
500
- export const getInvoiceUpdateInvoiceUrl = (invoiceUid: string | null,) => {
645
+ export const getSubscriptionAddOnGetAllSubscriptionsAddOnsUrl = (params?: SubscriptionAddOnGetAllSubscriptionsAddOnsParams,) => {
646
+ const normalizedParams = new URLSearchParams();
647
+
648
+ Object.entries(params || {}).forEach(([key, value]) => {
649
+
650
+ if (value !== undefined) {
651
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
652
+ }
653
+ });
654
+
655
+ const stringifiedParams = normalizedParams.toString();
501
656
 
657
+ return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptionaddons?${stringifiedParams}` : `/api/v1/billing/subscriptionaddons`
658
+ }
502
659
 
660
+ export const subscriptionAddOnGetAllSubscriptionsAddOns = async (params?: SubscriptionAddOnGetAllSubscriptionsAddOnsParams, options?: RequestInit): Promise<subscriptionAddOnGetAllSubscriptionsAddOnsResponse> => {
503
661
 
662
+ return customFetch<subscriptionAddOnGetAllSubscriptionsAddOnsResponse>(getSubscriptionAddOnGetAllSubscriptionsAddOnsUrl(params),
663
+ {
664
+ ...options,
665
+ method: 'GET'
666
+
667
+
668
+ }
669
+ );}
504
670
 
505
- return `/api/v1/billing/invoices/${invoiceUid}`
671
+
672
+ /**
673
+ * @summary Add an add-on to a subscription.
674
+ */
675
+ export type subscriptionAddOnAddSubscriptionAddOnResponse200 = {
676
+ data: Blob
677
+ status: 200
506
678
  }
507
679
 
508
- export const invoiceUpdateInvoice = async (invoiceUid: string | null,
509
- invoiceUpdateInvoiceBody: NonReadonly<InvoiceUpdateInvoiceBody>, options?: RequestInit): Promise<invoiceUpdateInvoiceResponse> => {
680
+ export type subscriptionAddOnAddSubscriptionAddOnResponse401 = {
681
+ data: void
682
+ status: 401
683
+ }
684
+
685
+ export type subscriptionAddOnAddSubscriptionAddOnResponseSuccess = (subscriptionAddOnAddSubscriptionAddOnResponse200) & {
686
+ headers: Headers;
687
+ };
688
+ export type subscriptionAddOnAddSubscriptionAddOnResponseError = (subscriptionAddOnAddSubscriptionAddOnResponse401) & {
689
+ headers: Headers;
690
+ };
691
+
692
+ export type subscriptionAddOnAddSubscriptionAddOnResponse = (subscriptionAddOnAddSubscriptionAddOnResponseSuccess | subscriptionAddOnAddSubscriptionAddOnResponseError)
693
+
694
+ export const getSubscriptionAddOnAddSubscriptionAddOnUrl = () => {
695
+
696
+
510
697
 
511
- return customFetch<invoiceUpdateInvoiceResponse>(getInvoiceUpdateInvoiceUrl(invoiceUid),
698
+
699
+ return `/api/v1/billing/subscriptionaddons`
700
+ }
701
+
702
+ export const subscriptionAddOnAddSubscriptionAddOn = async (subscriptionAddOnAddSubscriptionAddOnBody: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>, options?: RequestInit): Promise<subscriptionAddOnAddSubscriptionAddOnResponse> => {
703
+
704
+ return customFetch<subscriptionAddOnAddSubscriptionAddOnResponse>(getSubscriptionAddOnAddSubscriptionAddOnUrl(),
512
705
  {
513
706
  ...options,
514
- method: 'PUT',
707
+ method: 'POST',
515
708
  headers: { 'Content-Type': 'application/json', ...options?.headers },
516
709
  body: JSON.stringify(
517
- invoiceUpdateInvoiceBody,)
710
+ subscriptionAddOnAddSubscriptionAddOnBody,)
518
711
  }
519
712
  );}
520
713
 
521
714
 
522
715
  /**
523
- * @summary Delete an invoice.
716
+ * @summary Retrieve a subscription add-on.
524
717
  */
525
- export type invoiceDeleteInvoiceResponse200 = {
526
- data: Blob
718
+ export type subscriptionAddOnGetSubscriptionAddOnResponse200 = {
719
+ data: SubscriptionAddOn
527
720
  status: 200
528
721
  }
529
722
 
530
- export type invoiceDeleteInvoiceResponse400 = {
723
+ export type subscriptionAddOnGetSubscriptionAddOnResponse400 = {
531
724
  data: void
532
725
  status: 400
533
726
  }
534
727
 
535
- export type invoiceDeleteInvoiceResponse401 = {
728
+ export type subscriptionAddOnGetSubscriptionAddOnResponse401 = {
536
729
  data: void
537
730
  status: 401
538
731
  }
539
732
 
540
- export type invoiceDeleteInvoiceResponse404 = {
733
+ export type subscriptionAddOnGetSubscriptionAddOnResponse404 = {
541
734
  data: void
542
735
  status: 404
543
736
  }
544
737
 
545
- export type invoiceDeleteInvoiceResponseSuccess = (invoiceDeleteInvoiceResponse200) & {
738
+ export type subscriptionAddOnGetSubscriptionAddOnResponseSuccess = (subscriptionAddOnGetSubscriptionAddOnResponse200) & {
546
739
  headers: Headers;
547
740
  };
548
- export type invoiceDeleteInvoiceResponseError = (invoiceDeleteInvoiceResponse400 | invoiceDeleteInvoiceResponse401 | invoiceDeleteInvoiceResponse404) & {
741
+ export type subscriptionAddOnGetSubscriptionAddOnResponseError = (subscriptionAddOnGetSubscriptionAddOnResponse400 | subscriptionAddOnGetSubscriptionAddOnResponse401 | subscriptionAddOnGetSubscriptionAddOnResponse404) & {
549
742
  headers: Headers;
550
743
  };
551
744
 
552
- export type invoiceDeleteInvoiceResponse = (invoiceDeleteInvoiceResponseSuccess | invoiceDeleteInvoiceResponseError)
745
+ export type subscriptionAddOnGetSubscriptionAddOnResponse = (subscriptionAddOnGetSubscriptionAddOnResponseSuccess | subscriptionAddOnGetSubscriptionAddOnResponseError)
553
746
 
554
- export const getInvoiceDeleteInvoiceUrl = (invoiceUid: string | null,) => {
747
+ export const getSubscriptionAddOnGetSubscriptionAddOnUrl = (subscriptionAddOnUid: string | null,) => {
555
748
 
556
749
 
557
750
 
558
751
 
559
- return `/api/v1/billing/invoices/${invoiceUid}`
752
+ return `/api/v1/billing/subscriptionaddons/${subscriptionAddOnUid}`
560
753
  }
561
754
 
562
- export const invoiceDeleteInvoice = async (invoiceUid: string | null, options?: RequestInit): Promise<invoiceDeleteInvoiceResponse> => {
755
+ export const subscriptionAddOnGetSubscriptionAddOn = async (subscriptionAddOnUid: string | null, options?: RequestInit): Promise<subscriptionAddOnGetSubscriptionAddOnResponse> => {
563
756
 
564
- return customFetch<invoiceDeleteInvoiceResponse>(getInvoiceDeleteInvoiceUrl(invoiceUid),
757
+ return customFetch<subscriptionAddOnGetSubscriptionAddOnResponse>(getSubscriptionAddOnGetSubscriptionAddOnUrl(subscriptionAddOnUid),
565
758
  {
566
759
  ...options,
567
- method: 'DELETE'
760
+ method: 'GET'
568
761
 
569
762
 
570
763
  }
@@ -572,108 +765,1198 @@ export const invoiceDeleteInvoice = async (invoiceUid: string | null, options?:
572
765
 
573
766
 
574
767
  /**
575
- * Response body is a binary PDF (Content-Type: application/pdf) served as an
576
- attachment named invoice-{Number}-{InvoiceDate}-{AccountName}.pdf.
577
- * @summary Returns a rendered PDF copy of an invoice.
768
+ * Returns an invoice object with information about the amount outstanding. This method
769
+ does not commit the change.
770
+ * @summary Preview the invoice for adding an add-on to a subscription.
578
771
  */
579
- export type invoiceGetInvoiceAsPdfResponse200 = {
580
- data: Blob
772
+ export type subscriptionAddOnAddSubscriptionAddOnPreviewResponse200 = {
773
+ data: Invoice
581
774
  status: 200
582
775
  }
583
776
 
584
- export type invoiceGetInvoiceAsPdfResponse400 = {
777
+ export type subscriptionAddOnAddSubscriptionAddOnPreviewResponse401 = {
778
+ data: void
779
+ status: 401
780
+ }
781
+
782
+ export type subscriptionAddOnAddSubscriptionAddOnPreviewResponseSuccess = (subscriptionAddOnAddSubscriptionAddOnPreviewResponse200) & {
783
+ headers: Headers;
784
+ };
785
+ export type subscriptionAddOnAddSubscriptionAddOnPreviewResponseError = (subscriptionAddOnAddSubscriptionAddOnPreviewResponse401) & {
786
+ headers: Headers;
787
+ };
788
+
789
+ export type subscriptionAddOnAddSubscriptionAddOnPreviewResponse = (subscriptionAddOnAddSubscriptionAddOnPreviewResponseSuccess | subscriptionAddOnAddSubscriptionAddOnPreviewResponseError)
790
+
791
+ export const getSubscriptionAddOnAddSubscriptionAddOnPreviewUrl = () => {
792
+
793
+
794
+
795
+
796
+ return `/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview`
797
+ }
798
+
799
+ export const subscriptionAddOnAddSubscriptionAddOnPreview = async (subscriptionAddOnAddSubscriptionAddOnPreviewBody: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnPreviewBody>, options?: RequestInit): Promise<subscriptionAddOnAddSubscriptionAddOnPreviewResponse> => {
800
+
801
+ return customFetch<subscriptionAddOnAddSubscriptionAddOnPreviewResponse>(getSubscriptionAddOnAddSubscriptionAddOnPreviewUrl(),
802
+ {
803
+ ...options,
804
+ method: 'POST',
805
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
806
+ body: JSON.stringify(
807
+ subscriptionAddOnAddSubscriptionAddOnPreviewBody,)
808
+ }
809
+ );}
810
+
811
+
812
+ /**
813
+ * When a subscription add-on is flagged, the next time the user authenticates the
814
+ authentication widget will prompt the user to change their add-on.
815
+ * @summary Indicate that an upgrade of an add-on is required.
816
+ */
817
+ export type subscriptionAddOnSetAddOnUpgradeRequiredResponse200 = {
818
+ data: SubscriptionAddOn
819
+ status: 200
820
+ }
821
+
822
+ export type subscriptionAddOnSetAddOnUpgradeRequiredResponse400 = {
585
823
  data: void
586
824
  status: 400
587
825
  }
588
826
 
589
- export type invoiceGetInvoiceAsPdfResponse401 = {
827
+ export type subscriptionAddOnSetAddOnUpgradeRequiredResponse401 = {
590
828
  data: void
591
829
  status: 401
592
830
  }
593
831
 
594
- export type invoiceGetInvoiceAsPdfResponse404 = {
832
+ export type subscriptionAddOnSetAddOnUpgradeRequiredResponse404 = {
595
833
  data: void
596
834
  status: 404
597
835
  }
598
836
 
599
- export type invoiceGetInvoiceAsPdfResponseSuccess = (invoiceGetInvoiceAsPdfResponse200) & {
837
+ export type subscriptionAddOnSetAddOnUpgradeRequiredResponseSuccess = (subscriptionAddOnSetAddOnUpgradeRequiredResponse200) & {
600
838
  headers: Headers;
601
839
  };
602
- export type invoiceGetInvoiceAsPdfResponseError = (invoiceGetInvoiceAsPdfResponse400 | invoiceGetInvoiceAsPdfResponse401 | invoiceGetInvoiceAsPdfResponse404) & {
840
+ export type subscriptionAddOnSetAddOnUpgradeRequiredResponseError = (subscriptionAddOnSetAddOnUpgradeRequiredResponse400 | subscriptionAddOnSetAddOnUpgradeRequiredResponse401 | subscriptionAddOnSetAddOnUpgradeRequiredResponse404) & {
603
841
  headers: Headers;
604
842
  };
605
843
 
606
- export type invoiceGetInvoiceAsPdfResponse = (invoiceGetInvoiceAsPdfResponseSuccess | invoiceGetInvoiceAsPdfResponseError)
844
+ export type subscriptionAddOnSetAddOnUpgradeRequiredResponse = (subscriptionAddOnSetAddOnUpgradeRequiredResponseSuccess | subscriptionAddOnSetAddOnUpgradeRequiredResponseError)
607
845
 
608
- export const getInvoiceGetInvoiceAsPdfUrl = (invoiceUid: string | null,) => {
846
+ export const getSubscriptionAddOnSetAddOnUpgradeRequiredUrl = (subscriptionAddOnUid: string | null,) => {
609
847
 
610
848
 
611
849
 
612
850
 
613
- return `/api/v1/billing/invoices/${invoiceUid}/pdf`
851
+ return `/api/v1/billing/subscriptionaddons/${subscriptionAddOnUid}/setaddonupgraderequired`
614
852
  }
615
853
 
616
- export const invoiceGetInvoiceAsPdf = async (invoiceUid: string | null, options?: RequestInit): Promise<invoiceGetInvoiceAsPdfResponse> => {
854
+ export const subscriptionAddOnSetAddOnUpgradeRequired = async (subscriptionAddOnUid: string | null,
855
+ subscriptionAddOnSetAddOnUpgradeRequiredBody: NonReadonly<SubscriptionAddOnSetAddOnUpgradeRequiredBody>, options?: RequestInit): Promise<subscriptionAddOnSetAddOnUpgradeRequiredResponse> => {
617
856
 
618
- return customFetch<invoiceGetInvoiceAsPdfResponse>(getInvoiceGetInvoiceAsPdfUrl(invoiceUid),
857
+ return customFetch<subscriptionAddOnSetAddOnUpgradeRequiredResponse>(getSubscriptionAddOnSetAddOnUpgradeRequiredUrl(subscriptionAddOnUid),
619
858
  {
620
859
  ...options,
621
- method: 'GET'
622
-
623
-
860
+ method: 'PUT',
861
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
862
+ body: JSON.stringify(
863
+ subscriptionAddOnSetAddOnUpgradeRequiredBody,)
624
864
  }
625
865
  );}
626
866
 
627
867
 
628
868
  /**
629
- * Optional query parameters:
630
- note - free-text note to include in the email body.
631
- bcc - comma-separated list of email addresses to BCC.
632
- * @summary Email an invoice to the account's billing contact.
869
+ * Removes the add-on from the subscription going forward and returns the updated
870
+ subscription.
871
+ * @summary End an add-on on a subscription.
633
872
  */
634
- export type invoiceSendInvoiceEmailResponse200 = {
635
- data: Blob
873
+ export type subscriptionAddOnEndSubscriptionAddOnResponse200 = {
874
+ data: Subscription
636
875
  status: 200
637
876
  }
638
877
 
639
- export type invoiceSendInvoiceEmailResponse400 = {
878
+ export type subscriptionAddOnEndSubscriptionAddOnResponse400 = {
640
879
  data: void
641
880
  status: 400
642
881
  }
643
882
 
644
- export type invoiceSendInvoiceEmailResponse401 = {
883
+ export type subscriptionAddOnEndSubscriptionAddOnResponse401 = {
645
884
  data: void
646
885
  status: 401
647
886
  }
648
887
 
649
- export type invoiceSendInvoiceEmailResponse404 = {
888
+ export type subscriptionAddOnEndSubscriptionAddOnResponse404 = {
650
889
  data: void
651
890
  status: 404
652
891
  }
653
892
 
654
- export type invoiceSendInvoiceEmailResponseSuccess = (invoiceSendInvoiceEmailResponse200) & {
893
+ export type subscriptionAddOnEndSubscriptionAddOnResponseSuccess = (subscriptionAddOnEndSubscriptionAddOnResponse200) & {
655
894
  headers: Headers;
656
895
  };
657
- export type invoiceSendInvoiceEmailResponseError = (invoiceSendInvoiceEmailResponse400 | invoiceSendInvoiceEmailResponse401 | invoiceSendInvoiceEmailResponse404) & {
896
+ export type subscriptionAddOnEndSubscriptionAddOnResponseError = (subscriptionAddOnEndSubscriptionAddOnResponse400 | subscriptionAddOnEndSubscriptionAddOnResponse401 | subscriptionAddOnEndSubscriptionAddOnResponse404) & {
658
897
  headers: Headers;
659
898
  };
660
899
 
661
- export type invoiceSendInvoiceEmailResponse = (invoiceSendInvoiceEmailResponseSuccess | invoiceSendInvoiceEmailResponseError)
900
+ export type subscriptionAddOnEndSubscriptionAddOnResponse = (subscriptionAddOnEndSubscriptionAddOnResponseSuccess | subscriptionAddOnEndSubscriptionAddOnResponseError)
662
901
 
663
- export const getInvoiceSendInvoiceEmailUrl = (invoiceUid: string | null,) => {
902
+ export const getSubscriptionAddOnEndSubscriptionAddOnUrl = (subscriptionAddOnUid: string | null,) => {
664
903
 
665
904
 
666
905
 
667
906
 
668
- return `/api/v1/billing/invoices/${invoiceUid}/sendinvoiceemail`
907
+ return `/api/v1/billing/subscriptionaddons/${subscriptionAddOnUid}/end`
669
908
  }
670
909
 
671
- export const invoiceSendInvoiceEmail = async (invoiceUid: string | null, options?: RequestInit): Promise<invoiceSendInvoiceEmailResponse> => {
910
+ export const subscriptionAddOnEndSubscriptionAddOn = async (subscriptionAddOnUid: string | null, options?: RequestInit): Promise<subscriptionAddOnEndSubscriptionAddOnResponse> => {
672
911
 
673
- return customFetch<invoiceSendInvoiceEmailResponse>(getInvoiceSendInvoiceEmailUrl(invoiceUid),
912
+ return customFetch<subscriptionAddOnEndSubscriptionAddOnResponse>(getSubscriptionAddOnEndSubscriptionAddOnUrl(subscriptionAddOnUid),
674
913
  {
675
914
  ...options,
676
- method: 'POST'
915
+ method: 'PUT'
916
+
917
+
918
+ }
919
+ );}
920
+
921
+
922
+ /**
923
+ * @summary Immediately ends an add-on.
924
+ */
925
+ export type subscriptionAddOnExpireSubscriptionAddOnResponse200 = {
926
+ data: Blob
927
+ status: 200
928
+ }
929
+
930
+ export type subscriptionAddOnExpireSubscriptionAddOnResponse400 = {
931
+ data: void
932
+ status: 400
933
+ }
934
+
935
+ export type subscriptionAddOnExpireSubscriptionAddOnResponse401 = {
936
+ data: void
937
+ status: 401
938
+ }
939
+
940
+ export type subscriptionAddOnExpireSubscriptionAddOnResponse404 = {
941
+ data: void
942
+ status: 404
943
+ }
944
+
945
+ export type subscriptionAddOnExpireSubscriptionAddOnResponseSuccess = (subscriptionAddOnExpireSubscriptionAddOnResponse200) & {
946
+ headers: Headers;
947
+ };
948
+ export type subscriptionAddOnExpireSubscriptionAddOnResponseError = (subscriptionAddOnExpireSubscriptionAddOnResponse400 | subscriptionAddOnExpireSubscriptionAddOnResponse401 | subscriptionAddOnExpireSubscriptionAddOnResponse404) & {
949
+ headers: Headers;
950
+ };
951
+
952
+ export type subscriptionAddOnExpireSubscriptionAddOnResponse = (subscriptionAddOnExpireSubscriptionAddOnResponseSuccess | subscriptionAddOnExpireSubscriptionAddOnResponseError)
953
+
954
+ export const getSubscriptionAddOnExpireSubscriptionAddOnUrl = (subscriptionAddOnUid: string | null,) => {
955
+
956
+
957
+
958
+
959
+ return `/api/v1/billing/subscriptionaddons/${subscriptionAddOnUid}/expire`
960
+ }
961
+
962
+ export const subscriptionAddOnExpireSubscriptionAddOn = async (subscriptionAddOnUid: string | null, options?: RequestInit): Promise<subscriptionAddOnExpireSubscriptionAddOnResponse> => {
963
+
964
+ return customFetch<subscriptionAddOnExpireSubscriptionAddOnResponse>(getSubscriptionAddOnExpireSubscriptionAddOnUrl(subscriptionAddOnUid),
965
+ {
966
+ ...options,
967
+ method: 'PUT'
968
+
969
+
970
+ }
971
+ );}
972
+
973
+
974
+ /**
975
+ * Admins and API key callers see every invoice. Non-admin users see only invoices
976
+ belonging to the account they are the primary contact of.
977
+ Pass excludeInvoiceUid as a query parameter to omit a specific invoice from the result set.
978
+ * @summary Retrieve all invoices.
979
+ */
980
+ export type invoiceGetAllInvoicesResponse200 = {
981
+ data: Invoice[]
982
+ status: 200
983
+ }
984
+
985
+ export type invoiceGetAllInvoicesResponse401 = {
986
+ data: void
987
+ status: 401
988
+ }
989
+
990
+ export type invoiceGetAllInvoicesResponseSuccess = (invoiceGetAllInvoicesResponse200) & {
991
+ headers: Headers;
992
+ };
993
+ export type invoiceGetAllInvoicesResponseError = (invoiceGetAllInvoicesResponse401) & {
994
+ headers: Headers;
995
+ };
996
+
997
+ export type invoiceGetAllInvoicesResponse = (invoiceGetAllInvoicesResponseSuccess | invoiceGetAllInvoicesResponseError)
998
+
999
+ export const getInvoiceGetAllInvoicesUrl = () => {
1000
+
1001
+
1002
+
1003
+
1004
+ return `/api/v1/billing/invoices`
1005
+ }
1006
+
1007
+ export const invoiceGetAllInvoices = async ( options?: RequestInit): Promise<invoiceGetAllInvoicesResponse> => {
1008
+
1009
+ return customFetch<invoiceGetAllInvoicesResponse>(getInvoiceGetAllInvoicesUrl(),
1010
+ {
1011
+ ...options,
1012
+ method: 'GET'
1013
+
1014
+
1015
+ }
1016
+ );}
1017
+
1018
+
1019
+ /**
1020
+ * @summary Create an ad-hoc invoice for a given account.
1021
+ */
1022
+ export type invoiceAddInvoiceResponse200 = {
1023
+ data: Invoice
1024
+ status: 200
1025
+ }
1026
+
1027
+ export type invoiceAddInvoiceResponse401 = {
1028
+ data: void
1029
+ status: 401
1030
+ }
1031
+
1032
+ export type invoiceAddInvoiceResponseSuccess = (invoiceAddInvoiceResponse200) & {
1033
+ headers: Headers;
1034
+ };
1035
+ export type invoiceAddInvoiceResponseError = (invoiceAddInvoiceResponse401) & {
1036
+ headers: Headers;
1037
+ };
1038
+
1039
+ export type invoiceAddInvoiceResponse = (invoiceAddInvoiceResponseSuccess | invoiceAddInvoiceResponseError)
1040
+
1041
+ export const getInvoiceAddInvoiceUrl = () => {
1042
+
1043
+
1044
+
1045
+
1046
+ return `/api/v1/billing/invoices`
1047
+ }
1048
+
1049
+ export const invoiceAddInvoice = async (invoiceAddInvoiceBody: NonReadonly<InvoiceAddInvoiceBody>, options?: RequestInit): Promise<invoiceAddInvoiceResponse> => {
1050
+
1051
+ return customFetch<invoiceAddInvoiceResponse>(getInvoiceAddInvoiceUrl(),
1052
+ {
1053
+ ...options,
1054
+ method: 'POST',
1055
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1056
+ body: JSON.stringify(
1057
+ invoiceAddInvoiceBody,)
1058
+ }
1059
+ );}
1060
+
1061
+
1062
+ /**
1063
+ * @summary Retrieve an invoice.
1064
+ */
1065
+ export type invoiceGetInvoiceResponse200 = {
1066
+ data: Invoice
1067
+ status: 200
1068
+ }
1069
+
1070
+ export type invoiceGetInvoiceResponse400 = {
1071
+ data: void
1072
+ status: 400
1073
+ }
1074
+
1075
+ export type invoiceGetInvoiceResponse401 = {
1076
+ data: void
1077
+ status: 401
1078
+ }
1079
+
1080
+ export type invoiceGetInvoiceResponse404 = {
1081
+ data: void
1082
+ status: 404
1083
+ }
1084
+
1085
+ export type invoiceGetInvoiceResponseSuccess = (invoiceGetInvoiceResponse200) & {
1086
+ headers: Headers;
1087
+ };
1088
+ export type invoiceGetInvoiceResponseError = (invoiceGetInvoiceResponse400 | invoiceGetInvoiceResponse401 | invoiceGetInvoiceResponse404) & {
1089
+ headers: Headers;
1090
+ };
1091
+
1092
+ export type invoiceGetInvoiceResponse = (invoiceGetInvoiceResponseSuccess | invoiceGetInvoiceResponseError)
1093
+
1094
+ export const getInvoiceGetInvoiceUrl = (invoiceUid: string | null,) => {
1095
+
1096
+
1097
+
1098
+
1099
+ return `/api/v1/billing/invoices/${invoiceUid}`
1100
+ }
1101
+
1102
+ export const invoiceGetInvoice = async (invoiceUid: string | null, options?: RequestInit): Promise<invoiceGetInvoiceResponse> => {
1103
+
1104
+ return customFetch<invoiceGetInvoiceResponse>(getInvoiceGetInvoiceUrl(invoiceUid),
1105
+ {
1106
+ ...options,
1107
+ method: 'GET'
1108
+
1109
+
1110
+ }
1111
+ );}
1112
+
1113
+
1114
+ /**
1115
+ * Only invoices created manually via the API or admin UI can be updated; invoices
1116
+ generated by a subscription's billing cycle are immutable and will return a
1117
+ validation error.
1118
+ * @summary Update an ad-hoc (manually created) invoice.
1119
+ */
1120
+ export type invoiceUpdateInvoiceResponse200 = {
1121
+ data: Invoice
1122
+ status: 200
1123
+ }
1124
+
1125
+ export type invoiceUpdateInvoiceResponse400 = {
1126
+ data: void
1127
+ status: 400
1128
+ }
1129
+
1130
+ export type invoiceUpdateInvoiceResponse401 = {
1131
+ data: void
1132
+ status: 401
1133
+ }
1134
+
1135
+ export type invoiceUpdateInvoiceResponse404 = {
1136
+ data: void
1137
+ status: 404
1138
+ }
1139
+
1140
+ export type invoiceUpdateInvoiceResponseSuccess = (invoiceUpdateInvoiceResponse200) & {
1141
+ headers: Headers;
1142
+ };
1143
+ export type invoiceUpdateInvoiceResponseError = (invoiceUpdateInvoiceResponse400 | invoiceUpdateInvoiceResponse401 | invoiceUpdateInvoiceResponse404) & {
1144
+ headers: Headers;
1145
+ };
1146
+
1147
+ export type invoiceUpdateInvoiceResponse = (invoiceUpdateInvoiceResponseSuccess | invoiceUpdateInvoiceResponseError)
1148
+
1149
+ export const getInvoiceUpdateInvoiceUrl = (invoiceUid: string | null,) => {
1150
+
1151
+
1152
+
1153
+
1154
+ return `/api/v1/billing/invoices/${invoiceUid}`
1155
+ }
1156
+
1157
+ export const invoiceUpdateInvoice = async (invoiceUid: string | null,
1158
+ invoiceUpdateInvoiceBody: NonReadonly<InvoiceUpdateInvoiceBody>, options?: RequestInit): Promise<invoiceUpdateInvoiceResponse> => {
1159
+
1160
+ return customFetch<invoiceUpdateInvoiceResponse>(getInvoiceUpdateInvoiceUrl(invoiceUid),
1161
+ {
1162
+ ...options,
1163
+ method: 'PUT',
1164
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1165
+ body: JSON.stringify(
1166
+ invoiceUpdateInvoiceBody,)
1167
+ }
1168
+ );}
1169
+
1170
+
1171
+ /**
1172
+ * @summary Delete an invoice.
1173
+ */
1174
+ export type invoiceDeleteInvoiceResponse200 = {
1175
+ data: Blob
1176
+ status: 200
1177
+ }
1178
+
1179
+ export type invoiceDeleteInvoiceResponse400 = {
1180
+ data: void
1181
+ status: 400
1182
+ }
1183
+
1184
+ export type invoiceDeleteInvoiceResponse401 = {
1185
+ data: void
1186
+ status: 401
1187
+ }
1188
+
1189
+ export type invoiceDeleteInvoiceResponse404 = {
1190
+ data: void
1191
+ status: 404
1192
+ }
1193
+
1194
+ export type invoiceDeleteInvoiceResponseSuccess = (invoiceDeleteInvoiceResponse200) & {
1195
+ headers: Headers;
1196
+ };
1197
+ export type invoiceDeleteInvoiceResponseError = (invoiceDeleteInvoiceResponse400 | invoiceDeleteInvoiceResponse401 | invoiceDeleteInvoiceResponse404) & {
1198
+ headers: Headers;
1199
+ };
1200
+
1201
+ export type invoiceDeleteInvoiceResponse = (invoiceDeleteInvoiceResponseSuccess | invoiceDeleteInvoiceResponseError)
1202
+
1203
+ export const getInvoiceDeleteInvoiceUrl = (invoiceUid: string | null,) => {
1204
+
1205
+
1206
+
1207
+
1208
+ return `/api/v1/billing/invoices/${invoiceUid}`
1209
+ }
1210
+
1211
+ export const invoiceDeleteInvoice = async (invoiceUid: string | null, options?: RequestInit): Promise<invoiceDeleteInvoiceResponse> => {
1212
+
1213
+ return customFetch<invoiceDeleteInvoiceResponse>(getInvoiceDeleteInvoiceUrl(invoiceUid),
1214
+ {
1215
+ ...options,
1216
+ method: 'DELETE'
1217
+
1218
+
1219
+ }
1220
+ );}
1221
+
1222
+
1223
+ /**
1224
+ * Response body is a binary PDF (Content-Type: application/pdf) served as an
1225
+ attachment named invoice-{Number}-{InvoiceDate}-{AccountName}.pdf.
1226
+ * @summary Retrieve a rendered PDF copy of an invoice.
1227
+ */
1228
+ export type invoiceGetInvoiceAsPdfResponse200 = {
1229
+ data: Blob
1230
+ status: 200
1231
+ }
1232
+
1233
+ export type invoiceGetInvoiceAsPdfResponse400 = {
1234
+ data: void
1235
+ status: 400
1236
+ }
1237
+
1238
+ export type invoiceGetInvoiceAsPdfResponse401 = {
1239
+ data: void
1240
+ status: 401
1241
+ }
1242
+
1243
+ export type invoiceGetInvoiceAsPdfResponse404 = {
1244
+ data: void
1245
+ status: 404
1246
+ }
1247
+
1248
+ export type invoiceGetInvoiceAsPdfResponseSuccess = (invoiceGetInvoiceAsPdfResponse200) & {
1249
+ headers: Headers;
1250
+ };
1251
+ export type invoiceGetInvoiceAsPdfResponseError = (invoiceGetInvoiceAsPdfResponse400 | invoiceGetInvoiceAsPdfResponse401 | invoiceGetInvoiceAsPdfResponse404) & {
1252
+ headers: Headers;
1253
+ };
1254
+
1255
+ export type invoiceGetInvoiceAsPdfResponse = (invoiceGetInvoiceAsPdfResponseSuccess | invoiceGetInvoiceAsPdfResponseError)
1256
+
1257
+ export const getInvoiceGetInvoiceAsPdfUrl = (invoiceUid: string | null,) => {
1258
+
1259
+
1260
+
1261
+
1262
+ return `/api/v1/billing/invoices/${invoiceUid}/pdf`
1263
+ }
1264
+
1265
+ export const invoiceGetInvoiceAsPdf = async (invoiceUid: string | null, options?: RequestInit): Promise<invoiceGetInvoiceAsPdfResponse> => {
1266
+
1267
+ return customFetch<invoiceGetInvoiceAsPdfResponse>(getInvoiceGetInvoiceAsPdfUrl(invoiceUid),
1268
+ {
1269
+ ...options,
1270
+ method: 'GET'
1271
+
1272
+
1273
+ }
1274
+ );}
1275
+
1276
+
1277
+ /**
1278
+ * Optional query parameters:
1279
+ note - free-text note to include in the email body.
1280
+ bcc - comma-separated list of email addresses to BCC.
1281
+ * @summary Email an invoice to the account's billing contact.
1282
+ */
1283
+ export type invoiceSendInvoiceEmailResponse200 = {
1284
+ data: Blob
1285
+ status: 200
1286
+ }
1287
+
1288
+ export type invoiceSendInvoiceEmailResponse400 = {
1289
+ data: void
1290
+ status: 400
1291
+ }
1292
+
1293
+ export type invoiceSendInvoiceEmailResponse401 = {
1294
+ data: void
1295
+ status: 401
1296
+ }
1297
+
1298
+ export type invoiceSendInvoiceEmailResponse404 = {
1299
+ data: void
1300
+ status: 404
1301
+ }
1302
+
1303
+ export type invoiceSendInvoiceEmailResponseSuccess = (invoiceSendInvoiceEmailResponse200) & {
1304
+ headers: Headers;
1305
+ };
1306
+ export type invoiceSendInvoiceEmailResponseError = (invoiceSendInvoiceEmailResponse400 | invoiceSendInvoiceEmailResponse401 | invoiceSendInvoiceEmailResponse404) & {
1307
+ headers: Headers;
1308
+ };
1309
+
1310
+ export type invoiceSendInvoiceEmailResponse = (invoiceSendInvoiceEmailResponseSuccess | invoiceSendInvoiceEmailResponseError)
1311
+
1312
+ export const getInvoiceSendInvoiceEmailUrl = (invoiceUid: string | null,) => {
1313
+
1314
+
1315
+
1316
+
1317
+ return `/api/v1/billing/invoices/${invoiceUid}/sendinvoiceemail`
1318
+ }
1319
+
1320
+ export const invoiceSendInvoiceEmail = async (invoiceUid: string | null, options?: RequestInit): Promise<invoiceSendInvoiceEmailResponse> => {
1321
+
1322
+ return customFetch<invoiceSendInvoiceEmailResponse>(getInvoiceSendInvoiceEmailUrl(invoiceUid),
1323
+ {
1324
+ ...options,
1325
+ method: 'POST'
1326
+
1327
+
1328
+ }
1329
+ );}
1330
+
1331
+
1332
+ /**
1333
+ * Returns 400 Bad Request if the invoice is not in the Paid status.
1334
+ * @summary Send the "invoice paid" receipt email to the account's billing contact.
1335
+ */
1336
+ export type invoiceSendInvoicePaidEmailResponse200 = {
1337
+ data: Blob
1338
+ status: 200
1339
+ }
1340
+
1341
+ export type invoiceSendInvoicePaidEmailResponse400 = {
1342
+ data: void
1343
+ status: 400
1344
+ }
1345
+
1346
+ export type invoiceSendInvoicePaidEmailResponse401 = {
1347
+ data: void
1348
+ status: 401
1349
+ }
1350
+
1351
+ export type invoiceSendInvoicePaidEmailResponse404 = {
1352
+ data: void
1353
+ status: 404
1354
+ }
1355
+
1356
+ export type invoiceSendInvoicePaidEmailResponseSuccess = (invoiceSendInvoicePaidEmailResponse200) & {
1357
+ headers: Headers;
1358
+ };
1359
+ export type invoiceSendInvoicePaidEmailResponseError = (invoiceSendInvoicePaidEmailResponse400 | invoiceSendInvoicePaidEmailResponse401 | invoiceSendInvoicePaidEmailResponse404) & {
1360
+ headers: Headers;
1361
+ };
1362
+
1363
+ export type invoiceSendInvoicePaidEmailResponse = (invoiceSendInvoicePaidEmailResponseSuccess | invoiceSendInvoicePaidEmailResponseError)
1364
+
1365
+ export const getInvoiceSendInvoicePaidEmailUrl = (invoiceUid: string | null,) => {
1366
+
1367
+
1368
+
1369
+
1370
+ return `/api/v1/billing/invoices/${invoiceUid}/sendinvoicepaidemail`
1371
+ }
1372
+
1373
+ export const invoiceSendInvoicePaidEmail = async (invoiceUid: string | null, options?: RequestInit): Promise<invoiceSendInvoicePaidEmailResponse> => {
1374
+
1375
+ return customFetch<invoiceSendInvoicePaidEmailResponse>(getInvoiceSendInvoicePaidEmailUrl(invoiceUid),
1376
+ {
1377
+ ...options,
1378
+ method: 'POST'
1379
+
1380
+
1381
+ }
1382
+ );}
1383
+
1384
+
1385
+ /**
1386
+ * Admins and API key callers see every subscription; non-admin users see only
1387
+ subscriptions on accounts they are related to. That scope is determined by the auth
1388
+ token and cannot be widened by the caller. Optionally pass
1389
+ Account.PersonAccount.Person.Uid as a query parameter to narrow the results to a
1390
+ specific person.
1391
+ * @summary Retrieve all subscriptions.
1392
+ */
1393
+ export type subscriptionGetAllSubscriptionsResponse200 = {
1394
+ data: Subscription[]
1395
+ status: 200
1396
+ }
1397
+
1398
+ export type subscriptionGetAllSubscriptionsResponse401 = {
1399
+ data: void
1400
+ status: 401
1401
+ }
1402
+
1403
+ export type subscriptionGetAllSubscriptionsResponseSuccess = (subscriptionGetAllSubscriptionsResponse200) & {
1404
+ headers: Headers;
1405
+ };
1406
+ export type subscriptionGetAllSubscriptionsResponseError = (subscriptionGetAllSubscriptionsResponse401) & {
1407
+ headers: Headers;
1408
+ };
1409
+
1410
+ export type subscriptionGetAllSubscriptionsResponse = (subscriptionGetAllSubscriptionsResponseSuccess | subscriptionGetAllSubscriptionsResponseError)
1411
+
1412
+ export const getSubscriptionGetAllSubscriptionsUrl = (params?: SubscriptionGetAllSubscriptionsParams,) => {
1413
+ const normalizedParams = new URLSearchParams();
1414
+
1415
+ Object.entries(params || {}).forEach(([key, value]) => {
1416
+
1417
+ if (value !== undefined) {
1418
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1419
+ }
1420
+ });
1421
+
1422
+ const stringifiedParams = normalizedParams.toString();
1423
+
1424
+ return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptions?${stringifiedParams}` : `/api/v1/billing/subscriptions`
1425
+ }
1426
+
1427
+ export const subscriptionGetAllSubscriptions = async (params?: SubscriptionGetAllSubscriptionsParams, options?: RequestInit): Promise<subscriptionGetAllSubscriptionsResponse> => {
1428
+
1429
+ return customFetch<subscriptionGetAllSubscriptionsResponse>(getSubscriptionGetAllSubscriptionsUrl(params),
1430
+ {
1431
+ ...options,
1432
+ method: 'GET'
1433
+
1434
+
1435
+ }
1436
+ );}
1437
+
1438
+
1439
+ /**
1440
+ * @summary Retrieve a subscription.
1441
+ */
1442
+ export type subscriptionGetSubscriptionResponse200 = {
1443
+ data: Subscription
1444
+ status: 200
1445
+ }
1446
+
1447
+ export type subscriptionGetSubscriptionResponse400 = {
1448
+ data: void
1449
+ status: 400
1450
+ }
1451
+
1452
+ export type subscriptionGetSubscriptionResponse401 = {
1453
+ data: void
1454
+ status: 401
1455
+ }
1456
+
1457
+ export type subscriptionGetSubscriptionResponse404 = {
1458
+ data: void
1459
+ status: 404
1460
+ }
1461
+
1462
+ export type subscriptionGetSubscriptionResponseSuccess = (subscriptionGetSubscriptionResponse200) & {
1463
+ headers: Headers;
1464
+ };
1465
+ export type subscriptionGetSubscriptionResponseError = (subscriptionGetSubscriptionResponse400 | subscriptionGetSubscriptionResponse401 | subscriptionGetSubscriptionResponse404) & {
1466
+ headers: Headers;
1467
+ };
1468
+
1469
+ export type subscriptionGetSubscriptionResponse = (subscriptionGetSubscriptionResponseSuccess | subscriptionGetSubscriptionResponseError)
1470
+
1471
+ export const getSubscriptionGetSubscriptionUrl = (subscriptionUid: string | null,) => {
1472
+
1473
+
1474
+
1475
+
1476
+ return `/api/v1/billing/subscriptions/${subscriptionUid}`
1477
+ }
1478
+
1479
+ export const subscriptionGetSubscription = async (subscriptionUid: string | null, options?: RequestInit): Promise<subscriptionGetSubscriptionResponse> => {
1480
+
1481
+ return customFetch<subscriptionGetSubscriptionResponse>(getSubscriptionGetSubscriptionUrl(subscriptionUid),
1482
+ {
1483
+ ...options,
1484
+ method: 'GET'
1485
+
1486
+
1487
+ }
1488
+ );}
1489
+
1490
+
1491
+ /**
1492
+ * Only a future-dated subscription can be deleted; the current subscription on an
1493
+ account cannot be removed this way.
1494
+ * @summary Delete a subscription.
1495
+ */
1496
+ export type subscriptionDeleteSubscriptionResponse200 = {
1497
+ data: Blob
1498
+ status: 200
1499
+ }
1500
+
1501
+ export type subscriptionDeleteSubscriptionResponse400 = {
1502
+ data: void
1503
+ status: 400
1504
+ }
1505
+
1506
+ export type subscriptionDeleteSubscriptionResponse401 = {
1507
+ data: void
1508
+ status: 401
1509
+ }
1510
+
1511
+ export type subscriptionDeleteSubscriptionResponse404 = {
1512
+ data: void
1513
+ status: 404
1514
+ }
1515
+
1516
+ export type subscriptionDeleteSubscriptionResponseSuccess = (subscriptionDeleteSubscriptionResponse200) & {
1517
+ headers: Headers;
1518
+ };
1519
+ export type subscriptionDeleteSubscriptionResponseError = (subscriptionDeleteSubscriptionResponse400 | subscriptionDeleteSubscriptionResponse401 | subscriptionDeleteSubscriptionResponse404) & {
1520
+ headers: Headers;
1521
+ };
1522
+
1523
+ export type subscriptionDeleteSubscriptionResponse = (subscriptionDeleteSubscriptionResponseSuccess | subscriptionDeleteSubscriptionResponseError)
1524
+
1525
+ export const getSubscriptionDeleteSubscriptionUrl = (subscriptionUid: string | null,) => {
1526
+
1527
+
1528
+
1529
+
1530
+ return `/api/v1/billing/subscriptions/${subscriptionUid}`
1531
+ }
1532
+
1533
+ export const subscriptionDeleteSubscription = async (subscriptionUid: string | null, options?: RequestInit): Promise<subscriptionDeleteSubscriptionResponse> => {
1534
+
1535
+ return customFetch<subscriptionDeleteSubscriptionResponse>(getSubscriptionDeleteSubscriptionUrl(subscriptionUid),
1536
+ {
1537
+ ...options,
1538
+ method: 'DELETE'
1539
+
1540
+
1541
+ }
1542
+ );}
1543
+
1544
+
1545
+ /**
1546
+ * @summary Add a discount to a subscription.
1547
+ */
1548
+ export type subscriptionAddDiscountToSubscriptionResponse200 = {
1549
+ data: Blob
1550
+ status: 200
1551
+ }
1552
+
1553
+ export type subscriptionAddDiscountToSubscriptionResponse400 = {
1554
+ data: void
1555
+ status: 400
1556
+ }
1557
+
1558
+ export type subscriptionAddDiscountToSubscriptionResponse401 = {
1559
+ data: void
1560
+ status: 401
1561
+ }
1562
+
1563
+ export type subscriptionAddDiscountToSubscriptionResponse404 = {
1564
+ data: void
1565
+ status: 404
1566
+ }
1567
+
1568
+ export type subscriptionAddDiscountToSubscriptionResponseSuccess = (subscriptionAddDiscountToSubscriptionResponse200) & {
1569
+ headers: Headers;
1570
+ };
1571
+ export type subscriptionAddDiscountToSubscriptionResponseError = (subscriptionAddDiscountToSubscriptionResponse400 | subscriptionAddDiscountToSubscriptionResponse401 | subscriptionAddDiscountToSubscriptionResponse404) & {
1572
+ headers: Headers;
1573
+ };
1574
+
1575
+ export type subscriptionAddDiscountToSubscriptionResponse = (subscriptionAddDiscountToSubscriptionResponseSuccess | subscriptionAddDiscountToSubscriptionResponseError)
1576
+
1577
+ export const getSubscriptionAddDiscountToSubscriptionUrl = (subscriptionUid: string | null,
1578
+ discountUid: string | null,) => {
1579
+
1580
+
1581
+
1582
+
1583
+ return `/api/v1/billing/subscriptions/${subscriptionUid}/discounts/${discountUid}`
1584
+ }
1585
+
1586
+ export const subscriptionAddDiscountToSubscription = async (subscriptionUid: string | null,
1587
+ discountUid: string | null, options?: RequestInit): Promise<subscriptionAddDiscountToSubscriptionResponse> => {
1588
+
1589
+ return customFetch<subscriptionAddDiscountToSubscriptionResponse>(getSubscriptionAddDiscountToSubscriptionUrl(subscriptionUid,discountUid),
1590
+ {
1591
+ ...options,
1592
+ method: 'POST'
1593
+
1594
+
1595
+ }
1596
+ );}
1597
+
1598
+
1599
+ /**
1600
+ * Expires the active discount coupon on the subscription as of now.
1601
+ * @summary Remove a discount from a subscription.
1602
+ */
1603
+ export type subscriptionExpireDiscountCouponSubscriptionResponse200 = {
1604
+ data: Blob
1605
+ status: 200
1606
+ }
1607
+
1608
+ export type subscriptionExpireDiscountCouponSubscriptionResponse400 = {
1609
+ data: void
1610
+ status: 400
1611
+ }
1612
+
1613
+ export type subscriptionExpireDiscountCouponSubscriptionResponse401 = {
1614
+ data: void
1615
+ status: 401
1616
+ }
1617
+
1618
+ export type subscriptionExpireDiscountCouponSubscriptionResponse404 = {
1619
+ data: void
1620
+ status: 404
1621
+ }
1622
+
1623
+ export type subscriptionExpireDiscountCouponSubscriptionResponseSuccess = (subscriptionExpireDiscountCouponSubscriptionResponse200) & {
1624
+ headers: Headers;
1625
+ };
1626
+ export type subscriptionExpireDiscountCouponSubscriptionResponseError = (subscriptionExpireDiscountCouponSubscriptionResponse400 | subscriptionExpireDiscountCouponSubscriptionResponse401 | subscriptionExpireDiscountCouponSubscriptionResponse404) & {
1627
+ headers: Headers;
1628
+ };
1629
+
1630
+ export type subscriptionExpireDiscountCouponSubscriptionResponse = (subscriptionExpireDiscountCouponSubscriptionResponseSuccess | subscriptionExpireDiscountCouponSubscriptionResponseError)
1631
+
1632
+ export const getSubscriptionExpireDiscountCouponSubscriptionUrl = (subscriptionUid: string | null,
1633
+ discountUid: string | null,) => {
1634
+
1635
+
1636
+
1637
+
1638
+ return `/api/v1/billing/subscriptions/${subscriptionUid}/discounts/${discountUid}`
1639
+ }
1640
+
1641
+ export const subscriptionExpireDiscountCouponSubscription = async (subscriptionUid: string | null,
1642
+ discountUid: string | null, options?: RequestInit): Promise<subscriptionExpireDiscountCouponSubscriptionResponse> => {
1643
+
1644
+ return customFetch<subscriptionExpireDiscountCouponSubscriptionResponse>(getSubscriptionExpireDiscountCouponSubscriptionUrl(subscriptionUid,discountUid),
1645
+ {
1646
+ ...options,
1647
+ method: 'DELETE'
1648
+
1649
+
1650
+ }
1651
+ );}
1652
+
1653
+
1654
+ /**
1655
+ * When a subscription is flagged, next time the user authenticates the authentication
1656
+ widget will prompt the user to change plan.
1657
+ * @summary Indicate that an upgrade of plan is required.
1658
+ */
1659
+ export type subscriptionSetSubscriptionUpgradeRequiredResponse200 = {
1660
+ data: Subscription
1661
+ status: 200
1662
+ }
1663
+
1664
+ export type subscriptionSetSubscriptionUpgradeRequiredResponse400 = {
1665
+ data: void
1666
+ status: 400
1667
+ }
1668
+
1669
+ export type subscriptionSetSubscriptionUpgradeRequiredResponse401 = {
1670
+ data: void
1671
+ status: 401
1672
+ }
1673
+
1674
+ export type subscriptionSetSubscriptionUpgradeRequiredResponse404 = {
1675
+ data: void
1676
+ status: 404
1677
+ }
1678
+
1679
+ export type subscriptionSetSubscriptionUpgradeRequiredResponseSuccess = (subscriptionSetSubscriptionUpgradeRequiredResponse200) & {
1680
+ headers: Headers;
1681
+ };
1682
+ export type subscriptionSetSubscriptionUpgradeRequiredResponseError = (subscriptionSetSubscriptionUpgradeRequiredResponse400 | subscriptionSetSubscriptionUpgradeRequiredResponse401 | subscriptionSetSubscriptionUpgradeRequiredResponse404) & {
1683
+ headers: Headers;
1684
+ };
1685
+
1686
+ export type subscriptionSetSubscriptionUpgradeRequiredResponse = (subscriptionSetSubscriptionUpgradeRequiredResponseSuccess | subscriptionSetSubscriptionUpgradeRequiredResponseError)
1687
+
1688
+ export const getSubscriptionSetSubscriptionUpgradeRequiredUrl = (subscriptionUid: string | null,) => {
1689
+
1690
+
1691
+
1692
+
1693
+ return `/api/v1/billing/subscriptions/${subscriptionUid}/setsubscriptionupgraderequired`
1694
+ }
1695
+
1696
+ export const subscriptionSetSubscriptionUpgradeRequired = async (subscriptionUid: string | null,
1697
+ subscriptionSetSubscriptionUpgradeRequiredBody: NonReadonly<SubscriptionSetSubscriptionUpgradeRequiredBody>, options?: RequestInit): Promise<subscriptionSetSubscriptionUpgradeRequiredResponse> => {
1698
+
1699
+ return customFetch<subscriptionSetSubscriptionUpgradeRequiredResponse>(getSubscriptionSetSubscriptionUpgradeRequiredUrl(subscriptionUid),
1700
+ {
1701
+ ...options,
1702
+ method: 'PUT',
1703
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1704
+ body: JSON.stringify(
1705
+ subscriptionSetSubscriptionUpgradeRequiredBody,)
1706
+ }
1707
+ );}
1708
+
1709
+
1710
+ /**
1711
+ * Returns an invoice object with information about the amount outstanding if an account
1712
+ were to register with this subscription. BillingRenewalTerm values: 1 = Monthly,
1713
+ 2 = Yearly, 3 = Quarterly, 4 = OneTime. Pass asOf=renewal to see the renewal invoice
1714
+ instead of the initial invoice.
1715
+ * @summary Preview the initial or renewal invoice for a hypothetical subscription.
1716
+ */
1717
+ export type subscriptionFirstTimeSubscriptionPreviewResponse200 = {
1718
+ data: Invoice
1719
+ status: 200
1720
+ }
1721
+
1722
+ export type subscriptionFirstTimeSubscriptionPreviewResponseSuccess = (subscriptionFirstTimeSubscriptionPreviewResponse200) & {
1723
+ headers: Headers;
1724
+ };
1725
+ ;
1726
+
1727
+ export type subscriptionFirstTimeSubscriptionPreviewResponse = (subscriptionFirstTimeSubscriptionPreviewResponseSuccess)
1728
+
1729
+ export const getSubscriptionFirstTimeSubscriptionPreviewUrl = (params?: SubscriptionFirstTimeSubscriptionPreviewParams,) => {
1730
+ const normalizedParams = new URLSearchParams();
1731
+
1732
+ Object.entries(params || {}).forEach(([key, value]) => {
1733
+
1734
+ if (value !== undefined) {
1735
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1736
+ }
1737
+ });
1738
+
1739
+ const stringifiedParams = normalizedParams.toString();
1740
+
1741
+ return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptions/compute-charge-summary?${stringifiedParams}` : `/api/v1/billing/subscriptions/compute-charge-summary`
1742
+ }
1743
+
1744
+ export const subscriptionFirstTimeSubscriptionPreview = async (subscriptionFirstTimeSubscriptionPreviewBody: NonReadonly<SubscriptionFirstTimeSubscriptionPreviewBody>,
1745
+ params?: SubscriptionFirstTimeSubscriptionPreviewParams, options?: RequestInit): Promise<subscriptionFirstTimeSubscriptionPreviewResponse> => {
1746
+
1747
+ return customFetch<subscriptionFirstTimeSubscriptionPreviewResponse>(getSubscriptionFirstTimeSubscriptionPreviewUrl(params),
1748
+ {
1749
+ ...options,
1750
+ method: 'POST',
1751
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1752
+ body: JSON.stringify(
1753
+ subscriptionFirstTimeSubscriptionPreviewBody,)
1754
+ }
1755
+ );}
1756
+
1757
+
1758
+ /**
1759
+ * Returns an invoice object with information about the amount outstanding.
1760
+ * @summary Add a subscription to an account for the first time.
1761
+ */
1762
+ export type subscriptionFirstTimeSubscriptionResponse200 = {
1763
+ data: Invoice
1764
+ status: 200
1765
+ }
1766
+
1767
+ export type subscriptionFirstTimeSubscriptionResponse401 = {
1768
+ data: void
1769
+ status: 401
1770
+ }
1771
+
1772
+ export type subscriptionFirstTimeSubscriptionResponseSuccess = (subscriptionFirstTimeSubscriptionResponse200) & {
1773
+ headers: Headers;
1774
+ };
1775
+ export type subscriptionFirstTimeSubscriptionResponseError = (subscriptionFirstTimeSubscriptionResponse401) & {
1776
+ headers: Headers;
1777
+ };
1778
+
1779
+ export type subscriptionFirstTimeSubscriptionResponse = (subscriptionFirstTimeSubscriptionResponseSuccess | subscriptionFirstTimeSubscriptionResponseError)
1780
+
1781
+ export const getSubscriptionFirstTimeSubscriptionUrl = () => {
1782
+
1783
+
1784
+
1785
+
1786
+ return `/api/v1/billing/subscriptions/firsttimesubscription`
1787
+ }
1788
+
1789
+ export const subscriptionFirstTimeSubscription = async (subscriptionFirstTimeSubscriptionBody: NonReadonly<SubscriptionFirstTimeSubscriptionBody>, options?: RequestInit): Promise<subscriptionFirstTimeSubscriptionResponse> => {
1790
+
1791
+ return customFetch<subscriptionFirstTimeSubscriptionResponse>(getSubscriptionFirstTimeSubscriptionUrl(),
1792
+ {
1793
+ ...options,
1794
+ method: 'PUT',
1795
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1796
+ body: JSON.stringify(
1797
+ subscriptionFirstTimeSubscriptionBody,)
1798
+ }
1799
+ );}
1800
+
1801
+
1802
+ /**
1803
+ * Returns an invoice object with information about the amount outstanding. This method
1804
+ does not commit the subscription change.
1805
+ * @summary Preview the invoice for a subscription change.
1806
+ */
1807
+ export type subscriptionChangeSubscriptionPreviewResponse200 = {
1808
+ data: Invoice
1809
+ status: 200
1810
+ }
1811
+
1812
+ export type subscriptionChangeSubscriptionPreviewResponse400 = {
1813
+ data: void
1814
+ status: 400
1815
+ }
1816
+
1817
+ export type subscriptionChangeSubscriptionPreviewResponse401 = {
1818
+ data: void
1819
+ status: 401
1820
+ }
1821
+
1822
+ export type subscriptionChangeSubscriptionPreviewResponse404 = {
1823
+ data: void
1824
+ status: 404
1825
+ }
1826
+
1827
+ export type subscriptionChangeSubscriptionPreviewResponseSuccess = (subscriptionChangeSubscriptionPreviewResponse200) & {
1828
+ headers: Headers;
1829
+ };
1830
+ export type subscriptionChangeSubscriptionPreviewResponseError = (subscriptionChangeSubscriptionPreviewResponse400 | subscriptionChangeSubscriptionPreviewResponse401 | subscriptionChangeSubscriptionPreviewResponse404) & {
1831
+ headers: Headers;
1832
+ };
1833
+
1834
+ export type subscriptionChangeSubscriptionPreviewResponse = (subscriptionChangeSubscriptionPreviewResponseSuccess | subscriptionChangeSubscriptionPreviewResponseError)
1835
+
1836
+ export const getSubscriptionChangeSubscriptionPreviewUrl = (subscriptionUid: string | null,
1837
+ params?: SubscriptionChangeSubscriptionPreviewParams,) => {
1838
+ const normalizedParams = new URLSearchParams();
1839
+
1840
+ Object.entries(params || {}).forEach(([key, value]) => {
1841
+
1842
+ if (value !== undefined) {
1843
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1844
+ }
1845
+ });
1846
+
1847
+ const stringifiedParams = normalizedParams.toString();
1848
+
1849
+ return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscriptionpreview?${stringifiedParams}` : `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscriptionpreview`
1850
+ }
1851
+
1852
+ export const subscriptionChangeSubscriptionPreview = async (subscriptionUid: string | null,
1853
+ subscriptionChangeSubscriptionPreviewBody: NonReadonly<SubscriptionChangeSubscriptionPreviewBody>,
1854
+ params?: SubscriptionChangeSubscriptionPreviewParams, options?: RequestInit): Promise<subscriptionChangeSubscriptionPreviewResponse> => {
1855
+
1856
+ return customFetch<subscriptionChangeSubscriptionPreviewResponse>(getSubscriptionChangeSubscriptionPreviewUrl(subscriptionUid,params),
1857
+ {
1858
+ ...options,
1859
+ method: 'PUT',
1860
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1861
+ body: JSON.stringify(
1862
+ subscriptionChangeSubscriptionPreviewBody,)
1863
+ }
1864
+ );}
1865
+
1866
+
1867
+ /**
1868
+ * Returns an invoice object with information about the amount outstanding.
1869
+ * @summary Change a subscription on an account.
1870
+ */
1871
+ export type subscriptionChangeSubscriptionResponse200 = {
1872
+ data: Subscription
1873
+ status: 200
1874
+ }
1875
+
1876
+ export type subscriptionChangeSubscriptionResponse400 = {
1877
+ data: void
1878
+ status: 400
1879
+ }
1880
+
1881
+ export type subscriptionChangeSubscriptionResponse401 = {
1882
+ data: void
1883
+ status: 401
1884
+ }
1885
+
1886
+ export type subscriptionChangeSubscriptionResponse404 = {
1887
+ data: void
1888
+ status: 404
1889
+ }
1890
+
1891
+ export type subscriptionChangeSubscriptionResponseSuccess = (subscriptionChangeSubscriptionResponse200) & {
1892
+ headers: Headers;
1893
+ };
1894
+ export type subscriptionChangeSubscriptionResponseError = (subscriptionChangeSubscriptionResponse400 | subscriptionChangeSubscriptionResponse401 | subscriptionChangeSubscriptionResponse404) & {
1895
+ headers: Headers;
1896
+ };
1897
+
1898
+ export type subscriptionChangeSubscriptionResponse = (subscriptionChangeSubscriptionResponseSuccess | subscriptionChangeSubscriptionResponseError)
1899
+
1900
+ export const getSubscriptionChangeSubscriptionUrl = (subscriptionUid: string | null,
1901
+ params?: SubscriptionChangeSubscriptionParams,) => {
1902
+ const normalizedParams = new URLSearchParams();
1903
+
1904
+ Object.entries(params || {}).forEach(([key, value]) => {
1905
+
1906
+ if (value !== undefined) {
1907
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1908
+ }
1909
+ });
1910
+
1911
+ const stringifiedParams = normalizedParams.toString();
1912
+
1913
+ return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscription?${stringifiedParams}` : `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscription`
1914
+ }
1915
+
1916
+ export const subscriptionChangeSubscription = async (subscriptionUid: string | null,
1917
+ subscriptionChangeSubscriptionBody: NonReadonly<SubscriptionChangeSubscriptionBody>,
1918
+ params?: SubscriptionChangeSubscriptionParams, options?: RequestInit): Promise<subscriptionChangeSubscriptionResponse> => {
1919
+
1920
+ return customFetch<subscriptionChangeSubscriptionResponse>(getSubscriptionChangeSubscriptionUrl(subscriptionUid,params),
1921
+ {
1922
+ ...options,
1923
+ method: 'PUT',
1924
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1925
+ body: JSON.stringify(
1926
+ subscriptionChangeSubscriptionBody,)
1927
+ }
1928
+ );}
1929
+
1930
+
1931
+ /**
1932
+ * @summary Retrieve all plans.
1933
+ */
1934
+ export type planGetAllPlansResponse200 = {
1935
+ data: Plan[]
1936
+ status: 200
1937
+ }
1938
+
1939
+ export type planGetAllPlansResponseSuccess = (planGetAllPlansResponse200) & {
1940
+ headers: Headers;
1941
+ };
1942
+ ;
1943
+
1944
+ export type planGetAllPlansResponse = (planGetAllPlansResponseSuccess)
1945
+
1946
+ export const getPlanGetAllPlansUrl = () => {
1947
+
1948
+
1949
+
1950
+
1951
+ return `/api/v1/billing/plans`
1952
+ }
1953
+
1954
+ export const planGetAllPlans = async ( options?: RequestInit): Promise<planGetAllPlansResponse> => {
1955
+
1956
+ return customFetch<planGetAllPlansResponse>(getPlanGetAllPlansUrl(),
1957
+ {
1958
+ ...options,
1959
+ method: 'GET'
677
1960
 
678
1961
 
679
1962
  }
@@ -681,101 +1964,86 @@ export const invoiceSendInvoiceEmail = async (invoiceUid: string | null, options
681
1964
 
682
1965
 
683
1966
  /**
684
- * Returns 400 Bad Request if the invoice is not in the Paid status.
685
- * @summary Send the "invoice paid" receipt email to the account's billing contact.
1967
+ * @summary Add a new plan.
686
1968
  */
687
- export type invoiceSendInvoicePaidEmailResponse200 = {
688
- data: Blob
1969
+ export type planAddPlanResponse200 = {
1970
+ data: Plan
689
1971
  status: 200
690
1972
  }
691
1973
 
692
- export type invoiceSendInvoicePaidEmailResponse400 = {
693
- data: void
694
- status: 400
695
- }
696
-
697
- export type invoiceSendInvoicePaidEmailResponse401 = {
1974
+ export type planAddPlanResponse401 = {
698
1975
  data: void
699
1976
  status: 401
700
1977
  }
701
-
702
- export type invoiceSendInvoicePaidEmailResponse404 = {
703
- data: void
704
- status: 404
705
- }
706
1978
 
707
- export type invoiceSendInvoicePaidEmailResponseSuccess = (invoiceSendInvoicePaidEmailResponse200) & {
1979
+ export type planAddPlanResponseSuccess = (planAddPlanResponse200) & {
708
1980
  headers: Headers;
709
1981
  };
710
- export type invoiceSendInvoicePaidEmailResponseError = (invoiceSendInvoicePaidEmailResponse400 | invoiceSendInvoicePaidEmailResponse401 | invoiceSendInvoicePaidEmailResponse404) & {
1982
+ export type planAddPlanResponseError = (planAddPlanResponse401) & {
711
1983
  headers: Headers;
712
1984
  };
713
1985
 
714
- export type invoiceSendInvoicePaidEmailResponse = (invoiceSendInvoicePaidEmailResponseSuccess | invoiceSendInvoicePaidEmailResponseError)
1986
+ export type planAddPlanResponse = (planAddPlanResponseSuccess | planAddPlanResponseError)
715
1987
 
716
- export const getInvoiceSendInvoicePaidEmailUrl = (invoiceUid: string | null,) => {
1988
+ export const getPlanAddPlanUrl = () => {
717
1989
 
718
1990
 
719
1991
 
720
1992
 
721
- return `/api/v1/billing/invoices/${invoiceUid}/sendinvoicepaidemail`
1993
+ return `/api/v1/billing/plans`
722
1994
  }
723
1995
 
724
- export const invoiceSendInvoicePaidEmail = async (invoiceUid: string | null, options?: RequestInit): Promise<invoiceSendInvoicePaidEmailResponse> => {
1996
+ export const planAddPlan = async (planAddPlanBody: NonReadonly<PlanAddPlanBody>, options?: RequestInit): Promise<planAddPlanResponse> => {
725
1997
 
726
- return customFetch<invoiceSendInvoicePaidEmailResponse>(getInvoiceSendInvoicePaidEmailUrl(invoiceUid),
1998
+ return customFetch<planAddPlanResponse>(getPlanAddPlanUrl(),
727
1999
  {
728
2000
  ...options,
729
- method: 'POST'
730
-
731
-
2001
+ method: 'POST',
2002
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
2003
+ body: JSON.stringify(
2004
+ planAddPlanBody,)
732
2005
  }
733
2006
  );}
734
2007
 
735
2008
 
736
2009
  /**
737
- * @summary Retrieves a subscription.
2010
+ * @summary Retrieve a plan.
738
2011
  */
739
- export type subscriptionGetSubscriptionResponse200 = {
740
- data: Subscription
2012
+ export type planGetPlanResponse200 = {
2013
+ data: Plan
741
2014
  status: 200
742
2015
  }
743
2016
 
744
- export type subscriptionGetSubscriptionResponse400 = {
2017
+ export type planGetPlanResponse400 = {
745
2018
  data: void
746
2019
  status: 400
747
2020
  }
748
2021
 
749
- export type subscriptionGetSubscriptionResponse401 = {
750
- data: void
751
- status: 401
752
- }
753
-
754
- export type subscriptionGetSubscriptionResponse404 = {
2022
+ export type planGetPlanResponse404 = {
755
2023
  data: void
756
2024
  status: 404
757
2025
  }
758
2026
 
759
- export type subscriptionGetSubscriptionResponseSuccess = (subscriptionGetSubscriptionResponse200) & {
2027
+ export type planGetPlanResponseSuccess = (planGetPlanResponse200) & {
760
2028
  headers: Headers;
761
2029
  };
762
- export type subscriptionGetSubscriptionResponseError = (subscriptionGetSubscriptionResponse400 | subscriptionGetSubscriptionResponse401 | subscriptionGetSubscriptionResponse404) & {
2030
+ export type planGetPlanResponseError = (planGetPlanResponse400 | planGetPlanResponse404) & {
763
2031
  headers: Headers;
764
2032
  };
765
2033
 
766
- export type subscriptionGetSubscriptionResponse = (subscriptionGetSubscriptionResponseSuccess | subscriptionGetSubscriptionResponseError)
2034
+ export type planGetPlanResponse = (planGetPlanResponseSuccess | planGetPlanResponseError)
767
2035
 
768
- export const getSubscriptionGetSubscriptionUrl = (subscriptionUid: string | null,) => {
2036
+ export const getPlanGetPlanUrl = (planUid: string | null,) => {
769
2037
 
770
2038
 
771
2039
 
772
2040
 
773
- return `/api/v1/billing/subscriptions/${subscriptionUid}`
2041
+ return `/api/v1/billing/plans/${planUid}`
774
2042
  }
775
2043
 
776
- export const subscriptionGetSubscription = async (subscriptionUid: string | null, options?: RequestInit): Promise<subscriptionGetSubscriptionResponse> => {
2044
+ export const planGetPlan = async (planUid: string | null, options?: RequestInit): Promise<planGetPlanResponse> => {
777
2045
 
778
- return customFetch<subscriptionGetSubscriptionResponse>(getSubscriptionGetSubscriptionUrl(subscriptionUid),
2046
+ return customFetch<planGetPlanResponse>(getPlanGetPlanUrl(planUid),
779
2047
  {
780
2048
  ...options,
781
2049
  method: 'GET'
@@ -786,400 +2054,341 @@ export const subscriptionGetSubscription = async (subscriptionUid: string | null
786
2054
 
787
2055
 
788
2056
  /**
789
- * @summary Add a discount to a subscription.
2057
+ * @summary Update a plan.
790
2058
  */
791
- export type subscriptionAddDiscountToSubscriptionResponse200 = {
792
- data: Blob
2059
+ export type planUpdatePlanResponse200 = {
2060
+ data: Plan
793
2061
  status: 200
794
2062
  }
795
2063
 
796
- export type subscriptionAddDiscountToSubscriptionResponse400 = {
2064
+ export type planUpdatePlanResponse400 = {
797
2065
  data: void
798
2066
  status: 400
799
2067
  }
800
2068
 
801
- export type subscriptionAddDiscountToSubscriptionResponse401 = {
2069
+ export type planUpdatePlanResponse401 = {
802
2070
  data: void
803
2071
  status: 401
804
2072
  }
805
2073
 
806
- export type subscriptionAddDiscountToSubscriptionResponse404 = {
2074
+ export type planUpdatePlanResponse404 = {
807
2075
  data: void
808
2076
  status: 404
809
2077
  }
810
2078
 
811
- export type subscriptionAddDiscountToSubscriptionResponseSuccess = (subscriptionAddDiscountToSubscriptionResponse200) & {
2079
+ export type planUpdatePlanResponseSuccess = (planUpdatePlanResponse200) & {
812
2080
  headers: Headers;
813
2081
  };
814
- export type subscriptionAddDiscountToSubscriptionResponseError = (subscriptionAddDiscountToSubscriptionResponse400 | subscriptionAddDiscountToSubscriptionResponse401 | subscriptionAddDiscountToSubscriptionResponse404) & {
2082
+ export type planUpdatePlanResponseError = (planUpdatePlanResponse400 | planUpdatePlanResponse401 | planUpdatePlanResponse404) & {
815
2083
  headers: Headers;
816
2084
  };
817
2085
 
818
- export type subscriptionAddDiscountToSubscriptionResponse = (subscriptionAddDiscountToSubscriptionResponseSuccess | subscriptionAddDiscountToSubscriptionResponseError)
2086
+ export type planUpdatePlanResponse = (planUpdatePlanResponseSuccess | planUpdatePlanResponseError)
819
2087
 
820
- export const getSubscriptionAddDiscountToSubscriptionUrl = (subscriptionUid: string | null,
821
- discountUid: string | null,) => {
2088
+ export const getPlanUpdatePlanUrl = (planUid: string | null,) => {
822
2089
 
823
2090
 
824
2091
 
825
2092
 
826
- return `/api/v1/billing/subscriptions/${subscriptionUid}/discounts/${discountUid}`
2093
+ return `/api/v1/billing/plans/${planUid}`
827
2094
  }
828
2095
 
829
- export const subscriptionAddDiscountToSubscription = async (subscriptionUid: string | null,
830
- discountUid: string | null, options?: RequestInit): Promise<subscriptionAddDiscountToSubscriptionResponse> => {
2096
+ export const planUpdatePlan = async (planUid: string | null,
2097
+ planUpdatePlanBody: NonReadonly<PlanUpdatePlanBody>, options?: RequestInit): Promise<planUpdatePlanResponse> => {
831
2098
 
832
- return customFetch<subscriptionAddDiscountToSubscriptionResponse>(getSubscriptionAddDiscountToSubscriptionUrl(subscriptionUid,discountUid),
2099
+ return customFetch<planUpdatePlanResponse>(getPlanUpdatePlanUrl(planUid),
833
2100
  {
834
2101
  ...options,
835
- method: 'POST'
836
-
837
-
2102
+ method: 'PUT',
2103
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
2104
+ body: JSON.stringify(
2105
+ planUpdatePlanBody,)
838
2106
  }
839
2107
  );}
840
2108
 
841
2109
 
842
2110
  /**
843
- * When a subscription is flagged, next time the user authenticates the authentication
844
- widget will prompt the user to change plan.
845
- * @summary Indicate that an upgrade of plan is required.
2111
+ * @summary Delete a plan.
846
2112
  */
847
- export type subscriptionSetSubscriptionUpgradeRequiredResponse200 = {
848
- data: Subscription
2113
+ export type planDeletePlanResponse200 = {
2114
+ data: Blob
849
2115
  status: 200
850
2116
  }
851
2117
 
852
- export type subscriptionSetSubscriptionUpgradeRequiredResponse400 = {
2118
+ export type planDeletePlanResponse400 = {
853
2119
  data: void
854
2120
  status: 400
855
2121
  }
856
2122
 
857
- export type subscriptionSetSubscriptionUpgradeRequiredResponse401 = {
2123
+ export type planDeletePlanResponse401 = {
858
2124
  data: void
859
2125
  status: 401
860
2126
  }
861
2127
 
862
- export type subscriptionSetSubscriptionUpgradeRequiredResponse404 = {
2128
+ export type planDeletePlanResponse404 = {
863
2129
  data: void
864
2130
  status: 404
865
2131
  }
866
2132
 
867
- export type subscriptionSetSubscriptionUpgradeRequiredResponseSuccess = (subscriptionSetSubscriptionUpgradeRequiredResponse200) & {
2133
+ export type planDeletePlanResponseSuccess = (planDeletePlanResponse200) & {
868
2134
  headers: Headers;
869
2135
  };
870
- export type subscriptionSetSubscriptionUpgradeRequiredResponseError = (subscriptionSetSubscriptionUpgradeRequiredResponse400 | subscriptionSetSubscriptionUpgradeRequiredResponse401 | subscriptionSetSubscriptionUpgradeRequiredResponse404) & {
2136
+ export type planDeletePlanResponseError = (planDeletePlanResponse400 | planDeletePlanResponse401 | planDeletePlanResponse404) & {
871
2137
  headers: Headers;
872
2138
  };
873
2139
 
874
- export type subscriptionSetSubscriptionUpgradeRequiredResponse = (subscriptionSetSubscriptionUpgradeRequiredResponseSuccess | subscriptionSetSubscriptionUpgradeRequiredResponseError)
2140
+ export type planDeletePlanResponse = (planDeletePlanResponseSuccess | planDeletePlanResponseError)
875
2141
 
876
- export const getSubscriptionSetSubscriptionUpgradeRequiredUrl = (subscriptionUid: string | null,) => {
2142
+ export const getPlanDeletePlanUrl = (planUid: string | null,) => {
877
2143
 
878
2144
 
879
2145
 
880
2146
 
881
- return `/api/v1/billing/subscriptions/${subscriptionUid}/setsubscriptionupgraderequired`
2147
+ return `/api/v1/billing/plans/${planUid}`
882
2148
  }
883
2149
 
884
- export const subscriptionSetSubscriptionUpgradeRequired = async (subscriptionUid: string | null,
885
- subscriptionSetSubscriptionUpgradeRequiredBody: NonReadonly<SubscriptionSetSubscriptionUpgradeRequiredBody>, options?: RequestInit): Promise<subscriptionSetSubscriptionUpgradeRequiredResponse> => {
2150
+ export const planDeletePlan = async (planUid: string | null, options?: RequestInit): Promise<planDeletePlanResponse> => {
886
2151
 
887
- return customFetch<subscriptionSetSubscriptionUpgradeRequiredResponse>(getSubscriptionSetSubscriptionUpgradeRequiredUrl(subscriptionUid),
2152
+ return customFetch<planDeletePlanResponse>(getPlanDeletePlanUrl(planUid),
888
2153
  {
889
2154
  ...options,
890
- method: 'PUT',
891
- headers: { 'Content-Type': 'application/json', ...options?.headers },
892
- body: JSON.stringify(
893
- subscriptionSetSubscriptionUpgradeRequiredBody,)
2155
+ method: 'DELETE'
2156
+
2157
+
894
2158
  }
895
2159
  );}
896
2160
 
897
2161
 
898
2162
  /**
899
- * Returns an invoice object with information about the amount outstanding if an account
900
- were to register with this subscription. BillingRenewalTerm values: 1 = Monthly,
901
- 2 = Yearly, 3 = Quarterly, 4 = OneTime. Pass asOf=renewal to see the renewal invoice
902
- instead of the initial invoice.
903
- * @summary Preview the initial or renewal invoice for a hypothetical subscription.
2163
+ * @summary Retrieve all plan families.
904
2164
  */
905
- export type subscriptionFirstTimeSubscriptionPreviewResponse200 = {
906
- data: Invoice
2165
+ export type planFamilyGetAllPlanFamiliesResponse200 = {
2166
+ data: PlanFamily[]
907
2167
  status: 200
908
2168
  }
909
2169
 
910
- export type subscriptionFirstTimeSubscriptionPreviewResponseSuccess = (subscriptionFirstTimeSubscriptionPreviewResponse200) & {
2170
+ export type planFamilyGetAllPlanFamiliesResponseSuccess = (planFamilyGetAllPlanFamiliesResponse200) & {
911
2171
  headers: Headers;
912
2172
  };
913
2173
  ;
914
2174
 
915
- export type subscriptionFirstTimeSubscriptionPreviewResponse = (subscriptionFirstTimeSubscriptionPreviewResponseSuccess)
2175
+ export type planFamilyGetAllPlanFamiliesResponse = (planFamilyGetAllPlanFamiliesResponseSuccess)
916
2176
 
917
- export const getSubscriptionFirstTimeSubscriptionPreviewUrl = (params?: SubscriptionFirstTimeSubscriptionPreviewParams,) => {
918
- const normalizedParams = new URLSearchParams();
2177
+ export const getPlanFamilyGetAllPlanFamiliesUrl = () => {
919
2178
 
920
- Object.entries(params || {}).forEach(([key, value]) => {
921
-
922
- if (value !== undefined) {
923
- normalizedParams.append(key, value === null ? 'null' : value.toString())
924
- }
925
- });
926
2179
 
927
- const stringifiedParams = normalizedParams.toString();
2180
+
928
2181
 
929
- return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptions/compute-charge-summary?${stringifiedParams}` : `/api/v1/billing/subscriptions/compute-charge-summary`
2182
+ return `/api/v1/billing/planfamilies`
930
2183
  }
931
2184
 
932
- export const subscriptionFirstTimeSubscriptionPreview = async (subscriptionFirstTimeSubscriptionPreviewBody: NonReadonly<SubscriptionFirstTimeSubscriptionPreviewBody>,
933
- params?: SubscriptionFirstTimeSubscriptionPreviewParams, options?: RequestInit): Promise<subscriptionFirstTimeSubscriptionPreviewResponse> => {
2185
+ export const planFamilyGetAllPlanFamilies = async ( options?: RequestInit): Promise<planFamilyGetAllPlanFamiliesResponse> => {
934
2186
 
935
- return customFetch<subscriptionFirstTimeSubscriptionPreviewResponse>(getSubscriptionFirstTimeSubscriptionPreviewUrl(params),
2187
+ return customFetch<planFamilyGetAllPlanFamiliesResponse>(getPlanFamilyGetAllPlanFamiliesUrl(),
936
2188
  {
937
2189
  ...options,
938
- method: 'POST',
939
- headers: { 'Content-Type': 'application/json', ...options?.headers },
940
- body: JSON.stringify(
941
- subscriptionFirstTimeSubscriptionPreviewBody,)
2190
+ method: 'GET'
2191
+
2192
+
942
2193
  }
943
2194
  );}
944
2195
 
945
2196
 
946
2197
  /**
947
- * Returns an invoice object with information about the amount outstanding.
948
- * @summary Add a subscription to an account for the first time.
2198
+ * @summary Add a new plan family.
949
2199
  */
950
- export type subscriptionFirstTimeSubscriptionResponse200 = {
951
- data: Invoice
2200
+ export type planFamilyAddPlanFamilyResponse200 = {
2201
+ data: PlanFamily
952
2202
  status: 200
953
2203
  }
954
2204
 
955
- export type subscriptionFirstTimeSubscriptionResponse401 = {
2205
+ export type planFamilyAddPlanFamilyResponse401 = {
956
2206
  data: void
957
2207
  status: 401
958
2208
  }
959
2209
 
960
- export type subscriptionFirstTimeSubscriptionResponseSuccess = (subscriptionFirstTimeSubscriptionResponse200) & {
2210
+ export type planFamilyAddPlanFamilyResponseSuccess = (planFamilyAddPlanFamilyResponse200) & {
961
2211
  headers: Headers;
962
2212
  };
963
- export type subscriptionFirstTimeSubscriptionResponseError = (subscriptionFirstTimeSubscriptionResponse401) & {
2213
+ export type planFamilyAddPlanFamilyResponseError = (planFamilyAddPlanFamilyResponse401) & {
964
2214
  headers: Headers;
965
2215
  };
966
2216
 
967
- export type subscriptionFirstTimeSubscriptionResponse = (subscriptionFirstTimeSubscriptionResponseSuccess | subscriptionFirstTimeSubscriptionResponseError)
2217
+ export type planFamilyAddPlanFamilyResponse = (planFamilyAddPlanFamilyResponseSuccess | planFamilyAddPlanFamilyResponseError)
968
2218
 
969
- export const getSubscriptionFirstTimeSubscriptionUrl = () => {
2219
+ export const getPlanFamilyAddPlanFamilyUrl = () => {
970
2220
 
971
2221
 
972
2222
 
973
2223
 
974
- return `/api/v1/billing/subscriptions/firsttimesubscription`
2224
+ return `/api/v1/billing/planfamilies`
975
2225
  }
976
2226
 
977
- export const subscriptionFirstTimeSubscription = async (subscriptionFirstTimeSubscriptionBody: NonReadonly<SubscriptionFirstTimeSubscriptionBody>, options?: RequestInit): Promise<subscriptionFirstTimeSubscriptionResponse> => {
2227
+ export const planFamilyAddPlanFamily = async (planFamilyAddPlanFamilyBody: NonReadonly<PlanFamilyAddPlanFamilyBody>, options?: RequestInit): Promise<planFamilyAddPlanFamilyResponse> => {
978
2228
 
979
- return customFetch<subscriptionFirstTimeSubscriptionResponse>(getSubscriptionFirstTimeSubscriptionUrl(),
2229
+ return customFetch<planFamilyAddPlanFamilyResponse>(getPlanFamilyAddPlanFamilyUrl(),
980
2230
  {
981
2231
  ...options,
982
- method: 'PUT',
2232
+ method: 'POST',
983
2233
  headers: { 'Content-Type': 'application/json', ...options?.headers },
984
2234
  body: JSON.stringify(
985
- subscriptionFirstTimeSubscriptionBody,)
2235
+ planFamilyAddPlanFamilyBody,)
986
2236
  }
987
2237
  );}
988
2238
 
989
2239
 
990
2240
  /**
991
- * Returns an invoice object with information about the amount outstanding. This method
992
- does not commit the subscription change.
993
- * @summary Preview the invoice for a subscription change.
2241
+ * @summary Retrieve a plan family.
994
2242
  */
995
- export type subscriptionChangeSubscriptionPreviewResponse200 = {
996
- data: Invoice
2243
+ export type planFamilyGetPlanFamilyResponse200 = {
2244
+ data: PlanFamily
997
2245
  status: 200
998
2246
  }
999
2247
 
1000
- export type subscriptionChangeSubscriptionPreviewResponse400 = {
2248
+ export type planFamilyGetPlanFamilyResponse400 = {
1001
2249
  data: void
1002
2250
  status: 400
1003
2251
  }
1004
2252
 
1005
- export type subscriptionChangeSubscriptionPreviewResponse401 = {
2253
+ export type planFamilyGetPlanFamilyResponse401 = {
1006
2254
  data: void
1007
2255
  status: 401
1008
2256
  }
1009
2257
 
1010
- export type subscriptionChangeSubscriptionPreviewResponse404 = {
2258
+ export type planFamilyGetPlanFamilyResponse404 = {
1011
2259
  data: void
1012
2260
  status: 404
1013
2261
  }
1014
2262
 
1015
- export type subscriptionChangeSubscriptionPreviewResponseSuccess = (subscriptionChangeSubscriptionPreviewResponse200) & {
2263
+ export type planFamilyGetPlanFamilyResponseSuccess = (planFamilyGetPlanFamilyResponse200) & {
1016
2264
  headers: Headers;
1017
2265
  };
1018
- export type subscriptionChangeSubscriptionPreviewResponseError = (subscriptionChangeSubscriptionPreviewResponse400 | subscriptionChangeSubscriptionPreviewResponse401 | subscriptionChangeSubscriptionPreviewResponse404) & {
2266
+ export type planFamilyGetPlanFamilyResponseError = (planFamilyGetPlanFamilyResponse400 | planFamilyGetPlanFamilyResponse401 | planFamilyGetPlanFamilyResponse404) & {
1019
2267
  headers: Headers;
1020
2268
  };
1021
2269
 
1022
- export type subscriptionChangeSubscriptionPreviewResponse = (subscriptionChangeSubscriptionPreviewResponseSuccess | subscriptionChangeSubscriptionPreviewResponseError)
2270
+ export type planFamilyGetPlanFamilyResponse = (planFamilyGetPlanFamilyResponseSuccess | planFamilyGetPlanFamilyResponseError)
1023
2271
 
1024
- export const getSubscriptionChangeSubscriptionPreviewUrl = (subscriptionUid: string | null,
1025
- params?: SubscriptionChangeSubscriptionPreviewParams,) => {
1026
- const normalizedParams = new URLSearchParams();
2272
+ export const getPlanFamilyGetPlanFamilyUrl = (planFamilyUid: string | null,) => {
1027
2273
 
1028
- Object.entries(params || {}).forEach(([key, value]) => {
1029
-
1030
- if (value !== undefined) {
1031
- normalizedParams.append(key, value === null ? 'null' : value.toString())
1032
- }
1033
- });
1034
2274
 
1035
- const stringifiedParams = normalizedParams.toString();
2275
+
1036
2276
 
1037
- return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscriptionpreview?${stringifiedParams}` : `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscriptionpreview`
2277
+ return `/api/v1/billing/planfamilies/${planFamilyUid}`
1038
2278
  }
1039
2279
 
1040
- export const subscriptionChangeSubscriptionPreview = async (subscriptionUid: string | null,
1041
- subscriptionChangeSubscriptionPreviewBody: NonReadonly<SubscriptionChangeSubscriptionPreviewBody>,
1042
- params?: SubscriptionChangeSubscriptionPreviewParams, options?: RequestInit): Promise<subscriptionChangeSubscriptionPreviewResponse> => {
2280
+ export const planFamilyGetPlanFamily = async (planFamilyUid: string | null, options?: RequestInit): Promise<planFamilyGetPlanFamilyResponse> => {
1043
2281
 
1044
- return customFetch<subscriptionChangeSubscriptionPreviewResponse>(getSubscriptionChangeSubscriptionPreviewUrl(subscriptionUid,params),
2282
+ return customFetch<planFamilyGetPlanFamilyResponse>(getPlanFamilyGetPlanFamilyUrl(planFamilyUid),
1045
2283
  {
1046
2284
  ...options,
1047
- method: 'PUT',
1048
- headers: { 'Content-Type': 'application/json', ...options?.headers },
1049
- body: JSON.stringify(
1050
- subscriptionChangeSubscriptionPreviewBody,)
2285
+ method: 'GET'
2286
+
2287
+
1051
2288
  }
1052
2289
  );}
1053
2290
 
1054
2291
 
1055
2292
  /**
1056
- * Returns an invoice object with information about the amount outstanding.
1057
- * @summary Change a subscription on an account.
2293
+ * @summary Update a plan family.
1058
2294
  */
1059
- export type subscriptionChangeSubscriptionResponse200 = {
1060
- data: Subscription
2295
+ export type planFamilyUpdatePlanFamilyResponse200 = {
2296
+ data: PlanFamily
1061
2297
  status: 200
1062
2298
  }
1063
2299
 
1064
- export type subscriptionChangeSubscriptionResponse400 = {
2300
+ export type planFamilyUpdatePlanFamilyResponse400 = {
1065
2301
  data: void
1066
2302
  status: 400
1067
2303
  }
1068
2304
 
1069
- export type subscriptionChangeSubscriptionResponse401 = {
2305
+ export type planFamilyUpdatePlanFamilyResponse401 = {
1070
2306
  data: void
1071
2307
  status: 401
1072
2308
  }
1073
2309
 
1074
- export type subscriptionChangeSubscriptionResponse404 = {
2310
+ export type planFamilyUpdatePlanFamilyResponse404 = {
1075
2311
  data: void
1076
2312
  status: 404
1077
2313
  }
1078
2314
 
1079
- export type subscriptionChangeSubscriptionResponseSuccess = (subscriptionChangeSubscriptionResponse200) & {
2315
+ export type planFamilyUpdatePlanFamilyResponseSuccess = (planFamilyUpdatePlanFamilyResponse200) & {
1080
2316
  headers: Headers;
1081
2317
  };
1082
- export type subscriptionChangeSubscriptionResponseError = (subscriptionChangeSubscriptionResponse400 | subscriptionChangeSubscriptionResponse401 | subscriptionChangeSubscriptionResponse404) & {
2318
+ export type planFamilyUpdatePlanFamilyResponseError = (planFamilyUpdatePlanFamilyResponse400 | planFamilyUpdatePlanFamilyResponse401 | planFamilyUpdatePlanFamilyResponse404) & {
1083
2319
  headers: Headers;
1084
2320
  };
1085
2321
 
1086
- export type subscriptionChangeSubscriptionResponse = (subscriptionChangeSubscriptionResponseSuccess | subscriptionChangeSubscriptionResponseError)
2322
+ export type planFamilyUpdatePlanFamilyResponse = (planFamilyUpdatePlanFamilyResponseSuccess | planFamilyUpdatePlanFamilyResponseError)
1087
2323
 
1088
- export const getSubscriptionChangeSubscriptionUrl = (subscriptionUid: string | null,
1089
- params?: SubscriptionChangeSubscriptionParams,) => {
1090
- const normalizedParams = new URLSearchParams();
2324
+ export const getPlanFamilyUpdatePlanFamilyUrl = (planFamilyUid: string | null,) => {
1091
2325
 
1092
- Object.entries(params || {}).forEach(([key, value]) => {
1093
-
1094
- if (value !== undefined) {
1095
- normalizedParams.append(key, value === null ? 'null' : value.toString())
1096
- }
1097
- });
1098
2326
 
1099
- const stringifiedParams = normalizedParams.toString();
2327
+
1100
2328
 
1101
- return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscription?${stringifiedParams}` : `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscription`
2329
+ return `/api/v1/billing/planfamilies/${planFamilyUid}`
1102
2330
  }
1103
2331
 
1104
- export const subscriptionChangeSubscription = async (subscriptionUid: string | null,
1105
- subscriptionChangeSubscriptionBody: NonReadonly<SubscriptionChangeSubscriptionBody>,
1106
- params?: SubscriptionChangeSubscriptionParams, options?: RequestInit): Promise<subscriptionChangeSubscriptionResponse> => {
2332
+ export const planFamilyUpdatePlanFamily = async (planFamilyUid: string | null,
2333
+ planFamilyUpdatePlanFamilyBody: NonReadonly<PlanFamilyUpdatePlanFamilyBody>, options?: RequestInit): Promise<planFamilyUpdatePlanFamilyResponse> => {
1107
2334
 
1108
- return customFetch<subscriptionChangeSubscriptionResponse>(getSubscriptionChangeSubscriptionUrl(subscriptionUid,params),
2335
+ return customFetch<planFamilyUpdatePlanFamilyResponse>(getPlanFamilyUpdatePlanFamilyUrl(planFamilyUid),
1109
2336
  {
1110
2337
  ...options,
1111
2338
  method: 'PUT',
1112
2339
  headers: { 'Content-Type': 'application/json', ...options?.headers },
1113
2340
  body: JSON.stringify(
1114
- subscriptionChangeSubscriptionBody,)
2341
+ planFamilyUpdatePlanFamilyBody,)
1115
2342
  }
1116
2343
  );}
1117
2344
 
1118
2345
 
1119
2346
  /**
1120
- * @summary Retrieves all plans.
2347
+ * @summary Delete a plan family.
1121
2348
  */
1122
- export type planGetAllPlansResponse200 = {
1123
- data: Plan[]
2349
+ export type planFamilyDeletePlanFamilyResponse200 = {
2350
+ data: Blob
1124
2351
  status: 200
1125
2352
  }
1126
-
1127
- export type planGetAllPlansResponseSuccess = (planGetAllPlansResponse200) & {
1128
- headers: Headers;
1129
- };
1130
- ;
1131
-
1132
- export type planGetAllPlansResponse = (planGetAllPlansResponseSuccess)
1133
2353
 
1134
- export const getPlanGetAllPlansUrl = () => {
1135
-
1136
-
1137
-
1138
-
1139
- return `/api/v1/billing/plans`
2354
+ export type planFamilyDeletePlanFamilyResponse400 = {
2355
+ data: void
2356
+ status: 400
1140
2357
  }
1141
2358
 
1142
- export const planGetAllPlans = async ( options?: RequestInit): Promise<planGetAllPlansResponse> => {
1143
-
1144
- return customFetch<planGetAllPlansResponse>(getPlanGetAllPlansUrl(),
1145
- {
1146
- ...options,
1147
- method: 'GET'
1148
-
1149
-
1150
- }
1151
- );}
1152
-
2359
+ export type planFamilyDeletePlanFamilyResponse401 = {
2360
+ data: void
2361
+ status: 401
2362
+ }
1153
2363
 
1154
- /**
1155
- * @summary Retrieves all plan families.
1156
- */
1157
- export type planFamilyGetAllPlanFamiliesResponse200 = {
1158
- data: PlanFamily[]
1159
- status: 200
2364
+ export type planFamilyDeletePlanFamilyResponse404 = {
2365
+ data: void
2366
+ status: 404
1160
2367
  }
1161
2368
 
1162
- export type planFamilyGetAllPlanFamiliesResponseSuccess = (planFamilyGetAllPlanFamiliesResponse200) & {
2369
+ export type planFamilyDeletePlanFamilyResponseSuccess = (planFamilyDeletePlanFamilyResponse200) & {
2370
+ headers: Headers;
2371
+ };
2372
+ export type planFamilyDeletePlanFamilyResponseError = (planFamilyDeletePlanFamilyResponse400 | planFamilyDeletePlanFamilyResponse401 | planFamilyDeletePlanFamilyResponse404) & {
1163
2373
  headers: Headers;
1164
2374
  };
1165
- ;
1166
2375
 
1167
- export type planFamilyGetAllPlanFamiliesResponse = (planFamilyGetAllPlanFamiliesResponseSuccess)
2376
+ export type planFamilyDeletePlanFamilyResponse = (planFamilyDeletePlanFamilyResponseSuccess | planFamilyDeletePlanFamilyResponseError)
1168
2377
 
1169
- export const getPlanFamilyGetAllPlanFamiliesUrl = () => {
2378
+ export const getPlanFamilyDeletePlanFamilyUrl = (planFamilyUid: string | null,) => {
1170
2379
 
1171
2380
 
1172
2381
 
1173
2382
 
1174
- return `/api/v1/billing/planfamilies`
2383
+ return `/api/v1/billing/planfamilies/${planFamilyUid}`
1175
2384
  }
1176
2385
 
1177
- export const planFamilyGetAllPlanFamilies = async ( options?: RequestInit): Promise<planFamilyGetAllPlanFamiliesResponse> => {
2386
+ export const planFamilyDeletePlanFamily = async (planFamilyUid: string | null, options?: RequestInit): Promise<planFamilyDeletePlanFamilyResponse> => {
1178
2387
 
1179
- return customFetch<planFamilyGetAllPlanFamiliesResponse>(getPlanFamilyGetAllPlanFamiliesUrl(),
2388
+ return customFetch<planFamilyDeletePlanFamilyResponse>(getPlanFamilyDeletePlanFamilyUrl(planFamilyUid),
1180
2389
  {
1181
2390
  ...options,
1182
- method: 'GET'
2391
+ method: 'DELETE'
1183
2392
 
1184
2393
 
1185
2394
  }