@outseta/api-client 0.3.53 → 0.4.1

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 (50) hide show
  1. package/dist/index.js +667 -1
  2. package/package.json +1 -1
  3. package/src/generated/{billing/billing.ts → billing-v2/billing-v2.ts} +80 -8
  4. package/src/generated/billing-v3/billing-v3.ts +2541 -0
  5. package/src/generated/crm/crm.ts +148 -0
  6. package/src/generated/models/accountExpireCurrentSubscriptionBody.ts +7 -0
  7. package/src/generated/models/accountExtendRenewalBody.ts +7 -0
  8. package/src/generated/models/accountWebhookEntityCurrentStripeProductInstancesItem.ts +0 -11
  9. package/src/generated/models/extendRenewalParams.ts +10 -2
  10. package/src/generated/models/importResult.ts +9 -0
  11. package/src/generated/models/index.ts +39 -0
  12. package/src/generated/models/stripeCouponsCreateBody.ts +7 -0
  13. package/src/generated/models/stripeCouponsGetAll200.ts +8 -0
  14. package/src/generated/models/stripeCouponsGetAllParams.ts +14 -0
  15. package/src/generated/models/stripeCouponsGetRedemptions200.ts +8 -0
  16. package/src/generated/models/stripeCouponsGetRedemptionsParams.ts +14 -0
  17. package/src/generated/models/stripeInvoiceLineItemsGetAll200.ts +8 -0
  18. package/src/generated/models/stripeInvoiceLineItemsGetAllParams.ts +14 -0
  19. package/src/generated/models/stripeInvoicesChangeInvoiceStatusBody.ts +7 -0
  20. package/src/generated/models/stripeInvoicesGetAll200.ts +8 -0
  21. package/src/generated/models/stripeInvoicesGetAllParams.ts +14 -0
  22. package/src/generated/models/stripeInvoicesIssueInvoiceCreditBody.ts +7 -0
  23. package/src/generated/models/stripeInvoicesPostBody.ts +7 -0
  24. package/src/generated/models/stripePaymentMethodsGetAll200.ts +8 -0
  25. package/src/generated/models/stripePaymentMethodsGetAllParams.ts +14 -0
  26. package/src/generated/models/stripePricesGetAll200.ts +8 -0
  27. package/src/generated/models/stripePricesGetAllParams.ts +14 -0
  28. package/src/generated/models/stripeProductAllOf.ts +0 -11
  29. package/src/generated/models/stripeProductFamiliesGetAll200.ts +8 -0
  30. package/src/generated/models/stripeProductFamiliesGetAllParams.ts +14 -0
  31. package/src/generated/models/stripeProductFamiliesPostBody.ts +7 -0
  32. package/src/generated/models/stripeProductFamiliesPutBody.ts +7 -0
  33. package/src/generated/models/stripeProductsGetAll200.ts +8 -0
  34. package/src/generated/models/stripeProductsGetAllParams.ts +14 -0
  35. package/src/generated/models/stripeProductsPostBody.ts +7 -0
  36. package/src/generated/models/stripeProductsPutBody.ts +7 -0
  37. package/src/generated/models/stripePromotionCodesCreateBody.ts +7 -0
  38. package/src/generated/models/stripePromotionCodesGetAll200.ts +8 -0
  39. package/src/generated/models/stripePromotionCodesGetAllParams.ts +14 -0
  40. package/src/generated/models/stripePromotionCodesUpdateBody.ts +7 -0
  41. package/src/generated/models/stripeSubscriptionsChangeBody.ts +7 -0
  42. package/src/generated/models/stripeSubscriptionsCreateBody.ts +7 -0
  43. package/src/generated/models/stripeSubscriptionsExtendTrialBody.ts +7 -0
  44. package/src/generated/models/stripeSubscriptionsGetAll200.ts +8 -0
  45. package/src/generated/models/stripeSubscriptionsGetAllParams.ts +14 -0
  46. package/src/generated/models/stripeSubscriptionsPauseCollectionBody.ts +7 -0
  47. package/src/generated/models/stripeSubscriptionsPreviewChangeBody.ts +7 -0
  48. package/src/generated/models/teamTwoFactorSettings.ts +6 -0
  49. package/src/generated/public/public.ts +26 -0
  50. package/src/index.ts +4 -1
@@ -0,0 +1,2541 @@
1
+ // @ts-nocheck
2
+ import type {
3
+ ImportResult,
4
+ StripeCoupon,
5
+ StripeCouponsCreateBody,
6
+ StripeCouponsGetAll200,
7
+ StripeCouponsGetAllParams,
8
+ StripeCouponsGetRedemptions200,
9
+ StripeCouponsGetRedemptionsParams,
10
+ StripeInvoice,
11
+ StripeInvoiceLineItem,
12
+ StripeInvoiceLineItemsGetAll200,
13
+ StripeInvoiceLineItemsGetAllParams,
14
+ StripeInvoicesChangeInvoiceStatusBody,
15
+ StripeInvoicesGetAll200,
16
+ StripeInvoicesGetAllParams,
17
+ StripeInvoicesIssueInvoiceCreditBody,
18
+ StripeInvoicesPostBody,
19
+ StripePaymentMethod,
20
+ StripePaymentMethodsGetAll200,
21
+ StripePaymentMethodsGetAllParams,
22
+ StripePrice,
23
+ StripePricesGetAll200,
24
+ StripePricesGetAllParams,
25
+ StripeProduct,
26
+ StripeProductFamiliesGetAll200,
27
+ StripeProductFamiliesGetAllParams,
28
+ StripeProductFamiliesPostBody,
29
+ StripeProductFamiliesPutBody,
30
+ StripeProductFamily,
31
+ StripeProductsGetAll200,
32
+ StripeProductsGetAllParams,
33
+ StripeProductsPostBody,
34
+ StripeProductsPutBody,
35
+ StripePromotionCode,
36
+ StripePromotionCodesCreateBody,
37
+ StripePromotionCodesGetAll200,
38
+ StripePromotionCodesGetAllParams,
39
+ StripePromotionCodesUpdateBody,
40
+ StripeSubscription,
41
+ StripeSubscriptionsChangeBody,
42
+ StripeSubscriptionsCreateBody,
43
+ StripeSubscriptionsExtendTrialBody,
44
+ StripeSubscriptionsGetAll200,
45
+ StripeSubscriptionsGetAllParams,
46
+ StripeSubscriptionsPauseCollectionBody,
47
+ StripeSubscriptionsPreviewChangeBody
48
+ } from '.././models';
49
+
50
+ import { customFetch } from '../../client';
51
+
52
+ // https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
53
+ type IfEquals<X, Y, A = X, B = never> = (<T>() => T extends X ? 1 : 2) extends <
54
+ T,
55
+ >() => T extends Y ? 1 : 2
56
+ ? A
57
+ : B;
58
+
59
+ type WritableKeys<T> = {
60
+ [P in keyof T]-?: IfEquals<
61
+ { [Q in P]: T[P] },
62
+ { -readonly [Q in P]: T[P] },
63
+ P
64
+ >;
65
+ }[keyof T];
66
+
67
+ type UnionToIntersection<U> =
68
+ (U extends any ? (k: U)=>void : never) extends ((k: infer I)=>void) ? I : never;
69
+ type DistributeReadOnlyOverUnions<T> = T extends any ? NonReadonly<T> : never;
70
+
71
+ type Writable<T> = Pick<T, WritableKeys<T>>;
72
+ type NonReadonly<T> = [T] extends [UnionToIntersection<T>] ? {
73
+ [P in keyof Writable<T>]: T[P] extends object
74
+ ? NonReadonly<NonNullable<T[P]>>
75
+ : T[P];
76
+ } : DistributeReadOnlyOverUnions<T>;
77
+
78
+
79
+ /**
80
+ * Pass accountUid in the query string to return only the line items on that account's
81
+ invoices.
82
+ * @summary Retrieve all invoice line items.
83
+ */
84
+ export type stripeInvoiceLineItemsGetAllResponse200 = {
85
+ data: StripeInvoiceLineItemsGetAll200
86
+ status: 200
87
+ }
88
+
89
+ export type stripeInvoiceLineItemsGetAllResponse401 = {
90
+ data: void
91
+ status: 401
92
+ }
93
+
94
+ export type stripeInvoiceLineItemsGetAllResponseSuccess = (stripeInvoiceLineItemsGetAllResponse200) & {
95
+ headers: Headers;
96
+ };
97
+ export type stripeInvoiceLineItemsGetAllResponseError = (stripeInvoiceLineItemsGetAllResponse401) & {
98
+ headers: Headers;
99
+ };
100
+
101
+ export type stripeInvoiceLineItemsGetAllResponse = (stripeInvoiceLineItemsGetAllResponseSuccess | stripeInvoiceLineItemsGetAllResponseError)
102
+
103
+ export const getStripeInvoiceLineItemsGetAllUrl = (params?: StripeInvoiceLineItemsGetAllParams,) => {
104
+ const normalizedParams = new URLSearchParams();
105
+
106
+ Object.entries(params || {}).forEach(([key, value]) => {
107
+
108
+ if (value !== undefined) {
109
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
110
+ }
111
+ });
112
+
113
+ const stringifiedParams = normalizedParams.toString();
114
+
115
+ return stringifiedParams.length > 0 ? `/api/v1/billing/stripe/invoice-line-items?${stringifiedParams}` : `/api/v1/billing/stripe/invoice-line-items`
116
+ }
117
+
118
+ export const stripeInvoiceLineItemsGetAll = async (params?: StripeInvoiceLineItemsGetAllParams, options?: RequestInit): Promise<stripeInvoiceLineItemsGetAllResponse> => {
119
+
120
+ return customFetch<stripeInvoiceLineItemsGetAllResponse>(getStripeInvoiceLineItemsGetAllUrl(params),
121
+ {
122
+ ...options,
123
+ method: 'GET'
124
+
125
+
126
+ }
127
+ );}
128
+
129
+
130
+ /**
131
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
132
+
133
+ Access ends now. This sets the line item's EndDate and updates the account's products
134
+ and stage. The invoice is not changed.
135
+ * @summary End the product access that a line item gives.
136
+ */
137
+ export type stripeInvoiceLineItemsCancelAccessResponse200 = {
138
+ data: StripeInvoiceLineItem
139
+ status: 200
140
+ }
141
+
142
+ export type stripeInvoiceLineItemsCancelAccessResponse400 = {
143
+ data: void
144
+ status: 400
145
+ }
146
+
147
+ export type stripeInvoiceLineItemsCancelAccessResponse401 = {
148
+ data: void
149
+ status: 401
150
+ }
151
+
152
+ export type stripeInvoiceLineItemsCancelAccessResponse404 = {
153
+ data: void
154
+ status: 404
155
+ }
156
+
157
+ export type stripeInvoiceLineItemsCancelAccessResponseSuccess = (stripeInvoiceLineItemsCancelAccessResponse200) & {
158
+ headers: Headers;
159
+ };
160
+ export type stripeInvoiceLineItemsCancelAccessResponseError = (stripeInvoiceLineItemsCancelAccessResponse400 | stripeInvoiceLineItemsCancelAccessResponse401 | stripeInvoiceLineItemsCancelAccessResponse404) & {
161
+ headers: Headers;
162
+ };
163
+
164
+ export type stripeInvoiceLineItemsCancelAccessResponse = (stripeInvoiceLineItemsCancelAccessResponseSuccess | stripeInvoiceLineItemsCancelAccessResponseError)
165
+
166
+ export const getStripeInvoiceLineItemsCancelAccessUrl = (lineItemUid: string | null,) => {
167
+
168
+
169
+
170
+
171
+ return `/api/v1/billing/stripe/invoice-line-items/${lineItemUid}/cancel`
172
+ }
173
+
174
+ export const stripeInvoiceLineItemsCancelAccess = async (lineItemUid: string | null, options?: RequestInit): Promise<stripeInvoiceLineItemsCancelAccessResponse> => {
175
+
176
+ return customFetch<stripeInvoiceLineItemsCancelAccessResponse>(getStripeInvoiceLineItemsCancelAccessUrl(lineItemUid),
177
+ {
178
+ ...options,
179
+ method: 'PUT'
180
+
181
+
182
+ }
183
+ );}
184
+
185
+
186
+ /**
187
+ * These are the payment methods saved in the connected Stripe account for each account.
188
+ Only display details are stored, such as the type, card brand, last 4 digits and
189
+ expiry. Full card and bank numbers are never stored.
190
+ * @summary Retrieve all payment methods.
191
+ */
192
+ export type stripePaymentMethodsGetAllResponse200 = {
193
+ data: StripePaymentMethodsGetAll200
194
+ status: 200
195
+ }
196
+
197
+ export type stripePaymentMethodsGetAllResponse401 = {
198
+ data: void
199
+ status: 401
200
+ }
201
+
202
+ export type stripePaymentMethodsGetAllResponseSuccess = (stripePaymentMethodsGetAllResponse200) & {
203
+ headers: Headers;
204
+ };
205
+ export type stripePaymentMethodsGetAllResponseError = (stripePaymentMethodsGetAllResponse401) & {
206
+ headers: Headers;
207
+ };
208
+
209
+ export type stripePaymentMethodsGetAllResponse = (stripePaymentMethodsGetAllResponseSuccess | stripePaymentMethodsGetAllResponseError)
210
+
211
+ export const getStripePaymentMethodsGetAllUrl = (params?: StripePaymentMethodsGetAllParams,) => {
212
+ const normalizedParams = new URLSearchParams();
213
+
214
+ Object.entries(params || {}).forEach(([key, value]) => {
215
+
216
+ if (value !== undefined) {
217
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
218
+ }
219
+ });
220
+
221
+ const stringifiedParams = normalizedParams.toString();
222
+
223
+ return stringifiedParams.length > 0 ? `/api/v1/billing/stripe/payment-methods?${stringifiedParams}` : `/api/v1/billing/stripe/payment-methods`
224
+ }
225
+
226
+ export const stripePaymentMethodsGetAll = async (params?: StripePaymentMethodsGetAllParams, options?: RequestInit): Promise<stripePaymentMethodsGetAllResponse> => {
227
+
228
+ return customFetch<stripePaymentMethodsGetAllResponse>(getStripePaymentMethodsGetAllUrl(params),
229
+ {
230
+ ...options,
231
+ method: 'GET'
232
+
233
+
234
+ }
235
+ );}
236
+
237
+
238
+ /**
239
+ * @summary Retrieve a payment method.
240
+ */
241
+ export type stripePaymentMethodsGetResponse200 = {
242
+ data: StripePaymentMethod
243
+ status: 200
244
+ }
245
+
246
+ export type stripePaymentMethodsGetResponse401 = {
247
+ data: void
248
+ status: 401
249
+ }
250
+
251
+ export type stripePaymentMethodsGetResponseSuccess = (stripePaymentMethodsGetResponse200) & {
252
+ headers: Headers;
253
+ };
254
+ export type stripePaymentMethodsGetResponseError = (stripePaymentMethodsGetResponse401) & {
255
+ headers: Headers;
256
+ };
257
+
258
+ export type stripePaymentMethodsGetResponse = (stripePaymentMethodsGetResponseSuccess | stripePaymentMethodsGetResponseError)
259
+
260
+ export const getStripePaymentMethodsGetUrl = (uid: string | null,) => {
261
+
262
+
263
+
264
+
265
+ return `/api/v1/billing/stripe/payment-methods/${uid}`
266
+ }
267
+
268
+ export const stripePaymentMethodsGet = async (uid: string | null, options?: RequestInit): Promise<stripePaymentMethodsGetResponse> => {
269
+
270
+ return customFetch<stripePaymentMethodsGetResponse>(getStripePaymentMethodsGetUrl(uid),
271
+ {
272
+ ...options,
273
+ method: 'GET'
274
+
275
+
276
+ }
277
+ );}
278
+
279
+
280
+ /**
281
+ * Prices are created and updated through their product.
282
+ * @summary Retrieve all prices.
283
+ */
284
+ export type stripePricesGetAllResponse200 = {
285
+ data: StripePricesGetAll200
286
+ status: 200
287
+ }
288
+
289
+ export type stripePricesGetAllResponse401 = {
290
+ data: void
291
+ status: 401
292
+ }
293
+
294
+ export type stripePricesGetAllResponseSuccess = (stripePricesGetAllResponse200) & {
295
+ headers: Headers;
296
+ };
297
+ export type stripePricesGetAllResponseError = (stripePricesGetAllResponse401) & {
298
+ headers: Headers;
299
+ };
300
+
301
+ export type stripePricesGetAllResponse = (stripePricesGetAllResponseSuccess | stripePricesGetAllResponseError)
302
+
303
+ export const getStripePricesGetAllUrl = (params?: StripePricesGetAllParams,) => {
304
+ const normalizedParams = new URLSearchParams();
305
+
306
+ Object.entries(params || {}).forEach(([key, value]) => {
307
+
308
+ if (value !== undefined) {
309
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
310
+ }
311
+ });
312
+
313
+ const stringifiedParams = normalizedParams.toString();
314
+
315
+ return stringifiedParams.length > 0 ? `/api/v1/billing/stripe/prices?${stringifiedParams}` : `/api/v1/billing/stripe/prices`
316
+ }
317
+
318
+ export const stripePricesGetAll = async (params?: StripePricesGetAllParams, options?: RequestInit): Promise<stripePricesGetAllResponse> => {
319
+
320
+ return customFetch<stripePricesGetAllResponse>(getStripePricesGetAllUrl(params),
321
+ {
322
+ ...options,
323
+ method: 'GET'
324
+
325
+
326
+ }
327
+ );}
328
+
329
+
330
+ /**
331
+ * @summary Retrieve a price.
332
+ */
333
+ export type stripePricesGetResponse200 = {
334
+ data: StripePrice
335
+ status: 200
336
+ }
337
+
338
+ export type stripePricesGetResponse401 = {
339
+ data: void
340
+ status: 401
341
+ }
342
+
343
+ export type stripePricesGetResponseSuccess = (stripePricesGetResponse200) & {
344
+ headers: Headers;
345
+ };
346
+ export type stripePricesGetResponseError = (stripePricesGetResponse401) & {
347
+ headers: Headers;
348
+ };
349
+
350
+ export type stripePricesGetResponse = (stripePricesGetResponseSuccess | stripePricesGetResponseError)
351
+
352
+ export const getStripePricesGetUrl = (uid: string | null,) => {
353
+
354
+
355
+
356
+
357
+ return `/api/v1/billing/stripe/prices/${uid}`
358
+ }
359
+
360
+ export const stripePricesGet = async (uid: string | null, options?: RequestInit): Promise<stripePricesGetResponse> => {
361
+
362
+ return customFetch<stripePricesGetResponse>(getStripePricesGetUrl(uid),
363
+ {
364
+ ...options,
365
+ method: 'GET'
366
+
367
+
368
+ }
369
+ );}
370
+
371
+
372
+ /**
373
+ * @summary Retrieve all promotion codes.
374
+ */
375
+ export type stripePromotionCodesGetAllResponse200 = {
376
+ data: StripePromotionCodesGetAll200
377
+ status: 200
378
+ }
379
+
380
+ export type stripePromotionCodesGetAllResponse401 = {
381
+ data: void
382
+ status: 401
383
+ }
384
+
385
+ export type stripePromotionCodesGetAllResponseSuccess = (stripePromotionCodesGetAllResponse200) & {
386
+ headers: Headers;
387
+ };
388
+ export type stripePromotionCodesGetAllResponseError = (stripePromotionCodesGetAllResponse401) & {
389
+ headers: Headers;
390
+ };
391
+
392
+ export type stripePromotionCodesGetAllResponse = (stripePromotionCodesGetAllResponseSuccess | stripePromotionCodesGetAllResponseError)
393
+
394
+ export const getStripePromotionCodesGetAllUrl = (params?: StripePromotionCodesGetAllParams,) => {
395
+ const normalizedParams = new URLSearchParams();
396
+
397
+ Object.entries(params || {}).forEach(([key, value]) => {
398
+
399
+ if (value !== undefined) {
400
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
401
+ }
402
+ });
403
+
404
+ const stringifiedParams = normalizedParams.toString();
405
+
406
+ return stringifiedParams.length > 0 ? `/api/v1/billing/stripe/promotion-codes?${stringifiedParams}` : `/api/v1/billing/stripe/promotion-codes`
407
+ }
408
+
409
+ export const stripePromotionCodesGetAll = async (params?: StripePromotionCodesGetAllParams, options?: RequestInit): Promise<stripePromotionCodesGetAllResponse> => {
410
+
411
+ return customFetch<stripePromotionCodesGetAllResponse>(getStripePromotionCodesGetAllUrl(params),
412
+ {
413
+ ...options,
414
+ method: 'GET'
415
+
416
+
417
+ }
418
+ );}
419
+
420
+
421
+ /**
422
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected;
423
+ use POST /billing/discountcoupons instead.
424
+
425
+ A promotion code belongs to a coupon. The code is also created in the connected Stripe
426
+ account.
427
+ * @summary Add a new promotion code.
428
+ */
429
+ export type stripePromotionCodesCreateResponse200 = {
430
+ data: StripePromotionCode
431
+ status: 200
432
+ }
433
+
434
+ export type stripePromotionCodesCreateResponse401 = {
435
+ data: void
436
+ status: 401
437
+ }
438
+
439
+ export type stripePromotionCodesCreateResponseSuccess = (stripePromotionCodesCreateResponse200) & {
440
+ headers: Headers;
441
+ };
442
+ export type stripePromotionCodesCreateResponseError = (stripePromotionCodesCreateResponse401) & {
443
+ headers: Headers;
444
+ };
445
+
446
+ export type stripePromotionCodesCreateResponse = (stripePromotionCodesCreateResponseSuccess | stripePromotionCodesCreateResponseError)
447
+
448
+ export const getStripePromotionCodesCreateUrl = () => {
449
+
450
+
451
+
452
+
453
+ return `/api/v1/billing/stripe/promotion-codes`
454
+ }
455
+
456
+ export const stripePromotionCodesCreate = async (stripePromotionCodesCreateBody: NonReadonly<StripePromotionCodesCreateBody>, options?: RequestInit): Promise<stripePromotionCodesCreateResponse> => {
457
+
458
+ return customFetch<stripePromotionCodesCreateResponse>(getStripePromotionCodesCreateUrl(),
459
+ {
460
+ ...options,
461
+ method: 'POST',
462
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
463
+ body: JSON.stringify(
464
+ stripePromotionCodesCreateBody,)
465
+ }
466
+ );}
467
+
468
+
469
+ /**
470
+ * @summary Retrieve a promotion code.
471
+ */
472
+ export type stripePromotionCodesGetResponse200 = {
473
+ data: StripePromotionCode
474
+ status: 200
475
+ }
476
+
477
+ export type stripePromotionCodesGetResponse400 = {
478
+ data: void
479
+ status: 400
480
+ }
481
+
482
+ export type stripePromotionCodesGetResponse401 = {
483
+ data: void
484
+ status: 401
485
+ }
486
+
487
+ export type stripePromotionCodesGetResponse404 = {
488
+ data: void
489
+ status: 404
490
+ }
491
+
492
+ export type stripePromotionCodesGetResponseSuccess = (stripePromotionCodesGetResponse200) & {
493
+ headers: Headers;
494
+ };
495
+ export type stripePromotionCodesGetResponseError = (stripePromotionCodesGetResponse400 | stripePromotionCodesGetResponse401 | stripePromotionCodesGetResponse404) & {
496
+ headers: Headers;
497
+ };
498
+
499
+ export type stripePromotionCodesGetResponse = (stripePromotionCodesGetResponseSuccess | stripePromotionCodesGetResponseError)
500
+
501
+ export const getStripePromotionCodesGetUrl = (promotionCodeUid: string | null,) => {
502
+
503
+
504
+
505
+
506
+ return `/api/v1/billing/stripe/promotion-codes/${promotionCodeUid}`
507
+ }
508
+
509
+ export const stripePromotionCodesGet = async (promotionCodeUid: string | null, options?: RequestInit): Promise<stripePromotionCodesGetResponse> => {
510
+
511
+ return customFetch<stripePromotionCodesGetResponse>(getStripePromotionCodesGetUrl(promotionCodeUid),
512
+ {
513
+ ...options,
514
+ method: 'GET'
515
+
516
+
517
+ }
518
+ );}
519
+
520
+
521
+ /**
522
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
523
+
524
+ The code can no longer be redeemed. It is also ended in the connected Stripe account.
525
+ No other change is made. The promotion code to end is identified by the Uid in the
526
+ request body.
527
+ * @summary End a promotion code.
528
+ */
529
+ export type stripePromotionCodesUpdateResponse200 = {
530
+ data: StripePromotionCode
531
+ status: 200
532
+ }
533
+
534
+ export type stripePromotionCodesUpdateResponse400 = {
535
+ data: void
536
+ status: 400
537
+ }
538
+
539
+ export type stripePromotionCodesUpdateResponse401 = {
540
+ data: void
541
+ status: 401
542
+ }
543
+
544
+ export type stripePromotionCodesUpdateResponse404 = {
545
+ data: void
546
+ status: 404
547
+ }
548
+
549
+ export type stripePromotionCodesUpdateResponseSuccess = (stripePromotionCodesUpdateResponse200) & {
550
+ headers: Headers;
551
+ };
552
+ export type stripePromotionCodesUpdateResponseError = (stripePromotionCodesUpdateResponse400 | stripePromotionCodesUpdateResponse401 | stripePromotionCodesUpdateResponse404) & {
553
+ headers: Headers;
554
+ };
555
+
556
+ export type stripePromotionCodesUpdateResponse = (stripePromotionCodesUpdateResponseSuccess | stripePromotionCodesUpdateResponseError)
557
+
558
+ export const getStripePromotionCodesUpdateUrl = (promotionCodeUid: string | null,) => {
559
+
560
+
561
+
562
+
563
+ return `/api/v1/billing/stripe/promotion-codes/${promotionCodeUid}`
564
+ }
565
+
566
+ export const stripePromotionCodesUpdate = async (promotionCodeUid: string | null,
567
+ stripePromotionCodesUpdateBody: NonReadonly<StripePromotionCodesUpdateBody>, options?: RequestInit): Promise<stripePromotionCodesUpdateResponse> => {
568
+
569
+ return customFetch<stripePromotionCodesUpdateResponse>(getStripePromotionCodesUpdateUrl(promotionCodeUid),
570
+ {
571
+ ...options,
572
+ method: 'PUT',
573
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
574
+ body: JSON.stringify(
575
+ stripePromotionCodesUpdateBody,)
576
+ }
577
+ );}
578
+
579
+
580
+ /**
581
+ * Only an active promotion code that can still be redeemed is found. The match is
582
+ case-sensitive. Returns only the Code and StripeCoupon.Uid, and 404 if no code matches.
583
+ No authentication is required.
584
+ * @summary Find a promotion code by its code.
585
+ */
586
+ export type stripePromotionCodesSearchByCodeResponse200 = {
587
+ data: Blob
588
+ status: 200
589
+ }
590
+
591
+ export type stripePromotionCodesSearchByCodeResponseSuccess = (stripePromotionCodesSearchByCodeResponse200) & {
592
+ headers: Headers;
593
+ };
594
+ ;
595
+
596
+ export type stripePromotionCodesSearchByCodeResponse = (stripePromotionCodesSearchByCodeResponseSuccess)
597
+
598
+ export const getStripePromotionCodesSearchByCodeUrl = (promotionCode: string | null,) => {
599
+
600
+
601
+
602
+
603
+ return `/api/v1/billing/stripe/promotion-codes/search/${promotionCode}`
604
+ }
605
+
606
+ export const stripePromotionCodesSearchByCode = async (promotionCode: string | null, options?: RequestInit): Promise<stripePromotionCodesSearchByCodeResponse> => {
607
+
608
+ return customFetch<stripePromotionCodesSearchByCodeResponse>(getStripePromotionCodesSearchByCodeUrl(promotionCode),
609
+ {
610
+ ...options,
611
+ method: 'GET'
612
+
613
+
614
+ }
615
+ );}
616
+
617
+
618
+ /**
619
+ * @summary Retrieve all product families.
620
+ */
621
+ export type stripeProductFamiliesGetAllResponse200 = {
622
+ data: StripeProductFamiliesGetAll200
623
+ status: 200
624
+ }
625
+
626
+ export type stripeProductFamiliesGetAllResponseSuccess = (stripeProductFamiliesGetAllResponse200) & {
627
+ headers: Headers;
628
+ };
629
+ ;
630
+
631
+ export type stripeProductFamiliesGetAllResponse = (stripeProductFamiliesGetAllResponseSuccess)
632
+
633
+ export const getStripeProductFamiliesGetAllUrl = (params?: StripeProductFamiliesGetAllParams,) => {
634
+ const normalizedParams = new URLSearchParams();
635
+
636
+ Object.entries(params || {}).forEach(([key, value]) => {
637
+
638
+ if (value !== undefined) {
639
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
640
+ }
641
+ });
642
+
643
+ const stringifiedParams = normalizedParams.toString();
644
+
645
+ return stringifiedParams.length > 0 ? `/api/v1/billing/stripe/product-families?${stringifiedParams}` : `/api/v1/billing/stripe/product-families`
646
+ }
647
+
648
+ export const stripeProductFamiliesGetAll = async (params?: StripeProductFamiliesGetAllParams, options?: RequestInit): Promise<stripeProductFamiliesGetAllResponse> => {
649
+
650
+ return customFetch<stripeProductFamiliesGetAllResponse>(getStripeProductFamiliesGetAllUrl(params),
651
+ {
652
+ ...options,
653
+ method: 'GET'
654
+
655
+
656
+ }
657
+ );}
658
+
659
+
660
+ /**
661
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected;
662
+ use POST /billing/planfamilies instead.
663
+
664
+ A product added to this family is removed from any other family.
665
+ * @summary Add a new product family.
666
+ */
667
+ export type stripeProductFamiliesPostResponse200 = {
668
+ data: StripeProductFamily
669
+ status: 200
670
+ }
671
+
672
+ export type stripeProductFamiliesPostResponse401 = {
673
+ data: void
674
+ status: 401
675
+ }
676
+
677
+ export type stripeProductFamiliesPostResponseSuccess = (stripeProductFamiliesPostResponse200) & {
678
+ headers: Headers;
679
+ };
680
+ export type stripeProductFamiliesPostResponseError = (stripeProductFamiliesPostResponse401) & {
681
+ headers: Headers;
682
+ };
683
+
684
+ export type stripeProductFamiliesPostResponse = (stripeProductFamiliesPostResponseSuccess | stripeProductFamiliesPostResponseError)
685
+
686
+ export const getStripeProductFamiliesPostUrl = () => {
687
+
688
+
689
+
690
+
691
+ return `/api/v1/billing/stripe/product-families`
692
+ }
693
+
694
+ export const stripeProductFamiliesPost = async (stripeProductFamiliesPostBody: NonReadonly<StripeProductFamiliesPostBody>, options?: RequestInit): Promise<stripeProductFamiliesPostResponse> => {
695
+
696
+ return customFetch<stripeProductFamiliesPostResponse>(getStripeProductFamiliesPostUrl(),
697
+ {
698
+ ...options,
699
+ method: 'POST',
700
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
701
+ body: JSON.stringify(
702
+ stripeProductFamiliesPostBody,)
703
+ }
704
+ );}
705
+
706
+
707
+ /**
708
+ * @summary Retrieve a product family.
709
+ */
710
+ export type stripeProductFamiliesGetResponse200 = {
711
+ data: StripeProductFamily
712
+ status: 200
713
+ }
714
+
715
+ export type stripeProductFamiliesGetResponseSuccess = (stripeProductFamiliesGetResponse200) & {
716
+ headers: Headers;
717
+ };
718
+ ;
719
+
720
+ export type stripeProductFamiliesGetResponse = (stripeProductFamiliesGetResponseSuccess)
721
+
722
+ export const getStripeProductFamiliesGetUrl = (uid: string | null,) => {
723
+
724
+
725
+
726
+
727
+ return `/api/v1/billing/stripe/product-families/${uid}`
728
+ }
729
+
730
+ export const stripeProductFamiliesGet = async (uid: string | null, options?: RequestInit): Promise<stripeProductFamiliesGetResponse> => {
731
+
732
+ return customFetch<stripeProductFamiliesGetResponse>(getStripeProductFamiliesGetUrl(uid),
733
+ {
734
+ ...options,
735
+ method: 'GET'
736
+
737
+
738
+ }
739
+ );}
740
+
741
+
742
+ /**
743
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected;
744
+ use PUT /billing/planfamilies/{planFamilyUid} instead.
745
+
746
+ A product added to this family is removed from any other family.
747
+ * @summary Update a product family.
748
+ */
749
+ export type stripeProductFamiliesPutResponse200 = {
750
+ data: StripeProductFamily
751
+ status: 200
752
+ }
753
+
754
+ export type stripeProductFamiliesPutResponse400 = {
755
+ data: void
756
+ status: 400
757
+ }
758
+
759
+ export type stripeProductFamiliesPutResponse401 = {
760
+ data: void
761
+ status: 401
762
+ }
763
+
764
+ export type stripeProductFamiliesPutResponse404 = {
765
+ data: void
766
+ status: 404
767
+ }
768
+
769
+ export type stripeProductFamiliesPutResponseSuccess = (stripeProductFamiliesPutResponse200) & {
770
+ headers: Headers;
771
+ };
772
+ export type stripeProductFamiliesPutResponseError = (stripeProductFamiliesPutResponse400 | stripeProductFamiliesPutResponse401 | stripeProductFamiliesPutResponse404) & {
773
+ headers: Headers;
774
+ };
775
+
776
+ export type stripeProductFamiliesPutResponse = (stripeProductFamiliesPutResponseSuccess | stripeProductFamiliesPutResponseError)
777
+
778
+ export const getStripeProductFamiliesPutUrl = (productFamilyUid: string | null,) => {
779
+
780
+
781
+
782
+
783
+ return `/api/v1/billing/stripe/product-families/${productFamilyUid}`
784
+ }
785
+
786
+ export const stripeProductFamiliesPut = async (productFamilyUid: string | null,
787
+ stripeProductFamiliesPutBody: NonReadonly<StripeProductFamiliesPutBody>, options?: RequestInit): Promise<stripeProductFamiliesPutResponse> => {
788
+
789
+ return customFetch<stripeProductFamiliesPutResponse>(getStripeProductFamiliesPutUrl(productFamilyUid),
790
+ {
791
+ ...options,
792
+ method: 'PUT',
793
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
794
+ body: JSON.stringify(
795
+ stripeProductFamiliesPutBody,)
796
+ }
797
+ );}
798
+
799
+
800
+ /**
801
+ * @summary Delete a product family.
802
+ */
803
+ export type stripeProductFamiliesDeleteResponse200 = {
804
+ data: Blob
805
+ status: 200
806
+ }
807
+
808
+ export type stripeProductFamiliesDeleteResponse400 = {
809
+ data: void
810
+ status: 400
811
+ }
812
+
813
+ export type stripeProductFamiliesDeleteResponse401 = {
814
+ data: void
815
+ status: 401
816
+ }
817
+
818
+ export type stripeProductFamiliesDeleteResponse404 = {
819
+ data: void
820
+ status: 404
821
+ }
822
+
823
+ export type stripeProductFamiliesDeleteResponseSuccess = (stripeProductFamiliesDeleteResponse200) & {
824
+ headers: Headers;
825
+ };
826
+ export type stripeProductFamiliesDeleteResponseError = (stripeProductFamiliesDeleteResponse400 | stripeProductFamiliesDeleteResponse401 | stripeProductFamiliesDeleteResponse404) & {
827
+ headers: Headers;
828
+ };
829
+
830
+ export type stripeProductFamiliesDeleteResponse = (stripeProductFamiliesDeleteResponseSuccess | stripeProductFamiliesDeleteResponseError)
831
+
832
+ export const getStripeProductFamiliesDeleteUrl = (productFamilyUid: string | null,) => {
833
+
834
+
835
+
836
+
837
+ return `/api/v1/billing/stripe/product-families/${productFamilyUid}`
838
+ }
839
+
840
+ export const stripeProductFamiliesDelete = async (productFamilyUid: string | null, options?: RequestInit): Promise<stripeProductFamiliesDeleteResponse> => {
841
+
842
+ return customFetch<stripeProductFamiliesDeleteResponse>(getStripeProductFamiliesDeleteUrl(productFamilyUid),
843
+ {
844
+ ...options,
845
+ method: 'DELETE'
846
+
847
+
848
+ }
849
+ );}
850
+
851
+
852
+ /**
853
+ * @summary Retrieve all coupons.
854
+ */
855
+ export type stripeCouponsGetAllResponse200 = {
856
+ data: StripeCouponsGetAll200
857
+ status: 200
858
+ }
859
+
860
+ export type stripeCouponsGetAllResponse401 = {
861
+ data: void
862
+ status: 401
863
+ }
864
+
865
+ export type stripeCouponsGetAllResponseSuccess = (stripeCouponsGetAllResponse200) & {
866
+ headers: Headers;
867
+ };
868
+ export type stripeCouponsGetAllResponseError = (stripeCouponsGetAllResponse401) & {
869
+ headers: Headers;
870
+ };
871
+
872
+ export type stripeCouponsGetAllResponse = (stripeCouponsGetAllResponseSuccess | stripeCouponsGetAllResponseError)
873
+
874
+ export const getStripeCouponsGetAllUrl = (params?: StripeCouponsGetAllParams,) => {
875
+ const normalizedParams = new URLSearchParams();
876
+
877
+ Object.entries(params || {}).forEach(([key, value]) => {
878
+
879
+ if (value !== undefined) {
880
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
881
+ }
882
+ });
883
+
884
+ const stringifiedParams = normalizedParams.toString();
885
+
886
+ return stringifiedParams.length > 0 ? `/api/v1/billing/stripe/coupons?${stringifiedParams}` : `/api/v1/billing/stripe/coupons`
887
+ }
888
+
889
+ export const stripeCouponsGetAll = async (params?: StripeCouponsGetAllParams, options?: RequestInit): Promise<stripeCouponsGetAllResponse> => {
890
+
891
+ return customFetch<stripeCouponsGetAllResponse>(getStripeCouponsGetAllUrl(params),
892
+ {
893
+ ...options,
894
+ method: 'GET'
895
+
896
+
897
+ }
898
+ );}
899
+
900
+
901
+ /**
902
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected;
903
+ use POST /billing/discountcoupons instead.
904
+
905
+ Set exactly one of PercentOff or CurrencyAmountOff. The coupon is also created in the
906
+ connected Stripe account.
907
+ * @summary Add a new coupon.
908
+ */
909
+ export type stripeCouponsCreateResponse200 = {
910
+ data: StripeCoupon
911
+ status: 200
912
+ }
913
+
914
+ export type stripeCouponsCreateResponse401 = {
915
+ data: void
916
+ status: 401
917
+ }
918
+
919
+ export type stripeCouponsCreateResponseSuccess = (stripeCouponsCreateResponse200) & {
920
+ headers: Headers;
921
+ };
922
+ export type stripeCouponsCreateResponseError = (stripeCouponsCreateResponse401) & {
923
+ headers: Headers;
924
+ };
925
+
926
+ export type stripeCouponsCreateResponse = (stripeCouponsCreateResponseSuccess | stripeCouponsCreateResponseError)
927
+
928
+ export const getStripeCouponsCreateUrl = () => {
929
+
930
+
931
+
932
+
933
+ return `/api/v1/billing/stripe/coupons`
934
+ }
935
+
936
+ export const stripeCouponsCreate = async (stripeCouponsCreateBody: NonReadonly<StripeCouponsCreateBody>, options?: RequestInit): Promise<stripeCouponsCreateResponse> => {
937
+
938
+ return customFetch<stripeCouponsCreateResponse>(getStripeCouponsCreateUrl(),
939
+ {
940
+ ...options,
941
+ method: 'POST',
942
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
943
+ body: JSON.stringify(
944
+ stripeCouponsCreateBody,)
945
+ }
946
+ );}
947
+
948
+
949
+ /**
950
+ * @summary Retrieve a coupon.
951
+ */
952
+ export type stripeCouponsGetResponse200 = {
953
+ data: StripeCoupon
954
+ status: 200
955
+ }
956
+
957
+ export type stripeCouponsGetResponse400 = {
958
+ data: void
959
+ status: 400
960
+ }
961
+
962
+ export type stripeCouponsGetResponse401 = {
963
+ data: void
964
+ status: 401
965
+ }
966
+
967
+ export type stripeCouponsGetResponse404 = {
968
+ data: void
969
+ status: 404
970
+ }
971
+
972
+ export type stripeCouponsGetResponseSuccess = (stripeCouponsGetResponse200) & {
973
+ headers: Headers;
974
+ };
975
+ export type stripeCouponsGetResponseError = (stripeCouponsGetResponse400 | stripeCouponsGetResponse401 | stripeCouponsGetResponse404) & {
976
+ headers: Headers;
977
+ };
978
+
979
+ export type stripeCouponsGetResponse = (stripeCouponsGetResponseSuccess | stripeCouponsGetResponseError)
980
+
981
+ export const getStripeCouponsGetUrl = (couponUid: string | null,) => {
982
+
983
+
984
+
985
+
986
+ return `/api/v1/billing/stripe/coupons/${couponUid}`
987
+ }
988
+
989
+ export const stripeCouponsGet = async (couponUid: string | null, options?: RequestInit): Promise<stripeCouponsGetResponse> => {
990
+
991
+ return customFetch<stripeCouponsGetResponse>(getStripeCouponsGetUrl(couponUid),
992
+ {
993
+ ...options,
994
+ method: 'GET'
995
+
996
+
997
+ }
998
+ );}
999
+
1000
+
1001
+ /**
1002
+ * The coupon is also deleted in the connected Stripe account. A coupon that was ever
1003
+ applied to a subscription or invoice cannot be deleted.
1004
+ * @summary Delete a coupon.
1005
+ */
1006
+ export type stripeCouponsDeleteResponse200 = {
1007
+ data: Blob
1008
+ status: 200
1009
+ }
1010
+
1011
+ export type stripeCouponsDeleteResponse400 = {
1012
+ data: void
1013
+ status: 400
1014
+ }
1015
+
1016
+ export type stripeCouponsDeleteResponse401 = {
1017
+ data: void
1018
+ status: 401
1019
+ }
1020
+
1021
+ export type stripeCouponsDeleteResponse404 = {
1022
+ data: void
1023
+ status: 404
1024
+ }
1025
+
1026
+ export type stripeCouponsDeleteResponseSuccess = (stripeCouponsDeleteResponse200) & {
1027
+ headers: Headers;
1028
+ };
1029
+ export type stripeCouponsDeleteResponseError = (stripeCouponsDeleteResponse400 | stripeCouponsDeleteResponse401 | stripeCouponsDeleteResponse404) & {
1030
+ headers: Headers;
1031
+ };
1032
+
1033
+ export type stripeCouponsDeleteResponse = (stripeCouponsDeleteResponseSuccess | stripeCouponsDeleteResponseError)
1034
+
1035
+ export const getStripeCouponsDeleteUrl = (couponUid: string | null,) => {
1036
+
1037
+
1038
+
1039
+
1040
+ return `/api/v1/billing/stripe/coupons/${couponUid}`
1041
+ }
1042
+
1043
+ export const stripeCouponsDelete = async (couponUid: string | null, options?: RequestInit): Promise<stripeCouponsDeleteResponse> => {
1044
+
1045
+ return customFetch<stripeCouponsDeleteResponse>(getStripeCouponsDeleteUrl(couponUid),
1046
+ {
1047
+ ...options,
1048
+ method: 'DELETE'
1049
+
1050
+
1051
+ }
1052
+ );}
1053
+
1054
+
1055
+ /**
1056
+ * A redemption is the discount created when one of the coupon's promotion codes was
1057
+ applied.
1058
+ * @summary Retrieve the redemptions of a coupon.
1059
+ */
1060
+ export type stripeCouponsGetRedemptionsResponse200 = {
1061
+ data: StripeCouponsGetRedemptions200
1062
+ status: 200
1063
+ }
1064
+
1065
+ export type stripeCouponsGetRedemptionsResponse400 = {
1066
+ data: void
1067
+ status: 400
1068
+ }
1069
+
1070
+ export type stripeCouponsGetRedemptionsResponse401 = {
1071
+ data: void
1072
+ status: 401
1073
+ }
1074
+
1075
+ export type stripeCouponsGetRedemptionsResponseSuccess = (stripeCouponsGetRedemptionsResponse200) & {
1076
+ headers: Headers;
1077
+ };
1078
+ export type stripeCouponsGetRedemptionsResponseError = (stripeCouponsGetRedemptionsResponse400 | stripeCouponsGetRedemptionsResponse401) & {
1079
+ headers: Headers;
1080
+ };
1081
+
1082
+ export type stripeCouponsGetRedemptionsResponse = (stripeCouponsGetRedemptionsResponseSuccess | stripeCouponsGetRedemptionsResponseError)
1083
+
1084
+ export const getStripeCouponsGetRedemptionsUrl = (couponUid: string | null,
1085
+ params?: StripeCouponsGetRedemptionsParams,) => {
1086
+ const normalizedParams = new URLSearchParams();
1087
+
1088
+ Object.entries(params || {}).forEach(([key, value]) => {
1089
+
1090
+ if (value !== undefined) {
1091
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1092
+ }
1093
+ });
1094
+
1095
+ const stringifiedParams = normalizedParams.toString();
1096
+
1097
+ return stringifiedParams.length > 0 ? `/api/v1/billing/stripe/coupons/${couponUid}/redemptions?${stringifiedParams}` : `/api/v1/billing/stripe/coupons/${couponUid}/redemptions`
1098
+ }
1099
+
1100
+ export const stripeCouponsGetRedemptions = async (couponUid: string | null,
1101
+ params?: StripeCouponsGetRedemptionsParams, options?: RequestInit): Promise<stripeCouponsGetRedemptionsResponse> => {
1102
+
1103
+ return customFetch<stripeCouponsGetRedemptionsResponse>(getStripeCouponsGetRedemptionsUrl(couponUid,params),
1104
+ {
1105
+ ...options,
1106
+ method: 'GET'
1107
+
1108
+
1109
+ }
1110
+ );}
1111
+
1112
+
1113
+ /**
1114
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
1115
+ * @summary Import all coupons and promotion codes from the connected Stripe account.
1116
+ */
1117
+ export type stripeCouponsSyncCouponsFromStripeResponse200 = {
1118
+ data: ImportResult
1119
+ status: 200
1120
+ }
1121
+
1122
+ export type stripeCouponsSyncCouponsFromStripeResponse401 = {
1123
+ data: void
1124
+ status: 401
1125
+ }
1126
+
1127
+ export type stripeCouponsSyncCouponsFromStripeResponseSuccess = (stripeCouponsSyncCouponsFromStripeResponse200) & {
1128
+ headers: Headers;
1129
+ };
1130
+ export type stripeCouponsSyncCouponsFromStripeResponseError = (stripeCouponsSyncCouponsFromStripeResponse401) & {
1131
+ headers: Headers;
1132
+ };
1133
+
1134
+ export type stripeCouponsSyncCouponsFromStripeResponse = (stripeCouponsSyncCouponsFromStripeResponseSuccess | stripeCouponsSyncCouponsFromStripeResponseError)
1135
+
1136
+ export const getStripeCouponsSyncCouponsFromStripeUrl = () => {
1137
+
1138
+
1139
+
1140
+
1141
+ return `/api/v1/billing/stripe/coupons/sync`
1142
+ }
1143
+
1144
+ export const stripeCouponsSyncCouponsFromStripe = async ( options?: RequestInit): Promise<stripeCouponsSyncCouponsFromStripeResponse> => {
1145
+
1146
+ return customFetch<stripeCouponsSyncCouponsFromStripeResponse>(getStripeCouponsSyncCouponsFromStripeUrl(),
1147
+ {
1148
+ ...options,
1149
+ method: 'POST'
1150
+
1151
+
1152
+ }
1153
+ );}
1154
+
1155
+
1156
+ /**
1157
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
1158
+ * @summary Import a coupon from the connected Stripe account.
1159
+ */
1160
+ export type stripeCouponsSyncCouponFromStripeResponse200 = {
1161
+ data: Blob
1162
+ status: 200
1163
+ }
1164
+
1165
+ export type stripeCouponsSyncCouponFromStripeResponse401 = {
1166
+ data: void
1167
+ status: 401
1168
+ }
1169
+
1170
+ export type stripeCouponsSyncCouponFromStripeResponseSuccess = (stripeCouponsSyncCouponFromStripeResponse200) & {
1171
+ headers: Headers;
1172
+ };
1173
+ export type stripeCouponsSyncCouponFromStripeResponseError = (stripeCouponsSyncCouponFromStripeResponse401) & {
1174
+ headers: Headers;
1175
+ };
1176
+
1177
+ export type stripeCouponsSyncCouponFromStripeResponse = (stripeCouponsSyncCouponFromStripeResponseSuccess | stripeCouponsSyncCouponFromStripeResponseError)
1178
+
1179
+ export const getStripeCouponsSyncCouponFromStripeUrl = (uid: string | null,) => {
1180
+
1181
+
1182
+
1183
+
1184
+ return `/api/v1/billing/stripe/coupons/${uid}/sync`
1185
+ }
1186
+
1187
+ export const stripeCouponsSyncCouponFromStripe = async (uid: string | null, options?: RequestInit): Promise<stripeCouponsSyncCouponFromStripeResponse> => {
1188
+
1189
+ return customFetch<stripeCouponsSyncCouponFromStripeResponse>(getStripeCouponsSyncCouponFromStripeUrl(uid),
1190
+ {
1191
+ ...options,
1192
+ method: 'POST'
1193
+
1194
+
1195
+ }
1196
+ );}
1197
+
1198
+
1199
+ /**
1200
+ * Invoices imported from another billing system are left out, unless IsImported=true is
1201
+ passed in the query string, which returns only imported invoices. Pass
1202
+ excludeInvoiceUid in the query string to leave out one invoice.
1203
+ * @summary Retrieve all invoices.
1204
+ */
1205
+ export type stripeInvoicesGetAllResponse200 = {
1206
+ data: StripeInvoicesGetAll200
1207
+ status: 200
1208
+ }
1209
+
1210
+ export type stripeInvoicesGetAllResponse401 = {
1211
+ data: void
1212
+ status: 401
1213
+ }
1214
+
1215
+ export type stripeInvoicesGetAllResponseSuccess = (stripeInvoicesGetAllResponse200) & {
1216
+ headers: Headers;
1217
+ };
1218
+ export type stripeInvoicesGetAllResponseError = (stripeInvoicesGetAllResponse401) & {
1219
+ headers: Headers;
1220
+ };
1221
+
1222
+ export type stripeInvoicesGetAllResponse = (stripeInvoicesGetAllResponseSuccess | stripeInvoicesGetAllResponseError)
1223
+
1224
+ export const getStripeInvoicesGetAllUrl = (params?: StripeInvoicesGetAllParams,) => {
1225
+ const normalizedParams = new URLSearchParams();
1226
+
1227
+ Object.entries(params || {}).forEach(([key, value]) => {
1228
+
1229
+ if (value !== undefined) {
1230
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1231
+ }
1232
+ });
1233
+
1234
+ const stringifiedParams = normalizedParams.toString();
1235
+
1236
+ return stringifiedParams.length > 0 ? `/api/v1/billing/stripe/invoices?${stringifiedParams}` : `/api/v1/billing/stripe/invoices`
1237
+ }
1238
+
1239
+ export const stripeInvoicesGetAll = async (params?: StripeInvoicesGetAllParams, options?: RequestInit): Promise<stripeInvoicesGetAllResponse> => {
1240
+
1241
+ return customFetch<stripeInvoicesGetAllResponse>(getStripeInvoicesGetAllUrl(params),
1242
+ {
1243
+ ...options,
1244
+ method: 'GET'
1245
+
1246
+
1247
+ }
1248
+ );}
1249
+
1250
+
1251
+ /**
1252
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected;
1253
+ use POST /billing/invoices instead.
1254
+
1255
+ The invoice is created for an account, and also in the connected Stripe account.
1256
+ * @summary Add a new invoice.
1257
+ */
1258
+ export type stripeInvoicesPostResponse200 = {
1259
+ data: StripeInvoice
1260
+ status: 200
1261
+ }
1262
+
1263
+ export type stripeInvoicesPostResponse401 = {
1264
+ data: void
1265
+ status: 401
1266
+ }
1267
+
1268
+ export type stripeInvoicesPostResponseSuccess = (stripeInvoicesPostResponse200) & {
1269
+ headers: Headers;
1270
+ };
1271
+ export type stripeInvoicesPostResponseError = (stripeInvoicesPostResponse401) & {
1272
+ headers: Headers;
1273
+ };
1274
+
1275
+ export type stripeInvoicesPostResponse = (stripeInvoicesPostResponseSuccess | stripeInvoicesPostResponseError)
1276
+
1277
+ export const getStripeInvoicesPostUrl = () => {
1278
+
1279
+
1280
+
1281
+
1282
+ return `/api/v1/billing/stripe/invoices`
1283
+ }
1284
+
1285
+ export const stripeInvoicesPost = async (stripeInvoicesPostBody: NonReadonly<StripeInvoicesPostBody>, options?: RequestInit): Promise<stripeInvoicesPostResponse> => {
1286
+
1287
+ return customFetch<stripeInvoicesPostResponse>(getStripeInvoicesPostUrl(),
1288
+ {
1289
+ ...options,
1290
+ method: 'POST',
1291
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1292
+ body: JSON.stringify(
1293
+ stripeInvoicesPostBody,)
1294
+ }
1295
+ );}
1296
+
1297
+
1298
+ /**
1299
+ * @summary Retrieve an invoice.
1300
+ */
1301
+ export type stripeInvoicesGetResponse200 = {
1302
+ data: StripeInvoice
1303
+ status: 200
1304
+ }
1305
+
1306
+ export type stripeInvoicesGetResponse400 = {
1307
+ data: void
1308
+ status: 400
1309
+ }
1310
+
1311
+ export type stripeInvoicesGetResponse401 = {
1312
+ data: void
1313
+ status: 401
1314
+ }
1315
+
1316
+ export type stripeInvoicesGetResponse404 = {
1317
+ data: void
1318
+ status: 404
1319
+ }
1320
+
1321
+ export type stripeInvoicesGetResponseSuccess = (stripeInvoicesGetResponse200) & {
1322
+ headers: Headers;
1323
+ };
1324
+ export type stripeInvoicesGetResponseError = (stripeInvoicesGetResponse400 | stripeInvoicesGetResponse401 | stripeInvoicesGetResponse404) & {
1325
+ headers: Headers;
1326
+ };
1327
+
1328
+ export type stripeInvoicesGetResponse = (stripeInvoicesGetResponseSuccess | stripeInvoicesGetResponseError)
1329
+
1330
+ export const getStripeInvoicesGetUrl = (invoiceUid: string | null,) => {
1331
+
1332
+
1333
+
1334
+
1335
+ return `/api/v1/billing/stripe/invoices/${invoiceUid}`
1336
+ }
1337
+
1338
+ export const stripeInvoicesGet = async (invoiceUid: string | null, options?: RequestInit): Promise<stripeInvoicesGetResponse> => {
1339
+
1340
+ return customFetch<stripeInvoicesGetResponse>(getStripeInvoicesGetUrl(invoiceUid),
1341
+ {
1342
+ ...options,
1343
+ method: 'GET'
1344
+
1345
+
1346
+ }
1347
+ );}
1348
+
1349
+
1350
+ /**
1351
+ * The response is a 302 redirect to the PDF. A user token can only download invoices on
1352
+ its own account, and only as the account's primary contact.
1353
+ * @summary Download an invoice as a PDF.
1354
+ */
1355
+ export type stripeInvoicesGetInvoiceAsPdfResponse200 = {
1356
+ data: Blob
1357
+ status: 200
1358
+ }
1359
+
1360
+ export type stripeInvoicesGetInvoiceAsPdfResponse400 = {
1361
+ data: void
1362
+ status: 400
1363
+ }
1364
+
1365
+ export type stripeInvoicesGetInvoiceAsPdfResponse401 = {
1366
+ data: void
1367
+ status: 401
1368
+ }
1369
+
1370
+ export type stripeInvoicesGetInvoiceAsPdfResponse404 = {
1371
+ data: void
1372
+ status: 404
1373
+ }
1374
+
1375
+ export type stripeInvoicesGetInvoiceAsPdfResponseSuccess = (stripeInvoicesGetInvoiceAsPdfResponse200) & {
1376
+ headers: Headers;
1377
+ };
1378
+ export type stripeInvoicesGetInvoiceAsPdfResponseError = (stripeInvoicesGetInvoiceAsPdfResponse400 | stripeInvoicesGetInvoiceAsPdfResponse401 | stripeInvoicesGetInvoiceAsPdfResponse404) & {
1379
+ headers: Headers;
1380
+ };
1381
+
1382
+ export type stripeInvoicesGetInvoiceAsPdfResponse = (stripeInvoicesGetInvoiceAsPdfResponseSuccess | stripeInvoicesGetInvoiceAsPdfResponseError)
1383
+
1384
+ export const getStripeInvoicesGetInvoiceAsPdfUrl = (invoiceUid: string | null,) => {
1385
+
1386
+
1387
+
1388
+
1389
+ return `/api/v1/billing/stripe/invoices/${invoiceUid}/pdf`
1390
+ }
1391
+
1392
+ export const stripeInvoicesGetInvoiceAsPdf = async (invoiceUid: string | null, options?: RequestInit): Promise<stripeInvoicesGetInvoiceAsPdfResponse> => {
1393
+
1394
+ return customFetch<stripeInvoicesGetInvoiceAsPdfResponse>(getStripeInvoicesGetInvoiceAsPdfUrl(invoiceUid),
1395
+ {
1396
+ ...options,
1397
+ method: 'GET'
1398
+
1399
+
1400
+ }
1401
+ );}
1402
+
1403
+
1404
+ /**
1405
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
1406
+
1407
+ NewStatus is one of paid (paid outside Stripe), uncollectible or void. The change is
1408
+ also made in the connected Stripe account.
1409
+ * @summary Change the status of an invoice.
1410
+ */
1411
+ export type stripeInvoicesChangeInvoiceStatusResponse200 = {
1412
+ data: Blob
1413
+ status: 200
1414
+ }
1415
+
1416
+ export type stripeInvoicesChangeInvoiceStatusResponse400 = {
1417
+ data: void
1418
+ status: 400
1419
+ }
1420
+
1421
+ export type stripeInvoicesChangeInvoiceStatusResponse401 = {
1422
+ data: void
1423
+ status: 401
1424
+ }
1425
+
1426
+ export type stripeInvoicesChangeInvoiceStatusResponse404 = {
1427
+ data: void
1428
+ status: 404
1429
+ }
1430
+
1431
+ export type stripeInvoicesChangeInvoiceStatusResponseSuccess = (stripeInvoicesChangeInvoiceStatusResponse200) & {
1432
+ headers: Headers;
1433
+ };
1434
+ export type stripeInvoicesChangeInvoiceStatusResponseError = (stripeInvoicesChangeInvoiceStatusResponse400 | stripeInvoicesChangeInvoiceStatusResponse401 | stripeInvoicesChangeInvoiceStatusResponse404) & {
1435
+ headers: Headers;
1436
+ };
1437
+
1438
+ export type stripeInvoicesChangeInvoiceStatusResponse = (stripeInvoicesChangeInvoiceStatusResponseSuccess | stripeInvoicesChangeInvoiceStatusResponseError)
1439
+
1440
+ export const getStripeInvoicesChangeInvoiceStatusUrl = (invoiceUid: string | null,) => {
1441
+
1442
+
1443
+
1444
+
1445
+ return `/api/v1/billing/stripe/invoices/${invoiceUid}/change-status`
1446
+ }
1447
+
1448
+ export const stripeInvoicesChangeInvoiceStatus = async (invoiceUid: string | null,
1449
+ stripeInvoicesChangeInvoiceStatusBody: StripeInvoicesChangeInvoiceStatusBody, options?: RequestInit): Promise<stripeInvoicesChangeInvoiceStatusResponse> => {
1450
+
1451
+ return customFetch<stripeInvoicesChangeInvoiceStatusResponse>(getStripeInvoicesChangeInvoiceStatusUrl(invoiceUid),
1452
+ {
1453
+ ...options,
1454
+ method: 'POST',
1455
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1456
+ body: JSON.stringify(
1457
+ stripeInvoicesChangeInvoiceStatusBody,)
1458
+ }
1459
+ );}
1460
+
1461
+
1462
+ /**
1463
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
1464
+
1465
+ CreditType is one of account_balance, payment_method (refund to the payment method) or
1466
+ out_of_band. The credit note is created in the connected Stripe account.
1467
+ * @summary Issue a credit note against an invoice.
1468
+ */
1469
+ export type stripeInvoicesIssueInvoiceCreditResponse200 = {
1470
+ data: Blob
1471
+ status: 200
1472
+ }
1473
+
1474
+ export type stripeInvoicesIssueInvoiceCreditResponse400 = {
1475
+ data: void
1476
+ status: 400
1477
+ }
1478
+
1479
+ export type stripeInvoicesIssueInvoiceCreditResponse401 = {
1480
+ data: void
1481
+ status: 401
1482
+ }
1483
+
1484
+ export type stripeInvoicesIssueInvoiceCreditResponse404 = {
1485
+ data: void
1486
+ status: 404
1487
+ }
1488
+
1489
+ export type stripeInvoicesIssueInvoiceCreditResponseSuccess = (stripeInvoicesIssueInvoiceCreditResponse200) & {
1490
+ headers: Headers;
1491
+ };
1492
+ export type stripeInvoicesIssueInvoiceCreditResponseError = (stripeInvoicesIssueInvoiceCreditResponse400 | stripeInvoicesIssueInvoiceCreditResponse401 | stripeInvoicesIssueInvoiceCreditResponse404) & {
1493
+ headers: Headers;
1494
+ };
1495
+
1496
+ export type stripeInvoicesIssueInvoiceCreditResponse = (stripeInvoicesIssueInvoiceCreditResponseSuccess | stripeInvoicesIssueInvoiceCreditResponseError)
1497
+
1498
+ export const getStripeInvoicesIssueInvoiceCreditUrl = (invoiceUid: string | null,) => {
1499
+
1500
+
1501
+
1502
+
1503
+ return `/api/v1/billing/stripe/invoices/${invoiceUid}/issue-credit`
1504
+ }
1505
+
1506
+ export const stripeInvoicesIssueInvoiceCredit = async (invoiceUid: string | null,
1507
+ stripeInvoicesIssueInvoiceCreditBody: StripeInvoicesIssueInvoiceCreditBody, options?: RequestInit): Promise<stripeInvoicesIssueInvoiceCreditResponse> => {
1508
+
1509
+ return customFetch<stripeInvoicesIssueInvoiceCreditResponse>(getStripeInvoicesIssueInvoiceCreditUrl(invoiceUid),
1510
+ {
1511
+ ...options,
1512
+ method: 'POST',
1513
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1514
+ body: JSON.stringify(
1515
+ stripeInvoicesIssueInvoiceCreditBody,)
1516
+ }
1517
+ );}
1518
+
1519
+
1520
+ /**
1521
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
1522
+ * @summary Email an invoice to the account.
1523
+ */
1524
+ export type stripeInvoicesSendInvoiceEmailResponse200 = {
1525
+ data: Blob
1526
+ status: 200
1527
+ }
1528
+
1529
+ export type stripeInvoicesSendInvoiceEmailResponse400 = {
1530
+ data: void
1531
+ status: 400
1532
+ }
1533
+
1534
+ export type stripeInvoicesSendInvoiceEmailResponse401 = {
1535
+ data: void
1536
+ status: 401
1537
+ }
1538
+
1539
+ export type stripeInvoicesSendInvoiceEmailResponse404 = {
1540
+ data: void
1541
+ status: 404
1542
+ }
1543
+
1544
+ export type stripeInvoicesSendInvoiceEmailResponseSuccess = (stripeInvoicesSendInvoiceEmailResponse200) & {
1545
+ headers: Headers;
1546
+ };
1547
+ export type stripeInvoicesSendInvoiceEmailResponseError = (stripeInvoicesSendInvoiceEmailResponse400 | stripeInvoicesSendInvoiceEmailResponse401 | stripeInvoicesSendInvoiceEmailResponse404) & {
1548
+ headers: Headers;
1549
+ };
1550
+
1551
+ export type stripeInvoicesSendInvoiceEmailResponse = (stripeInvoicesSendInvoiceEmailResponseSuccess | stripeInvoicesSendInvoiceEmailResponseError)
1552
+
1553
+ export const getStripeInvoicesSendInvoiceEmailUrl = (invoiceUid: string | null,) => {
1554
+
1555
+
1556
+
1557
+
1558
+ return `/api/v1/billing/stripe/invoices/${invoiceUid}/send`
1559
+ }
1560
+
1561
+ export const stripeInvoicesSendInvoiceEmail = async (invoiceUid: string | null, options?: RequestInit): Promise<stripeInvoicesSendInvoiceEmailResponse> => {
1562
+
1563
+ return customFetch<stripeInvoicesSendInvoiceEmailResponse>(getStripeInvoicesSendInvoiceEmailUrl(invoiceUid),
1564
+ {
1565
+ ...options,
1566
+ method: 'POST'
1567
+
1568
+
1569
+ }
1570
+ );}
1571
+
1572
+
1573
+ /**
1574
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
1575
+ * @summary Import all invoices from the connected Stripe account.
1576
+ */
1577
+ export type stripeInvoicesSyncInvoicesFromStripeResponse200 = {
1578
+ data: ImportResult
1579
+ status: 200
1580
+ }
1581
+
1582
+ export type stripeInvoicesSyncInvoicesFromStripeResponse401 = {
1583
+ data: void
1584
+ status: 401
1585
+ }
1586
+
1587
+ export type stripeInvoicesSyncInvoicesFromStripeResponseSuccess = (stripeInvoicesSyncInvoicesFromStripeResponse200) & {
1588
+ headers: Headers;
1589
+ };
1590
+ export type stripeInvoicesSyncInvoicesFromStripeResponseError = (stripeInvoicesSyncInvoicesFromStripeResponse401) & {
1591
+ headers: Headers;
1592
+ };
1593
+
1594
+ export type stripeInvoicesSyncInvoicesFromStripeResponse = (stripeInvoicesSyncInvoicesFromStripeResponseSuccess | stripeInvoicesSyncInvoicesFromStripeResponseError)
1595
+
1596
+ export const getStripeInvoicesSyncInvoicesFromStripeUrl = () => {
1597
+
1598
+
1599
+
1600
+
1601
+ return `/api/v1/billing/stripe/invoices/sync`
1602
+ }
1603
+
1604
+ export const stripeInvoicesSyncInvoicesFromStripe = async ( options?: RequestInit): Promise<stripeInvoicesSyncInvoicesFromStripeResponse> => {
1605
+
1606
+ return customFetch<stripeInvoicesSyncInvoicesFromStripeResponse>(getStripeInvoicesSyncInvoicesFromStripeUrl(),
1607
+ {
1608
+ ...options,
1609
+ method: 'POST'
1610
+
1611
+
1612
+ }
1613
+ );}
1614
+
1615
+
1616
+ /**
1617
+ * @summary Retrieve all subscriptions.
1618
+ */
1619
+ export type stripeSubscriptionsGetAllResponse200 = {
1620
+ data: StripeSubscriptionsGetAll200
1621
+ status: 200
1622
+ }
1623
+
1624
+ export type stripeSubscriptionsGetAllResponse401 = {
1625
+ data: void
1626
+ status: 401
1627
+ }
1628
+
1629
+ export type stripeSubscriptionsGetAllResponseSuccess = (stripeSubscriptionsGetAllResponse200) & {
1630
+ headers: Headers;
1631
+ };
1632
+ export type stripeSubscriptionsGetAllResponseError = (stripeSubscriptionsGetAllResponse401) & {
1633
+ headers: Headers;
1634
+ };
1635
+
1636
+ export type stripeSubscriptionsGetAllResponse = (stripeSubscriptionsGetAllResponseSuccess | stripeSubscriptionsGetAllResponseError)
1637
+
1638
+ export const getStripeSubscriptionsGetAllUrl = (params?: StripeSubscriptionsGetAllParams,) => {
1639
+ const normalizedParams = new URLSearchParams();
1640
+
1641
+ Object.entries(params || {}).forEach(([key, value]) => {
1642
+
1643
+ if (value !== undefined) {
1644
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1645
+ }
1646
+ });
1647
+
1648
+ const stringifiedParams = normalizedParams.toString();
1649
+
1650
+ return stringifiedParams.length > 0 ? `/api/v1/billing/stripe/subscriptions?${stringifiedParams}` : `/api/v1/billing/stripe/subscriptions`
1651
+ }
1652
+
1653
+ export const stripeSubscriptionsGetAll = async (params?: StripeSubscriptionsGetAllParams, options?: RequestInit): Promise<stripeSubscriptionsGetAllResponse> => {
1654
+
1655
+ return customFetch<stripeSubscriptionsGetAllResponse>(getStripeSubscriptionsGetAllUrl(params),
1656
+ {
1657
+ ...options,
1658
+ method: 'GET'
1659
+
1660
+
1661
+ }
1662
+ );}
1663
+
1664
+
1665
+ /**
1666
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected;
1667
+ use PUT /billing/subscriptions/firsttimesubscription instead.
1668
+
1669
+ The subscription is created for an account, and also in the connected Stripe account.
1670
+ Identify each item's StripePrice by Uid or StripeId. A discount can name a
1671
+ StripePromotionCode, or a StripeCoupon, in which case the first promotion code of
1672
+ that coupon that the account can redeem is used.
1673
+ * @summary Add a new subscription.
1674
+ */
1675
+ export type stripeSubscriptionsCreateResponse200 = {
1676
+ data: StripeSubscription
1677
+ status: 200
1678
+ }
1679
+
1680
+ export type stripeSubscriptionsCreateResponse401 = {
1681
+ data: void
1682
+ status: 401
1683
+ }
1684
+
1685
+ export type stripeSubscriptionsCreateResponseSuccess = (stripeSubscriptionsCreateResponse200) & {
1686
+ headers: Headers;
1687
+ };
1688
+ export type stripeSubscriptionsCreateResponseError = (stripeSubscriptionsCreateResponse401) & {
1689
+ headers: Headers;
1690
+ };
1691
+
1692
+ export type stripeSubscriptionsCreateResponse = (stripeSubscriptionsCreateResponseSuccess | stripeSubscriptionsCreateResponseError)
1693
+
1694
+ export const getStripeSubscriptionsCreateUrl = () => {
1695
+
1696
+
1697
+
1698
+
1699
+ return `/api/v1/billing/stripe/subscriptions`
1700
+ }
1701
+
1702
+ export const stripeSubscriptionsCreate = async (stripeSubscriptionsCreateBody: NonReadonly<StripeSubscriptionsCreateBody>, options?: RequestInit): Promise<stripeSubscriptionsCreateResponse> => {
1703
+
1704
+ return customFetch<stripeSubscriptionsCreateResponse>(getStripeSubscriptionsCreateUrl(),
1705
+ {
1706
+ ...options,
1707
+ method: 'POST',
1708
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1709
+ body: JSON.stringify(
1710
+ stripeSubscriptionsCreateBody,)
1711
+ }
1712
+ );}
1713
+
1714
+
1715
+ /**
1716
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
1717
+
1718
+ By default the subscription ends at the end of the current billing period. Pass
1719
+ cancelImmediately=true in the query string to end it now.
1720
+ * @summary Cancel a subscription.
1721
+ */
1722
+ export type stripeSubscriptionsCancelResponse200 = {
1723
+ data: StripeSubscription
1724
+ status: 200
1725
+ }
1726
+
1727
+ export type stripeSubscriptionsCancelResponse400 = {
1728
+ data: void
1729
+ status: 400
1730
+ }
1731
+
1732
+ export type stripeSubscriptionsCancelResponse401 = {
1733
+ data: void
1734
+ status: 401
1735
+ }
1736
+
1737
+ export type stripeSubscriptionsCancelResponse404 = {
1738
+ data: void
1739
+ status: 404
1740
+ }
1741
+
1742
+ export type stripeSubscriptionsCancelResponseSuccess = (stripeSubscriptionsCancelResponse200) & {
1743
+ headers: Headers;
1744
+ };
1745
+ export type stripeSubscriptionsCancelResponseError = (stripeSubscriptionsCancelResponse400 | stripeSubscriptionsCancelResponse401 | stripeSubscriptionsCancelResponse404) & {
1746
+ headers: Headers;
1747
+ };
1748
+
1749
+ export type stripeSubscriptionsCancelResponse = (stripeSubscriptionsCancelResponseSuccess | stripeSubscriptionsCancelResponseError)
1750
+
1751
+ export const getStripeSubscriptionsCancelUrl = (subscriptionUid: string | null,) => {
1752
+
1753
+
1754
+
1755
+
1756
+ return `/api/v1/billing/stripe/subscriptions/${subscriptionUid}/cancel`
1757
+ }
1758
+
1759
+ export const stripeSubscriptionsCancel = async (subscriptionUid: string | null, options?: RequestInit): Promise<stripeSubscriptionsCancelResponse> => {
1760
+
1761
+ return customFetch<stripeSubscriptionsCancelResponse>(getStripeSubscriptionsCancelUrl(subscriptionUid),
1762
+ {
1763
+ ...options,
1764
+ method: 'POST'
1765
+
1766
+
1767
+ }
1768
+ );}
1769
+
1770
+
1771
+ /**
1772
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
1773
+
1774
+ Behavior is one of Stripe's pause_collection behaviors: keep_as_draft,
1775
+ mark_uncollectible or void. ResumesAt is optional; without it, collection stays paused
1776
+ until resumed.
1777
+ * @summary Pause payment collection on a subscription.
1778
+ */
1779
+ export type stripeSubscriptionsPauseCollectionResponse200 = {
1780
+ data: StripeSubscription
1781
+ status: 200
1782
+ }
1783
+
1784
+ export type stripeSubscriptionsPauseCollectionResponse400 = {
1785
+ data: void
1786
+ status: 400
1787
+ }
1788
+
1789
+ export type stripeSubscriptionsPauseCollectionResponse401 = {
1790
+ data: void
1791
+ status: 401
1792
+ }
1793
+
1794
+ export type stripeSubscriptionsPauseCollectionResponse404 = {
1795
+ data: void
1796
+ status: 404
1797
+ }
1798
+
1799
+ export type stripeSubscriptionsPauseCollectionResponseSuccess = (stripeSubscriptionsPauseCollectionResponse200) & {
1800
+ headers: Headers;
1801
+ };
1802
+ export type stripeSubscriptionsPauseCollectionResponseError = (stripeSubscriptionsPauseCollectionResponse400 | stripeSubscriptionsPauseCollectionResponse401 | stripeSubscriptionsPauseCollectionResponse404) & {
1803
+ headers: Headers;
1804
+ };
1805
+
1806
+ export type stripeSubscriptionsPauseCollectionResponse = (stripeSubscriptionsPauseCollectionResponseSuccess | stripeSubscriptionsPauseCollectionResponseError)
1807
+
1808
+ export const getStripeSubscriptionsPauseCollectionUrl = (subscriptionUid: string | null,) => {
1809
+
1810
+
1811
+
1812
+
1813
+ return `/api/v1/billing/stripe/subscriptions/${subscriptionUid}/pause`
1814
+ }
1815
+
1816
+ export const stripeSubscriptionsPauseCollection = async (subscriptionUid: string | null,
1817
+ stripeSubscriptionsPauseCollectionBody: StripeSubscriptionsPauseCollectionBody, options?: RequestInit): Promise<stripeSubscriptionsPauseCollectionResponse> => {
1818
+
1819
+ return customFetch<stripeSubscriptionsPauseCollectionResponse>(getStripeSubscriptionsPauseCollectionUrl(subscriptionUid),
1820
+ {
1821
+ ...options,
1822
+ method: 'POST',
1823
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1824
+ body: JSON.stringify(
1825
+ stripeSubscriptionsPauseCollectionBody,)
1826
+ }
1827
+ );}
1828
+
1829
+
1830
+ /**
1831
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected;
1832
+ use PUT /billing/subscriptions/{subscriptionUid}/changesubscription instead.
1833
+
1834
+ Use this, for example, to move a subscription to another price. Identify each item's
1835
+ StripePrice by Uid or StripeId. A user token can only change a subscription on its own
1836
+ account, and only as the account's primary contact.
1837
+ * @summary Change the items of a subscription.
1838
+ */
1839
+ export type stripeSubscriptionsChangeResponse200 = {
1840
+ data: StripeSubscription
1841
+ status: 200
1842
+ }
1843
+
1844
+ export type stripeSubscriptionsChangeResponse400 = {
1845
+ data: void
1846
+ status: 400
1847
+ }
1848
+
1849
+ export type stripeSubscriptionsChangeResponse401 = {
1850
+ data: void
1851
+ status: 401
1852
+ }
1853
+
1854
+ export type stripeSubscriptionsChangeResponse404 = {
1855
+ data: void
1856
+ status: 404
1857
+ }
1858
+
1859
+ export type stripeSubscriptionsChangeResponseSuccess = (stripeSubscriptionsChangeResponse200) & {
1860
+ headers: Headers;
1861
+ };
1862
+ export type stripeSubscriptionsChangeResponseError = (stripeSubscriptionsChangeResponse400 | stripeSubscriptionsChangeResponse401 | stripeSubscriptionsChangeResponse404) & {
1863
+ headers: Headers;
1864
+ };
1865
+
1866
+ export type stripeSubscriptionsChangeResponse = (stripeSubscriptionsChangeResponseSuccess | stripeSubscriptionsChangeResponseError)
1867
+
1868
+ export const getStripeSubscriptionsChangeUrl = (subscriptionUid: string | null,) => {
1869
+
1870
+
1871
+
1872
+
1873
+ return `/api/v1/billing/stripe/subscriptions/${subscriptionUid}/change`
1874
+ }
1875
+
1876
+ export const stripeSubscriptionsChange = async (subscriptionUid: string | null,
1877
+ stripeSubscriptionsChangeBody: NonReadonly<StripeSubscriptionsChangeBody>, options?: RequestInit): Promise<stripeSubscriptionsChangeResponse> => {
1878
+
1879
+ return customFetch<stripeSubscriptionsChangeResponse>(getStripeSubscriptionsChangeUrl(subscriptionUid),
1880
+ {
1881
+ ...options,
1882
+ method: 'PUT',
1883
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1884
+ body: JSON.stringify(
1885
+ stripeSubscriptionsChangeBody,)
1886
+ }
1887
+ );}
1888
+
1889
+
1890
+ /**
1891
+ * Returns the invoice that the change would create, without making the change. The
1892
+ request body is the same as for the change. Pass asOf in the query string to preview
1893
+ the change at a later date (default: now). A user token can only preview a change on
1894
+ its own account, and only as the account's primary contact.
1895
+ * @summary Preview a subscription change.
1896
+ */
1897
+ export type stripeSubscriptionsPreviewChangeResponse200 = {
1898
+ data: StripeInvoice
1899
+ status: 200
1900
+ }
1901
+
1902
+ export type stripeSubscriptionsPreviewChangeResponse400 = {
1903
+ data: void
1904
+ status: 400
1905
+ }
1906
+
1907
+ export type stripeSubscriptionsPreviewChangeResponse401 = {
1908
+ data: void
1909
+ status: 401
1910
+ }
1911
+
1912
+ export type stripeSubscriptionsPreviewChangeResponse404 = {
1913
+ data: void
1914
+ status: 404
1915
+ }
1916
+
1917
+ export type stripeSubscriptionsPreviewChangeResponseSuccess = (stripeSubscriptionsPreviewChangeResponse200) & {
1918
+ headers: Headers;
1919
+ };
1920
+ export type stripeSubscriptionsPreviewChangeResponseError = (stripeSubscriptionsPreviewChangeResponse400 | stripeSubscriptionsPreviewChangeResponse401 | stripeSubscriptionsPreviewChangeResponse404) & {
1921
+ headers: Headers;
1922
+ };
1923
+
1924
+ export type stripeSubscriptionsPreviewChangeResponse = (stripeSubscriptionsPreviewChangeResponseSuccess | stripeSubscriptionsPreviewChangeResponseError)
1925
+
1926
+ export const getStripeSubscriptionsPreviewChangeUrl = (subscriptionUid: string | null,) => {
1927
+
1928
+
1929
+
1930
+
1931
+ return `/api/v1/billing/stripe/subscriptions/${subscriptionUid}/change-preview`
1932
+ }
1933
+
1934
+ export const stripeSubscriptionsPreviewChange = async (subscriptionUid: string | null,
1935
+ stripeSubscriptionsPreviewChangeBody: NonReadonly<StripeSubscriptionsPreviewChangeBody>, options?: RequestInit): Promise<stripeSubscriptionsPreviewChangeResponse> => {
1936
+
1937
+ return customFetch<stripeSubscriptionsPreviewChangeResponse>(getStripeSubscriptionsPreviewChangeUrl(subscriptionUid),
1938
+ {
1939
+ ...options,
1940
+ method: 'POST',
1941
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1942
+ body: JSON.stringify(
1943
+ stripeSubscriptionsPreviewChangeBody,)
1944
+ }
1945
+ );}
1946
+
1947
+
1948
+ /**
1949
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
1950
+
1951
+ This sets the subscription's trial end to ToDate, without proration.
1952
+ * @summary Extend the date of a subscription's next invoice.
1953
+ */
1954
+ export type stripeSubscriptionsExtendTrialResponse200 = {
1955
+ data: Blob
1956
+ status: 200
1957
+ }
1958
+
1959
+ export type stripeSubscriptionsExtendTrialResponse400 = {
1960
+ data: void
1961
+ status: 400
1962
+ }
1963
+
1964
+ export type stripeSubscriptionsExtendTrialResponse401 = {
1965
+ data: void
1966
+ status: 401
1967
+ }
1968
+
1969
+ export type stripeSubscriptionsExtendTrialResponse404 = {
1970
+ data: void
1971
+ status: 404
1972
+ }
1973
+
1974
+ export type stripeSubscriptionsExtendTrialResponseSuccess = (stripeSubscriptionsExtendTrialResponse200) & {
1975
+ headers: Headers;
1976
+ };
1977
+ export type stripeSubscriptionsExtendTrialResponseError = (stripeSubscriptionsExtendTrialResponse400 | stripeSubscriptionsExtendTrialResponse401 | stripeSubscriptionsExtendTrialResponse404) & {
1978
+ headers: Headers;
1979
+ };
1980
+
1981
+ export type stripeSubscriptionsExtendTrialResponse = (stripeSubscriptionsExtendTrialResponseSuccess | stripeSubscriptionsExtendTrialResponseError)
1982
+
1983
+ export const getStripeSubscriptionsExtendTrialUrl = (subscriptionUid: string | null,) => {
1984
+
1985
+
1986
+
1987
+
1988
+ return `/api/v1/billing/stripe/subscriptions/${subscriptionUid}/extend`
1989
+ }
1990
+
1991
+ export const stripeSubscriptionsExtendTrial = async (subscriptionUid: string | null,
1992
+ stripeSubscriptionsExtendTrialBody: StripeSubscriptionsExtendTrialBody, options?: RequestInit): Promise<stripeSubscriptionsExtendTrialResponse> => {
1993
+
1994
+ return customFetch<stripeSubscriptionsExtendTrialResponse>(getStripeSubscriptionsExtendTrialUrl(subscriptionUid),
1995
+ {
1996
+ ...options,
1997
+ method: 'PUT',
1998
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1999
+ body: JSON.stringify(
2000
+ stripeSubscriptionsExtendTrialBody,)
2001
+ }
2002
+ );}
2003
+
2004
+
2005
+ /**
2006
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
2007
+
2008
+ The scheduled changes no longer happen, and the subscription keeps its current items.
2009
+ Nothing happens when there is no active schedule.
2010
+ * @summary Release a subscription's active schedule.
2011
+ */
2012
+ export type stripeSubscriptionsReleaseScheduleResponse200 = {
2013
+ data: StripeSubscription
2014
+ status: 200
2015
+ }
2016
+
2017
+ export type stripeSubscriptionsReleaseScheduleResponse400 = {
2018
+ data: void
2019
+ status: 400
2020
+ }
2021
+
2022
+ export type stripeSubscriptionsReleaseScheduleResponse401 = {
2023
+ data: void
2024
+ status: 401
2025
+ }
2026
+
2027
+ export type stripeSubscriptionsReleaseScheduleResponse404 = {
2028
+ data: void
2029
+ status: 404
2030
+ }
2031
+
2032
+ export type stripeSubscriptionsReleaseScheduleResponseSuccess = (stripeSubscriptionsReleaseScheduleResponse200) & {
2033
+ headers: Headers;
2034
+ };
2035
+ export type stripeSubscriptionsReleaseScheduleResponseError = (stripeSubscriptionsReleaseScheduleResponse400 | stripeSubscriptionsReleaseScheduleResponse401 | stripeSubscriptionsReleaseScheduleResponse404) & {
2036
+ headers: Headers;
2037
+ };
2038
+
2039
+ export type stripeSubscriptionsReleaseScheduleResponse = (stripeSubscriptionsReleaseScheduleResponseSuccess | stripeSubscriptionsReleaseScheduleResponseError)
2040
+
2041
+ export const getStripeSubscriptionsReleaseScheduleUrl = (subscriptionUid: string | null,) => {
2042
+
2043
+
2044
+
2045
+
2046
+ return `/api/v1/billing/stripe/subscriptions/${subscriptionUid}/release-schedule`
2047
+ }
2048
+
2049
+ export const stripeSubscriptionsReleaseSchedule = async (subscriptionUid: string | null, options?: RequestInit): Promise<stripeSubscriptionsReleaseScheduleResponse> => {
2050
+
2051
+ return customFetch<stripeSubscriptionsReleaseScheduleResponse>(getStripeSubscriptionsReleaseScheduleUrl(subscriptionUid),
2052
+ {
2053
+ ...options,
2054
+ method: 'POST'
2055
+
2056
+
2057
+ }
2058
+ );}
2059
+
2060
+
2061
+ /**
2062
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
2063
+ * @summary Resume payment collection on a paused subscription.
2064
+ */
2065
+ export type stripeSubscriptionsResumeCollectionResponse200 = {
2066
+ data: StripeSubscription
2067
+ status: 200
2068
+ }
2069
+
2070
+ export type stripeSubscriptionsResumeCollectionResponse400 = {
2071
+ data: void
2072
+ status: 400
2073
+ }
2074
+
2075
+ export type stripeSubscriptionsResumeCollectionResponse401 = {
2076
+ data: void
2077
+ status: 401
2078
+ }
2079
+
2080
+ export type stripeSubscriptionsResumeCollectionResponse404 = {
2081
+ data: void
2082
+ status: 404
2083
+ }
2084
+
2085
+ export type stripeSubscriptionsResumeCollectionResponseSuccess = (stripeSubscriptionsResumeCollectionResponse200) & {
2086
+ headers: Headers;
2087
+ };
2088
+ export type stripeSubscriptionsResumeCollectionResponseError = (stripeSubscriptionsResumeCollectionResponse400 | stripeSubscriptionsResumeCollectionResponse401 | stripeSubscriptionsResumeCollectionResponse404) & {
2089
+ headers: Headers;
2090
+ };
2091
+
2092
+ export type stripeSubscriptionsResumeCollectionResponse = (stripeSubscriptionsResumeCollectionResponseSuccess | stripeSubscriptionsResumeCollectionResponseError)
2093
+
2094
+ export const getStripeSubscriptionsResumeCollectionUrl = (subscriptionUid: string | null,) => {
2095
+
2096
+
2097
+
2098
+
2099
+ return `/api/v1/billing/stripe/subscriptions/${subscriptionUid}/resume`
2100
+ }
2101
+
2102
+ export const stripeSubscriptionsResumeCollection = async (subscriptionUid: string | null, options?: RequestInit): Promise<stripeSubscriptionsResumeCollectionResponse> => {
2103
+
2104
+ return customFetch<stripeSubscriptionsResumeCollectionResponse>(getStripeSubscriptionsResumeCollectionUrl(subscriptionUid),
2105
+ {
2106
+ ...options,
2107
+ method: 'POST'
2108
+
2109
+
2110
+ }
2111
+ );}
2112
+
2113
+
2114
+ /**
2115
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
2116
+
2117
+ The trial ends now, so that the subscription starts and is invoiced.
2118
+ * @summary Start a trialing subscription.
2119
+ */
2120
+ export type stripeSubscriptionsStartResponse200 = {
2121
+ data: StripeSubscription
2122
+ status: 200
2123
+ }
2124
+
2125
+ export type stripeSubscriptionsStartResponse400 = {
2126
+ data: void
2127
+ status: 400
2128
+ }
2129
+
2130
+ export type stripeSubscriptionsStartResponse401 = {
2131
+ data: void
2132
+ status: 401
2133
+ }
2134
+
2135
+ export type stripeSubscriptionsStartResponse404 = {
2136
+ data: void
2137
+ status: 404
2138
+ }
2139
+
2140
+ export type stripeSubscriptionsStartResponseSuccess = (stripeSubscriptionsStartResponse200) & {
2141
+ headers: Headers;
2142
+ };
2143
+ export type stripeSubscriptionsStartResponseError = (stripeSubscriptionsStartResponse400 | stripeSubscriptionsStartResponse401 | stripeSubscriptionsStartResponse404) & {
2144
+ headers: Headers;
2145
+ };
2146
+
2147
+ export type stripeSubscriptionsStartResponse = (stripeSubscriptionsStartResponseSuccess | stripeSubscriptionsStartResponseError)
2148
+
2149
+ export const getStripeSubscriptionsStartUrl = (subscriptionUid: string | null,) => {
2150
+
2151
+
2152
+
2153
+
2154
+ return `/api/v1/billing/stripe/subscriptions/${subscriptionUid}/start`
2155
+ }
2156
+
2157
+ export const stripeSubscriptionsStart = async (subscriptionUid: string | null, options?: RequestInit): Promise<stripeSubscriptionsStartResponse> => {
2158
+
2159
+ return customFetch<stripeSubscriptionsStartResponse>(getStripeSubscriptionsStartUrl(subscriptionUid),
2160
+ {
2161
+ ...options,
2162
+ method: 'POST'
2163
+
2164
+
2165
+ }
2166
+ );}
2167
+
2168
+
2169
+ /**
2170
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
2171
+
2172
+ Pass productUid in the query string to import only the subscriptions to that
2173
+ product's prices. The response is an import result wrapped in a Count property.
2174
+ * @summary Import subscriptions from the connected Stripe account.
2175
+ */
2176
+ export type stripeSubscriptionsSyncSubscriptionsFromStripeResponse200 = {
2177
+ data: Blob
2178
+ status: 200
2179
+ }
2180
+
2181
+ export type stripeSubscriptionsSyncSubscriptionsFromStripeResponse401 = {
2182
+ data: void
2183
+ status: 401
2184
+ }
2185
+
2186
+ export type stripeSubscriptionsSyncSubscriptionsFromStripeResponseSuccess = (stripeSubscriptionsSyncSubscriptionsFromStripeResponse200) & {
2187
+ headers: Headers;
2188
+ };
2189
+ export type stripeSubscriptionsSyncSubscriptionsFromStripeResponseError = (stripeSubscriptionsSyncSubscriptionsFromStripeResponse401) & {
2190
+ headers: Headers;
2191
+ };
2192
+
2193
+ export type stripeSubscriptionsSyncSubscriptionsFromStripeResponse = (stripeSubscriptionsSyncSubscriptionsFromStripeResponseSuccess | stripeSubscriptionsSyncSubscriptionsFromStripeResponseError)
2194
+
2195
+ export const getStripeSubscriptionsSyncSubscriptionsFromStripeUrl = () => {
2196
+
2197
+
2198
+
2199
+
2200
+ return `/api/v1/billing/stripe/subscriptions/sync`
2201
+ }
2202
+
2203
+ export const stripeSubscriptionsSyncSubscriptionsFromStripe = async ( options?: RequestInit): Promise<stripeSubscriptionsSyncSubscriptionsFromStripeResponse> => {
2204
+
2205
+ return customFetch<stripeSubscriptionsSyncSubscriptionsFromStripeResponse>(getStripeSubscriptionsSyncSubscriptionsFromStripeUrl(),
2206
+ {
2207
+ ...options,
2208
+ method: 'POST'
2209
+
2210
+
2211
+ }
2212
+ );}
2213
+
2214
+
2215
+ /**
2216
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
2217
+
2218
+ A subscription set to end at the end of its billing period renews instead.
2219
+ * @summary Remove a subscription's pending cancellation.
2220
+ */
2221
+ export type stripeSubscriptionsUncancelResponse200 = {
2222
+ data: StripeSubscription
2223
+ status: 200
2224
+ }
2225
+
2226
+ export type stripeSubscriptionsUncancelResponse400 = {
2227
+ data: void
2228
+ status: 400
2229
+ }
2230
+
2231
+ export type stripeSubscriptionsUncancelResponse401 = {
2232
+ data: void
2233
+ status: 401
2234
+ }
2235
+
2236
+ export type stripeSubscriptionsUncancelResponse404 = {
2237
+ data: void
2238
+ status: 404
2239
+ }
2240
+
2241
+ export type stripeSubscriptionsUncancelResponseSuccess = (stripeSubscriptionsUncancelResponse200) & {
2242
+ headers: Headers;
2243
+ };
2244
+ export type stripeSubscriptionsUncancelResponseError = (stripeSubscriptionsUncancelResponse400 | stripeSubscriptionsUncancelResponse401 | stripeSubscriptionsUncancelResponse404) & {
2245
+ headers: Headers;
2246
+ };
2247
+
2248
+ export type stripeSubscriptionsUncancelResponse = (stripeSubscriptionsUncancelResponseSuccess | stripeSubscriptionsUncancelResponseError)
2249
+
2250
+ export const getStripeSubscriptionsUncancelUrl = (subscriptionUid: string | null,) => {
2251
+
2252
+
2253
+
2254
+
2255
+ return `/api/v1/billing/stripe/subscriptions/${subscriptionUid}/uncancel`
2256
+ }
2257
+
2258
+ export const stripeSubscriptionsUncancel = async (subscriptionUid: string | null, options?: RequestInit): Promise<stripeSubscriptionsUncancelResponse> => {
2259
+
2260
+ return customFetch<stripeSubscriptionsUncancelResponse>(getStripeSubscriptionsUncancelUrl(subscriptionUid),
2261
+ {
2262
+ ...options,
2263
+ method: 'POST'
2264
+
2265
+
2266
+ }
2267
+ );}
2268
+
2269
+
2270
+ /**
2271
+ * @summary Retrieve all products.
2272
+ */
2273
+ export type stripeProductsGetAllResponse200 = {
2274
+ data: StripeProductsGetAll200
2275
+ status: 200
2276
+ }
2277
+
2278
+ export type stripeProductsGetAllResponse401 = {
2279
+ data: void
2280
+ status: 401
2281
+ }
2282
+
2283
+ export type stripeProductsGetAllResponseSuccess = (stripeProductsGetAllResponse200) & {
2284
+ headers: Headers;
2285
+ };
2286
+ export type stripeProductsGetAllResponseError = (stripeProductsGetAllResponse401) & {
2287
+ headers: Headers;
2288
+ };
2289
+
2290
+ export type stripeProductsGetAllResponse = (stripeProductsGetAllResponseSuccess | stripeProductsGetAllResponseError)
2291
+
2292
+ export const getStripeProductsGetAllUrl = (params?: StripeProductsGetAllParams,) => {
2293
+ const normalizedParams = new URLSearchParams();
2294
+
2295
+ Object.entries(params || {}).forEach(([key, value]) => {
2296
+
2297
+ if (value !== undefined) {
2298
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
2299
+ }
2300
+ });
2301
+
2302
+ const stringifiedParams = normalizedParams.toString();
2303
+
2304
+ return stringifiedParams.length > 0 ? `/api/v1/billing/stripe/products?${stringifiedParams}` : `/api/v1/billing/stripe/products`
2305
+ }
2306
+
2307
+ export const stripeProductsGetAll = async (params?: StripeProductsGetAllParams, options?: RequestInit): Promise<stripeProductsGetAllResponse> => {
2308
+
2309
+ return customFetch<stripeProductsGetAllResponse>(getStripeProductsGetAllUrl(params),
2310
+ {
2311
+ ...options,
2312
+ method: 'GET'
2313
+
2314
+
2315
+ }
2316
+ );}
2317
+
2318
+
2319
+ /**
2320
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected;
2321
+ use POST /billing/plans or POST /billing/addons instead.
2322
+
2323
+ The product is also created in the connected Stripe account.
2324
+ * @summary Add a new product.
2325
+ */
2326
+ export type stripeProductsPostResponse200 = {
2327
+ data: StripeProduct
2328
+ status: 200
2329
+ }
2330
+
2331
+ export type stripeProductsPostResponse401 = {
2332
+ data: void
2333
+ status: 401
2334
+ }
2335
+
2336
+ export type stripeProductsPostResponseSuccess = (stripeProductsPostResponse200) & {
2337
+ headers: Headers;
2338
+ };
2339
+ export type stripeProductsPostResponseError = (stripeProductsPostResponse401) & {
2340
+ headers: Headers;
2341
+ };
2342
+
2343
+ export type stripeProductsPostResponse = (stripeProductsPostResponseSuccess | stripeProductsPostResponseError)
2344
+
2345
+ export const getStripeProductsPostUrl = () => {
2346
+
2347
+
2348
+
2349
+
2350
+ return `/api/v1/billing/stripe/products`
2351
+ }
2352
+
2353
+ export const stripeProductsPost = async (stripeProductsPostBody: NonReadonly<StripeProductsPostBody>, options?: RequestInit): Promise<stripeProductsPostResponse> => {
2354
+
2355
+ return customFetch<stripeProductsPostResponse>(getStripeProductsPostUrl(),
2356
+ {
2357
+ ...options,
2358
+ method: 'POST',
2359
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
2360
+ body: JSON.stringify(
2361
+ stripeProductsPostBody,)
2362
+ }
2363
+ );}
2364
+
2365
+
2366
+ /**
2367
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
2368
+ * @summary Import all products and their prices from the connected Stripe account.
2369
+ */
2370
+ export type stripeProductsSyncProductsFromStripeResponse200 = {
2371
+ data: ImportResult
2372
+ status: 200
2373
+ }
2374
+
2375
+ export type stripeProductsSyncProductsFromStripeResponse401 = {
2376
+ data: void
2377
+ status: 401
2378
+ }
2379
+
2380
+ export type stripeProductsSyncProductsFromStripeResponseSuccess = (stripeProductsSyncProductsFromStripeResponse200) & {
2381
+ headers: Headers;
2382
+ };
2383
+ export type stripeProductsSyncProductsFromStripeResponseError = (stripeProductsSyncProductsFromStripeResponse401) & {
2384
+ headers: Headers;
2385
+ };
2386
+
2387
+ export type stripeProductsSyncProductsFromStripeResponse = (stripeProductsSyncProductsFromStripeResponseSuccess | stripeProductsSyncProductsFromStripeResponseError)
2388
+
2389
+ export const getStripeProductsSyncProductsFromStripeUrl = () => {
2390
+
2391
+
2392
+
2393
+
2394
+ return `/api/v1/billing/stripe/products/sync`
2395
+ }
2396
+
2397
+ export const stripeProductsSyncProductsFromStripe = async ( options?: RequestInit): Promise<stripeProductsSyncProductsFromStripeResponse> => {
2398
+
2399
+ return customFetch<stripeProductsSyncProductsFromStripeResponse>(getStripeProductsSyncProductsFromStripeUrl(),
2400
+ {
2401
+ ...options,
2402
+ method: 'POST'
2403
+
2404
+
2405
+ }
2406
+ );}
2407
+
2408
+
2409
+ /**
2410
+ * @summary Retrieve a product.
2411
+ */
2412
+ export type stripeProductsGetResponse200 = {
2413
+ data: StripeProduct
2414
+ status: 200
2415
+ }
2416
+
2417
+ export type stripeProductsGetResponse401 = {
2418
+ data: void
2419
+ status: 401
2420
+ }
2421
+
2422
+ export type stripeProductsGetResponseSuccess = (stripeProductsGetResponse200) & {
2423
+ headers: Headers;
2424
+ };
2425
+ export type stripeProductsGetResponseError = (stripeProductsGetResponse401) & {
2426
+ headers: Headers;
2427
+ };
2428
+
2429
+ export type stripeProductsGetResponse = (stripeProductsGetResponseSuccess | stripeProductsGetResponseError)
2430
+
2431
+ export const getStripeProductsGetUrl = (uid: string | null,) => {
2432
+
2433
+
2434
+
2435
+
2436
+ return `/api/v1/billing/stripe/products/${uid}`
2437
+ }
2438
+
2439
+ export const stripeProductsGet = async (uid: string | null, options?: RequestInit): Promise<stripeProductsGetResponse> => {
2440
+
2441
+ return customFetch<stripeProductsGetResponse>(getStripeProductsGetUrl(uid),
2442
+ {
2443
+ ...options,
2444
+ method: 'GET'
2445
+
2446
+
2447
+ }
2448
+ );}
2449
+
2450
+
2451
+ /**
2452
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected;
2453
+ use PUT /billing/plans/{planUid} or PUT /billing/addons/{addOnUid} instead.
2454
+
2455
+ The changes are also sent to the connected Stripe account.
2456
+ * @summary Update a product.
2457
+ */
2458
+ export type stripeProductsPutResponse200 = {
2459
+ data: StripeProduct
2460
+ status: 200
2461
+ }
2462
+
2463
+ export type stripeProductsPutResponse401 = {
2464
+ data: void
2465
+ status: 401
2466
+ }
2467
+
2468
+ export type stripeProductsPutResponseSuccess = (stripeProductsPutResponse200) & {
2469
+ headers: Headers;
2470
+ };
2471
+ export type stripeProductsPutResponseError = (stripeProductsPutResponse401) & {
2472
+ headers: Headers;
2473
+ };
2474
+
2475
+ export type stripeProductsPutResponse = (stripeProductsPutResponseSuccess | stripeProductsPutResponseError)
2476
+
2477
+ export const getStripeProductsPutUrl = (uid: string | null,) => {
2478
+
2479
+
2480
+
2481
+
2482
+ return `/api/v1/billing/stripe/products/${uid}`
2483
+ }
2484
+
2485
+ export const stripeProductsPut = async (uid: string | null,
2486
+ stripeProductsPutBody: NonReadonly<StripeProductsPutBody>, options?: RequestInit): Promise<stripeProductsPutResponse> => {
2487
+
2488
+ return customFetch<stripeProductsPutResponse>(getStripeProductsPutUrl(uid),
2489
+ {
2490
+ ...options,
2491
+ method: 'PUT',
2492
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
2493
+ body: JSON.stringify(
2494
+ stripeProductsPutBody,)
2495
+ }
2496
+ );}
2497
+
2498
+
2499
+ /**
2500
+ * Applies to Stripe Billing (v3) only. With Outseta billing (v2) the request is rejected.
2501
+ * @summary Import a product and its prices from the connected Stripe account.
2502
+ */
2503
+ export type stripeProductsSyncProductFromStripeResponse200 = {
2504
+ data: Blob
2505
+ status: 200
2506
+ }
2507
+
2508
+ export type stripeProductsSyncProductFromStripeResponse401 = {
2509
+ data: void
2510
+ status: 401
2511
+ }
2512
+
2513
+ export type stripeProductsSyncProductFromStripeResponseSuccess = (stripeProductsSyncProductFromStripeResponse200) & {
2514
+ headers: Headers;
2515
+ };
2516
+ export type stripeProductsSyncProductFromStripeResponseError = (stripeProductsSyncProductFromStripeResponse401) & {
2517
+ headers: Headers;
2518
+ };
2519
+
2520
+ export type stripeProductsSyncProductFromStripeResponse = (stripeProductsSyncProductFromStripeResponseSuccess | stripeProductsSyncProductFromStripeResponseError)
2521
+
2522
+ export const getStripeProductsSyncProductFromStripeUrl = (uid: string | null,) => {
2523
+
2524
+
2525
+
2526
+
2527
+ return `/api/v1/billing/stripe/products/${uid}/sync`
2528
+ }
2529
+
2530
+ export const stripeProductsSyncProductFromStripe = async (uid: string | null, options?: RequestInit): Promise<stripeProductsSyncProductFromStripeResponse> => {
2531
+
2532
+ return customFetch<stripeProductsSyncProductFromStripeResponse>(getStripeProductsSyncProductFromStripeUrl(uid),
2533
+ {
2534
+ ...options,
2535
+ method: 'POST'
2536
+
2537
+
2538
+ }
2539
+ );}
2540
+
2541
+