@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
@@ -221,7 +221,7 @@ For help regarding the Outseta API please email [support@outseta.com](mailto:sup
221
221
  */
222
222
 
223
223
  /**
224
- * `100` - Slack, `102` - MagicLinkApiKey, `103` - MagicLinkApiKeySecret, `104` - OAuth_HideCreateAccountLink, `105` - Chat_IsOffline, `106` - HostedPageCustomCode, `107` - RegistrationConfirmationEmailDelaySeconds, `108` - AccountCancellationReasons, `110` - WebhookSignatureKey, `111` - HostedProfileBackLink, `112` - AccountCancellationReasonRequired, `114` - Email_OutsetaBrandingDisabled, `115` - Email_MarketingIpPool, `116` - Email_TransactionalIpPool, `117` - Email_LifecycleIpPool, `118` - Email_DomainAuthenticationConfigured, `119` - Email_BlacklistedInboundEmails, `120` - CRM_TeamMemberInviteEmailDisabled, `121` - PasswordPolicy, `123` - CRM_FieldSortingEnabled, `125` - KnowledgeBaseVersion, `126` - Support_SpamThreshold, `127` - Email_RestrictedPhrases, `128` - KnowledgeBaseLanguage, `130` - Billing_System, `131` - Billing_RestrictSubscriptionActions, `190` - Stripe_TaxEnabled, `192` - Stripe_TaxIdTypes, `193` - Stripe_ApplePayMerchantIdDomainAssociation, `194` - Stripe_WebhookSecret, `200` - Webflow_AccessToken, `201` - Webflow_SyncEnabled, `202` - Webflow_SyncConfiguration, `203` - Webflow_ApiVersion, `300` - SqsQueueEnabled, `301` - PersonSegmentationStatusEnabled, `304` - SqsCampaignEmailQueueEnabled, `310` - Account_AutoIncrementClientIdentifier, `402` - SqsEmailLogQueueUrlOverride, `500` - Logging_Webhook_Enabled, `501` - Logging_Activty_Enabled, `550` - CopyQcount_AddOnMap, `551` - CopyQcount_AccountMap, `552` - CopyQcount_DiscountCouponMap, `553` - CopyQcount_InvoiceMap, `554` - CopyQcount_PersonMap, `555` - CopyQcount_PlanMap, `556` - CopyQcount_PlanFamilyMap, `557` - CopyQcount_SubscriptionMap, `558` - CopyQcount_TransactionMap, `570` - StripeMigration_LastAccountId, `571` - StripeMigration_LastInvoiceId, `572` - StripeMigration_LastExpiredSubscriptionId, `573` - StripeMigration_LastPostExportSubscriptionId, `574` - StripeMigration_LastUsageId, `575` - StripeMigration_SubscriptionExportDate, `576` - StripeMigration_SubscriptionExportIds, `577` - StripeMigration_SubscriptionAddOnExportIds, `578` - StripeMigration_SubscriptionCutoverDate, `579` - StripeMigration_LastPreCutoverExportSubscriptionId, `601` - SqsSendGridWebHookEventQueueUrlOverride
224
+ * `100` - Slack, `102` - MagicLinkApiKey, `103` - MagicLinkApiKeySecret, `104` - OAuth_HideCreateAccountLink, `105` - Chat_IsOffline, `106` - HostedPageCustomCode, `107` - RegistrationConfirmationEmailDelaySeconds, `108` - AccountCancellationReasons, `110` - WebhookSignatureKey, `111` - HostedProfileBackLink, `112` - AccountCancellationReasonRequired, `114` - Email_OutsetaBrandingDisabled, `115` - Email_MarketingIpPool, `116` - Email_TransactionalIpPool, `117` - Email_LifecycleIpPool, `118` - Email_DomainAuthenticationConfigured, `119` - Email_BlacklistedInboundEmails, `120` - CRM_TeamMemberInviteEmailDisabled, `121` - PasswordPolicy, `123` - CRM_FieldSortingEnabled, `124` - CRM_RegistrationCallbackLocations, `125` - KnowledgeBaseVersion, `126` - Support_SpamThreshold, `127` - Email_RestrictedPhrases, `128` - KnowledgeBaseLanguage, `129` - Email_BroadcastGroupSendEnabled, `130` - Billing_System, `131` - Billing_RestrictSubscriptionActions, `190` - Stripe_TaxEnabled, `192` - Stripe_TaxIdTypes, `193` - Stripe_ApplePayMerchantIdDomainAssociation, `194` - Stripe_WebhookSecret, `200` - Webflow_AccessToken, `201` - Webflow_SyncEnabled, `202` - Webflow_SyncConfiguration, `203` - Webflow_ApiVersion, `300` - SqsQueueEnabled, `301` - PersonSegmentationStatusEnabled, `304` - SqsCampaignEmailQueueEnabled, `310` - Account_AutoIncrementClientIdentifier, `402` - SqsEmailLogQueueUrlOverride, `500` - Logging_Webhook_Enabled, `501` - Logging_Activty_Enabled, `550` - CopyQcount_AddOnMap, `551` - CopyQcount_AccountMap, `552` - CopyQcount_DiscountCouponMap, `553` - CopyQcount_InvoiceMap, `554` - CopyQcount_PersonMap, `555` - CopyQcount_PlanMap, `556` - CopyQcount_PlanFamilyMap, `557` - CopyQcount_SubscriptionMap, `558` - CopyQcount_TransactionMap, `570` - StripeMigration_LastAccountId, `571` - StripeMigration_LastInvoiceId, `572` - StripeMigration_LastExpiredSubscriptionId, `573` - StripeMigration_LastPostExportSubscriptionId, `574` - StripeMigration_LastUsageId, `575` - StripeMigration_SubscriptionExportDate, `576` - StripeMigration_SubscriptionExportIds, `577` - StripeMigration_SubscriptionAddOnExportIds, `578` - StripeMigration_SubscriptionCutoverDate, `579` - StripeMigration_LastPreCutoverExportSubscriptionId, `601` - SqsSendGridWebHookEventQueueUrlOverride
225
225
  */
226
226
  export type QcountConfigSettingType = typeof QcountConfigSettingType[keyof typeof QcountConfigSettingType];
227
227
 
@@ -248,10 +248,12 @@ export const QcountConfigSettingType = {
248
248
  CRM_TeamMemberInviteEmailDisabled: 120,
249
249
  PasswordPolicy: 121,
250
250
  CRM_FieldSortingEnabled: 123,
251
+ CRM_RegistrationCallbackLocations: 124,
251
252
  KnowledgeBaseVersion: 125,
252
253
  Support_SpamThreshold: 126,
253
254
  Email_RestrictedPhrases: 127,
254
255
  KnowledgeBaseLanguage: 128,
256
+ Email_BroadcastGroupSendEnabled: 129,
255
257
  Billing_System: 130,
256
258
  Billing_RestrictSubscriptionActions: 131,
257
259
  Stripe_TaxEnabled: 190,
@@ -0,0 +1,226 @@
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
+
223
+ export interface ResendEmailsRequest {
224
+ /** @nullable */
225
+ EmailLogUids?: string[] | null;
226
+ }
@@ -228,6 +228,7 @@ export type SendGridDomainAuthenticationAllOf = {
228
228
  */
229
229
  DomainName: string;
230
230
  IsValid?: boolean;
231
+ IsBrandedLinksDisabled?: boolean;
231
232
  /** @nullable */
232
233
  LastValidationAttempt?: string | null;
233
234
  /** @nullable */
@@ -248,4 +248,6 @@ export interface SetupIntent {
248
248
  PaymentToken?: string | null;
249
249
  /** @nullable */
250
250
  PlanUid?: string | null;
251
+ /** @nullable */
252
+ ToltReferralId?: string | null;
251
253
  }
@@ -236,6 +236,10 @@ export type StripeCreditNoteAllOf = {
236
236
  * @nullable
237
237
  */
238
238
  InvoiceId?: string | null;
239
+ /** @nullable */
240
+ OutOfBandAmount?: number | null;
241
+ PostPaymentAmount?: number;
242
+ PrePaymentAmount?: number;
239
243
  /**
240
244
  * @maxLength 30
241
245
  * @nullable
@@ -247,6 +251,11 @@ export type StripeCreditNoteAllOf = {
247
251
  */
248
252
  Status?: string | null;
249
253
  Total?: number;
254
+ /**
255
+ * @maxLength 30
256
+ * @nullable
257
+ */
258
+ Type?: string | null;
250
259
  /** @nullable */
251
260
  CurrencySymbol?: string | null;
252
261
  CurrencyTotal?: number;
@@ -239,6 +239,8 @@ export type StripeInvoiceAllOf = {
239
239
  Currency?: string | null;
240
240
  /** @nullable */
241
241
  Description?: string | null;
242
+ /** @nullable */
243
+ FinalizedAt?: string | null;
242
244
  /**
243
245
  * @maxLength 500
244
246
  * @nullable
@@ -274,6 +276,11 @@ export type StripeInvoiceAllOf = {
274
276
  SubTotal?: number;
275
277
  /** @nullable */
276
278
  SubTotalExcludingTax?: number | null;
279
+ /**
280
+ * @maxLength 255
281
+ * @nullable
282
+ */
283
+ SubscriptionId?: string | null;
277
284
  /** @nullable */
278
285
  Tax?: number | null;
279
286
  Total?: number;
@@ -282,6 +289,8 @@ export type StripeInvoiceAllOf = {
282
289
  /** @nullable */
283
290
  Account?: StripeInvoiceAllOfAccount;
284
291
  IsRefunded?: boolean;
292
+ CurrencyAmountCreditedPostPayment?: number;
293
+ CurrencyAmountCreditedPrePayment?: number;
285
294
  CurrencyAmountDue?: number;
286
295
  CurrencyAmountPaid?: number;
287
296
  /** @nullable */
@@ -278,6 +278,8 @@ export type StripePriceAllOf = {
278
278
  /** @nullable */
279
279
  CurrencyUnitAmountDecimal?: number | null;
280
280
  /** @nullable */
281
+ Recurring_IntervalDays?: number | null;
282
+ /** @nullable */
281
283
  Recurring_Description?: string | null;
282
284
  /** @nullable */
283
285
  StripeMeterId?: string | null;
@@ -231,6 +231,11 @@ export type StripeProductAllOf = {
231
231
  * @nullable
232
232
  */
233
233
  Name?: string | null;
234
+ /**
235
+ * @maxLength 255
236
+ * @nullable
237
+ */
238
+ DefaultPriceId?: string | null;
234
239
  /** @nullable */
235
240
  Description?: string | null;
236
241
  IsActive?: boolean;
@@ -265,8 +265,12 @@ export type StripeSubscriptionAllOf = {
265
265
  /** @nullable */
266
266
  AccountUid?: string | null;
267
267
  /** @nullable */
268
+ CollectionMethod?: string | null;
269
+ /** @nullable */
268
270
  CustomerId?: string | null;
269
271
  /** @nullable */
272
+ DaysUntilDue?: number | null;
273
+ /** @nullable */
270
274
  ScheduleId?: string | null;
271
275
  /** @nullable */
272
276
  StripeDiscountIds?: string[] | null;
@@ -0,0 +1,227 @@
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 { SubscriptionAddOn } from './subscriptionAddOn';
223
+
224
+ /**
225
+ * @nullable
226
+ */
227
+ export type SubscriptionAddOnAddSubscriptionAddOnBody = SubscriptionAddOn | null;