@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.
- package/README.md +6 -8
- package/dist/index.js +23 -19
- package/package.json +3 -6
- package/src/__tests__/accounts-crud.integration.test.ts +41 -39
- package/src/__tests__/client.test.ts +3 -3
- package/src/__tests__/people.integration.test.ts +28 -32
- package/src/__tests__/setup.ts +5 -6
- package/src/__tests__/support.integration.test.ts +28 -35
- package/src/client.ts +55 -24
- package/src/generated/activity/activity.ts +335 -0
- package/src/generated/billing/billing.ts +1006 -0
- package/src/generated/crm/crm.ts +1143 -1
- package/src/generated/email/email.ts +798 -0
- package/src/generated/models/accountAddPersonToAccountBody.ts +227 -0
- package/src/generated/models/accountCancelAccountBody.ts +227 -0
- package/src/generated/models/accountCancelationAllOf.ts +2 -0
- package/src/generated/models/accountExtendTrialBody.ts +227 -0
- package/src/generated/models/accountStage.ts +2 -1
- package/src/generated/models/accountUpdateAccountBody.ts +227 -0
- package/src/generated/models/accountUpdateMembershipBody.ts +227 -0
- package/src/generated/models/activityAddCustomActivityBody.ts +227 -0
- package/src/generated/models/activityGetAllParams.ts +241 -0
- package/src/generated/models/articleGetAllArticlesParams.ts +228 -0
- package/src/generated/models/backGroundTaskType.ts +3 -1
- package/src/generated/models/broadcastCampaignAllOf.ts +4 -0
- package/src/generated/models/broadcastCampaignStatus.ts +2 -1
- package/src/generated/models/campaignAddBroadcastEmailBody.ts +227 -0
- package/src/generated/models/campaignSendTestCampaignEmailBody.ts +227 -0
- package/src/generated/models/campaignUpdateBroadcastEmailBody.ts +227 -0
- package/src/generated/models/cancelationStatus.ts +236 -0
- package/src/generated/models/caseAddCaseBody.ts +227 -0
- package/src/generated/models/caseAddCaseParams.ts +229 -0
- package/src/generated/models/crmSettingsAllOf.ts +2 -0
- package/src/generated/models/dealAddDealBody.ts +227 -0
- package/src/generated/models/dealGetAllDealsParams.ts +234 -0
- package/src/generated/models/dealUpdateDealBody.ts +227 -0
- package/src/generated/models/discountCouponAddDiscountCouponBody.ts +227 -0
- package/src/generated/models/dnsEntry.ts +2 -0
- package/src/generated/models/emailListAddSubscriptionBody.ts +227 -0
- package/src/generated/models/emailListGetAllSubscriptionsParams.ts +229 -0
- package/src/generated/models/extendSubscriptionOptions.ts +225 -0
- package/src/generated/models/index.ts +40 -0
- package/src/generated/models/invoiceAddInvoiceBody.ts +227 -0
- package/src/generated/models/invoiceAllOf.ts +8 -0
- package/src/generated/models/messageAllOf.ts +1 -0
- package/src/generated/models/paymentInformationSavePaymentInformationBody.ts +227 -0
- package/src/generated/models/personAddPersonBody.ts +227 -0
- package/src/generated/models/personAllOf.ts +3 -3
- package/src/generated/models/personForgotPasswordBody.ts +227 -0
- package/src/generated/models/personGetAllPeopleParams.ts +229 -0
- package/src/generated/models/personSetTemporaryPasswordBody.ts +227 -0
- package/src/generated/models/personUpdatePersonBody.ts +227 -0
- package/src/generated/models/qcountConfigSettingType.ts +3 -1
- package/src/generated/models/resendEmailsRequest.ts +226 -0
- package/src/generated/models/sendGridDomainAuthenticationAllOf.ts +1 -0
- package/src/generated/models/setupIntent.ts +2 -0
- package/src/generated/models/stripeCreditNoteAllOf.ts +9 -0
- package/src/generated/models/stripeInvoiceAllOf.ts +9 -0
- package/src/generated/models/stripePriceAllOf.ts +2 -0
- package/src/generated/models/stripeProductAllOf.ts +5 -0
- package/src/generated/models/stripeSubscriptionAllOf.ts +4 -0
- package/src/generated/models/subscriptionAddOnAddSubscriptionAddOnBody.ts +227 -0
- package/src/generated/models/subscriptionChangeSubscriptionBody.ts +227 -0
- package/src/generated/models/subscriptionChangeSubscriptionParams.ts +229 -0
- package/src/generated/models/subscriptionChangeSubscriptionPreviewBody.ts +227 -0
- package/src/generated/models/subscriptionChangeSubscriptionPreviewParams.ts +229 -0
- package/src/generated/models/subscriptionFirstTimeSubscriptionBody.ts +227 -0
- package/src/generated/models/subscriptionFirstTimeSubscriptionPreviewBody.ts +227 -0
- package/src/generated/models/subscriptionFirstTimeSubscriptionPreviewParams.ts +229 -0
- package/src/generated/models/subscriptionSetSubscriptionUpgradeRequiredBody.ts +227 -0
- package/src/generated/models/transactionsAddPaymentTransactionBody.ts +227 -0
- package/src/generated/models/usageAddUsageBody.ts +227 -0
- package/src/generated/support/support.ts +341 -1
- package/src/index.ts +7 -1
- package/src/generated/zod.ts +0 -191087
|
@@ -0,0 +1,225 @@
|
|
|
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 ExtendSubscriptionOptions {
|
|
224
|
+
ToDate?: string;
|
|
225
|
+
}
|
|
@@ -271,6 +271,7 @@ export * from './acceptTermsAndConditionsLocations';
|
|
|
271
271
|
export * from './account';
|
|
272
272
|
export * from './accountAddAccountBody';
|
|
273
273
|
export * from './accountAddAccountParams';
|
|
274
|
+
export * from './accountAddPersonToAccountBody';
|
|
274
275
|
export * from './accountAllOf';
|
|
275
276
|
export * from './accountAllOfBillingAddress';
|
|
276
277
|
export * from './accountAllOfCurrentSubscription';
|
|
@@ -280,23 +281,29 @@ export * from './accountAllOfPaymentInformation';
|
|
|
280
281
|
export * from './accountAllOfPrimaryContact';
|
|
281
282
|
export * from './accountAllOfPrimaryStripeSubscription';
|
|
282
283
|
export * from './accountAllOfPrimarySubscription';
|
|
284
|
+
export * from './accountCancelAccountBody';
|
|
283
285
|
export * from './accountCancelation';
|
|
284
286
|
export * from './accountCancelationAllOf';
|
|
285
287
|
export * from './accountCancelationAllOfAccount';
|
|
286
288
|
export * from './accountCancelationAllOfLastPlan';
|
|
289
|
+
export * from './accountExtendTrialBody';
|
|
287
290
|
export * from './accountGetAllAccountsParams';
|
|
288
291
|
export * from './accountRegistrationMode';
|
|
289
292
|
export * from './accountStage';
|
|
290
293
|
export * from './accountTaxId';
|
|
291
294
|
export * from './accountTaxIdAllOf';
|
|
292
295
|
export * from './accountTaxIdAllOfAccount';
|
|
296
|
+
export * from './accountUpdateAccountBody';
|
|
297
|
+
export * from './accountUpdateMembershipBody';
|
|
293
298
|
export * from './activity';
|
|
299
|
+
export * from './activityAddCustomActivityBody';
|
|
294
300
|
export * from './activityAllOf';
|
|
295
301
|
export * from './activityCRMDealTrigger';
|
|
296
302
|
export * from './activityCRMDealTriggerAllOf';
|
|
297
303
|
export * from './activityCRMDealTriggerAllOfDealPipelineStage';
|
|
298
304
|
export * from './activityCriteria';
|
|
299
305
|
export * from './activityCriteriaActivityType';
|
|
306
|
+
export * from './activityGetAllParams';
|
|
300
307
|
export * from './activityNotification';
|
|
301
308
|
export * from './activityNotificationAllOf';
|
|
302
309
|
export * from './activityType';
|
|
@@ -311,6 +318,7 @@ export * from './apiKeyType';
|
|
|
311
318
|
export * from './article';
|
|
312
319
|
export * from './articleAllOf';
|
|
313
320
|
export * from './articleAllOfCategory';
|
|
321
|
+
export * from './articleGetAllArticlesParams';
|
|
314
322
|
export * from './backGroundTaskType';
|
|
315
323
|
export * from './billSettings';
|
|
316
324
|
export * from './billSettingsAllOf';
|
|
@@ -326,9 +334,15 @@ export * from './broadcastCampaignAllOfCampaign';
|
|
|
326
334
|
export * from './broadcastCampaignAllOfMessage';
|
|
327
335
|
export * from './broadcastCampaignStatus';
|
|
328
336
|
export * from './campaign';
|
|
337
|
+
export * from './campaignAddBroadcastEmailBody';
|
|
329
338
|
export * from './campaignAllOf';
|
|
339
|
+
export * from './campaignSendTestCampaignEmailBody';
|
|
330
340
|
export * from './campaignType';
|
|
341
|
+
export * from './campaignUpdateBroadcastEmailBody';
|
|
342
|
+
export * from './cancelationStatus';
|
|
331
343
|
export * from './case';
|
|
344
|
+
export * from './caseAddCaseBody';
|
|
345
|
+
export * from './caseAddCaseParams';
|
|
332
346
|
export * from './caseAllOf';
|
|
333
347
|
export * from './caseAllOfLastCaseHistory';
|
|
334
348
|
export * from './caseGetAllCasesParams';
|
|
@@ -356,10 +370,12 @@ export * from './database';
|
|
|
356
370
|
export * from './databaseAllOf';
|
|
357
371
|
export * from './databaseType';
|
|
358
372
|
export * from './deal';
|
|
373
|
+
export * from './dealAddDealBody';
|
|
359
374
|
export * from './dealAllOf';
|
|
360
375
|
export * from './dealAllOfAccount';
|
|
361
376
|
export * from './dealAllOfDealPipelineStage';
|
|
362
377
|
export * from './dealAllOfOwner';
|
|
378
|
+
export * from './dealGetAllDealsParams';
|
|
363
379
|
export * from './dealPerson';
|
|
364
380
|
export * from './dealPersonAllOf';
|
|
365
381
|
export * from './dealPersonAllOfDeal';
|
|
@@ -369,6 +385,7 @@ export * from './dealPipelineAllOf';
|
|
|
369
385
|
export * from './dealPipelineStage';
|
|
370
386
|
export * from './dealPipelineStageAllOf';
|
|
371
387
|
export * from './dealPipelineStageAllOfDealPipeline';
|
|
388
|
+
export * from './dealUpdateDealBody';
|
|
372
389
|
export * from './definition';
|
|
373
390
|
export * from './definitionAllOf';
|
|
374
391
|
export * from './deserializationStatus';
|
|
@@ -384,6 +401,7 @@ export * from './discordServerAllOf';
|
|
|
384
401
|
export * from './discordUser';
|
|
385
402
|
export * from './discordUserAllOf';
|
|
386
403
|
export * from './discountCoupon';
|
|
404
|
+
export * from './discountCouponAddDiscountCouponBody';
|
|
387
405
|
export * from './discountCouponAllOf';
|
|
388
406
|
export * from './discountCouponPlan';
|
|
389
407
|
export * from './discountCouponPlanAllOf';
|
|
@@ -404,7 +422,9 @@ export * from './dripCampaignMessageAllOfMessage';
|
|
|
404
422
|
export * from './emailLink';
|
|
405
423
|
export * from './emailLinkAllOf';
|
|
406
424
|
export * from './emailList';
|
|
425
|
+
export * from './emailListAddSubscriptionBody';
|
|
407
426
|
export * from './emailListAllOf';
|
|
427
|
+
export * from './emailListGetAllSubscriptionsParams';
|
|
408
428
|
export * from './emailListPerson';
|
|
409
429
|
export * from './emailListPersonAllOf';
|
|
410
430
|
export * from './emailListPersonAllOfEmailList';
|
|
@@ -413,10 +433,12 @@ export * from './emailListSubscriberStatus';
|
|
|
413
433
|
export * from './emailSubscriptionsPayload';
|
|
414
434
|
export * from './entityType';
|
|
415
435
|
export * from './extendRenewalParams';
|
|
436
|
+
export * from './extendSubscriptionOptions';
|
|
416
437
|
export * from './extendTrialParams';
|
|
417
438
|
export * from './flatfileImportData';
|
|
418
439
|
export * from './flatfileImportDataSchemalessData';
|
|
419
440
|
export * from './invoice';
|
|
441
|
+
export * from './invoiceAddInvoiceBody';
|
|
420
442
|
export * from './invoiceAllOf';
|
|
421
443
|
export * from './invoiceAllOfSubscription';
|
|
422
444
|
export * from './invoiceCreditOptions';
|
|
@@ -446,6 +468,7 @@ export * from './passwordPayload';
|
|
|
446
468
|
export * from './pauseCollectionOptions';
|
|
447
469
|
export * from './paymentInformation';
|
|
448
470
|
export * from './paymentInformationAllOf';
|
|
471
|
+
export * from './paymentInformationSavePaymentInformationBody';
|
|
449
472
|
export * from './paymentsGatewayActivationStatus';
|
|
450
473
|
export * from './paymentsMode';
|
|
451
474
|
export * from './person';
|
|
@@ -453,10 +476,15 @@ export * from './personAccount';
|
|
|
453
476
|
export * from './personAccountAllOf';
|
|
454
477
|
export * from './personAccountAllOfAccount';
|
|
455
478
|
export * from './personAccountAllOfPerson';
|
|
479
|
+
export * from './personAddPersonBody';
|
|
456
480
|
export * from './personAllOf';
|
|
457
481
|
export * from './personAllOfAccount';
|
|
458
482
|
export * from './personAllOfDiscordUser';
|
|
459
483
|
export * from './personAllOfMailingAddress';
|
|
484
|
+
export * from './personForgotPasswordBody';
|
|
485
|
+
export * from './personGetAllPeopleParams';
|
|
486
|
+
export * from './personSetTemporaryPasswordBody';
|
|
487
|
+
export * from './personUpdatePersonBody';
|
|
460
488
|
export * from './plan';
|
|
461
489
|
export * from './planAddOn';
|
|
462
490
|
export * from './planAddOnAllOf';
|
|
@@ -475,6 +503,7 @@ export * from './qcountConfigAllOf';
|
|
|
475
503
|
export * from './qcountConfigSettingType';
|
|
476
504
|
export * from './qcountStatus';
|
|
477
505
|
export * from './registrationField';
|
|
506
|
+
export * from './resendEmailsRequest';
|
|
478
507
|
export * from './segment';
|
|
479
508
|
export * from './segmentAllOf';
|
|
480
509
|
export * from './segmentPerson';
|
|
@@ -588,6 +617,7 @@ export * from './stripeSubscriptionSchedulePhaseItemAllOf';
|
|
|
588
617
|
export * from './stripeSubscriptionSchedulePhaseItemAllOfStripePrice';
|
|
589
618
|
export * from './subscription';
|
|
590
619
|
export * from './subscriptionAddOn';
|
|
620
|
+
export * from './subscriptionAddOnAddSubscriptionAddOnBody';
|
|
591
621
|
export * from './subscriptionAddOnAllOf';
|
|
592
622
|
export * from './subscriptionAddOnAllOfAddOn';
|
|
593
623
|
export * from './subscriptionAddOnAllOfSubscription';
|
|
@@ -595,6 +625,14 @@ export * from './subscriptionAllOf';
|
|
|
595
625
|
export * from './subscriptionAllOfAccount';
|
|
596
626
|
export * from './subscriptionAllOfLatestInvoice';
|
|
597
627
|
export * from './subscriptionAllOfPlan';
|
|
628
|
+
export * from './subscriptionChangeSubscriptionBody';
|
|
629
|
+
export * from './subscriptionChangeSubscriptionParams';
|
|
630
|
+
export * from './subscriptionChangeSubscriptionPreviewBody';
|
|
631
|
+
export * from './subscriptionChangeSubscriptionPreviewParams';
|
|
632
|
+
export * from './subscriptionFirstTimeSubscriptionBody';
|
|
633
|
+
export * from './subscriptionFirstTimeSubscriptionPreviewBody';
|
|
634
|
+
export * from './subscriptionFirstTimeSubscriptionPreviewParams';
|
|
635
|
+
export * from './subscriptionSetSubscriptionUpgradeRequiredBody';
|
|
598
636
|
export * from './supportArticleStatus';
|
|
599
637
|
export * from './supportCaseHistoryType';
|
|
600
638
|
export * from './supportCaseSource';
|
|
@@ -624,9 +662,11 @@ export * from './transaction';
|
|
|
624
662
|
export * from './transactionAllOf';
|
|
625
663
|
export * from './transactionAllOfAccount';
|
|
626
664
|
export * from './transactionAllOfInvoice';
|
|
665
|
+
export * from './transactionsAddPaymentTransactionBody';
|
|
627
666
|
export * from './translation';
|
|
628
667
|
export * from './translationAllOf';
|
|
629
668
|
export * from './usage';
|
|
669
|
+
export * from './usageAddUsageBody';
|
|
630
670
|
export * from './usageAllOf';
|
|
631
671
|
export * from './usageAllOfInvoice';
|
|
632
672
|
export * from './webflowCollection';
|
|
@@ -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 { Invoice } from './invoice';
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @nullable
|
|
226
|
+
*/
|
|
227
|
+
export type InvoiceAddInvoiceBody = Invoice | null;
|
|
@@ -252,5 +252,13 @@ export type InvoiceAllOf = {
|
|
|
252
252
|
AmountRefunded?: number;
|
|
253
253
|
AmountSubtotal?: number;
|
|
254
254
|
AmountTax?: number;
|
|
255
|
+
AmountTaxRefunded?: number;
|
|
255
256
|
IsTaxable?: boolean;
|
|
257
|
+
HasPaymentGatewayTransactions?: boolean;
|
|
258
|
+
/** @nullable */
|
|
259
|
+
StripePaymentTransactionIds?: string | null;
|
|
260
|
+
/** @nullable */
|
|
261
|
+
StripeRefundTransactionIds?: string | null;
|
|
262
|
+
/** @nullable */
|
|
263
|
+
StripeTaxRefundTransactionIds?: string | null;
|
|
256
264
|
};
|