@outseta/api-client 0.1.1 → 0.2.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 (75) hide show
  1. package/README.md +6 -8
  2. package/dist/index.js +23 -19
  3. package/package.json +3 -6
  4. package/src/__tests__/accounts-crud.integration.test.ts +41 -39
  5. package/src/__tests__/client.test.ts +3 -3
  6. package/src/__tests__/people.integration.test.ts +28 -32
  7. package/src/__tests__/setup.ts +5 -6
  8. package/src/__tests__/support.integration.test.ts +28 -35
  9. package/src/client.ts +55 -24
  10. package/src/generated/activity/activity.ts +335 -0
  11. package/src/generated/billing/billing.ts +1006 -0
  12. package/src/generated/crm/crm.ts +1143 -1
  13. package/src/generated/email/email.ts +798 -0
  14. package/src/generated/models/accountAddPersonToAccountBody.ts +227 -0
  15. package/src/generated/models/accountCancelAccountBody.ts +227 -0
  16. package/src/generated/models/accountCancelationAllOf.ts +2 -0
  17. package/src/generated/models/accountExtendTrialBody.ts +227 -0
  18. package/src/generated/models/accountStage.ts +2 -1
  19. package/src/generated/models/accountUpdateAccountBody.ts +227 -0
  20. package/src/generated/models/accountUpdateMembershipBody.ts +227 -0
  21. package/src/generated/models/activityAddCustomActivityBody.ts +227 -0
  22. package/src/generated/models/activityGetAllParams.ts +241 -0
  23. package/src/generated/models/articleGetAllArticlesParams.ts +228 -0
  24. package/src/generated/models/backGroundTaskType.ts +3 -1
  25. package/src/generated/models/broadcastCampaignAllOf.ts +4 -0
  26. package/src/generated/models/broadcastCampaignStatus.ts +2 -1
  27. package/src/generated/models/campaignAddBroadcastEmailBody.ts +227 -0
  28. package/src/generated/models/campaignSendTestCampaignEmailBody.ts +227 -0
  29. package/src/generated/models/campaignUpdateBroadcastEmailBody.ts +227 -0
  30. package/src/generated/models/cancelationStatus.ts +236 -0
  31. package/src/generated/models/caseAddCaseBody.ts +227 -0
  32. package/src/generated/models/caseAddCaseParams.ts +229 -0
  33. package/src/generated/models/crmSettingsAllOf.ts +2 -0
  34. package/src/generated/models/dealAddDealBody.ts +227 -0
  35. package/src/generated/models/dealGetAllDealsParams.ts +234 -0
  36. package/src/generated/models/dealUpdateDealBody.ts +227 -0
  37. package/src/generated/models/discountCouponAddDiscountCouponBody.ts +227 -0
  38. package/src/generated/models/dnsEntry.ts +2 -0
  39. package/src/generated/models/emailListAddSubscriptionBody.ts +227 -0
  40. package/src/generated/models/emailListGetAllSubscriptionsParams.ts +229 -0
  41. package/src/generated/models/extendSubscriptionOptions.ts +225 -0
  42. package/src/generated/models/index.ts +40 -0
  43. package/src/generated/models/invoiceAddInvoiceBody.ts +227 -0
  44. package/src/generated/models/invoiceAllOf.ts +8 -0
  45. package/src/generated/models/messageAllOf.ts +1 -0
  46. package/src/generated/models/paymentInformationSavePaymentInformationBody.ts +227 -0
  47. package/src/generated/models/personAddPersonBody.ts +227 -0
  48. package/src/generated/models/personAllOf.ts +3 -3
  49. package/src/generated/models/personForgotPasswordBody.ts +227 -0
  50. package/src/generated/models/personGetAllPeopleParams.ts +229 -0
  51. package/src/generated/models/personSetTemporaryPasswordBody.ts +227 -0
  52. package/src/generated/models/personUpdatePersonBody.ts +227 -0
  53. package/src/generated/models/qcountConfigSettingType.ts +3 -1
  54. package/src/generated/models/resendEmailsRequest.ts +226 -0
  55. package/src/generated/models/sendGridDomainAuthenticationAllOf.ts +1 -0
  56. package/src/generated/models/setupIntent.ts +2 -0
  57. package/src/generated/models/stripeCreditNoteAllOf.ts +9 -0
  58. package/src/generated/models/stripeInvoiceAllOf.ts +9 -0
  59. package/src/generated/models/stripePriceAllOf.ts +2 -0
  60. package/src/generated/models/stripeProductAllOf.ts +5 -0
  61. package/src/generated/models/stripeSubscriptionAllOf.ts +4 -0
  62. package/src/generated/models/subscriptionAddOnAddSubscriptionAddOnBody.ts +227 -0
  63. package/src/generated/models/subscriptionChangeSubscriptionBody.ts +227 -0
  64. package/src/generated/models/subscriptionChangeSubscriptionParams.ts +229 -0
  65. package/src/generated/models/subscriptionChangeSubscriptionPreviewBody.ts +227 -0
  66. package/src/generated/models/subscriptionChangeSubscriptionPreviewParams.ts +229 -0
  67. package/src/generated/models/subscriptionFirstTimeSubscriptionBody.ts +227 -0
  68. package/src/generated/models/subscriptionFirstTimeSubscriptionPreviewBody.ts +227 -0
  69. package/src/generated/models/subscriptionFirstTimeSubscriptionPreviewParams.ts +229 -0
  70. package/src/generated/models/subscriptionSetSubscriptionUpgradeRequiredBody.ts +227 -0
  71. package/src/generated/models/transactionsAddPaymentTransactionBody.ts +227 -0
  72. package/src/generated/models/usageAddUsageBody.ts +227 -0
  73. package/src/generated/support/support.ts +341 -1
  74. package/src/index.ts +7 -1
  75. package/src/generated/zod.ts +0 -191087
@@ -0,0 +1,1006 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * Generated by orval v7.21.0 🍺
4
+ * Do not edit manually.
5
+ * Outseta API
6
+ * # Outseta REST API
7
+
8
+ The Outseta REST API enables you to perform a variety of powerful tasks such as creating and updating people, accounts, subscriptions, and invoices. Outseta uses standard HTTP protocols within a compliant architecture that is simple to integrate. You can use the API both on the client or the server side; see the authentication section below for each scenario.
9
+
10
+ **Base URL:** `https://{your-domain}.outseta.com/api/v1/`
11
+
12
+ ## API Guidelines
13
+
14
+ 1. The API will only respond to secured communication done over **HTTPS**. HTTP requests will be sent a `301` redirect to the corresponding HTTPS resource.
15
+ 2. Responses are sent in **JSON** format. In case the API request results in an error, it is represented by an `"error": {}` key in the JSON response.
16
+ 3. The request method (verb) determines the nature of the action: **GET** fetches data, **POST** creates new records, **PUT** updates existing records.
17
+ 4. The API responds with appropriate **HTTP status codes** for all requests.
18
+ 5. Use `donotlog=1` as a query parameter on any API call where you don't want the action to be logged in the activity log.
19
+
20
+ ## Authentication
21
+
22
+ All API requests require authentication via one of two methods:
23
+
24
+ ### Server-Side (API Keys)
25
+
26
+ Use API keys for server-to-server integrations. Create keys at **Settings > Integrations > API Keys**. Make sure to record the secret key when you create it.
27
+
28
+ ```
29
+ Authorization: Outseta {api_key}:{api_secret}
30
+ ```
31
+
32
+ **Example:**
33
+ ```
34
+ Authorization: Outseta ce08fd5a-e1ee-4472-9c5f-b7575d8369b2:74fc1d2242a4eb7336d34b0e40cfbc5f
35
+ ```
36
+
37
+ > **Warning:** Never expose API keys in client-side code. The API key and secret combined give full access to all data in your account.
38
+
39
+ ### Client-Side (Bearer Token)
40
+
41
+ Do **not** use API keys on the client side — they can be easily copied. Instead, obtain a JWT access token by calling the `POST /tokens` endpoint from the server side with your credentials, then use it on the client:
42
+
43
+ ```
44
+ Authorization: bearer {access_token}
45
+ ```
46
+
47
+ Tokens are JWTs containing claims such as `PersonUid`, `AccountUid`, and subscription details. Tokens expire after approximately one year.
48
+
49
+ Verify tokens server-side using Outseta's [JWKS endpoint](https://{your-domain}.outseta.com/.well-known/jwks.json).
50
+
51
+ ## Field Selection
52
+
53
+ When you make an API request, you'll automatically get all the basic information from the main object and its immediate child objects. Referenced objects beyond the first level are returned as `null`.
54
+
55
+ Change this behavior using the `fields` query parameter:
56
+
57
+ - **Go deeper** — Request fields lower down in the object tree: `?fields=CurrentSubscription.Plan.*`
58
+ - **Go lighter** — Request only the essentials for faster performance: `?fields=Uid,Name`
59
+ - **Combination** — `?fields=Uid,Name,CurrentSubscription.Plan.Uid`
60
+ - **Wildcard** — Use `*` to get all fields in an object: `?fields=*` or `?fields=CurrentSubscription.Plan.*`
61
+
62
+ > **Tip:** When expanding nested paths, include `*` and intermediate path segments (e.g., `PersonAccount.*`) to preserve root-level and intermediate fields.
63
+
64
+ **Examples:**
65
+
66
+ ```
67
+ # Get the current subscription plan UID for an account
68
+ GET /crm/accounts/{uid}?fields=CurrentSubscription.Plan.Uid
69
+
70
+ # Get the account UID and plan UID for a list of accounts
71
+ GET /crm/accounts?fields=Uid,CurrentSubscription.Plan.Uid
72
+
73
+ # Get the full plan object for an account's current subscription
74
+ GET /crm/accounts/{uid}?fields=CurrentSubscription.Plan.*
75
+
76
+ # Get a person with their account and subscription info
77
+ GET /crm/people/{uid}?fields=Uid,PersonAccount.Account.CurrentSubscription.Plan.Uid
78
+ ```
79
+
80
+ If your request includes fields from a child object you will be limited to retrieving **25 items** per page. The maximum for requests not expanding child object fields is **100 items**.
81
+
82
+ ## Pagination
83
+
84
+ List endpoints return paginated results with a `metadata` object and an `items` array:
85
+
86
+ ```json
87
+ {
88
+ "metadata": {
89
+ "limit": 25,
90
+ "offset": 0,
91
+ "total": 142
92
+ },
93
+ "items": [ ... ]
94
+ }
95
+ ```
96
+
97
+ | Parameter | Type | Default | Description |
98
+ |-----------|------|---------|-------------|
99
+ | `offset` | integer | `0` | Page number (zero-based) |
100
+ | `limit` | integer | `25` | Maximum number of records per page |
101
+
102
+ **Examples:**
103
+ ```
104
+ ?offset=0&limit=20 # returns results 1-20
105
+ ?offset=1&limit=20 # returns results 21-40
106
+ ```
107
+
108
+ ## Sorting
109
+
110
+ Sort results using the `orderBy` parameter with a property name and direction:
111
+
112
+ ```
113
+ ?orderBy=PropertyName+DESC
114
+ ```
115
+
116
+ ## Filtering
117
+
118
+ Filter results by passing entity properties as query parameters.
119
+
120
+ ### Basic Filtering
121
+
122
+ Filter on any field using the field name as a query parameter:
123
+
124
+ ```
125
+ GET /crm/people?Email=john@example.com
126
+ GET /crm/accounts?AccountStage=2
127
+ ```
128
+
129
+ ### Wildcard Matching
130
+
131
+ | Pattern | Match Type | Example |
132
+ |---------|-----------|---------|
133
+ | `*value` | Ends with | `?Email=*@example.com` |
134
+ | `value*` | Starts with | `?Name=Acme*` |
135
+ | `*value*` | Contains | `?Name=*corp*` |
136
+
137
+ ### Comparison Operators
138
+
139
+ For advanced filtering, append comparison operators to field names:
140
+
141
+ | Operator | Description | Example |
142
+ |----------|-------------|---------|
143
+ | `__gt` | Greater than | `Created__gt=2024-01-01` |
144
+ | `__gte` | Greater than or equal | `Amount__gte=100` |
145
+ | `__lt` | Less than | `Created__lt=2024-12-31` |
146
+ | `__lte` | Less than or equal | `Amount__lte=500` |
147
+ | `__ne` | Not equal | `Status__ne=Active` |
148
+ | `__isnull` | Is null (true/false) | `ProfileImageS3Url__isnull=true` |
149
+
150
+ **Examples:**
151
+
152
+ ```
153
+ # Date filtering
154
+ GET /crm/accounts?Created__gt=2024-01-01
155
+ GET /billing/subscriptions?EndDate__lt=2024-08-01
156
+
157
+ # Numeric filtering
158
+ GET /billing/invoices?Amount__gte=1000
159
+
160
+ # Null value filtering
161
+ GET /crm/people?ProfileImageS3Url__isnull=true
162
+
163
+ # Multiple filters combined with field selection
164
+ GET /billing/subscriptions?StartDate__gte=2024-01-01&Rate__lt=100&DiscountCode__isnull=false&fields=Uid,Amount,StartDate,DiscountCode,Plan.Name
165
+ ```
166
+
167
+ ## Account Billing Stages
168
+
169
+ Account stages reflect the financial standing of each account and are not directly editable — they change automatically based on subscription activity.
170
+
171
+ | Value | Stage | Description |
172
+ |-------|-------|-------------|
173
+ | `2` | Trialing | Currently on a free trial or free plan |
174
+ | `3` | Subscribing | Active paid subscription (contributes to MRR) |
175
+ | `4` | Canceling | Customer has indicated intent to cancel |
176
+ | `5` | Expired | Subscription has ended after cancellation |
177
+ | `6` | Trial Expired | Free trial ended without conversion to paid |
178
+
179
+ Filter by stage: `GET /crm/accounts?AccountStage=3` returns all actively subscribing accounts.
180
+
181
+ ## Webhooks
182
+
183
+ Use **Activity Notifications** to receive real-time callbacks when events occur in Outseta. Configure webhooks at **Settings > Notifications**.
184
+
185
+ Common events include:
186
+ - `Person Created` / `Person Updated`
187
+ - `Account Created` / `Account Updated`
188
+ - `Subscription Created` / `Subscription Updated`
189
+
190
+ Always verify webhook signatures using the SHA256 secret provided in the Outseta dashboard.
191
+
192
+ ## Error Responses
193
+
194
+ | Status Code | Description |
195
+ |-------------|-------------|
196
+ | `200` | Success |
197
+ | `301` | Redirect — HTTP requests are redirected to HTTPS |
198
+ | `400` | Bad request — invalid parameters or Uid format |
199
+ | `401` | Unauthorized — missing or invalid authentication |
200
+ | `404` | Entity not found |
201
+ | `4XX` / `5XX` | Client or server error |
202
+
203
+ Validation errors return a JSON body with `ErrorMessage` and `PropertyName` fields:
204
+
205
+ ```json
206
+ {
207
+ "ErrorMessage": "Invalid company email",
208
+ "PropertyName": "Email"
209
+ }
210
+ ```
211
+
212
+ ## Rate Limits
213
+
214
+ Requests authorized by an API Key should not exceed **4 requests/second**.
215
+
216
+ ## Support
217
+
218
+ For help regarding the Outseta API please email [support@outseta.com](mailto:support@outseta.com).
219
+
220
+ * OpenAPI spec version: v1
221
+ */
222
+ import type {
223
+ DiscountCoupon,
224
+ DiscountCouponAddDiscountCouponBody,
225
+ Invoice,
226
+ InvoiceAddInvoiceBody,
227
+ PaymentInformation,
228
+ PaymentInformationSavePaymentInformationBody,
229
+ Plan,
230
+ PlanFamily,
231
+ Subscription,
232
+ SubscriptionAddOnAddSubscriptionAddOnBody,
233
+ SubscriptionChangeSubscriptionBody,
234
+ SubscriptionChangeSubscriptionParams,
235
+ SubscriptionChangeSubscriptionPreviewBody,
236
+ SubscriptionChangeSubscriptionPreviewParams,
237
+ SubscriptionFirstTimeSubscriptionBody,
238
+ SubscriptionFirstTimeSubscriptionPreviewBody,
239
+ SubscriptionFirstTimeSubscriptionPreviewParams,
240
+ SubscriptionSetSubscriptionUpgradeRequiredBody,
241
+ Transaction,
242
+ TransactionsAddPaymentTransactionBody,
243
+ Usage,
244
+ UsageAddUsageBody
245
+ } from '.././models';
246
+
247
+ import { customFetch } from '../../client';
248
+
249
+ /**
250
+ * @summary Add a new discount coupon. Only one of AmountOff or PercentOff should be set.
251
+ Duration values: 1 = Forever, 2 = Once, 3 = Repeating (DurationInMonths must be set).
252
+ */
253
+ export type discountCouponAddDiscountCouponResponse200 = {
254
+ data: DiscountCoupon
255
+ status: 200
256
+ }
257
+
258
+ export type discountCouponAddDiscountCouponResponse401 = {
259
+ data: void
260
+ status: 401
261
+ }
262
+
263
+ export type discountCouponAddDiscountCouponResponseSuccess = (discountCouponAddDiscountCouponResponse200) & {
264
+ headers: Headers;
265
+ };
266
+ export type discountCouponAddDiscountCouponResponseError = (discountCouponAddDiscountCouponResponse401) & {
267
+ headers: Headers;
268
+ };
269
+
270
+ export type discountCouponAddDiscountCouponResponse = (discountCouponAddDiscountCouponResponseSuccess | discountCouponAddDiscountCouponResponseError)
271
+
272
+ export const getDiscountCouponAddDiscountCouponUrl = () => {
273
+
274
+
275
+
276
+
277
+ return `/api/v1/billing/discountcoupons`
278
+ }
279
+
280
+ export const discountCouponAddDiscountCoupon = async (discountCouponAddDiscountCouponBody: DiscountCouponAddDiscountCouponBody, options?: RequestInit): Promise<discountCouponAddDiscountCouponResponse> => {
281
+
282
+ return customFetch<discountCouponAddDiscountCouponResponse>(getDiscountCouponAddDiscountCouponUrl(),
283
+ {
284
+ ...options,
285
+ method: 'POST',
286
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
287
+ body: JSON.stringify(
288
+ discountCouponAddDiscountCouponBody,)
289
+ }
290
+ );}
291
+
292
+
293
+ /**
294
+ * @summary Add a usage entry for an add-on that bills for usage at the end of the month.
295
+ */
296
+ export type usageAddUsageResponse200 = {
297
+ data: Usage
298
+ status: 200
299
+ }
300
+
301
+ export type usageAddUsageResponse401 = {
302
+ data: void
303
+ status: 401
304
+ }
305
+
306
+ export type usageAddUsageResponseSuccess = (usageAddUsageResponse200) & {
307
+ headers: Headers;
308
+ };
309
+ export type usageAddUsageResponseError = (usageAddUsageResponse401) & {
310
+ headers: Headers;
311
+ };
312
+
313
+ export type usageAddUsageResponse = (usageAddUsageResponseSuccess | usageAddUsageResponseError)
314
+
315
+ export const getUsageAddUsageUrl = () => {
316
+
317
+
318
+
319
+
320
+ return `/api/v1/billing/usage`
321
+ }
322
+
323
+ export const usageAddUsage = async (usageAddUsageBody: UsageAddUsageBody, options?: RequestInit): Promise<usageAddUsageResponse> => {
324
+
325
+ return customFetch<usageAddUsageResponse>(getUsageAddUsageUrl(),
326
+ {
327
+ ...options,
328
+ method: 'POST',
329
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
330
+ body: JSON.stringify(
331
+ usageAddUsageBody,)
332
+ }
333
+ );}
334
+
335
+
336
+ /**
337
+ * @summary Retrieves all transactions for a given account. Transactions are tied to accounts and invoices.
338
+ BillingTransactionType: Invoice = 1, Payment = 2, Credit = 3, Refund = 4, Chargeback = 5.
339
+ */
340
+ export type transactionsGetAllTransactionsByAccountIdResponse200 = {
341
+ data: Transaction[]
342
+ status: 200
343
+ }
344
+
345
+ export type transactionsGetAllTransactionsByAccountIdResponse400 = {
346
+ data: void
347
+ status: 400
348
+ }
349
+
350
+ export type transactionsGetAllTransactionsByAccountIdResponse401 = {
351
+ data: void
352
+ status: 401
353
+ }
354
+
355
+ export type transactionsGetAllTransactionsByAccountIdResponseSuccess = (transactionsGetAllTransactionsByAccountIdResponse200) & {
356
+ headers: Headers;
357
+ };
358
+ export type transactionsGetAllTransactionsByAccountIdResponseError = (transactionsGetAllTransactionsByAccountIdResponse400 | transactionsGetAllTransactionsByAccountIdResponse401) & {
359
+ headers: Headers;
360
+ };
361
+
362
+ export type transactionsGetAllTransactionsByAccountIdResponse = (transactionsGetAllTransactionsByAccountIdResponseSuccess | transactionsGetAllTransactionsByAccountIdResponseError)
363
+
364
+ export const getTransactionsGetAllTransactionsByAccountIdUrl = (accountUid: string | null,) => {
365
+
366
+
367
+
368
+
369
+ return `/api/v1/billing/transactions/${accountUid}`
370
+ }
371
+
372
+ export const transactionsGetAllTransactionsByAccountId = async (accountUid: string | null, options?: RequestInit): Promise<transactionsGetAllTransactionsByAccountIdResponse> => {
373
+
374
+ return customFetch<transactionsGetAllTransactionsByAccountIdResponse>(getTransactionsGetAllTransactionsByAccountIdUrl(accountUid),
375
+ {
376
+ ...options,
377
+ method: 'GET'
378
+
379
+
380
+ }
381
+ );}
382
+
383
+
384
+ /**
385
+ * @summary Adds a payment to an invoice. If the amount matches the outstanding amount of the invoice,
386
+ the invoice will be marked as Paid.
387
+ */
388
+ export type transactionsAddPaymentTransactionResponse200 = {
389
+ data: Transaction
390
+ status: 200
391
+ }
392
+
393
+ export type transactionsAddPaymentTransactionResponse401 = {
394
+ data: void
395
+ status: 401
396
+ }
397
+
398
+ export type transactionsAddPaymentTransactionResponseSuccess = (transactionsAddPaymentTransactionResponse200) & {
399
+ headers: Headers;
400
+ };
401
+ export type transactionsAddPaymentTransactionResponseError = (transactionsAddPaymentTransactionResponse401) & {
402
+ headers: Headers;
403
+ };
404
+
405
+ export type transactionsAddPaymentTransactionResponse = (transactionsAddPaymentTransactionResponseSuccess | transactionsAddPaymentTransactionResponseError)
406
+
407
+ export const getTransactionsAddPaymentTransactionUrl = () => {
408
+
409
+
410
+
411
+
412
+ return `/api/v1/billing/transactions/payment`
413
+ }
414
+
415
+ export const transactionsAddPaymentTransaction = async (transactionsAddPaymentTransactionBody: TransactionsAddPaymentTransactionBody, options?: RequestInit): Promise<transactionsAddPaymentTransactionResponse> => {
416
+
417
+ return customFetch<transactionsAddPaymentTransactionResponse>(getTransactionsAddPaymentTransactionUrl(),
418
+ {
419
+ ...options,
420
+ method: 'POST',
421
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
422
+ body: JSON.stringify(
423
+ transactionsAddPaymentTransactionBody,)
424
+ }
425
+ );}
426
+
427
+
428
+ /**
429
+ * @summary Update payment information for an account.
430
+ */
431
+ export type paymentInformationSavePaymentInformationResponse200 = {
432
+ data: PaymentInformation
433
+ status: 200
434
+ }
435
+
436
+ export type paymentInformationSavePaymentInformationResponse401 = {
437
+ data: void
438
+ status: 401
439
+ }
440
+
441
+ export type paymentInformationSavePaymentInformationResponseSuccess = (paymentInformationSavePaymentInformationResponse200) & {
442
+ headers: Headers;
443
+ };
444
+ export type paymentInformationSavePaymentInformationResponseError = (paymentInformationSavePaymentInformationResponse401) & {
445
+ headers: Headers;
446
+ };
447
+
448
+ export type paymentInformationSavePaymentInformationResponse = (paymentInformationSavePaymentInformationResponseSuccess | paymentInformationSavePaymentInformationResponseError)
449
+
450
+ export const getPaymentInformationSavePaymentInformationUrl = () => {
451
+
452
+
453
+
454
+
455
+ return `/api/v1/billing/paymentinformation`
456
+ }
457
+
458
+ export const paymentInformationSavePaymentInformation = async (paymentInformationSavePaymentInformationBody: PaymentInformationSavePaymentInformationBody, options?: RequestInit): Promise<paymentInformationSavePaymentInformationResponse> => {
459
+
460
+ return customFetch<paymentInformationSavePaymentInformationResponse>(getPaymentInformationSavePaymentInformationUrl(),
461
+ {
462
+ ...options,
463
+ method: 'POST',
464
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
465
+ body: JSON.stringify(
466
+ paymentInformationSavePaymentInformationBody,)
467
+ }
468
+ );}
469
+
470
+
471
+ /**
472
+ * @summary Add an add-on to a subscription.
473
+ */
474
+ export type subscriptionAddOnAddSubscriptionAddOnResponse200 = {
475
+ data: Blob
476
+ status: 200
477
+ }
478
+
479
+ export type subscriptionAddOnAddSubscriptionAddOnResponse401 = {
480
+ data: void
481
+ status: 401
482
+ }
483
+
484
+ export type subscriptionAddOnAddSubscriptionAddOnResponseSuccess = (subscriptionAddOnAddSubscriptionAddOnResponse200) & {
485
+ headers: Headers;
486
+ };
487
+ export type subscriptionAddOnAddSubscriptionAddOnResponseError = (subscriptionAddOnAddSubscriptionAddOnResponse401) & {
488
+ headers: Headers;
489
+ };
490
+
491
+ export type subscriptionAddOnAddSubscriptionAddOnResponse = (subscriptionAddOnAddSubscriptionAddOnResponseSuccess | subscriptionAddOnAddSubscriptionAddOnResponseError)
492
+
493
+ export const getSubscriptionAddOnAddSubscriptionAddOnUrl = () => {
494
+
495
+
496
+
497
+
498
+ return `/api/v1/billing/subscriptionaddons`
499
+ }
500
+
501
+ export const subscriptionAddOnAddSubscriptionAddOn = async (subscriptionAddOnAddSubscriptionAddOnBody: SubscriptionAddOnAddSubscriptionAddOnBody, options?: RequestInit): Promise<subscriptionAddOnAddSubscriptionAddOnResponse> => {
502
+
503
+ return customFetch<subscriptionAddOnAddSubscriptionAddOnResponse>(getSubscriptionAddOnAddSubscriptionAddOnUrl(),
504
+ {
505
+ ...options,
506
+ method: 'POST',
507
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
508
+ body: JSON.stringify(
509
+ subscriptionAddOnAddSubscriptionAddOnBody,)
510
+ }
511
+ );}
512
+
513
+
514
+ /**
515
+ * @summary Create an ad-hoc invoice for a given account.
516
+ */
517
+ export type invoiceAddInvoiceResponse200 = {
518
+ data: Invoice
519
+ status: 200
520
+ }
521
+
522
+ export type invoiceAddInvoiceResponse401 = {
523
+ data: void
524
+ status: 401
525
+ }
526
+
527
+ export type invoiceAddInvoiceResponseSuccess = (invoiceAddInvoiceResponse200) & {
528
+ headers: Headers;
529
+ };
530
+ export type invoiceAddInvoiceResponseError = (invoiceAddInvoiceResponse401) & {
531
+ headers: Headers;
532
+ };
533
+
534
+ export type invoiceAddInvoiceResponse = (invoiceAddInvoiceResponseSuccess | invoiceAddInvoiceResponseError)
535
+
536
+ export const getInvoiceAddInvoiceUrl = () => {
537
+
538
+
539
+
540
+
541
+ return `/api/v1/billing/invoices`
542
+ }
543
+
544
+ export const invoiceAddInvoice = async (invoiceAddInvoiceBody: InvoiceAddInvoiceBody, options?: RequestInit): Promise<invoiceAddInvoiceResponse> => {
545
+
546
+ return customFetch<invoiceAddInvoiceResponse>(getInvoiceAddInvoiceUrl(),
547
+ {
548
+ ...options,
549
+ method: 'POST',
550
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
551
+ body: JSON.stringify(
552
+ invoiceAddInvoiceBody,)
553
+ }
554
+ );}
555
+
556
+
557
+ /**
558
+ * @summary Retrieves a subscription.
559
+ */
560
+ export type subscriptionGetSubscriptionResponse200 = {
561
+ data: Subscription
562
+ status: 200
563
+ }
564
+
565
+ export type subscriptionGetSubscriptionResponse400 = {
566
+ data: void
567
+ status: 400
568
+ }
569
+
570
+ export type subscriptionGetSubscriptionResponse401 = {
571
+ data: void
572
+ status: 401
573
+ }
574
+
575
+ export type subscriptionGetSubscriptionResponse404 = {
576
+ data: void
577
+ status: 404
578
+ }
579
+
580
+ export type subscriptionGetSubscriptionResponseSuccess = (subscriptionGetSubscriptionResponse200) & {
581
+ headers: Headers;
582
+ };
583
+ export type subscriptionGetSubscriptionResponseError = (subscriptionGetSubscriptionResponse400 | subscriptionGetSubscriptionResponse401 | subscriptionGetSubscriptionResponse404) & {
584
+ headers: Headers;
585
+ };
586
+
587
+ export type subscriptionGetSubscriptionResponse = (subscriptionGetSubscriptionResponseSuccess | subscriptionGetSubscriptionResponseError)
588
+
589
+ export const getSubscriptionGetSubscriptionUrl = (subscriptionUid: string | null,) => {
590
+
591
+
592
+
593
+
594
+ return `/api/v1/billing/subscriptions/${subscriptionUid}`
595
+ }
596
+
597
+ export const subscriptionGetSubscription = async (subscriptionUid: string | null, options?: RequestInit): Promise<subscriptionGetSubscriptionResponse> => {
598
+
599
+ return customFetch<subscriptionGetSubscriptionResponse>(getSubscriptionGetSubscriptionUrl(subscriptionUid),
600
+ {
601
+ ...options,
602
+ method: 'GET'
603
+
604
+
605
+ }
606
+ );}
607
+
608
+
609
+ /**
610
+ * @summary Add a discount to a subscription.
611
+ */
612
+ export type subscriptionAddDiscountToSubscriptionResponse200 = {
613
+ data: Blob
614
+ status: 200
615
+ }
616
+
617
+ export type subscriptionAddDiscountToSubscriptionResponse400 = {
618
+ data: void
619
+ status: 400
620
+ }
621
+
622
+ export type subscriptionAddDiscountToSubscriptionResponse401 = {
623
+ data: void
624
+ status: 401
625
+ }
626
+
627
+ export type subscriptionAddDiscountToSubscriptionResponse404 = {
628
+ data: void
629
+ status: 404
630
+ }
631
+
632
+ export type subscriptionAddDiscountToSubscriptionResponseSuccess = (subscriptionAddDiscountToSubscriptionResponse200) & {
633
+ headers: Headers;
634
+ };
635
+ export type subscriptionAddDiscountToSubscriptionResponseError = (subscriptionAddDiscountToSubscriptionResponse400 | subscriptionAddDiscountToSubscriptionResponse401 | subscriptionAddDiscountToSubscriptionResponse404) & {
636
+ headers: Headers;
637
+ };
638
+
639
+ export type subscriptionAddDiscountToSubscriptionResponse = (subscriptionAddDiscountToSubscriptionResponseSuccess | subscriptionAddDiscountToSubscriptionResponseError)
640
+
641
+ export const getSubscriptionAddDiscountToSubscriptionUrl = (subscriptionUid: string | null,
642
+ discountUid: string | null,) => {
643
+
644
+
645
+
646
+
647
+ return `/api/v1/billing/subscriptions/${subscriptionUid}/discounts/${discountUid}`
648
+ }
649
+
650
+ export const subscriptionAddDiscountToSubscription = async (subscriptionUid: string | null,
651
+ discountUid: string | null, options?: RequestInit): Promise<subscriptionAddDiscountToSubscriptionResponse> => {
652
+
653
+ return customFetch<subscriptionAddDiscountToSubscriptionResponse>(getSubscriptionAddDiscountToSubscriptionUrl(subscriptionUid,discountUid),
654
+ {
655
+ ...options,
656
+ method: 'POST'
657
+
658
+
659
+ }
660
+ );}
661
+
662
+
663
+ /**
664
+ * @summary Indicate that an upgrade of plan is required. When a subscription is flagged, next time
665
+ the user authenticates the authentication widget will prompt the user to change plan.
666
+ */
667
+ export type subscriptionSetSubscriptionUpgradeRequiredResponse200 = {
668
+ data: Subscription
669
+ status: 200
670
+ }
671
+
672
+ export type subscriptionSetSubscriptionUpgradeRequiredResponse400 = {
673
+ data: void
674
+ status: 400
675
+ }
676
+
677
+ export type subscriptionSetSubscriptionUpgradeRequiredResponse401 = {
678
+ data: void
679
+ status: 401
680
+ }
681
+
682
+ export type subscriptionSetSubscriptionUpgradeRequiredResponse404 = {
683
+ data: void
684
+ status: 404
685
+ }
686
+
687
+ export type subscriptionSetSubscriptionUpgradeRequiredResponseSuccess = (subscriptionSetSubscriptionUpgradeRequiredResponse200) & {
688
+ headers: Headers;
689
+ };
690
+ export type subscriptionSetSubscriptionUpgradeRequiredResponseError = (subscriptionSetSubscriptionUpgradeRequiredResponse400 | subscriptionSetSubscriptionUpgradeRequiredResponse401 | subscriptionSetSubscriptionUpgradeRequiredResponse404) & {
691
+ headers: Headers;
692
+ };
693
+
694
+ export type subscriptionSetSubscriptionUpgradeRequiredResponse = (subscriptionSetSubscriptionUpgradeRequiredResponseSuccess | subscriptionSetSubscriptionUpgradeRequiredResponseError)
695
+
696
+ export const getSubscriptionSetSubscriptionUpgradeRequiredUrl = (subscriptionUid: string | null,) => {
697
+
698
+
699
+
700
+
701
+ return `/api/v1/billing/subscriptions/${subscriptionUid}/setsubscriptionupgraderequired`
702
+ }
703
+
704
+ export const subscriptionSetSubscriptionUpgradeRequired = async (subscriptionUid: string | null,
705
+ subscriptionSetSubscriptionUpgradeRequiredBody: SubscriptionSetSubscriptionUpgradeRequiredBody, options?: RequestInit): Promise<subscriptionSetSubscriptionUpgradeRequiredResponse> => {
706
+
707
+ return customFetch<subscriptionSetSubscriptionUpgradeRequiredResponse>(getSubscriptionSetSubscriptionUpgradeRequiredUrl(subscriptionUid),
708
+ {
709
+ ...options,
710
+ method: 'PUT',
711
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
712
+ body: JSON.stringify(
713
+ subscriptionSetSubscriptionUpgradeRequiredBody,)
714
+ }
715
+ );}
716
+
717
+
718
+ /**
719
+ * @summary Preview what the initial or renewal invoice would look like if an account were to register
720
+ with this subscription. Returns an invoice object with information about the amount outstanding.
721
+ BillingRenewalTerm values: 1 = Monthly, 2 = Yearly, 3 = Quarterly, 4 = OneTime.
722
+ Pass asOf=renewal to see the renewal invoice instead of the initial invoice.
723
+ */
724
+ export type subscriptionFirstTimeSubscriptionPreviewResponse200 = {
725
+ data: Invoice
726
+ status: 200
727
+ }
728
+
729
+ export type subscriptionFirstTimeSubscriptionPreviewResponseSuccess = (subscriptionFirstTimeSubscriptionPreviewResponse200) & {
730
+ headers: Headers;
731
+ };
732
+ ;
733
+
734
+ export type subscriptionFirstTimeSubscriptionPreviewResponse = (subscriptionFirstTimeSubscriptionPreviewResponseSuccess)
735
+
736
+ export const getSubscriptionFirstTimeSubscriptionPreviewUrl = (params?: SubscriptionFirstTimeSubscriptionPreviewParams,) => {
737
+ const normalizedParams = new URLSearchParams();
738
+
739
+ Object.entries(params || {}).forEach(([key, value]) => {
740
+
741
+ if (value !== undefined) {
742
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
743
+ }
744
+ });
745
+
746
+ const stringifiedParams = normalizedParams.toString();
747
+
748
+ return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptions/compute-charge-summary?${stringifiedParams}` : `/api/v1/billing/subscriptions/compute-charge-summary`
749
+ }
750
+
751
+ export const subscriptionFirstTimeSubscriptionPreview = async (subscriptionFirstTimeSubscriptionPreviewBody: SubscriptionFirstTimeSubscriptionPreviewBody,
752
+ params?: SubscriptionFirstTimeSubscriptionPreviewParams, options?: RequestInit): Promise<subscriptionFirstTimeSubscriptionPreviewResponse> => {
753
+
754
+ return customFetch<subscriptionFirstTimeSubscriptionPreviewResponse>(getSubscriptionFirstTimeSubscriptionPreviewUrl(params),
755
+ {
756
+ ...options,
757
+ method: 'POST',
758
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
759
+ body: JSON.stringify(
760
+ subscriptionFirstTimeSubscriptionPreviewBody,)
761
+ }
762
+ );}
763
+
764
+
765
+ /**
766
+ * @summary Add a subscription to an account for the first time. Returns an invoice object
767
+ with information about the amount outstanding.
768
+ */
769
+ export type subscriptionFirstTimeSubscriptionResponse200 = {
770
+ data: Invoice
771
+ status: 200
772
+ }
773
+
774
+ export type subscriptionFirstTimeSubscriptionResponse401 = {
775
+ data: void
776
+ status: 401
777
+ }
778
+
779
+ export type subscriptionFirstTimeSubscriptionResponseSuccess = (subscriptionFirstTimeSubscriptionResponse200) & {
780
+ headers: Headers;
781
+ };
782
+ export type subscriptionFirstTimeSubscriptionResponseError = (subscriptionFirstTimeSubscriptionResponse401) & {
783
+ headers: Headers;
784
+ };
785
+
786
+ export type subscriptionFirstTimeSubscriptionResponse = (subscriptionFirstTimeSubscriptionResponseSuccess | subscriptionFirstTimeSubscriptionResponseError)
787
+
788
+ export const getSubscriptionFirstTimeSubscriptionUrl = () => {
789
+
790
+
791
+
792
+
793
+ return `/api/v1/billing/subscriptions/firsttimesubscription`
794
+ }
795
+
796
+ export const subscriptionFirstTimeSubscription = async (subscriptionFirstTimeSubscriptionBody: SubscriptionFirstTimeSubscriptionBody, options?: RequestInit): Promise<subscriptionFirstTimeSubscriptionResponse> => {
797
+
798
+ return customFetch<subscriptionFirstTimeSubscriptionResponse>(getSubscriptionFirstTimeSubscriptionUrl(),
799
+ {
800
+ ...options,
801
+ method: 'PUT',
802
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
803
+ body: JSON.stringify(
804
+ subscriptionFirstTimeSubscriptionBody,)
805
+ }
806
+ );}
807
+
808
+
809
+ /**
810
+ * @summary Preview what the invoice would look like when changing a subscription. Returns an invoice object
811
+ with information about the amount outstanding. This method does not commit the subscription change.
812
+ */
813
+ export type subscriptionChangeSubscriptionPreviewResponse200 = {
814
+ data: Invoice
815
+ status: 200
816
+ }
817
+
818
+ export type subscriptionChangeSubscriptionPreviewResponse400 = {
819
+ data: void
820
+ status: 400
821
+ }
822
+
823
+ export type subscriptionChangeSubscriptionPreviewResponse401 = {
824
+ data: void
825
+ status: 401
826
+ }
827
+
828
+ export type subscriptionChangeSubscriptionPreviewResponse404 = {
829
+ data: void
830
+ status: 404
831
+ }
832
+
833
+ export type subscriptionChangeSubscriptionPreviewResponseSuccess = (subscriptionChangeSubscriptionPreviewResponse200) & {
834
+ headers: Headers;
835
+ };
836
+ export type subscriptionChangeSubscriptionPreviewResponseError = (subscriptionChangeSubscriptionPreviewResponse400 | subscriptionChangeSubscriptionPreviewResponse401 | subscriptionChangeSubscriptionPreviewResponse404) & {
837
+ headers: Headers;
838
+ };
839
+
840
+ export type subscriptionChangeSubscriptionPreviewResponse = (subscriptionChangeSubscriptionPreviewResponseSuccess | subscriptionChangeSubscriptionPreviewResponseError)
841
+
842
+ export const getSubscriptionChangeSubscriptionPreviewUrl = (subscriptionUid: string | null,
843
+ params?: SubscriptionChangeSubscriptionPreviewParams,) => {
844
+ const normalizedParams = new URLSearchParams();
845
+
846
+ Object.entries(params || {}).forEach(([key, value]) => {
847
+
848
+ if (value !== undefined) {
849
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
850
+ }
851
+ });
852
+
853
+ const stringifiedParams = normalizedParams.toString();
854
+
855
+ return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscriptionpreview?${stringifiedParams}` : `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscriptionpreview`
856
+ }
857
+
858
+ export const subscriptionChangeSubscriptionPreview = async (subscriptionUid: string | null,
859
+ subscriptionChangeSubscriptionPreviewBody: SubscriptionChangeSubscriptionPreviewBody,
860
+ params?: SubscriptionChangeSubscriptionPreviewParams, options?: RequestInit): Promise<subscriptionChangeSubscriptionPreviewResponse> => {
861
+
862
+ return customFetch<subscriptionChangeSubscriptionPreviewResponse>(getSubscriptionChangeSubscriptionPreviewUrl(subscriptionUid,params),
863
+ {
864
+ ...options,
865
+ method: 'PUT',
866
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
867
+ body: JSON.stringify(
868
+ subscriptionChangeSubscriptionPreviewBody,)
869
+ }
870
+ );}
871
+
872
+
873
+ /**
874
+ * @summary Change a subscription on an account. Returns an invoice object with information about
875
+ the amount outstanding.
876
+ */
877
+ export type subscriptionChangeSubscriptionResponse200 = {
878
+ data: Subscription
879
+ status: 200
880
+ }
881
+
882
+ export type subscriptionChangeSubscriptionResponse400 = {
883
+ data: void
884
+ status: 400
885
+ }
886
+
887
+ export type subscriptionChangeSubscriptionResponse401 = {
888
+ data: void
889
+ status: 401
890
+ }
891
+
892
+ export type subscriptionChangeSubscriptionResponse404 = {
893
+ data: void
894
+ status: 404
895
+ }
896
+
897
+ export type subscriptionChangeSubscriptionResponseSuccess = (subscriptionChangeSubscriptionResponse200) & {
898
+ headers: Headers;
899
+ };
900
+ export type subscriptionChangeSubscriptionResponseError = (subscriptionChangeSubscriptionResponse400 | subscriptionChangeSubscriptionResponse401 | subscriptionChangeSubscriptionResponse404) & {
901
+ headers: Headers;
902
+ };
903
+
904
+ export type subscriptionChangeSubscriptionResponse = (subscriptionChangeSubscriptionResponseSuccess | subscriptionChangeSubscriptionResponseError)
905
+
906
+ export const getSubscriptionChangeSubscriptionUrl = (subscriptionUid: string | null,
907
+ params?: SubscriptionChangeSubscriptionParams,) => {
908
+ const normalizedParams = new URLSearchParams();
909
+
910
+ Object.entries(params || {}).forEach(([key, value]) => {
911
+
912
+ if (value !== undefined) {
913
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
914
+ }
915
+ });
916
+
917
+ const stringifiedParams = normalizedParams.toString();
918
+
919
+ return stringifiedParams.length > 0 ? `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscription?${stringifiedParams}` : `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscription`
920
+ }
921
+
922
+ export const subscriptionChangeSubscription = async (subscriptionUid: string | null,
923
+ subscriptionChangeSubscriptionBody: SubscriptionChangeSubscriptionBody,
924
+ params?: SubscriptionChangeSubscriptionParams, options?: RequestInit): Promise<subscriptionChangeSubscriptionResponse> => {
925
+
926
+ return customFetch<subscriptionChangeSubscriptionResponse>(getSubscriptionChangeSubscriptionUrl(subscriptionUid,params),
927
+ {
928
+ ...options,
929
+ method: 'PUT',
930
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
931
+ body: JSON.stringify(
932
+ subscriptionChangeSubscriptionBody,)
933
+ }
934
+ );}
935
+
936
+
937
+ /**
938
+ * @summary Retrieves all plans.
939
+ */
940
+ export type planGetAllPlansResponse200 = {
941
+ data: Plan[]
942
+ status: 200
943
+ }
944
+
945
+ export type planGetAllPlansResponseSuccess = (planGetAllPlansResponse200) & {
946
+ headers: Headers;
947
+ };
948
+ ;
949
+
950
+ export type planGetAllPlansResponse = (planGetAllPlansResponseSuccess)
951
+
952
+ export const getPlanGetAllPlansUrl = () => {
953
+
954
+
955
+
956
+
957
+ return `/api/v1/billing/plans`
958
+ }
959
+
960
+ export const planGetAllPlans = async ( options?: RequestInit): Promise<planGetAllPlansResponse> => {
961
+
962
+ return customFetch<planGetAllPlansResponse>(getPlanGetAllPlansUrl(),
963
+ {
964
+ ...options,
965
+ method: 'GET'
966
+
967
+
968
+ }
969
+ );}
970
+
971
+
972
+ /**
973
+ * @summary Retrieves all plan families.
974
+ */
975
+ export type planFamilyGetAllPlanFamiliesResponse200 = {
976
+ data: PlanFamily[]
977
+ status: 200
978
+ }
979
+
980
+ export type planFamilyGetAllPlanFamiliesResponseSuccess = (planFamilyGetAllPlanFamiliesResponse200) & {
981
+ headers: Headers;
982
+ };
983
+ ;
984
+
985
+ export type planFamilyGetAllPlanFamiliesResponse = (planFamilyGetAllPlanFamiliesResponseSuccess)
986
+
987
+ export const getPlanFamilyGetAllPlanFamiliesUrl = () => {
988
+
989
+
990
+
991
+
992
+ return `/api/v1/billing/planfamilies`
993
+ }
994
+
995
+ export const planFamilyGetAllPlanFamilies = async ( options?: RequestInit): Promise<planFamilyGetAllPlanFamiliesResponse> => {
996
+
997
+ return customFetch<planFamilyGetAllPlanFamiliesResponse>(getPlanFamilyGetAllPlanFamiliesUrl(),
998
+ {
999
+ ...options,
1000
+ method: 'GET'
1001
+
1002
+
1003
+ }
1004
+ );}
1005
+
1006
+