atmn 1.1.25 → 2.0.0
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 +120 -0
- package/dist/bin.js +23102 -0
- package/dist/index.js +2906 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -74
- package/src/actions/api/callApi.ts +280 -0
- package/src/actions/api/registerApiCommands.ts +121 -0
- package/src/actions/env/fetchOrgInfo.ts +32 -0
- package/src/actions/env/types/orgInfo.ts +18 -0
- package/src/actions/env.ts +94 -0
- package/src/actions/init/runInit.ts +401 -0
- package/src/actions/login/keyless.ts +135 -0
- package/src/actions/login.ts +144 -0
- package/src/actions/pull/appendPlanVersionFixture.ts +373 -0
- package/src/actions/pull/applyPreview.ts +553 -0
- package/src/actions/pull/applySettingsPreview.ts +114 -0
- package/src/actions/pull/changedFixtureKeys.ts +88 -0
- package/src/actions/pull/listSourceFiles.ts +29 -0
- package/src/actions/pull/locateFixture.ts +78 -0
- package/src/actions/pull/resolveCollectionTarget.ts +198 -0
- package/src/actions/pull/rewriteConfig.ts +57 -0
- package/src/actions/pull/scaffoldConfig.ts +118 -0
- package/src/actions/pull.ts +399 -0
- package/src/actions/push/backfillInternalIds.ts +394 -0
- package/src/actions/push/deprecatedFields.ts +55 -0
- package/src/actions/push.ts +294 -0
- package/src/actions/reset/runReset.ts +58 -0
- package/src/actions/sandbox/createSandbox.ts +83 -0
- package/src/actions/sandbox/deleteSandbox.ts +91 -0
- package/src/actions/sandbox/listSandboxes.ts +28 -0
- package/src/actions/sandbox/types/sandboxClient.ts +16 -0
- package/src/actions/sandbox/useSandbox.ts +157 -0
- package/src/actions/sandbox/withSandboxScopeHint.ts +27 -0
- package/src/actions/skills/skills.ts +246 -0
- package/src/auth/announceAuthorizationUrl.ts +26 -0
- package/src/auth/browser/openSystemBrowser.ts +7 -0
- package/src/auth/browser/tryOpenBrowser.ts +17 -0
- package/src/auth/browser/watchLauncher.ts +46 -0
- package/src/auth/buildAuthorizationUrl.ts +36 -0
- package/src/auth/callbackPages.ts +126 -0
- package/src/auth/createOrgApiKeys.ts +46 -0
- package/src/auth/keyless.ts +119 -0
- package/src/auth/oauthConfig.ts +63 -0
- package/src/auth/runOAuthFlow.ts +230 -0
- package/src/auth/types/browserOpener.ts +5 -0
- package/src/auth/types/impersonationTokens.ts +23 -0
- package/src/auth/types/oauthTokens.ts +13 -0
- package/src/auth/types/orgApiKeys.ts +6 -0
- package/src/bin.ts +9 -0
- package/src/cli.ts +648 -0
- package/src/config/configPackageName.ts +9 -0
- package/src/config/legacyConfig.ts +25 -0
- package/src/config/loadConfig.ts +231 -0
- package/src/env/assertSandboxTarget.ts +20 -0
- package/src/env/loadEnv.ts +184 -0
- package/src/env/resolveTarget.ts +134 -0
- package/src/env/sandboxKeyName.ts +18 -0
- package/src/generated/apiRoutes.ts +3787 -0
- package/src/generated/client.ts +51564 -0
- package/src/generated/emit.ts +1163 -0
- package/src/generated/emitRuntime.ts +522 -0
- package/src/generated/features.ts +146 -0
- package/src/generated/labels.ts +29 -0
- package/src/generated/licenses.ts +287 -0
- package/src/generated/lintRules.ts +2207 -0
- package/src/generated/lintRuntime.ts +865 -0
- package/src/generated/plans.ts +1628 -0
- package/src/generated/referralPrograms.ts +22 -0
- package/src/generated/rewards.ts +58 -0
- package/src/generated/settings.ts +21 -0
- package/src/generated/skills.ts +305 -0
- package/src/generated/variants.ts +934 -0
- package/src/generated/wire.ts +334 -0
- package/src/http/autumnFetch.ts +30 -0
- package/src/index.ts +20 -0
- package/src/project/chooseConfigDir.ts +41 -0
- package/src/project/resolveProject.ts +115 -0
- package/src/project/rootMarker.ts +40 -0
- package/src/prompt/prompt.ts +186 -0
- package/src/prompt/select.ts +162 -0
- package/src/render/renderEnv.ts +77 -0
- package/src/render/renderPreview.ts +945 -0
- package/src/render/renderSandboxes.ts +92 -0
- package/src/render/stripTerminalControls.ts +19 -0
- package/src/repo/findRepoRoot.ts +79 -0
- package/src/surgery/appendPropertyEdit.ts +67 -0
- package/src/surgery/appendToArray.ts +87 -0
- package/src/surgery/appendToBinding.ts +19 -0
- package/src/surgery/appendToCollection.ts +40 -0
- package/src/surgery/appendToFixtureArray.ts +71 -0
- package/src/surgery/arrayBinding.ts +30 -0
- package/src/surgery/deleteFixtureLiteral.ts +81 -0
- package/src/surgery/deleteReference.ts +48 -0
- package/src/surgery/ensureBuilderImport.ts +65 -0
- package/src/surgery/findFixture.ts +238 -0
- package/src/surgery/fixtureEdit.ts +156 -0
- package/src/surgery/fixtureLocation.ts +32 -0
- package/src/surgery/insertCollection.ts +86 -0
- package/src/surgery/insertFirstProperty.ts +73 -0
- package/src/surgery/patchFixtureProperty.ts +152 -0
- package/src/surgery/patchSingletonProperty.ts +221 -0
- package/src/surgery/replaceFixture.ts +28 -0
- package/src/surgery/setFixtureProperty.ts +55 -0
- package/src/surgery/staticFixtureRule.ts +48 -0
- package/src/version.ts +5 -0
- package/dist/cli.js +0 -146296
- package/dist/compose/index.js +0 -122
- package/dist/src/compose/builders/builderFunctions.d.ts +0 -84
- package/dist/src/compose/builders/rewardFunctions.d.ts +0 -5
- package/dist/src/compose/builders/variantFunctions.d.ts +0 -2
- package/dist/src/compose/index.d.ts +0 -19
- package/dist/src/compose/models/featureModels.d.ts +0 -262
- package/dist/src/compose/models/index.d.ts +0 -3
- package/dist/src/compose/models/planModels.d.ts +0 -562
- package/dist/src/compose/models/rewardModels.d.ts +0 -52
- package/dist/src/compose/models/variantModels.d.ts +0 -34
- package/readme.md +0 -186
|
@@ -0,0 +1,3787 @@
|
|
|
1
|
+
// Generated by @autumn/atmn-generator from packages/openapi/openapi.yml (the public spec).
|
|
2
|
+
// Do not edit — run `bun generate` in packages/atmn-generator instead.
|
|
3
|
+
|
|
4
|
+
export type ApiFieldType = "string" | "number" | "boolean" | "json";
|
|
5
|
+
|
|
6
|
+
export type ApiField = {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly type: ApiFieldType;
|
|
9
|
+
readonly required: boolean;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type ApiRoute = {
|
|
14
|
+
readonly group: string;
|
|
15
|
+
readonly method: string;
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly description?: string;
|
|
18
|
+
/** `array` bodies (batch routes) take JSON only; `none` takes nothing. */
|
|
19
|
+
readonly body: "object" | "array" | "none";
|
|
20
|
+
readonly fields: readonly ApiField[];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** The x-api-version every request carries: the spec's default. */
|
|
24
|
+
export const API_VERSION = "2.4.0";
|
|
25
|
+
|
|
26
|
+
export const API_ROUTES: readonly ApiRoute[] = [
|
|
27
|
+
{
|
|
28
|
+
group: "customers",
|
|
29
|
+
method: "get_or_create",
|
|
30
|
+
path: "/v1/customers.get_or_create",
|
|
31
|
+
description:
|
|
32
|
+
"Creates a customer if they do not exist, or returns the existing customer by your external customer ID.",
|
|
33
|
+
body: "object",
|
|
34
|
+
fields: [
|
|
35
|
+
{
|
|
36
|
+
name: "customer_id",
|
|
37
|
+
type: "string",
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "name",
|
|
42
|
+
type: "string",
|
|
43
|
+
required: false,
|
|
44
|
+
description: "Customer's name",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "email",
|
|
48
|
+
type: "string",
|
|
49
|
+
required: false,
|
|
50
|
+
description: "Customer's email address",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "fingerprint",
|
|
54
|
+
type: "string",
|
|
55
|
+
required: false,
|
|
56
|
+
description:
|
|
57
|
+
"Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "metadata",
|
|
61
|
+
type: "json",
|
|
62
|
+
required: false,
|
|
63
|
+
description: "Additional metadata for the customer",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "stripe_id",
|
|
67
|
+
type: "string",
|
|
68
|
+
required: false,
|
|
69
|
+
description: "Stripe customer ID if you already have one",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "create_in_stripe",
|
|
73
|
+
type: "boolean",
|
|
74
|
+
required: false,
|
|
75
|
+
description: "Whether to create the customer in Stripe",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "auto_enable_plan_id",
|
|
79
|
+
type: "string",
|
|
80
|
+
required: false,
|
|
81
|
+
description: "The ID of the free plan to auto-enable for the customer",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "send_email_receipts",
|
|
85
|
+
type: "boolean",
|
|
86
|
+
required: false,
|
|
87
|
+
description: "Whether to send email receipts to this customer",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "currency",
|
|
91
|
+
type: "string",
|
|
92
|
+
required: false,
|
|
93
|
+
description:
|
|
94
|
+
"Currency to bill this customer in (e.g. usd, eur). Defaults to the organization's default currency.",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "billing_controls",
|
|
98
|
+
type: "json",
|
|
99
|
+
required: false,
|
|
100
|
+
description: "Billing controls for the customer (auto top-ups, etc.)",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "config",
|
|
104
|
+
type: "json",
|
|
105
|
+
required: false,
|
|
106
|
+
description: "Miscellaneous configurations for the customer.",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "expand",
|
|
110
|
+
type: "json",
|
|
111
|
+
required: false,
|
|
112
|
+
description:
|
|
113
|
+
"Fields to expand in the returned customer response, such as subscriptions.plan, purchases.plan, balances.feature, or flags.feature.",
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
group: "customers",
|
|
119
|
+
method: "get",
|
|
120
|
+
path: "/v1/customers.get",
|
|
121
|
+
description:
|
|
122
|
+
"Fetches a customer by ID, optionally expanding related data such as invoices or entities.",
|
|
123
|
+
body: "object",
|
|
124
|
+
fields: [
|
|
125
|
+
{
|
|
126
|
+
name: "customer_id",
|
|
127
|
+
type: "string",
|
|
128
|
+
required: true,
|
|
129
|
+
description: "ID of the customer to fetch",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "expand",
|
|
133
|
+
type: "json",
|
|
134
|
+
required: false,
|
|
135
|
+
description:
|
|
136
|
+
"Expand related customer data like invoices or entities, or expand nested objects like balances.feature, flags.feature, subscriptions.plan, and purchases.plan.",
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
group: "customers",
|
|
142
|
+
method: "list",
|
|
143
|
+
path: "/v1/customers.list",
|
|
144
|
+
description:
|
|
145
|
+
'Lists customers with cursor pagination and optional filters. Pass `start_cursor: ""` (or omit) for the first page; use `next_cursor` from a prior response for subsequent pages.',
|
|
146
|
+
body: "object",
|
|
147
|
+
fields: [
|
|
148
|
+
{
|
|
149
|
+
name: "start_cursor",
|
|
150
|
+
type: "string",
|
|
151
|
+
required: false,
|
|
152
|
+
description:
|
|
153
|
+
"Opaque pagination cursor. Empty string (default) requests the first page; use next_cursor from a prior response for subsequent pages.",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "limit",
|
|
157
|
+
type: "number",
|
|
158
|
+
required: false,
|
|
159
|
+
description:
|
|
160
|
+
"Number of items to return. Default 50, hard ceiling 5000.",
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "plans",
|
|
164
|
+
type: "json",
|
|
165
|
+
required: false,
|
|
166
|
+
description:
|
|
167
|
+
"Filter by plan ID and version. Returns customers with active subscriptions to this plan.",
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "subscription_status",
|
|
171
|
+
type: "string",
|
|
172
|
+
required: false,
|
|
173
|
+
description:
|
|
174
|
+
"Filter by customer product status. Defaults to active and scheduled.",
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "search",
|
|
178
|
+
type: "string",
|
|
179
|
+
required: false,
|
|
180
|
+
description: "Search customers by id, name, or email.",
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "processors",
|
|
184
|
+
type: "json",
|
|
185
|
+
required: false,
|
|
186
|
+
description:
|
|
187
|
+
"Filter by customer processor type (stripe, revenuecat, vercel).",
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: "sort_order",
|
|
191
|
+
type: "string",
|
|
192
|
+
required: false,
|
|
193
|
+
description:
|
|
194
|
+
"Sort by customer creation time. Defaults to desc (newest first).",
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "created_at_range",
|
|
198
|
+
type: "json",
|
|
199
|
+
required: false,
|
|
200
|
+
description:
|
|
201
|
+
"Filter by customer creation time (epoch milliseconds, inclusive bounds).",
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
group: "customers",
|
|
207
|
+
method: "update",
|
|
208
|
+
path: "/v1/customers.update",
|
|
209
|
+
description: "Updates an existing customer by ID.",
|
|
210
|
+
body: "object",
|
|
211
|
+
fields: [
|
|
212
|
+
{
|
|
213
|
+
name: "customer_id",
|
|
214
|
+
type: "string",
|
|
215
|
+
required: true,
|
|
216
|
+
description: "ID of the customer to update",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "name",
|
|
220
|
+
type: "string",
|
|
221
|
+
required: false,
|
|
222
|
+
description: "Customer's name",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "email",
|
|
226
|
+
type: "string",
|
|
227
|
+
required: false,
|
|
228
|
+
description: "Customer's email address",
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: "fingerprint",
|
|
232
|
+
type: "string",
|
|
233
|
+
required: false,
|
|
234
|
+
description:
|
|
235
|
+
"Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse",
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "metadata",
|
|
239
|
+
type: "json",
|
|
240
|
+
required: false,
|
|
241
|
+
description: "Additional metadata for the customer",
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "stripe_id",
|
|
245
|
+
type: "string",
|
|
246
|
+
required: false,
|
|
247
|
+
description: "Stripe customer ID if you already have one",
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "send_email_receipts",
|
|
251
|
+
type: "boolean",
|
|
252
|
+
required: false,
|
|
253
|
+
description: "Whether to send email receipts to this customer",
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: "currency",
|
|
257
|
+
type: "string",
|
|
258
|
+
required: false,
|
|
259
|
+
description:
|
|
260
|
+
"Currency to bill this customer in (e.g. usd, eur). Defaults to the organization's default currency.",
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: "billing_controls",
|
|
264
|
+
type: "json",
|
|
265
|
+
required: false,
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: "config",
|
|
269
|
+
type: "json",
|
|
270
|
+
required: false,
|
|
271
|
+
description: "Miscellaneous configurations for the customer.",
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "new_customer_id",
|
|
275
|
+
type: "string",
|
|
276
|
+
required: false,
|
|
277
|
+
description: "New ID for the customer",
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
group: "customers",
|
|
283
|
+
method: "delete",
|
|
284
|
+
path: "/v1/customers.delete",
|
|
285
|
+
description: "Deletes a customer by ID.",
|
|
286
|
+
body: "object",
|
|
287
|
+
fields: [
|
|
288
|
+
{
|
|
289
|
+
name: "customer_id",
|
|
290
|
+
type: "string",
|
|
291
|
+
required: true,
|
|
292
|
+
description: "ID of the customer to delete",
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "delete_in_stripe",
|
|
296
|
+
type: "boolean",
|
|
297
|
+
required: false,
|
|
298
|
+
description: "Whether to also delete the customer in Stripe",
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
group: "plans",
|
|
304
|
+
method: "create",
|
|
305
|
+
path: "/v1/plans.create",
|
|
306
|
+
description:
|
|
307
|
+
"Creates a new plan with optional base price and feature configurations.",
|
|
308
|
+
body: "object",
|
|
309
|
+
fields: [
|
|
310
|
+
{
|
|
311
|
+
name: "plan_id",
|
|
312
|
+
type: "string",
|
|
313
|
+
required: true,
|
|
314
|
+
description: "The ID of the plan to create.",
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: "group",
|
|
318
|
+
type: "string",
|
|
319
|
+
required: false,
|
|
320
|
+
description:
|
|
321
|
+
"Group identifier for organizing related plans. Plans in the same group are mutually exclusive.",
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
name: "name",
|
|
325
|
+
type: "string",
|
|
326
|
+
required: true,
|
|
327
|
+
description: "Display name of the plan.",
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: "description",
|
|
331
|
+
type: "string",
|
|
332
|
+
required: false,
|
|
333
|
+
description: "Optional description of the plan.",
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: "add_on",
|
|
337
|
+
type: "boolean",
|
|
338
|
+
required: false,
|
|
339
|
+
description:
|
|
340
|
+
"If true, this plan can be attached alongside other plans. Otherwise, attaching replaces existing plans in the same group.",
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: "auto_enable",
|
|
344
|
+
type: "boolean",
|
|
345
|
+
required: false,
|
|
346
|
+
description:
|
|
347
|
+
"If true, plan is automatically attached when a customer is created. Use for free tiers.",
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: "price",
|
|
351
|
+
type: "json",
|
|
352
|
+
required: false,
|
|
353
|
+
description:
|
|
354
|
+
"Base recurring price for the plan. Omit for free or usage-only plans.",
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
name: "items",
|
|
358
|
+
type: "json",
|
|
359
|
+
required: false,
|
|
360
|
+
description:
|
|
361
|
+
"Feature configurations for this plan. Each item defines included units, pricing, and reset behavior.",
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
name: "licenses",
|
|
365
|
+
type: "json",
|
|
366
|
+
required: false,
|
|
367
|
+
description:
|
|
368
|
+
"Plans offered as assignable licenses under this plan. The full set replaces existing links.",
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
name: "free_trial",
|
|
372
|
+
type: "json",
|
|
373
|
+
required: false,
|
|
374
|
+
description:
|
|
375
|
+
"Free trial configuration. Customers can try this plan before being charged.",
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
name: "config",
|
|
379
|
+
type: "json",
|
|
380
|
+
required: false,
|
|
381
|
+
description: "Miscellaneous plan-level configuration flags.",
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
name: "billing_controls",
|
|
385
|
+
type: "json",
|
|
386
|
+
required: false,
|
|
387
|
+
description: "Plan-level billing controls used as customer defaults.",
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: "metadata",
|
|
391
|
+
type: "json",
|
|
392
|
+
required: false,
|
|
393
|
+
description:
|
|
394
|
+
"Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan.",
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: "create_in_stripe",
|
|
398
|
+
type: "boolean",
|
|
399
|
+
required: false,
|
|
400
|
+
},
|
|
401
|
+
],
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
group: "plans",
|
|
405
|
+
method: "get",
|
|
406
|
+
path: "/v1/plans.get",
|
|
407
|
+
description: "Retrieves a single plan by its ID.",
|
|
408
|
+
body: "object",
|
|
409
|
+
fields: [
|
|
410
|
+
{
|
|
411
|
+
name: "plan_id",
|
|
412
|
+
type: "string",
|
|
413
|
+
required: true,
|
|
414
|
+
description: "The ID of the plan to retrieve.",
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: "version",
|
|
418
|
+
type: "number",
|
|
419
|
+
required: false,
|
|
420
|
+
description:
|
|
421
|
+
"The version of the plan to get. Defaults to the latest version.",
|
|
422
|
+
},
|
|
423
|
+
],
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
group: "plans",
|
|
427
|
+
method: "list",
|
|
428
|
+
path: "/v1/plans.list",
|
|
429
|
+
description: "Lists all plans in the current environment.",
|
|
430
|
+
body: "object",
|
|
431
|
+
fields: [
|
|
432
|
+
{
|
|
433
|
+
name: "customer_id",
|
|
434
|
+
type: "string",
|
|
435
|
+
required: false,
|
|
436
|
+
description:
|
|
437
|
+
"Customer ID to include eligibility info (trial availability, attach scenario).",
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
name: "entity_id",
|
|
441
|
+
type: "string",
|
|
442
|
+
required: false,
|
|
443
|
+
description: "Entity ID for entity-scoped plans.",
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
name: "include_archived",
|
|
447
|
+
type: "boolean",
|
|
448
|
+
required: false,
|
|
449
|
+
description: "If true, includes archived plans in the response.",
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
name: "all_versions",
|
|
453
|
+
type: "boolean",
|
|
454
|
+
required: false,
|
|
455
|
+
description: "If true, includes all plan versions.",
|
|
456
|
+
},
|
|
457
|
+
],
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
group: "plans",
|
|
461
|
+
method: "update",
|
|
462
|
+
path: "/v1/plans.update",
|
|
463
|
+
description:
|
|
464
|
+
"Updates an existing plan. Creates a new version unless `disableVersion` is set.",
|
|
465
|
+
body: "object",
|
|
466
|
+
fields: [
|
|
467
|
+
{
|
|
468
|
+
name: "plan_id",
|
|
469
|
+
type: "string",
|
|
470
|
+
required: true,
|
|
471
|
+
description: "The ID of the plan to update.",
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
name: "group",
|
|
475
|
+
type: "string",
|
|
476
|
+
required: false,
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
name: "name",
|
|
480
|
+
type: "string",
|
|
481
|
+
required: false,
|
|
482
|
+
description: "Display name of the plan.",
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
name: "description",
|
|
486
|
+
type: "string",
|
|
487
|
+
required: false,
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
name: "add_on",
|
|
491
|
+
type: "boolean",
|
|
492
|
+
required: false,
|
|
493
|
+
description: "Whether the plan is an add-on.",
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
name: "auto_enable",
|
|
497
|
+
type: "boolean",
|
|
498
|
+
required: false,
|
|
499
|
+
description: "Whether the plan is automatically enabled.",
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
name: "price",
|
|
503
|
+
type: "json",
|
|
504
|
+
required: false,
|
|
505
|
+
description:
|
|
506
|
+
"The price of the plan. Set to null to remove the base price.",
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
name: "items",
|
|
510
|
+
type: "json",
|
|
511
|
+
required: false,
|
|
512
|
+
description:
|
|
513
|
+
"Feature configurations for this plan. Each item defines included units, pricing, and reset behavior.",
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
name: "licenses",
|
|
517
|
+
type: "json",
|
|
518
|
+
required: false,
|
|
519
|
+
description:
|
|
520
|
+
"Plans offered as assignable licenses under this plan. The full set replaces existing links.",
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: "free_trial",
|
|
524
|
+
type: "json",
|
|
525
|
+
required: false,
|
|
526
|
+
description:
|
|
527
|
+
"The free trial of the plan. Set to null to remove the free trial.",
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
name: "config",
|
|
531
|
+
type: "json",
|
|
532
|
+
required: false,
|
|
533
|
+
description: "Miscellaneous plan-level configuration flags.",
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: "billing_controls",
|
|
537
|
+
type: "json",
|
|
538
|
+
required: false,
|
|
539
|
+
description: "Plan-level billing controls used as customer defaults.",
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
name: "metadata",
|
|
543
|
+
type: "json",
|
|
544
|
+
required: false,
|
|
545
|
+
description:
|
|
546
|
+
"Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan.",
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
name: "create_in_stripe",
|
|
550
|
+
type: "boolean",
|
|
551
|
+
required: false,
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
name: "version",
|
|
555
|
+
type: "number",
|
|
556
|
+
required: false,
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
name: "archived",
|
|
560
|
+
type: "boolean",
|
|
561
|
+
required: false,
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
name: "base_plan_id",
|
|
565
|
+
type: "string",
|
|
566
|
+
required: false,
|
|
567
|
+
description:
|
|
568
|
+
"The base plan this plan should be linked to as a variant. Set to null to detach it from its base plan.",
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
name: "new_plan_id",
|
|
572
|
+
type: "string",
|
|
573
|
+
required: false,
|
|
574
|
+
description:
|
|
575
|
+
"The new ID to use for the plan. Can only be updated if the plan has not been used by any customers.",
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
name: "disable_version",
|
|
579
|
+
type: "boolean",
|
|
580
|
+
required: false,
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
name: "all_versions",
|
|
584
|
+
type: "boolean",
|
|
585
|
+
required: false,
|
|
586
|
+
description:
|
|
587
|
+
"Apply the update diff to all versions of this plan. Mutually exclusive with disable_version.",
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: "migration",
|
|
591
|
+
type: "json",
|
|
592
|
+
required: false,
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
name: "force_version",
|
|
596
|
+
type: "boolean",
|
|
597
|
+
required: false,
|
|
598
|
+
description:
|
|
599
|
+
"Force versioning even when no customers exist. Mutually exclusive with disable_version.",
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
name: "update_variant_ids",
|
|
603
|
+
type: "json",
|
|
604
|
+
required: false,
|
|
605
|
+
description:
|
|
606
|
+
"Variant plan IDs to apply this update to. Empty or omitted means no propagation.",
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
name: "update_license_parents",
|
|
610
|
+
type: "json",
|
|
611
|
+
required: false,
|
|
612
|
+
description:
|
|
613
|
+
"Parent plan versions that should receive this license-plan update.",
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
name: "variants",
|
|
617
|
+
type: "json",
|
|
618
|
+
required: false,
|
|
619
|
+
description:
|
|
620
|
+
"Additive variant updates for this base plan. Missing variants are created when name is provided.",
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
name: "is_default",
|
|
624
|
+
type: "boolean",
|
|
625
|
+
required: false,
|
|
626
|
+
description:
|
|
627
|
+
"Whether this is the org's default plan. Cannot be true on a variant.",
|
|
628
|
+
},
|
|
629
|
+
],
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
group: "plans",
|
|
633
|
+
method: "delete",
|
|
634
|
+
path: "/v1/plans.delete",
|
|
635
|
+
description: "Deletes a plan by its ID.",
|
|
636
|
+
body: "object",
|
|
637
|
+
fields: [
|
|
638
|
+
{
|
|
639
|
+
name: "plan_id",
|
|
640
|
+
type: "string",
|
|
641
|
+
required: true,
|
|
642
|
+
description: "The ID of the plan to delete.",
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
name: "all_versions",
|
|
646
|
+
type: "boolean",
|
|
647
|
+
required: false,
|
|
648
|
+
description:
|
|
649
|
+
"If true, deletes all versions of the plan. Otherwise, only deletes the latest version.",
|
|
650
|
+
},
|
|
651
|
+
],
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
group: "features",
|
|
655
|
+
method: "create",
|
|
656
|
+
path: "/v1/features.create",
|
|
657
|
+
description: "Creates a new feature.",
|
|
658
|
+
body: "object",
|
|
659
|
+
fields: [
|
|
660
|
+
{
|
|
661
|
+
name: "name",
|
|
662
|
+
type: "string",
|
|
663
|
+
required: true,
|
|
664
|
+
description: "The name of the feature.",
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
name: "type",
|
|
668
|
+
type: "string",
|
|
669
|
+
required: true,
|
|
670
|
+
description:
|
|
671
|
+
"The type of the feature. 'single_use' features are consumed, like API calls, tokens, or messages. 'continuous_use' features are allocated, like seats, workspaces, or projects. 'credit_system' features are schemas that unify multiple 'single_use' features into a single credit system.",
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
name: "consumable",
|
|
675
|
+
type: "boolean",
|
|
676
|
+
required: false,
|
|
677
|
+
description:
|
|
678
|
+
"Whether this feature is consumable. A consumable feature is one that periodically resets and is consumed rather than allocated (like credits, API requests, etc.). Applicable only for 'metered' features.",
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
name: "display",
|
|
682
|
+
type: "json",
|
|
683
|
+
required: false,
|
|
684
|
+
description:
|
|
685
|
+
"Singular and plural display names for the feature in your user interface.",
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
name: "credit_schema",
|
|
689
|
+
type: "json",
|
|
690
|
+
required: false,
|
|
691
|
+
description:
|
|
692
|
+
"A schema that maps metered feature IDs to flat or graduated credit costs. For classic credit systems only — AI credit systems use model_markups instead.",
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
name: "model_markups",
|
|
696
|
+
type: "json",
|
|
697
|
+
required: false,
|
|
698
|
+
description:
|
|
699
|
+
"Per-model markup overrides for AI credit systems. Maps model IDs to their markup configuration.",
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: "default_markup",
|
|
703
|
+
type: "number",
|
|
704
|
+
required: false,
|
|
705
|
+
description:
|
|
706
|
+
"Default percentage markup for this AI credit system. Used when no model or provider markup applies. Use -100 to make usage free.",
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
name: "provider_markups",
|
|
710
|
+
type: "json",
|
|
711
|
+
required: false,
|
|
712
|
+
description:
|
|
713
|
+
"Per-provider default markup percentages for AI credit systems. Provider keys match the first segment of model_id.",
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
name: "event_names",
|
|
717
|
+
type: "json",
|
|
718
|
+
required: false,
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
name: "feature_id",
|
|
722
|
+
type: "string",
|
|
723
|
+
required: true,
|
|
724
|
+
description: "The ID of the feature to create.",
|
|
725
|
+
},
|
|
726
|
+
],
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
group: "features",
|
|
730
|
+
method: "get",
|
|
731
|
+
path: "/v1/features.get",
|
|
732
|
+
description: "Retrieves a single feature by its ID.",
|
|
733
|
+
body: "object",
|
|
734
|
+
fields: [
|
|
735
|
+
{
|
|
736
|
+
name: "feature_id",
|
|
737
|
+
type: "string",
|
|
738
|
+
required: true,
|
|
739
|
+
description: "The ID of the feature.",
|
|
740
|
+
},
|
|
741
|
+
],
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
group: "features",
|
|
745
|
+
method: "list",
|
|
746
|
+
path: "/v1/features.list",
|
|
747
|
+
description: "Lists all features in the current environment.",
|
|
748
|
+
body: "none",
|
|
749
|
+
fields: [],
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
group: "features",
|
|
753
|
+
method: "update",
|
|
754
|
+
path: "/v1/features.update",
|
|
755
|
+
description: "Updates an existing feature.",
|
|
756
|
+
body: "object",
|
|
757
|
+
fields: [
|
|
758
|
+
{
|
|
759
|
+
name: "name",
|
|
760
|
+
type: "string",
|
|
761
|
+
required: false,
|
|
762
|
+
description: "The name of the feature.",
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
name: "type",
|
|
766
|
+
type: "string",
|
|
767
|
+
required: false,
|
|
768
|
+
description:
|
|
769
|
+
"The type of the feature. 'single_use' features are consumed, like API calls, tokens, or messages. 'continuous_use' features are allocated, like seats, workspaces, or projects. 'credit_system' features are schemas that unify multiple 'single_use' features into a single credit system.",
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
name: "consumable",
|
|
773
|
+
type: "boolean",
|
|
774
|
+
required: false,
|
|
775
|
+
description:
|
|
776
|
+
"Whether this feature is consumable. A consumable feature is one that periodically resets and is consumed rather than allocated (like credits, API requests, etc.). Applicable only for 'metered' features.",
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
name: "display",
|
|
780
|
+
type: "json",
|
|
781
|
+
required: false,
|
|
782
|
+
description:
|
|
783
|
+
"Singular and plural display names for the feature in your user interface.",
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
name: "credit_schema",
|
|
787
|
+
type: "json",
|
|
788
|
+
required: false,
|
|
789
|
+
description:
|
|
790
|
+
"A schema that maps metered feature IDs to flat or graduated credit costs. For classic credit systems only — AI credit systems use model_markups instead.",
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
name: "model_markups",
|
|
794
|
+
type: "json",
|
|
795
|
+
required: false,
|
|
796
|
+
description:
|
|
797
|
+
"Per-model markup overrides for AI credit systems. Maps model IDs to their markup configuration.",
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
name: "default_markup",
|
|
801
|
+
type: "number",
|
|
802
|
+
required: false,
|
|
803
|
+
description:
|
|
804
|
+
"Default percentage markup for this AI credit system. Used when no model or provider markup applies. Use -100 to make usage free.",
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
name: "provider_markups",
|
|
808
|
+
type: "json",
|
|
809
|
+
required: false,
|
|
810
|
+
description:
|
|
811
|
+
"Per-provider default markup percentages for AI credit systems. Provider keys match the first segment of model_id.",
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
name: "event_names",
|
|
815
|
+
type: "json",
|
|
816
|
+
required: false,
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
name: "archived",
|
|
820
|
+
type: "boolean",
|
|
821
|
+
required: false,
|
|
822
|
+
description:
|
|
823
|
+
"Whether the feature is archived. Archived features are hidden from the dashboard.",
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
name: "feature_id",
|
|
827
|
+
type: "string",
|
|
828
|
+
required: true,
|
|
829
|
+
description: "The ID of the feature to update.",
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
name: "new_feature_id",
|
|
833
|
+
type: "string",
|
|
834
|
+
required: false,
|
|
835
|
+
description:
|
|
836
|
+
"The new ID of the feature. Feature ID can only be updated if it's not being used by any customers.",
|
|
837
|
+
},
|
|
838
|
+
],
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
group: "features",
|
|
842
|
+
method: "delete",
|
|
843
|
+
path: "/v1/features.delete",
|
|
844
|
+
description: "Deletes a feature by its ID.",
|
|
845
|
+
body: "object",
|
|
846
|
+
fields: [
|
|
847
|
+
{
|
|
848
|
+
name: "feature_id",
|
|
849
|
+
type: "string",
|
|
850
|
+
required: true,
|
|
851
|
+
description: "The ID of the feature to delete.",
|
|
852
|
+
},
|
|
853
|
+
],
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
group: "billing",
|
|
857
|
+
method: "attach",
|
|
858
|
+
path: "/v1/billing.attach",
|
|
859
|
+
description:
|
|
860
|
+
"Attaches a plan to a customer. Handles new subscriptions, upgrades and downgrades.",
|
|
861
|
+
body: "object",
|
|
862
|
+
fields: [
|
|
863
|
+
{
|
|
864
|
+
name: "customer_id",
|
|
865
|
+
type: "string",
|
|
866
|
+
required: true,
|
|
867
|
+
description: "The ID of the customer to attach the plan to.",
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
name: "entity_id",
|
|
871
|
+
type: "string",
|
|
872
|
+
required: false,
|
|
873
|
+
description: "The ID of the entity to attach the plan to.",
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
name: "plan_id",
|
|
877
|
+
type: "string",
|
|
878
|
+
required: true,
|
|
879
|
+
description: "The ID of the plan.",
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
name: "feature_quantities",
|
|
883
|
+
type: "json",
|
|
884
|
+
required: false,
|
|
885
|
+
description:
|
|
886
|
+
"If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.",
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
name: "version",
|
|
890
|
+
type: "number",
|
|
891
|
+
required: false,
|
|
892
|
+
description: "The version of the plan to attach.",
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
name: "free_trial",
|
|
896
|
+
type: "json",
|
|
897
|
+
required: false,
|
|
898
|
+
description:
|
|
899
|
+
"Free trial for this plan. A shorthand for customize.free_trial, which takes precedence when both are given.",
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
name: "customize",
|
|
903
|
+
type: "json",
|
|
904
|
+
required: false,
|
|
905
|
+
description:
|
|
906
|
+
"Customize the plan to attach. Can override the price, items, licenses, free trial, or a combination.",
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
name: "invoice_mode",
|
|
910
|
+
type: "json",
|
|
911
|
+
required: false,
|
|
912
|
+
description:
|
|
913
|
+
"Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. This uses Stripe's send_invoice collection method.",
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
name: "proration_behavior",
|
|
917
|
+
type: "string",
|
|
918
|
+
required: false,
|
|
919
|
+
description:
|
|
920
|
+
"How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.",
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
name: "redirect_mode",
|
|
924
|
+
type: "string",
|
|
925
|
+
required: false,
|
|
926
|
+
description:
|
|
927
|
+
"Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.",
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
name: "subscription_id",
|
|
931
|
+
type: "string",
|
|
932
|
+
required: false,
|
|
933
|
+
description:
|
|
934
|
+
"A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.",
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
name: "discounts",
|
|
938
|
+
type: "json",
|
|
939
|
+
required: false,
|
|
940
|
+
description:
|
|
941
|
+
"List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.",
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
name: "success_url",
|
|
945
|
+
type: "string",
|
|
946
|
+
required: false,
|
|
947
|
+
description: "URL to redirect to after successful checkout.",
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
name: "new_billing_subscription",
|
|
951
|
+
type: "boolean",
|
|
952
|
+
required: false,
|
|
953
|
+
description:
|
|
954
|
+
"Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.",
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
name: "billing_cycle_anchor",
|
|
958
|
+
type: "json",
|
|
959
|
+
required: false,
|
|
960
|
+
description:
|
|
961
|
+
"Reset the billing cycle immediately with 'now', or schedule a reset at a future Unix timestamp in milliseconds.",
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
name: "plan_schedule",
|
|
965
|
+
type: "string",
|
|
966
|
+
required: false,
|
|
967
|
+
description:
|
|
968
|
+
"When the plan change should take effect. 'immediate' applies now, 'end_of_cycle' schedules for the end of the current billing cycle. By default, upgrades are immediate and downgrades are scheduled.",
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
name: "starts_at",
|
|
972
|
+
type: "number",
|
|
973
|
+
required: false,
|
|
974
|
+
description:
|
|
975
|
+
"Unix timestamp in milliseconds for when the attached plan should start. Future dates create a scheduled subscription.",
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
name: "ends_at",
|
|
979
|
+
type: "number",
|
|
980
|
+
required: false,
|
|
981
|
+
description:
|
|
982
|
+
"Unix timestamp in milliseconds for when the attached plan should end.",
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
name: "checkout_session_params",
|
|
986
|
+
type: "json",
|
|
987
|
+
required: false,
|
|
988
|
+
description:
|
|
989
|
+
"Additional parameters to pass into the creation of the Stripe checkout session.",
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
name: "long_lived_checkout",
|
|
993
|
+
type: "boolean",
|
|
994
|
+
required: false,
|
|
995
|
+
description:
|
|
996
|
+
"If true, returns an Autumn-hosted checkout link that can create a fresh Stripe checkout session when opened.",
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
name: "custom_line_items",
|
|
1000
|
+
type: "json",
|
|
1001
|
+
required: false,
|
|
1002
|
+
description:
|
|
1003
|
+
"Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans).",
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
name: "processor_subscription_id",
|
|
1007
|
+
type: "string",
|
|
1008
|
+
required: false,
|
|
1009
|
+
description:
|
|
1010
|
+
"The processor subscription ID to link. Use this to attach an existing Stripe subscription instead of creating a new one.",
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
name: "carry_over_balances",
|
|
1014
|
+
type: "json",
|
|
1015
|
+
required: false,
|
|
1016
|
+
description: "Whether to carry over balances from the previous plan.",
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
name: "carry_over_usages",
|
|
1020
|
+
type: "json",
|
|
1021
|
+
required: false,
|
|
1022
|
+
description: "Whether to carry over usages from the previous plan.",
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
name: "license_quantities",
|
|
1026
|
+
type: "json",
|
|
1027
|
+
required: false,
|
|
1028
|
+
description:
|
|
1029
|
+
"Seat quantities for the plan's licenses, keyed by license plan.",
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
name: "metadata",
|
|
1033
|
+
type: "json",
|
|
1034
|
+
required: false,
|
|
1035
|
+
description:
|
|
1036
|
+
"Key-value metadata to attach to the Stripe subscription, invoice, and checkout session created during this attach flow. Keys prefixed with 'autumn_' are reserved and will be stripped.",
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
name: "no_billing_changes",
|
|
1040
|
+
type: "boolean",
|
|
1041
|
+
required: false,
|
|
1042
|
+
description:
|
|
1043
|
+
"If true, skips any billing changes for the attach operation.",
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
name: "enable_plan_immediately",
|
|
1047
|
+
type: "boolean",
|
|
1048
|
+
required: false,
|
|
1049
|
+
description:
|
|
1050
|
+
"If true, the customer's plan is activated immediately even when payment is deferred (invoice mode) or pending (Stripe checkout). For Stripe checkout, the customer_product is inserted before the customer completes the hosted form. Set it here rather than on `invoice_mode`, which only covers the invoice-unpaid case.",
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
name: "tax_rate_id",
|
|
1054
|
+
type: "string",
|
|
1055
|
+
required: false,
|
|
1056
|
+
description:
|
|
1057
|
+
"Stripe tax rate ID (txr_...) to apply as the default tax rate on the created subscription, invoice, or checkout session line items.",
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
name: "currency",
|
|
1061
|
+
type: "string",
|
|
1062
|
+
required: false,
|
|
1063
|
+
description:
|
|
1064
|
+
"Currency to bill this attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and the plan must offer a paid price in it. Defaults to the customer's currency, then the org default.",
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
name: "remove_plan_ids",
|
|
1068
|
+
type: "json",
|
|
1069
|
+
required: false,
|
|
1070
|
+
description:
|
|
1071
|
+
"Plan IDs to expire on the customer as part of this attach. Each must be an active plan billed on the same subscription as the attach (or a free plan); plans on a separate subscription are rejected.",
|
|
1072
|
+
},
|
|
1073
|
+
],
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
group: "billing",
|
|
1077
|
+
method: "create_schedule",
|
|
1078
|
+
path: "/v1/billing.create_schedule",
|
|
1079
|
+
description:
|
|
1080
|
+
"Creates a multi-phase subscription schedule for a customer. The first phase starts immediately and subsequent phases automatically transition at their scheduled start times.",
|
|
1081
|
+
body: "object",
|
|
1082
|
+
fields: [
|
|
1083
|
+
{
|
|
1084
|
+
name: "customer_id",
|
|
1085
|
+
type: "string",
|
|
1086
|
+
required: true,
|
|
1087
|
+
description: "The ID of the customer to create the schedule for.",
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
name: "entity_id",
|
|
1091
|
+
type: "string",
|
|
1092
|
+
required: false,
|
|
1093
|
+
description: "Optional entity ID for an entity-scoped schedule.",
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
name: "free_trial",
|
|
1097
|
+
type: "json",
|
|
1098
|
+
required: false,
|
|
1099
|
+
description:
|
|
1100
|
+
"Free trial configuration applied to every plan in the immediate phase.",
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
name: "currency",
|
|
1104
|
+
type: "string",
|
|
1105
|
+
required: false,
|
|
1106
|
+
description:
|
|
1107
|
+
"Three-letter Stripe-supported currency code used to bill the immediate phase (for example, 'usd').",
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
name: "invoice_mode",
|
|
1111
|
+
type: "json",
|
|
1112
|
+
required: false,
|
|
1113
|
+
description:
|
|
1114
|
+
"Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase.",
|
|
1115
|
+
},
|
|
1116
|
+
{
|
|
1117
|
+
name: "discounts",
|
|
1118
|
+
type: "json",
|
|
1119
|
+
required: false,
|
|
1120
|
+
description:
|
|
1121
|
+
"List of discounts to apply to the immediate phase. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.",
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
name: "success_url",
|
|
1125
|
+
type: "string",
|
|
1126
|
+
required: false,
|
|
1127
|
+
description: "URL to redirect to after successful checkout.",
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
name: "checkout_session_params",
|
|
1131
|
+
type: "json",
|
|
1132
|
+
required: false,
|
|
1133
|
+
description:
|
|
1134
|
+
"Additional parameters to pass into the creation of the Stripe checkout session.",
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
name: "redirect_mode",
|
|
1138
|
+
type: "string",
|
|
1139
|
+
required: false,
|
|
1140
|
+
description:
|
|
1141
|
+
"Controls when to return a checkout URL for the immediate phase. 'always' forces a confirmation or checkout flow, 'if_required' only redirects when needed, and 'never' disables redirects.",
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
name: "billing_behavior",
|
|
1145
|
+
type: "string",
|
|
1146
|
+
required: false,
|
|
1147
|
+
description:
|
|
1148
|
+
"Whether to prorate the immediate phase. 'none' skips proration charges and credits.",
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
name: "no_billing_changes",
|
|
1152
|
+
type: "boolean",
|
|
1153
|
+
required: false,
|
|
1154
|
+
description: "If true, skips any billing changes for the schedule.",
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
name: "billing_cycle_anchor",
|
|
1158
|
+
type: "json",
|
|
1159
|
+
required: false,
|
|
1160
|
+
description:
|
|
1161
|
+
"Pass 'now' to reset the billing cycle anchor of the immediate phase to the current time.",
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
name: "enable_plan_immediately",
|
|
1165
|
+
type: "boolean",
|
|
1166
|
+
required: false,
|
|
1167
|
+
description:
|
|
1168
|
+
"If true, the immediate-phase cusProducts are activated immediately (and scheduled-phase cusProducts pre-inserted) even when payment is pending via Stripe checkout. The Autumn schedule rows are persisted on checkout.session.completed.",
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
name: "preserve_add_ons",
|
|
1172
|
+
type: "boolean",
|
|
1173
|
+
required: false,
|
|
1174
|
+
description:
|
|
1175
|
+
"Deprecated and ignored. Active plans the schedule does not declare are always retained.",
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
name: "unscheduled_plans",
|
|
1179
|
+
type: "json",
|
|
1180
|
+
required: false,
|
|
1181
|
+
description:
|
|
1182
|
+
"Plans billed with the immediate phase that the schedule never expires or replaces. No phase may declare a plan in the same group and scope.",
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
name: "phases",
|
|
1186
|
+
type: "json",
|
|
1187
|
+
required: true,
|
|
1188
|
+
description: "Ordered phase definitions for the schedule.",
|
|
1189
|
+
},
|
|
1190
|
+
],
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
group: "billing",
|
|
1194
|
+
method: "multi_attach",
|
|
1195
|
+
path: "/v1/billing.multi_attach",
|
|
1196
|
+
description:
|
|
1197
|
+
"Attaches multiple plans to a customer in a single request. Creates a single Stripe subscription with all plans consolidated.",
|
|
1198
|
+
body: "object",
|
|
1199
|
+
fields: [
|
|
1200
|
+
{
|
|
1201
|
+
name: "customer_id",
|
|
1202
|
+
type: "string",
|
|
1203
|
+
required: true,
|
|
1204
|
+
description: "The ID of the customer to attach the plans to.",
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
name: "entity_id",
|
|
1208
|
+
type: "string",
|
|
1209
|
+
required: false,
|
|
1210
|
+
description: "The ID of the entity to attach the plans to.",
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
name: "plans",
|
|
1214
|
+
type: "json",
|
|
1215
|
+
required: true,
|
|
1216
|
+
description: "The list of plans to attach to the customer.",
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
name: "free_trial",
|
|
1220
|
+
type: "json",
|
|
1221
|
+
required: false,
|
|
1222
|
+
description:
|
|
1223
|
+
"Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial.",
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
name: "starts_at",
|
|
1227
|
+
type: "number",
|
|
1228
|
+
required: false,
|
|
1229
|
+
description:
|
|
1230
|
+
"Unix timestamp in milliseconds for backdating every plan in this multi-attach.",
|
|
1231
|
+
},
|
|
1232
|
+
{
|
|
1233
|
+
name: "currency",
|
|
1234
|
+
type: "string",
|
|
1235
|
+
required: false,
|
|
1236
|
+
description:
|
|
1237
|
+
"Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.",
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
name: "invoice_mode",
|
|
1241
|
+
type: "json",
|
|
1242
|
+
required: false,
|
|
1243
|
+
description:
|
|
1244
|
+
"Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.",
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
name: "discounts",
|
|
1248
|
+
type: "json",
|
|
1249
|
+
required: false,
|
|
1250
|
+
description:
|
|
1251
|
+
"List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.",
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
name: "billing_behavior",
|
|
1255
|
+
type: "string",
|
|
1256
|
+
required: false,
|
|
1257
|
+
description:
|
|
1258
|
+
"How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.",
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
name: "billing_cycle_anchor",
|
|
1262
|
+
type: "json",
|
|
1263
|
+
required: false,
|
|
1264
|
+
description:
|
|
1265
|
+
"Pass 'now' to reset the billing cycle of every plan on the subscription to the time of this request.",
|
|
1266
|
+
},
|
|
1267
|
+
{
|
|
1268
|
+
name: "success_url",
|
|
1269
|
+
type: "string",
|
|
1270
|
+
required: false,
|
|
1271
|
+
description: "URL to redirect to after successful checkout.",
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
name: "checkout_session_params",
|
|
1275
|
+
type: "json",
|
|
1276
|
+
required: false,
|
|
1277
|
+
description:
|
|
1278
|
+
"Additional parameters to pass into the creation of the Stripe checkout session.",
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
name: "redirect_mode",
|
|
1282
|
+
type: "string",
|
|
1283
|
+
required: false,
|
|
1284
|
+
description:
|
|
1285
|
+
"Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.",
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
name: "new_billing_subscription",
|
|
1289
|
+
type: "boolean",
|
|
1290
|
+
required: false,
|
|
1291
|
+
description:
|
|
1292
|
+
"Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.",
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
name: "enable_plan_immediately",
|
|
1296
|
+
type: "boolean",
|
|
1297
|
+
required: false,
|
|
1298
|
+
description:
|
|
1299
|
+
"If true, the cusProducts are activated immediately even when payment is pending via Stripe checkout.",
|
|
1300
|
+
},
|
|
1301
|
+
{
|
|
1302
|
+
name: "customer_data",
|
|
1303
|
+
type: "json",
|
|
1304
|
+
required: false,
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
name: "entity_data",
|
|
1308
|
+
type: "json",
|
|
1309
|
+
required: false,
|
|
1310
|
+
},
|
|
1311
|
+
],
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
group: "billing",
|
|
1315
|
+
method: "preview_attach",
|
|
1316
|
+
path: "/v1/billing.preview_attach",
|
|
1317
|
+
description:
|
|
1318
|
+
"Previews the billing changes that would occur when attaching a plan, without actually making any changes.",
|
|
1319
|
+
body: "object",
|
|
1320
|
+
fields: [
|
|
1321
|
+
{
|
|
1322
|
+
name: "customer_id",
|
|
1323
|
+
type: "string",
|
|
1324
|
+
required: true,
|
|
1325
|
+
description: "The ID of the customer to attach the plan to.",
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
name: "entity_id",
|
|
1329
|
+
type: "string",
|
|
1330
|
+
required: false,
|
|
1331
|
+
description: "The ID of the entity to attach the plan to.",
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
name: "plan_id",
|
|
1335
|
+
type: "string",
|
|
1336
|
+
required: true,
|
|
1337
|
+
description: "The ID of the plan.",
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
name: "feature_quantities",
|
|
1341
|
+
type: "json",
|
|
1342
|
+
required: false,
|
|
1343
|
+
description:
|
|
1344
|
+
"If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.",
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
name: "version",
|
|
1348
|
+
type: "number",
|
|
1349
|
+
required: false,
|
|
1350
|
+
description: "The version of the plan to attach.",
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
name: "free_trial",
|
|
1354
|
+
type: "json",
|
|
1355
|
+
required: false,
|
|
1356
|
+
description:
|
|
1357
|
+
"Free trial for this plan. A shorthand for customize.free_trial, which takes precedence when both are given.",
|
|
1358
|
+
},
|
|
1359
|
+
{
|
|
1360
|
+
name: "customize",
|
|
1361
|
+
type: "json",
|
|
1362
|
+
required: false,
|
|
1363
|
+
description:
|
|
1364
|
+
"Customize the plan to attach. Can override the price, items, licenses, free trial, or a combination.",
|
|
1365
|
+
},
|
|
1366
|
+
{
|
|
1367
|
+
name: "invoice_mode",
|
|
1368
|
+
type: "json",
|
|
1369
|
+
required: false,
|
|
1370
|
+
description:
|
|
1371
|
+
"Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. This uses Stripe's send_invoice collection method.",
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
name: "proration_behavior",
|
|
1375
|
+
type: "string",
|
|
1376
|
+
required: false,
|
|
1377
|
+
description:
|
|
1378
|
+
"How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.",
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
name: "redirect_mode",
|
|
1382
|
+
type: "string",
|
|
1383
|
+
required: false,
|
|
1384
|
+
description:
|
|
1385
|
+
"Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.",
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
name: "subscription_id",
|
|
1389
|
+
type: "string",
|
|
1390
|
+
required: false,
|
|
1391
|
+
description:
|
|
1392
|
+
"A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.",
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
name: "discounts",
|
|
1396
|
+
type: "json",
|
|
1397
|
+
required: false,
|
|
1398
|
+
description:
|
|
1399
|
+
"List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.",
|
|
1400
|
+
},
|
|
1401
|
+
{
|
|
1402
|
+
name: "success_url",
|
|
1403
|
+
type: "string",
|
|
1404
|
+
required: false,
|
|
1405
|
+
description: "URL to redirect to after successful checkout.",
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
name: "new_billing_subscription",
|
|
1409
|
+
type: "boolean",
|
|
1410
|
+
required: false,
|
|
1411
|
+
description:
|
|
1412
|
+
"Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.",
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
name: "billing_cycle_anchor",
|
|
1416
|
+
type: "json",
|
|
1417
|
+
required: false,
|
|
1418
|
+
description:
|
|
1419
|
+
"Reset the billing cycle immediately with 'now', or schedule a reset at a future Unix timestamp in milliseconds.",
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
name: "plan_schedule",
|
|
1423
|
+
type: "string",
|
|
1424
|
+
required: false,
|
|
1425
|
+
description:
|
|
1426
|
+
"When the plan change should take effect. 'immediate' applies now, 'end_of_cycle' schedules for the end of the current billing cycle. By default, upgrades are immediate and downgrades are scheduled.",
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
name: "starts_at",
|
|
1430
|
+
type: "number",
|
|
1431
|
+
required: false,
|
|
1432
|
+
description:
|
|
1433
|
+
"Unix timestamp in milliseconds for when the attached plan should start. Future dates create a scheduled subscription.",
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
name: "ends_at",
|
|
1437
|
+
type: "number",
|
|
1438
|
+
required: false,
|
|
1439
|
+
description:
|
|
1440
|
+
"Unix timestamp in milliseconds for when the attached plan should end.",
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
name: "checkout_session_params",
|
|
1444
|
+
type: "json",
|
|
1445
|
+
required: false,
|
|
1446
|
+
description:
|
|
1447
|
+
"Additional parameters to pass into the creation of the Stripe checkout session.",
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
name: "long_lived_checkout",
|
|
1451
|
+
type: "boolean",
|
|
1452
|
+
required: false,
|
|
1453
|
+
description:
|
|
1454
|
+
"If true, returns an Autumn-hosted checkout link that can create a fresh Stripe checkout session when opened.",
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
name: "custom_line_items",
|
|
1458
|
+
type: "json",
|
|
1459
|
+
required: false,
|
|
1460
|
+
description:
|
|
1461
|
+
"Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans).",
|
|
1462
|
+
},
|
|
1463
|
+
{
|
|
1464
|
+
name: "processor_subscription_id",
|
|
1465
|
+
type: "string",
|
|
1466
|
+
required: false,
|
|
1467
|
+
description:
|
|
1468
|
+
"The processor subscription ID to link. Use this to attach an existing Stripe subscription instead of creating a new one.",
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
name: "carry_over_balances",
|
|
1472
|
+
type: "json",
|
|
1473
|
+
required: false,
|
|
1474
|
+
description: "Whether to carry over balances from the previous plan.",
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
name: "carry_over_usages",
|
|
1478
|
+
type: "json",
|
|
1479
|
+
required: false,
|
|
1480
|
+
description: "Whether to carry over usages from the previous plan.",
|
|
1481
|
+
},
|
|
1482
|
+
{
|
|
1483
|
+
name: "license_quantities",
|
|
1484
|
+
type: "json",
|
|
1485
|
+
required: false,
|
|
1486
|
+
description:
|
|
1487
|
+
"Seat quantities for the plan's licenses, keyed by license plan.",
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
name: "metadata",
|
|
1491
|
+
type: "json",
|
|
1492
|
+
required: false,
|
|
1493
|
+
description:
|
|
1494
|
+
"Key-value metadata to attach to the Stripe subscription, invoice, and checkout session created during this attach flow. Keys prefixed with 'autumn_' are reserved and will be stripped.",
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
name: "no_billing_changes",
|
|
1498
|
+
type: "boolean",
|
|
1499
|
+
required: false,
|
|
1500
|
+
description:
|
|
1501
|
+
"If true, skips any billing changes for the attach operation.",
|
|
1502
|
+
},
|
|
1503
|
+
{
|
|
1504
|
+
name: "enable_plan_immediately",
|
|
1505
|
+
type: "boolean",
|
|
1506
|
+
required: false,
|
|
1507
|
+
description:
|
|
1508
|
+
"If true, the customer's plan is activated immediately even when payment is deferred (invoice mode) or pending (Stripe checkout). For Stripe checkout, the customer_product is inserted before the customer completes the hosted form. Set it here rather than on `invoice_mode`, which only covers the invoice-unpaid case.",
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
name: "tax_rate_id",
|
|
1512
|
+
type: "string",
|
|
1513
|
+
required: false,
|
|
1514
|
+
description:
|
|
1515
|
+
"Stripe tax rate ID (txr_...) to apply as the default tax rate on the created subscription, invoice, or checkout session line items.",
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
name: "currency",
|
|
1519
|
+
type: "string",
|
|
1520
|
+
required: false,
|
|
1521
|
+
description:
|
|
1522
|
+
"Currency to bill this attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and the plan must offer a paid price in it. Defaults to the customer's currency, then the org default.",
|
|
1523
|
+
},
|
|
1524
|
+
{
|
|
1525
|
+
name: "remove_plan_ids",
|
|
1526
|
+
type: "json",
|
|
1527
|
+
required: false,
|
|
1528
|
+
description:
|
|
1529
|
+
"Plan IDs to expire on the customer as part of this attach. Each must be an active plan billed on the same subscription as the attach (or a free plan); plans on a separate subscription are rejected.",
|
|
1530
|
+
},
|
|
1531
|
+
],
|
|
1532
|
+
},
|
|
1533
|
+
{
|
|
1534
|
+
group: "billing",
|
|
1535
|
+
method: "preview_multi_attach",
|
|
1536
|
+
path: "/v1/billing.preview_multi_attach",
|
|
1537
|
+
description:
|
|
1538
|
+
"Previews the billing changes that would occur when attaching multiple plans, without actually making any changes.",
|
|
1539
|
+
body: "object",
|
|
1540
|
+
fields: [
|
|
1541
|
+
{
|
|
1542
|
+
name: "customer_id",
|
|
1543
|
+
type: "string",
|
|
1544
|
+
required: true,
|
|
1545
|
+
description: "The ID of the customer to attach the plans to.",
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
name: "entity_id",
|
|
1549
|
+
type: "string",
|
|
1550
|
+
required: false,
|
|
1551
|
+
description: "The ID of the entity to attach the plans to.",
|
|
1552
|
+
},
|
|
1553
|
+
{
|
|
1554
|
+
name: "plans",
|
|
1555
|
+
type: "json",
|
|
1556
|
+
required: true,
|
|
1557
|
+
description: "The list of plans to attach to the customer.",
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
name: "free_trial",
|
|
1561
|
+
type: "json",
|
|
1562
|
+
required: false,
|
|
1563
|
+
description:
|
|
1564
|
+
"Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial.",
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
name: "starts_at",
|
|
1568
|
+
type: "number",
|
|
1569
|
+
required: false,
|
|
1570
|
+
description:
|
|
1571
|
+
"Unix timestamp in milliseconds for backdating every plan in this multi-attach.",
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
name: "currency",
|
|
1575
|
+
type: "string",
|
|
1576
|
+
required: false,
|
|
1577
|
+
description:
|
|
1578
|
+
"Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.",
|
|
1579
|
+
},
|
|
1580
|
+
{
|
|
1581
|
+
name: "invoice_mode",
|
|
1582
|
+
type: "json",
|
|
1583
|
+
required: false,
|
|
1584
|
+
description:
|
|
1585
|
+
"Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.",
|
|
1586
|
+
},
|
|
1587
|
+
{
|
|
1588
|
+
name: "discounts",
|
|
1589
|
+
type: "json",
|
|
1590
|
+
required: false,
|
|
1591
|
+
description:
|
|
1592
|
+
"List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.",
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
name: "billing_behavior",
|
|
1596
|
+
type: "string",
|
|
1597
|
+
required: false,
|
|
1598
|
+
description:
|
|
1599
|
+
"How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.",
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
name: "billing_cycle_anchor",
|
|
1603
|
+
type: "json",
|
|
1604
|
+
required: false,
|
|
1605
|
+
description:
|
|
1606
|
+
"Pass 'now' to reset the billing cycle of every plan on the subscription to the time of this request.",
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
name: "success_url",
|
|
1610
|
+
type: "string",
|
|
1611
|
+
required: false,
|
|
1612
|
+
description: "URL to redirect to after successful checkout.",
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
name: "checkout_session_params",
|
|
1616
|
+
type: "json",
|
|
1617
|
+
required: false,
|
|
1618
|
+
description:
|
|
1619
|
+
"Additional parameters to pass into the creation of the Stripe checkout session.",
|
|
1620
|
+
},
|
|
1621
|
+
{
|
|
1622
|
+
name: "redirect_mode",
|
|
1623
|
+
type: "string",
|
|
1624
|
+
required: false,
|
|
1625
|
+
description:
|
|
1626
|
+
"Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.",
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
name: "new_billing_subscription",
|
|
1630
|
+
type: "boolean",
|
|
1631
|
+
required: false,
|
|
1632
|
+
description:
|
|
1633
|
+
"Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.",
|
|
1634
|
+
},
|
|
1635
|
+
{
|
|
1636
|
+
name: "enable_plan_immediately",
|
|
1637
|
+
type: "boolean",
|
|
1638
|
+
required: false,
|
|
1639
|
+
description:
|
|
1640
|
+
"If true, the cusProducts are activated immediately even when payment is pending via Stripe checkout.",
|
|
1641
|
+
},
|
|
1642
|
+
{
|
|
1643
|
+
name: "customer_data",
|
|
1644
|
+
type: "json",
|
|
1645
|
+
required: false,
|
|
1646
|
+
},
|
|
1647
|
+
{
|
|
1648
|
+
name: "entity_data",
|
|
1649
|
+
type: "json",
|
|
1650
|
+
required: false,
|
|
1651
|
+
},
|
|
1652
|
+
],
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
group: "billing",
|
|
1656
|
+
method: "update",
|
|
1657
|
+
path: "/v1/billing.update",
|
|
1658
|
+
description:
|
|
1659
|
+
"Updates an existing subscription. Use to modify feature quantities, cancel, or change plan configuration.",
|
|
1660
|
+
body: "object",
|
|
1661
|
+
fields: [
|
|
1662
|
+
{
|
|
1663
|
+
name: "customer_id",
|
|
1664
|
+
type: "string",
|
|
1665
|
+
required: true,
|
|
1666
|
+
description: "The ID of the customer to attach the plan to.",
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
name: "entity_id",
|
|
1670
|
+
type: "string",
|
|
1671
|
+
required: false,
|
|
1672
|
+
description: "The ID of the entity to attach the plan to.",
|
|
1673
|
+
},
|
|
1674
|
+
{
|
|
1675
|
+
name: "plan_id",
|
|
1676
|
+
type: "string",
|
|
1677
|
+
required: false,
|
|
1678
|
+
description:
|
|
1679
|
+
"The ID of the plan to update. Optional if subscription_id is provided, or if the customer has only one product.",
|
|
1680
|
+
},
|
|
1681
|
+
{
|
|
1682
|
+
name: "feature_quantities",
|
|
1683
|
+
type: "json",
|
|
1684
|
+
required: false,
|
|
1685
|
+
description:
|
|
1686
|
+
"If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.",
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
name: "version",
|
|
1690
|
+
type: "number",
|
|
1691
|
+
required: false,
|
|
1692
|
+
description: "The version of the plan to attach.",
|
|
1693
|
+
},
|
|
1694
|
+
{
|
|
1695
|
+
name: "free_trial",
|
|
1696
|
+
type: "json",
|
|
1697
|
+
required: false,
|
|
1698
|
+
description:
|
|
1699
|
+
"Free trial for this plan. A shorthand for customize.free_trial, which takes precedence when both are given.",
|
|
1700
|
+
},
|
|
1701
|
+
{
|
|
1702
|
+
name: "customize",
|
|
1703
|
+
type: "json",
|
|
1704
|
+
required: false,
|
|
1705
|
+
description:
|
|
1706
|
+
"Customize the plan to attach. Can override the price, items, licenses, free trial, or a combination.",
|
|
1707
|
+
},
|
|
1708
|
+
{
|
|
1709
|
+
name: "invoice_mode",
|
|
1710
|
+
type: "json",
|
|
1711
|
+
required: false,
|
|
1712
|
+
description:
|
|
1713
|
+
"Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. This uses Stripe's send_invoice collection method.",
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
name: "proration_behavior",
|
|
1717
|
+
type: "string",
|
|
1718
|
+
required: false,
|
|
1719
|
+
description:
|
|
1720
|
+
"How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.",
|
|
1721
|
+
},
|
|
1722
|
+
{
|
|
1723
|
+
name: "redirect_mode",
|
|
1724
|
+
type: "string",
|
|
1725
|
+
required: false,
|
|
1726
|
+
description:
|
|
1727
|
+
"Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.",
|
|
1728
|
+
},
|
|
1729
|
+
{
|
|
1730
|
+
name: "subscription_id",
|
|
1731
|
+
type: "string",
|
|
1732
|
+
required: false,
|
|
1733
|
+
description:
|
|
1734
|
+
"A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.",
|
|
1735
|
+
},
|
|
1736
|
+
{
|
|
1737
|
+
name: "discounts",
|
|
1738
|
+
type: "json",
|
|
1739
|
+
required: false,
|
|
1740
|
+
description:
|
|
1741
|
+
"List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.",
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
name: "cancel_action",
|
|
1745
|
+
type: "string",
|
|
1746
|
+
required: false,
|
|
1747
|
+
description:
|
|
1748
|
+
"Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.",
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
name: "billing_cycle_anchor",
|
|
1752
|
+
type: "json",
|
|
1753
|
+
required: false,
|
|
1754
|
+
description:
|
|
1755
|
+
"Reset the billing cycle immediately with 'now', or schedule a reset at a future Unix timestamp in milliseconds.",
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
name: "no_billing_changes",
|
|
1759
|
+
type: "boolean",
|
|
1760
|
+
required: false,
|
|
1761
|
+
description:
|
|
1762
|
+
"If true, the subscription is updated internally without applying billing changes in Stripe.",
|
|
1763
|
+
},
|
|
1764
|
+
{
|
|
1765
|
+
name: "refund_last_payment",
|
|
1766
|
+
type: "string",
|
|
1767
|
+
required: false,
|
|
1768
|
+
description:
|
|
1769
|
+
"Controls how the last payment is refunded on immediate cancellation. 'prorated' refunds the unused portion, 'full' refunds the entire last payment.",
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
name: "subscription_params",
|
|
1773
|
+
type: "json",
|
|
1774
|
+
required: false,
|
|
1775
|
+
description:
|
|
1776
|
+
"Additional parameters to pass into the Stripe subscription update or cancel call.",
|
|
1777
|
+
},
|
|
1778
|
+
{
|
|
1779
|
+
name: "recalculate_balances",
|
|
1780
|
+
type: "json",
|
|
1781
|
+
required: false,
|
|
1782
|
+
description:
|
|
1783
|
+
"Controls whether balances should be recalculated during the subscription update.",
|
|
1784
|
+
},
|
|
1785
|
+
{
|
|
1786
|
+
name: "carry_over_usages",
|
|
1787
|
+
type: "json",
|
|
1788
|
+
required: false,
|
|
1789
|
+
description: "Whether to carry over usages from the previous plan.",
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
name: "license_quantities",
|
|
1793
|
+
type: "json",
|
|
1794
|
+
required: false,
|
|
1795
|
+
description:
|
|
1796
|
+
"Total seat quantities (inclusive of the license's included count) per license plan offered by this plan. Licenses not listed keep their current paid quantity.",
|
|
1797
|
+
},
|
|
1798
|
+
{
|
|
1799
|
+
name: "custom_line_items",
|
|
1800
|
+
type: "json",
|
|
1801
|
+
required: false,
|
|
1802
|
+
description:
|
|
1803
|
+
"Custom line items that replace the auto-generated proration invoice, or bill a standalone invoice when nothing else changes. Only valid on an existing recurring subscription.",
|
|
1804
|
+
},
|
|
1805
|
+
],
|
|
1806
|
+
},
|
|
1807
|
+
{
|
|
1808
|
+
group: "billing",
|
|
1809
|
+
method: "preview_update",
|
|
1810
|
+
path: "/v1/billing.preview_update",
|
|
1811
|
+
description:
|
|
1812
|
+
"Previews the billing changes that would occur when updating a subscription, without actually making any changes.",
|
|
1813
|
+
body: "object",
|
|
1814
|
+
fields: [
|
|
1815
|
+
{
|
|
1816
|
+
name: "customer_id",
|
|
1817
|
+
type: "string",
|
|
1818
|
+
required: true,
|
|
1819
|
+
description: "The ID of the customer to attach the plan to.",
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
name: "entity_id",
|
|
1823
|
+
type: "string",
|
|
1824
|
+
required: false,
|
|
1825
|
+
description: "The ID of the entity to attach the plan to.",
|
|
1826
|
+
},
|
|
1827
|
+
{
|
|
1828
|
+
name: "plan_id",
|
|
1829
|
+
type: "string",
|
|
1830
|
+
required: false,
|
|
1831
|
+
description:
|
|
1832
|
+
"The ID of the plan to update. Optional if subscription_id is provided, or if the customer has only one product.",
|
|
1833
|
+
},
|
|
1834
|
+
{
|
|
1835
|
+
name: "feature_quantities",
|
|
1836
|
+
type: "json",
|
|
1837
|
+
required: false,
|
|
1838
|
+
description:
|
|
1839
|
+
"If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.",
|
|
1840
|
+
},
|
|
1841
|
+
{
|
|
1842
|
+
name: "version",
|
|
1843
|
+
type: "number",
|
|
1844
|
+
required: false,
|
|
1845
|
+
description: "The version of the plan to attach.",
|
|
1846
|
+
},
|
|
1847
|
+
{
|
|
1848
|
+
name: "free_trial",
|
|
1849
|
+
type: "json",
|
|
1850
|
+
required: false,
|
|
1851
|
+
description:
|
|
1852
|
+
"Free trial for this plan. A shorthand for customize.free_trial, which takes precedence when both are given.",
|
|
1853
|
+
},
|
|
1854
|
+
{
|
|
1855
|
+
name: "customize",
|
|
1856
|
+
type: "json",
|
|
1857
|
+
required: false,
|
|
1858
|
+
description:
|
|
1859
|
+
"Customize the plan to attach. Can override the price, items, licenses, free trial, or a combination.",
|
|
1860
|
+
},
|
|
1861
|
+
{
|
|
1862
|
+
name: "invoice_mode",
|
|
1863
|
+
type: "json",
|
|
1864
|
+
required: false,
|
|
1865
|
+
description:
|
|
1866
|
+
"Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. This uses Stripe's send_invoice collection method.",
|
|
1867
|
+
},
|
|
1868
|
+
{
|
|
1869
|
+
name: "proration_behavior",
|
|
1870
|
+
type: "string",
|
|
1871
|
+
required: false,
|
|
1872
|
+
description:
|
|
1873
|
+
"How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.",
|
|
1874
|
+
},
|
|
1875
|
+
{
|
|
1876
|
+
name: "redirect_mode",
|
|
1877
|
+
type: "string",
|
|
1878
|
+
required: false,
|
|
1879
|
+
description:
|
|
1880
|
+
"Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.",
|
|
1881
|
+
},
|
|
1882
|
+
{
|
|
1883
|
+
name: "subscription_id",
|
|
1884
|
+
type: "string",
|
|
1885
|
+
required: false,
|
|
1886
|
+
description:
|
|
1887
|
+
"A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.",
|
|
1888
|
+
},
|
|
1889
|
+
{
|
|
1890
|
+
name: "discounts",
|
|
1891
|
+
type: "json",
|
|
1892
|
+
required: false,
|
|
1893
|
+
description:
|
|
1894
|
+
"List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.",
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
name: "cancel_action",
|
|
1898
|
+
type: "string",
|
|
1899
|
+
required: false,
|
|
1900
|
+
description:
|
|
1901
|
+
"Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.",
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
name: "billing_cycle_anchor",
|
|
1905
|
+
type: "json",
|
|
1906
|
+
required: false,
|
|
1907
|
+
description:
|
|
1908
|
+
"Reset the billing cycle immediately with 'now', or schedule a reset at a future Unix timestamp in milliseconds.",
|
|
1909
|
+
},
|
|
1910
|
+
{
|
|
1911
|
+
name: "no_billing_changes",
|
|
1912
|
+
type: "boolean",
|
|
1913
|
+
required: false,
|
|
1914
|
+
description:
|
|
1915
|
+
"If true, the subscription is updated internally without applying billing changes in Stripe.",
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
name: "refund_last_payment",
|
|
1919
|
+
type: "string",
|
|
1920
|
+
required: false,
|
|
1921
|
+
description:
|
|
1922
|
+
"Controls how the last payment is refunded on immediate cancellation. 'prorated' refunds the unused portion, 'full' refunds the entire last payment.",
|
|
1923
|
+
},
|
|
1924
|
+
{
|
|
1925
|
+
name: "subscription_params",
|
|
1926
|
+
type: "json",
|
|
1927
|
+
required: false,
|
|
1928
|
+
description:
|
|
1929
|
+
"Additional parameters to pass into the Stripe subscription update or cancel call.",
|
|
1930
|
+
},
|
|
1931
|
+
{
|
|
1932
|
+
name: "recalculate_balances",
|
|
1933
|
+
type: "json",
|
|
1934
|
+
required: false,
|
|
1935
|
+
description:
|
|
1936
|
+
"Controls whether balances should be recalculated during the subscription update.",
|
|
1937
|
+
},
|
|
1938
|
+
{
|
|
1939
|
+
name: "carry_over_usages",
|
|
1940
|
+
type: "json",
|
|
1941
|
+
required: false,
|
|
1942
|
+
description: "Whether to carry over usages from the previous plan.",
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
name: "license_quantities",
|
|
1946
|
+
type: "json",
|
|
1947
|
+
required: false,
|
|
1948
|
+
description:
|
|
1949
|
+
"Total seat quantities (inclusive of the license's included count) per license plan offered by this plan. Licenses not listed keep their current paid quantity.",
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
name: "custom_line_items",
|
|
1953
|
+
type: "json",
|
|
1954
|
+
required: false,
|
|
1955
|
+
description:
|
|
1956
|
+
"Custom line items that replace the auto-generated proration invoice, or bill a standalone invoice when nothing else changes. Only valid on an existing recurring subscription.",
|
|
1957
|
+
},
|
|
1958
|
+
],
|
|
1959
|
+
},
|
|
1960
|
+
{
|
|
1961
|
+
group: "billing",
|
|
1962
|
+
method: "multi_update",
|
|
1963
|
+
path: "/v1/billing.multi_update",
|
|
1964
|
+
description:
|
|
1965
|
+
"Updates multiple plans on a customer in a single request. Currently supports cancel actions (immediately, end of cycle, or uncancel) across one or more subscriptions.",
|
|
1966
|
+
body: "object",
|
|
1967
|
+
fields: [
|
|
1968
|
+
{
|
|
1969
|
+
name: "customer_id",
|
|
1970
|
+
type: "string",
|
|
1971
|
+
required: true,
|
|
1972
|
+
description: "The ID of the customer to update plans for.",
|
|
1973
|
+
},
|
|
1974
|
+
{
|
|
1975
|
+
name: "entity_id",
|
|
1976
|
+
type: "string",
|
|
1977
|
+
required: false,
|
|
1978
|
+
description:
|
|
1979
|
+
"The ID of the entity to update plans for. Individual updates can override this with their own entity_id.",
|
|
1980
|
+
},
|
|
1981
|
+
{
|
|
1982
|
+
name: "refund_last_payment",
|
|
1983
|
+
type: "string",
|
|
1984
|
+
required: false,
|
|
1985
|
+
description:
|
|
1986
|
+
"Controls how the last payment is refunded on immediate cancellation. 'prorated' refunds the unused portion, 'full' refunds the entire last payment.",
|
|
1987
|
+
},
|
|
1988
|
+
{
|
|
1989
|
+
name: "subscription_params",
|
|
1990
|
+
type: "json",
|
|
1991
|
+
required: false,
|
|
1992
|
+
description:
|
|
1993
|
+
"Additional parameters to pass into the Stripe subscription update or cancel call.",
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
name: "updates",
|
|
1997
|
+
type: "json",
|
|
1998
|
+
required: true,
|
|
1999
|
+
description: "The list of plan updates to apply to the customer.",
|
|
2000
|
+
},
|
|
2001
|
+
],
|
|
2002
|
+
},
|
|
2003
|
+
{
|
|
2004
|
+
group: "billing",
|
|
2005
|
+
method: "preview_multi_update",
|
|
2006
|
+
path: "/v1/billing.preview_multi_update",
|
|
2007
|
+
description:
|
|
2008
|
+
"Previews the billing changes of a multi-plan update without making any changes. Returns one core preview per affected subscription.",
|
|
2009
|
+
body: "object",
|
|
2010
|
+
fields: [
|
|
2011
|
+
{
|
|
2012
|
+
name: "customer_id",
|
|
2013
|
+
type: "string",
|
|
2014
|
+
required: true,
|
|
2015
|
+
description: "The ID of the customer to update plans for.",
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
name: "entity_id",
|
|
2019
|
+
type: "string",
|
|
2020
|
+
required: false,
|
|
2021
|
+
description:
|
|
2022
|
+
"The ID of the entity to update plans for. Individual updates can override this with their own entity_id.",
|
|
2023
|
+
},
|
|
2024
|
+
{
|
|
2025
|
+
name: "refund_last_payment",
|
|
2026
|
+
type: "string",
|
|
2027
|
+
required: false,
|
|
2028
|
+
description:
|
|
2029
|
+
"Controls how the last payment is refunded on immediate cancellation. 'prorated' refunds the unused portion, 'full' refunds the entire last payment.",
|
|
2030
|
+
},
|
|
2031
|
+
{
|
|
2032
|
+
name: "subscription_params",
|
|
2033
|
+
type: "json",
|
|
2034
|
+
required: false,
|
|
2035
|
+
description:
|
|
2036
|
+
"Additional parameters to pass into the Stripe subscription update or cancel call.",
|
|
2037
|
+
},
|
|
2038
|
+
{
|
|
2039
|
+
name: "updates",
|
|
2040
|
+
type: "json",
|
|
2041
|
+
required: true,
|
|
2042
|
+
description: "The list of plan updates to apply to the customer.",
|
|
2043
|
+
},
|
|
2044
|
+
],
|
|
2045
|
+
},
|
|
2046
|
+
{
|
|
2047
|
+
group: "billing",
|
|
2048
|
+
method: "open_customer_portal",
|
|
2049
|
+
path: "/v1/billing.open_customer_portal",
|
|
2050
|
+
description:
|
|
2051
|
+
"Create a billing portal session for a customer to manage their subscription.",
|
|
2052
|
+
body: "object",
|
|
2053
|
+
fields: [
|
|
2054
|
+
{
|
|
2055
|
+
name: "customer_id",
|
|
2056
|
+
type: "string",
|
|
2057
|
+
required: true,
|
|
2058
|
+
description: "The ID of the customer to open the billing portal for.",
|
|
2059
|
+
},
|
|
2060
|
+
{
|
|
2061
|
+
name: "configuration_id",
|
|
2062
|
+
type: "string",
|
|
2063
|
+
required: false,
|
|
2064
|
+
description:
|
|
2065
|
+
"Stripe billing portal configuration ID. Create configurations in your Stripe dashboard.",
|
|
2066
|
+
},
|
|
2067
|
+
{
|
|
2068
|
+
name: "return_url",
|
|
2069
|
+
type: "string",
|
|
2070
|
+
required: false,
|
|
2071
|
+
description:
|
|
2072
|
+
"URL to redirect to when back button is clicked in the billing portal",
|
|
2073
|
+
},
|
|
2074
|
+
],
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
group: "billing",
|
|
2078
|
+
method: "setup_payment",
|
|
2079
|
+
path: "/v1/billing.setup_payment",
|
|
2080
|
+
description:
|
|
2081
|
+
"Create a payment setup session for a customer to add or update their payment method.",
|
|
2082
|
+
body: "object",
|
|
2083
|
+
fields: [
|
|
2084
|
+
{
|
|
2085
|
+
name: "customer_id",
|
|
2086
|
+
type: "string",
|
|
2087
|
+
required: true,
|
|
2088
|
+
description: "The ID of the customer to attach the plan to.",
|
|
2089
|
+
},
|
|
2090
|
+
{
|
|
2091
|
+
name: "entity_id",
|
|
2092
|
+
type: "string",
|
|
2093
|
+
required: false,
|
|
2094
|
+
description: "The ID of the entity to attach the plan to.",
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
name: "plan_id",
|
|
2098
|
+
type: "string",
|
|
2099
|
+
required: false,
|
|
2100
|
+
description:
|
|
2101
|
+
"If specified, the plan will be attached to the customer after setup.",
|
|
2102
|
+
},
|
|
2103
|
+
{
|
|
2104
|
+
name: "feature_quantities",
|
|
2105
|
+
type: "json",
|
|
2106
|
+
required: false,
|
|
2107
|
+
description:
|
|
2108
|
+
"If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.",
|
|
2109
|
+
},
|
|
2110
|
+
{
|
|
2111
|
+
name: "version",
|
|
2112
|
+
type: "number",
|
|
2113
|
+
required: false,
|
|
2114
|
+
description: "The version of the plan to attach.",
|
|
2115
|
+
},
|
|
2116
|
+
{
|
|
2117
|
+
name: "free_trial",
|
|
2118
|
+
type: "json",
|
|
2119
|
+
required: false,
|
|
2120
|
+
description:
|
|
2121
|
+
"Free trial for this plan. A shorthand for customize.free_trial, which takes precedence when both are given.",
|
|
2122
|
+
},
|
|
2123
|
+
{
|
|
2124
|
+
name: "customize",
|
|
2125
|
+
type: "json",
|
|
2126
|
+
required: false,
|
|
2127
|
+
description:
|
|
2128
|
+
"Customize the plan to attach. Can override the price, items, licenses, free trial, or a combination.",
|
|
2129
|
+
},
|
|
2130
|
+
{
|
|
2131
|
+
name: "proration_behavior",
|
|
2132
|
+
type: "string",
|
|
2133
|
+
required: false,
|
|
2134
|
+
description:
|
|
2135
|
+
"How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.",
|
|
2136
|
+
},
|
|
2137
|
+
{
|
|
2138
|
+
name: "subscription_id",
|
|
2139
|
+
type: "string",
|
|
2140
|
+
required: false,
|
|
2141
|
+
description:
|
|
2142
|
+
"A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.",
|
|
2143
|
+
},
|
|
2144
|
+
{
|
|
2145
|
+
name: "discounts",
|
|
2146
|
+
type: "json",
|
|
2147
|
+
required: false,
|
|
2148
|
+
description:
|
|
2149
|
+
"List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.",
|
|
2150
|
+
},
|
|
2151
|
+
{
|
|
2152
|
+
name: "success_url",
|
|
2153
|
+
type: "string",
|
|
2154
|
+
required: false,
|
|
2155
|
+
description: "URL to redirect to after successful checkout.",
|
|
2156
|
+
},
|
|
2157
|
+
{
|
|
2158
|
+
name: "billing_cycle_anchor",
|
|
2159
|
+
type: "json",
|
|
2160
|
+
required: false,
|
|
2161
|
+
description:
|
|
2162
|
+
"Reset the billing cycle immediately with 'now', or schedule a reset at a future Unix timestamp in milliseconds.",
|
|
2163
|
+
},
|
|
2164
|
+
{
|
|
2165
|
+
name: "starts_at",
|
|
2166
|
+
type: "number",
|
|
2167
|
+
required: false,
|
|
2168
|
+
description:
|
|
2169
|
+
"Unix timestamp in milliseconds for when the attached plan should start. Future dates create a scheduled subscription.",
|
|
2170
|
+
},
|
|
2171
|
+
{
|
|
2172
|
+
name: "ends_at",
|
|
2173
|
+
type: "number",
|
|
2174
|
+
required: false,
|
|
2175
|
+
description:
|
|
2176
|
+
"Unix timestamp in milliseconds for when the attached plan should end.",
|
|
2177
|
+
},
|
|
2178
|
+
{
|
|
2179
|
+
name: "checkout_session_params",
|
|
2180
|
+
type: "json",
|
|
2181
|
+
required: false,
|
|
2182
|
+
description:
|
|
2183
|
+
"Additional parameters to pass into the creation of the Stripe checkout session.",
|
|
2184
|
+
},
|
|
2185
|
+
{
|
|
2186
|
+
name: "custom_line_items",
|
|
2187
|
+
type: "json",
|
|
2188
|
+
required: false,
|
|
2189
|
+
description:
|
|
2190
|
+
"Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans).",
|
|
2191
|
+
},
|
|
2192
|
+
{
|
|
2193
|
+
name: "processor_subscription_id",
|
|
2194
|
+
type: "string",
|
|
2195
|
+
required: false,
|
|
2196
|
+
description:
|
|
2197
|
+
"The processor subscription ID to link. Use this to attach an existing Stripe subscription instead of creating a new one.",
|
|
2198
|
+
},
|
|
2199
|
+
{
|
|
2200
|
+
name: "carry_over_balances",
|
|
2201
|
+
type: "json",
|
|
2202
|
+
required: false,
|
|
2203
|
+
description: "Whether to carry over balances from the previous plan.",
|
|
2204
|
+
},
|
|
2205
|
+
{
|
|
2206
|
+
name: "carry_over_usages",
|
|
2207
|
+
type: "json",
|
|
2208
|
+
required: false,
|
|
2209
|
+
description: "Whether to carry over usages from the previous plan.",
|
|
2210
|
+
},
|
|
2211
|
+
{
|
|
2212
|
+
name: "license_quantities",
|
|
2213
|
+
type: "json",
|
|
2214
|
+
required: false,
|
|
2215
|
+
description:
|
|
2216
|
+
"Seat quantities for the plan's licenses, keyed by license plan.",
|
|
2217
|
+
},
|
|
2218
|
+
{
|
|
2219
|
+
name: "metadata",
|
|
2220
|
+
type: "json",
|
|
2221
|
+
required: false,
|
|
2222
|
+
description:
|
|
2223
|
+
"Key-value metadata to attach to the Stripe subscription, invoice, and checkout session created during this attach flow. Keys prefixed with 'autumn_' are reserved and will be stripped.",
|
|
2224
|
+
},
|
|
2225
|
+
{
|
|
2226
|
+
name: "no_billing_changes",
|
|
2227
|
+
type: "boolean",
|
|
2228
|
+
required: false,
|
|
2229
|
+
description:
|
|
2230
|
+
"If true, skips any billing changes for the attach operation.",
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
name: "enable_plan_immediately",
|
|
2234
|
+
type: "boolean",
|
|
2235
|
+
required: false,
|
|
2236
|
+
description:
|
|
2237
|
+
"If true, the customer's plan is activated immediately even when payment is deferred (invoice mode) or pending (Stripe checkout). For Stripe checkout, the customer_product is inserted before the customer completes the hosted form. Set it here rather than on `invoice_mode`, which only covers the invoice-unpaid case.",
|
|
2238
|
+
},
|
|
2239
|
+
{
|
|
2240
|
+
name: "tax_rate_id",
|
|
2241
|
+
type: "string",
|
|
2242
|
+
required: false,
|
|
2243
|
+
description:
|
|
2244
|
+
"Stripe tax rate ID (txr_...) to apply as the default tax rate on the created subscription, invoice, or checkout session line items.",
|
|
2245
|
+
},
|
|
2246
|
+
{
|
|
2247
|
+
name: "currency",
|
|
2248
|
+
type: "string",
|
|
2249
|
+
required: false,
|
|
2250
|
+
description:
|
|
2251
|
+
"Currency to bill this attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and the plan must offer a paid price in it. Defaults to the customer's currency, then the org default.",
|
|
2252
|
+
},
|
|
2253
|
+
{
|
|
2254
|
+
name: "remove_plan_ids",
|
|
2255
|
+
type: "json",
|
|
2256
|
+
required: false,
|
|
2257
|
+
description:
|
|
2258
|
+
"Plan IDs to expire on the customer as part of this attach. Each must be an active plan billed on the same subscription as the attach (or a free plan); plans on a separate subscription are rejected.",
|
|
2259
|
+
},
|
|
2260
|
+
],
|
|
2261
|
+
},
|
|
2262
|
+
{
|
|
2263
|
+
group: "billing",
|
|
2264
|
+
method: "import",
|
|
2265
|
+
path: "/v1/billing.import",
|
|
2266
|
+
description:
|
|
2267
|
+
"Image a customer into Autumn for live migration. Read-only against processors.",
|
|
2268
|
+
body: "object",
|
|
2269
|
+
fields: [
|
|
2270
|
+
{
|
|
2271
|
+
name: "customer_id",
|
|
2272
|
+
type: "string",
|
|
2273
|
+
required: true,
|
|
2274
|
+
description: "Autumn customer to image into.",
|
|
2275
|
+
},
|
|
2276
|
+
{
|
|
2277
|
+
name: "customer_data",
|
|
2278
|
+
type: "json",
|
|
2279
|
+
required: false,
|
|
2280
|
+
description:
|
|
2281
|
+
"Optional identity fields upserted onto the customer (applied to existing customers too).",
|
|
2282
|
+
},
|
|
2283
|
+
{
|
|
2284
|
+
name: "processors",
|
|
2285
|
+
type: "json",
|
|
2286
|
+
required: false,
|
|
2287
|
+
description:
|
|
2288
|
+
"The customer's processor identities (e.g. Stripe customer id, RevenueCat app_user_id). Omit for customers with no processor, e.g. those only ever on a free plan.",
|
|
2289
|
+
},
|
|
2290
|
+
{
|
|
2291
|
+
name: "billables",
|
|
2292
|
+
type: "json",
|
|
2293
|
+
required: true,
|
|
2294
|
+
description:
|
|
2295
|
+
"The billing objects (subscriptions, one-offs) to image, each carrying its plan.",
|
|
2296
|
+
},
|
|
2297
|
+
{
|
|
2298
|
+
name: "dry_run",
|
|
2299
|
+
type: "boolean",
|
|
2300
|
+
required: false,
|
|
2301
|
+
description:
|
|
2302
|
+
"If true, validate and compute without persisting; returns what would be flashed.",
|
|
2303
|
+
},
|
|
2304
|
+
],
|
|
2305
|
+
},
|
|
2306
|
+
{
|
|
2307
|
+
group: "balances",
|
|
2308
|
+
method: "create",
|
|
2309
|
+
path: "/v1/balances.create",
|
|
2310
|
+
description: "Create a balance for a customer feature.",
|
|
2311
|
+
body: "object",
|
|
2312
|
+
fields: [
|
|
2313
|
+
{
|
|
2314
|
+
name: "customer_id",
|
|
2315
|
+
type: "string",
|
|
2316
|
+
required: true,
|
|
2317
|
+
description: "The ID of the customer.",
|
|
2318
|
+
},
|
|
2319
|
+
{
|
|
2320
|
+
name: "feature_id",
|
|
2321
|
+
type: "string",
|
|
2322
|
+
required: true,
|
|
2323
|
+
description: "The ID of the feature.",
|
|
2324
|
+
},
|
|
2325
|
+
{
|
|
2326
|
+
name: "entity_id",
|
|
2327
|
+
type: "string",
|
|
2328
|
+
required: false,
|
|
2329
|
+
description:
|
|
2330
|
+
"The ID of the entity for entity-scoped balances (e.g., per-seat limits).",
|
|
2331
|
+
},
|
|
2332
|
+
{
|
|
2333
|
+
name: "included_grant",
|
|
2334
|
+
type: "number",
|
|
2335
|
+
required: false,
|
|
2336
|
+
description:
|
|
2337
|
+
"The initial balance amount to grant. For metered features, this is the number of units the customer can use.",
|
|
2338
|
+
},
|
|
2339
|
+
{
|
|
2340
|
+
name: "unlimited",
|
|
2341
|
+
type: "boolean",
|
|
2342
|
+
required: false,
|
|
2343
|
+
description:
|
|
2344
|
+
"If true, the balance has unlimited usage. Cannot be combined with 'included_grant'.",
|
|
2345
|
+
},
|
|
2346
|
+
{
|
|
2347
|
+
name: "reset",
|
|
2348
|
+
type: "json",
|
|
2349
|
+
required: false,
|
|
2350
|
+
description:
|
|
2351
|
+
"Reset configuration for the balance. If not provided, the balance is a one-time grant that never resets.",
|
|
2352
|
+
},
|
|
2353
|
+
{
|
|
2354
|
+
name: "rollover",
|
|
2355
|
+
type: "json",
|
|
2356
|
+
required: false,
|
|
2357
|
+
description: "Rollover configuration for the balance.",
|
|
2358
|
+
},
|
|
2359
|
+
{
|
|
2360
|
+
name: "expires_at",
|
|
2361
|
+
type: "number",
|
|
2362
|
+
required: false,
|
|
2363
|
+
description:
|
|
2364
|
+
"Unix timestamp (milliseconds) when the balance expires. Mutually exclusive with reset.",
|
|
2365
|
+
},
|
|
2366
|
+
{
|
|
2367
|
+
name: "next_reset_at",
|
|
2368
|
+
type: "number",
|
|
2369
|
+
required: false,
|
|
2370
|
+
description:
|
|
2371
|
+
"Unix timestamp (milliseconds) for the first reset boundary, allowing a custom (e.g. shorter) first period. Requires 'reset', and must occur before 'expires_at' if both are provided. Subsequent resets advance by one reset interval from this boundary.",
|
|
2372
|
+
},
|
|
2373
|
+
{
|
|
2374
|
+
name: "balance_id",
|
|
2375
|
+
type: "string",
|
|
2376
|
+
required: false,
|
|
2377
|
+
description:
|
|
2378
|
+
"A unique identifier for this balance. Use this to target the balance in future update / delete calls.",
|
|
2379
|
+
},
|
|
2380
|
+
],
|
|
2381
|
+
},
|
|
2382
|
+
{
|
|
2383
|
+
group: "balances",
|
|
2384
|
+
method: "update",
|
|
2385
|
+
path: "/v1/balances.update",
|
|
2386
|
+
description: "Update a customer balance.",
|
|
2387
|
+
body: "object",
|
|
2388
|
+
fields: [
|
|
2389
|
+
{
|
|
2390
|
+
name: "customer_id",
|
|
2391
|
+
type: "string",
|
|
2392
|
+
required: true,
|
|
2393
|
+
description: "The ID of the customer.",
|
|
2394
|
+
},
|
|
2395
|
+
{
|
|
2396
|
+
name: "feature_id",
|
|
2397
|
+
type: "string",
|
|
2398
|
+
required: true,
|
|
2399
|
+
description: "The ID of the feature.",
|
|
2400
|
+
},
|
|
2401
|
+
{
|
|
2402
|
+
name: "entity_id",
|
|
2403
|
+
type: "string",
|
|
2404
|
+
required: false,
|
|
2405
|
+
description:
|
|
2406
|
+
"The ID of the entity for entity-scoped balances (e.g., per-seat limits).",
|
|
2407
|
+
},
|
|
2408
|
+
{
|
|
2409
|
+
name: "remaining",
|
|
2410
|
+
type: "number",
|
|
2411
|
+
required: false,
|
|
2412
|
+
description:
|
|
2413
|
+
"Set the remaining balance to this exact value. Cannot be combined with add_to_balance.",
|
|
2414
|
+
},
|
|
2415
|
+
{
|
|
2416
|
+
name: "add_to_balance",
|
|
2417
|
+
type: "number",
|
|
2418
|
+
required: false,
|
|
2419
|
+
description:
|
|
2420
|
+
"Add this amount to the current balance. Use negative values to subtract. Cannot be combined with current_balance.",
|
|
2421
|
+
},
|
|
2422
|
+
{
|
|
2423
|
+
name: "usage",
|
|
2424
|
+
type: "number",
|
|
2425
|
+
required: false,
|
|
2426
|
+
description:
|
|
2427
|
+
"The usage amount to update. Cannot be combined with remaining or add_to_balance.",
|
|
2428
|
+
},
|
|
2429
|
+
{
|
|
2430
|
+
name: "interval",
|
|
2431
|
+
type: "string",
|
|
2432
|
+
required: false,
|
|
2433
|
+
description:
|
|
2434
|
+
"Target a specific balance by its reset interval. Use when the customer has multiple balances for the same feature with different reset intervals.",
|
|
2435
|
+
},
|
|
2436
|
+
{
|
|
2437
|
+
name: "included_grant",
|
|
2438
|
+
type: "number",
|
|
2439
|
+
required: false,
|
|
2440
|
+
description: "Set the granted balance to this exact value.",
|
|
2441
|
+
},
|
|
2442
|
+
{
|
|
2443
|
+
name: "balance_id",
|
|
2444
|
+
type: "string",
|
|
2445
|
+
required: false,
|
|
2446
|
+
description:
|
|
2447
|
+
"Target a specific balance by its ID (set on create). Use when the customer has multiple balances for the same feature.",
|
|
2448
|
+
},
|
|
2449
|
+
{
|
|
2450
|
+
name: "next_reset_at",
|
|
2451
|
+
type: "number",
|
|
2452
|
+
required: false,
|
|
2453
|
+
description:
|
|
2454
|
+
"The next reset time for the balance. If there are multiple breakdowns, this will update the breakdown with the next reset time.",
|
|
2455
|
+
},
|
|
2456
|
+
{
|
|
2457
|
+
name: "expires_at",
|
|
2458
|
+
type: "number",
|
|
2459
|
+
required: false,
|
|
2460
|
+
description:
|
|
2461
|
+
"Unix timestamp (milliseconds) when the balance expires. Targets a specific balance via balance_id / interval when the customer has multiple balances for the same feature.",
|
|
2462
|
+
},
|
|
2463
|
+
],
|
|
2464
|
+
},
|
|
2465
|
+
{
|
|
2466
|
+
group: "balances",
|
|
2467
|
+
method: "delete",
|
|
2468
|
+
path: "/v1/balances.delete",
|
|
2469
|
+
description:
|
|
2470
|
+
"Delete a balance for a customer feature. Can only delete a balance that is not attached to a price (eg. you cannot delete messages that have an overage price).",
|
|
2471
|
+
body: "object",
|
|
2472
|
+
fields: [
|
|
2473
|
+
{
|
|
2474
|
+
name: "customer_id",
|
|
2475
|
+
type: "string",
|
|
2476
|
+
required: true,
|
|
2477
|
+
description: "The ID of the customer.",
|
|
2478
|
+
},
|
|
2479
|
+
{
|
|
2480
|
+
name: "entity_id",
|
|
2481
|
+
type: "string",
|
|
2482
|
+
required: false,
|
|
2483
|
+
description: "The ID of the entity.",
|
|
2484
|
+
},
|
|
2485
|
+
{
|
|
2486
|
+
name: "feature_id",
|
|
2487
|
+
type: "string",
|
|
2488
|
+
required: false,
|
|
2489
|
+
description: "The ID of the feature.",
|
|
2490
|
+
},
|
|
2491
|
+
{
|
|
2492
|
+
name: "balance_id",
|
|
2493
|
+
type: "string",
|
|
2494
|
+
required: false,
|
|
2495
|
+
description: "The ID of the balance to delete.",
|
|
2496
|
+
},
|
|
2497
|
+
{
|
|
2498
|
+
name: "recalculate_balances",
|
|
2499
|
+
type: "boolean",
|
|
2500
|
+
required: false,
|
|
2501
|
+
description:
|
|
2502
|
+
"If true, deduct the deleted balance's remaining amount from the customer's other balances for the same feature after deletion.",
|
|
2503
|
+
},
|
|
2504
|
+
{
|
|
2505
|
+
name: "interval",
|
|
2506
|
+
type: "string",
|
|
2507
|
+
required: false,
|
|
2508
|
+
description:
|
|
2509
|
+
"Target a specific balance by its reset interval. Use when the customer has multiple balances for the same feature with different reset intervals.",
|
|
2510
|
+
},
|
|
2511
|
+
],
|
|
2512
|
+
},
|
|
2513
|
+
{
|
|
2514
|
+
group: "balances",
|
|
2515
|
+
method: "finalize",
|
|
2516
|
+
path: "/v1/balances.finalize",
|
|
2517
|
+
description:
|
|
2518
|
+
"Finalize a previously locked balance. Use 'confirm' to commit the deduction, or 'release' to return the held balance.",
|
|
2519
|
+
body: "object",
|
|
2520
|
+
fields: [
|
|
2521
|
+
{
|
|
2522
|
+
name: "lock_id",
|
|
2523
|
+
type: "string",
|
|
2524
|
+
required: true,
|
|
2525
|
+
description:
|
|
2526
|
+
"The lock ID that was passed into the previous check call.",
|
|
2527
|
+
},
|
|
2528
|
+
{
|
|
2529
|
+
name: "action",
|
|
2530
|
+
type: "string",
|
|
2531
|
+
required: true,
|
|
2532
|
+
description:
|
|
2533
|
+
"Use 'confirm' to commit the deduction, or 'release' to return the held balance.",
|
|
2534
|
+
},
|
|
2535
|
+
{
|
|
2536
|
+
name: "override_value",
|
|
2537
|
+
type: "number",
|
|
2538
|
+
required: false,
|
|
2539
|
+
description:
|
|
2540
|
+
"Additional properties to attach to this finalize lock event.",
|
|
2541
|
+
},
|
|
2542
|
+
{
|
|
2543
|
+
name: "properties",
|
|
2544
|
+
type: "json",
|
|
2545
|
+
required: false,
|
|
2546
|
+
description:
|
|
2547
|
+
"Additional properties to attach to this finalize lock event.",
|
|
2548
|
+
},
|
|
2549
|
+
],
|
|
2550
|
+
},
|
|
2551
|
+
{
|
|
2552
|
+
group: "balances",
|
|
2553
|
+
method: "check",
|
|
2554
|
+
path: "/v1/balances.check",
|
|
2555
|
+
description:
|
|
2556
|
+
"Checks whether a customer currently has enough balance to use a feature.",
|
|
2557
|
+
body: "object",
|
|
2558
|
+
fields: [
|
|
2559
|
+
{
|
|
2560
|
+
name: "customer_id",
|
|
2561
|
+
type: "string",
|
|
2562
|
+
required: true,
|
|
2563
|
+
description: "The ID of the customer.",
|
|
2564
|
+
},
|
|
2565
|
+
{
|
|
2566
|
+
name: "feature_id",
|
|
2567
|
+
type: "string",
|
|
2568
|
+
required: true,
|
|
2569
|
+
description: "The ID of the feature.",
|
|
2570
|
+
},
|
|
2571
|
+
{
|
|
2572
|
+
name: "entity_id",
|
|
2573
|
+
type: "string",
|
|
2574
|
+
required: false,
|
|
2575
|
+
description:
|
|
2576
|
+
"The ID of the entity for entity-scoped balances (e.g., per-seat limits).",
|
|
2577
|
+
},
|
|
2578
|
+
{
|
|
2579
|
+
name: "required_balance",
|
|
2580
|
+
type: "number",
|
|
2581
|
+
required: false,
|
|
2582
|
+
description:
|
|
2583
|
+
"Minimum balance required for access. Returns allowed: false if the customer's balance is below this value. Defaults to 1.",
|
|
2584
|
+
},
|
|
2585
|
+
{
|
|
2586
|
+
name: "properties",
|
|
2587
|
+
type: "json",
|
|
2588
|
+
required: false,
|
|
2589
|
+
description:
|
|
2590
|
+
"Additional properties to attach to the usage event if send_event is true.",
|
|
2591
|
+
},
|
|
2592
|
+
{
|
|
2593
|
+
name: "send_event",
|
|
2594
|
+
type: "boolean",
|
|
2595
|
+
required: false,
|
|
2596
|
+
description:
|
|
2597
|
+
"If true, atomically records a usage event while checking access. The required_balance value is used as the usage amount. Combines check + track in one call.",
|
|
2598
|
+
},
|
|
2599
|
+
{
|
|
2600
|
+
name: "lock",
|
|
2601
|
+
type: "json",
|
|
2602
|
+
required: false,
|
|
2603
|
+
description:
|
|
2604
|
+
"Reserve units of a feature upfront by passing a lock_id, then call balances.finalize to confirm or release the hold.",
|
|
2605
|
+
},
|
|
2606
|
+
{
|
|
2607
|
+
name: "with_preview",
|
|
2608
|
+
type: "boolean",
|
|
2609
|
+
required: false,
|
|
2610
|
+
description:
|
|
2611
|
+
"If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls.",
|
|
2612
|
+
},
|
|
2613
|
+
],
|
|
2614
|
+
},
|
|
2615
|
+
{
|
|
2616
|
+
group: "balances",
|
|
2617
|
+
method: "track",
|
|
2618
|
+
path: "/v1/balances.track",
|
|
2619
|
+
description:
|
|
2620
|
+
"Records usage for a customer feature and returns updated balances.",
|
|
2621
|
+
body: "object",
|
|
2622
|
+
fields: [
|
|
2623
|
+
{
|
|
2624
|
+
name: "customer_id",
|
|
2625
|
+
type: "string",
|
|
2626
|
+
required: true,
|
|
2627
|
+
description: "The ID of the customer.",
|
|
2628
|
+
},
|
|
2629
|
+
{
|
|
2630
|
+
name: "feature_id",
|
|
2631
|
+
type: "string",
|
|
2632
|
+
required: false,
|
|
2633
|
+
description:
|
|
2634
|
+
"The ID of the feature to track usage for. Required if event_name is not provided.",
|
|
2635
|
+
},
|
|
2636
|
+
{
|
|
2637
|
+
name: "entity_id",
|
|
2638
|
+
type: "string",
|
|
2639
|
+
required: false,
|
|
2640
|
+
description:
|
|
2641
|
+
"The ID of the entity for entity-scoped balances (e.g., per-seat limits).",
|
|
2642
|
+
},
|
|
2643
|
+
{
|
|
2644
|
+
name: "event_name",
|
|
2645
|
+
type: "string",
|
|
2646
|
+
required: false,
|
|
2647
|
+
description:
|
|
2648
|
+
"Event name to track usage for. Use instead of feature_id when multiple features should be tracked from a single event.",
|
|
2649
|
+
},
|
|
2650
|
+
{
|
|
2651
|
+
name: "value",
|
|
2652
|
+
type: "number",
|
|
2653
|
+
required: false,
|
|
2654
|
+
description:
|
|
2655
|
+
"The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat).",
|
|
2656
|
+
},
|
|
2657
|
+
{
|
|
2658
|
+
name: "properties",
|
|
2659
|
+
type: "json",
|
|
2660
|
+
required: false,
|
|
2661
|
+
description: "Additional properties to attach to this usage event.",
|
|
2662
|
+
},
|
|
2663
|
+
{
|
|
2664
|
+
name: "timestamp",
|
|
2665
|
+
type: "number",
|
|
2666
|
+
required: false,
|
|
2667
|
+
description:
|
|
2668
|
+
"Unix timestamp in milliseconds to use for the usage event. Defaults to the current time.",
|
|
2669
|
+
},
|
|
2670
|
+
{
|
|
2671
|
+
name: "overage_behavior",
|
|
2672
|
+
type: "string",
|
|
2673
|
+
required: false,
|
|
2674
|
+
description:
|
|
2675
|
+
'How to handle usage that exceeds the available balance. "cap" (default) deducts only what fits, stopping at zero. "overflow" deducts the full value: the balance can go negative and usage limits do not clamp the deduction, though spend limits still apply.',
|
|
2676
|
+
},
|
|
2677
|
+
{
|
|
2678
|
+
name: "async",
|
|
2679
|
+
type: "boolean",
|
|
2680
|
+
required: false,
|
|
2681
|
+
description:
|
|
2682
|
+
"If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.",
|
|
2683
|
+
},
|
|
2684
|
+
{
|
|
2685
|
+
name: "lock",
|
|
2686
|
+
type: "json",
|
|
2687
|
+
required: false,
|
|
2688
|
+
},
|
|
2689
|
+
],
|
|
2690
|
+
},
|
|
2691
|
+
{
|
|
2692
|
+
group: "balances",
|
|
2693
|
+
method: "track_tokens",
|
|
2694
|
+
path: "/v1/balances.track_tokens",
|
|
2695
|
+
description:
|
|
2696
|
+
"Records AI token usage for a customer and returns the updated AI credit balance.",
|
|
2697
|
+
body: "object",
|
|
2698
|
+
fields: [
|
|
2699
|
+
{
|
|
2700
|
+
name: "customer_id",
|
|
2701
|
+
type: "string",
|
|
2702
|
+
required: true,
|
|
2703
|
+
description: "The ID of the customer.",
|
|
2704
|
+
},
|
|
2705
|
+
{
|
|
2706
|
+
name: "entity_id",
|
|
2707
|
+
type: "string",
|
|
2708
|
+
required: false,
|
|
2709
|
+
description: "The ID of the entity for entity-scoped balances.",
|
|
2710
|
+
},
|
|
2711
|
+
{
|
|
2712
|
+
name: "feature_id",
|
|
2713
|
+
type: "string",
|
|
2714
|
+
required: false,
|
|
2715
|
+
description:
|
|
2716
|
+
"The ID of the AI credit system feature. Auto-detected from the customer's entitlements if omitted — only required when a customer has multiple AI credit systems.",
|
|
2717
|
+
},
|
|
2718
|
+
{
|
|
2719
|
+
name: "model_id",
|
|
2720
|
+
type: "string",
|
|
2721
|
+
required: true,
|
|
2722
|
+
description:
|
|
2723
|
+
"The AI model as '[provider]/[model]' (e.g. 'anthropic/claude-opus-4-8', 'openrouter/openai/gpt-4o'). The provider is the first path segment and must match a provider + model key in models.dev.",
|
|
2724
|
+
},
|
|
2725
|
+
{
|
|
2726
|
+
name: "input_tokens",
|
|
2727
|
+
type: "number",
|
|
2728
|
+
required: true,
|
|
2729
|
+
description:
|
|
2730
|
+
"Number of non-cached text input tokens consumed. Exclusive of cache and audio token pools.",
|
|
2731
|
+
},
|
|
2732
|
+
{
|
|
2733
|
+
name: "output_tokens",
|
|
2734
|
+
type: "number",
|
|
2735
|
+
required: true,
|
|
2736
|
+
description:
|
|
2737
|
+
"Number of text output tokens consumed. Exclusive of the reasoning and audio output pools.",
|
|
2738
|
+
},
|
|
2739
|
+
{
|
|
2740
|
+
name: "cache_read_tokens",
|
|
2741
|
+
type: "number",
|
|
2742
|
+
required: false,
|
|
2743
|
+
description: "Number of cached input tokens read.",
|
|
2744
|
+
},
|
|
2745
|
+
{
|
|
2746
|
+
name: "cache_write_tokens",
|
|
2747
|
+
type: "number",
|
|
2748
|
+
required: false,
|
|
2749
|
+
description: "Number of input tokens written to the cache.",
|
|
2750
|
+
},
|
|
2751
|
+
{
|
|
2752
|
+
name: "audio_input_tokens",
|
|
2753
|
+
type: "number",
|
|
2754
|
+
required: false,
|
|
2755
|
+
description: "Number of audio input tokens consumed.",
|
|
2756
|
+
},
|
|
2757
|
+
{
|
|
2758
|
+
name: "audio_output_tokens",
|
|
2759
|
+
type: "number",
|
|
2760
|
+
required: false,
|
|
2761
|
+
description: "Number of audio output tokens generated.",
|
|
2762
|
+
},
|
|
2763
|
+
{
|
|
2764
|
+
name: "reasoning_tokens",
|
|
2765
|
+
type: "number",
|
|
2766
|
+
required: false,
|
|
2767
|
+
description: "Number of reasoning tokens generated.",
|
|
2768
|
+
},
|
|
2769
|
+
{
|
|
2770
|
+
name: "properties",
|
|
2771
|
+
type: "json",
|
|
2772
|
+
required: false,
|
|
2773
|
+
description: "Additional properties to attach to this usage event.",
|
|
2774
|
+
},
|
|
2775
|
+
{
|
|
2776
|
+
name: "timestamp",
|
|
2777
|
+
type: "number",
|
|
2778
|
+
required: false,
|
|
2779
|
+
description:
|
|
2780
|
+
"Unix timestamp in milliseconds to use for the usage event. Defaults to the current time.",
|
|
2781
|
+
},
|
|
2782
|
+
{
|
|
2783
|
+
name: "overage_behavior",
|
|
2784
|
+
type: "string",
|
|
2785
|
+
required: false,
|
|
2786
|
+
description:
|
|
2787
|
+
'How to handle usage that exceeds the available balance. "cap" (default) deducts only what fits, stopping at zero. "overflow" deducts the full value: the balance can go negative and usage limits do not clamp the deduction, though spend limits still apply.',
|
|
2788
|
+
},
|
|
2789
|
+
{
|
|
2790
|
+
name: "async",
|
|
2791
|
+
type: "boolean",
|
|
2792
|
+
required: false,
|
|
2793
|
+
description:
|
|
2794
|
+
"If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.",
|
|
2795
|
+
},
|
|
2796
|
+
],
|
|
2797
|
+
},
|
|
2798
|
+
{
|
|
2799
|
+
group: "balances",
|
|
2800
|
+
method: "batch_track",
|
|
2801
|
+
path: "/v1/balances.batch_track",
|
|
2802
|
+
description:
|
|
2803
|
+
"Enqueue up to 1000 usage events for asynchronous processing. Items are validated synchronously up front; validated items are then enqueued via SQS for background deduction by workers. The response returns 202 immediately and does not include balance information. On partial enqueue failure (some items fail to enqueue, others succeed), the endpoint still returns 202 and logs the failures server-side; clients should NOT retry, because retrying re-enqueues the already-succeeded items. A 503 is returned only when zero items were successfully enqueued (queue entirely unavailable) — that case is safe to retry.",
|
|
2804
|
+
body: "array",
|
|
2805
|
+
fields: [],
|
|
2806
|
+
},
|
|
2807
|
+
{
|
|
2808
|
+
group: "events",
|
|
2809
|
+
method: "list",
|
|
2810
|
+
path: "/v1/events.list",
|
|
2811
|
+
description:
|
|
2812
|
+
"List usage events for your organization. Filter by customer, feature, or time range.",
|
|
2813
|
+
body: "object",
|
|
2814
|
+
fields: [
|
|
2815
|
+
{
|
|
2816
|
+
name: "start_cursor",
|
|
2817
|
+
type: "string",
|
|
2818
|
+
required: false,
|
|
2819
|
+
description:
|
|
2820
|
+
"Opaque pagination cursor. Empty string (default) requests the first page; use next_cursor from a prior response for subsequent pages.",
|
|
2821
|
+
},
|
|
2822
|
+
{
|
|
2823
|
+
name: "limit",
|
|
2824
|
+
type: "number",
|
|
2825
|
+
required: false,
|
|
2826
|
+
description:
|
|
2827
|
+
"Number of items to return. Default 50, hard ceiling 5000.",
|
|
2828
|
+
},
|
|
2829
|
+
{
|
|
2830
|
+
name: "customer_id",
|
|
2831
|
+
type: "string",
|
|
2832
|
+
required: false,
|
|
2833
|
+
description: "Filter events by customer ID",
|
|
2834
|
+
},
|
|
2835
|
+
{
|
|
2836
|
+
name: "entity_id",
|
|
2837
|
+
type: "string",
|
|
2838
|
+
required: false,
|
|
2839
|
+
description:
|
|
2840
|
+
"Filter events by entity ID (e.g., per-seat or per-resource)",
|
|
2841
|
+
},
|
|
2842
|
+
{
|
|
2843
|
+
name: "feature_id",
|
|
2844
|
+
type: "json",
|
|
2845
|
+
required: false,
|
|
2846
|
+
description: "Filter by specific feature ID(s)",
|
|
2847
|
+
},
|
|
2848
|
+
{
|
|
2849
|
+
name: "custom_range",
|
|
2850
|
+
type: "json",
|
|
2851
|
+
required: false,
|
|
2852
|
+
description: "Filter events by time range",
|
|
2853
|
+
},
|
|
2854
|
+
],
|
|
2855
|
+
},
|
|
2856
|
+
{
|
|
2857
|
+
group: "events",
|
|
2858
|
+
method: "aggregate",
|
|
2859
|
+
path: "/v1/events.aggregate",
|
|
2860
|
+
description:
|
|
2861
|
+
"Aggregate usage events by time period. Returns usage totals grouped by feature and optionally by a custom property.",
|
|
2862
|
+
body: "object",
|
|
2863
|
+
fields: [
|
|
2864
|
+
{
|
|
2865
|
+
name: "customer_id",
|
|
2866
|
+
type: "string",
|
|
2867
|
+
required: false,
|
|
2868
|
+
description: "Customer ID to aggregate events for",
|
|
2869
|
+
},
|
|
2870
|
+
{
|
|
2871
|
+
name: "entity_id",
|
|
2872
|
+
type: "string",
|
|
2873
|
+
required: false,
|
|
2874
|
+
description:
|
|
2875
|
+
"Entity ID to filter aggregated events for (e.g., per-seat or per-resource limits)",
|
|
2876
|
+
},
|
|
2877
|
+
{
|
|
2878
|
+
name: "feature_id",
|
|
2879
|
+
type: "json",
|
|
2880
|
+
required: true,
|
|
2881
|
+
description: "Feature ID(s) to aggregate events for",
|
|
2882
|
+
},
|
|
2883
|
+
{
|
|
2884
|
+
name: "group_by",
|
|
2885
|
+
type: "string",
|
|
2886
|
+
required: false,
|
|
2887
|
+
description:
|
|
2888
|
+
'Property to group events by (e.g. "properties.region"), or "$customer_id" / "$entity_id" / "$plan_id" to group by those columns. When aggregate_on is "deducted", "$feature_id" groups deductions by the tracked feature that consumed each balance.',
|
|
2889
|
+
},
|
|
2890
|
+
{
|
|
2891
|
+
name: "range",
|
|
2892
|
+
type: "string",
|
|
2893
|
+
required: false,
|
|
2894
|
+
description:
|
|
2895
|
+
"Time range to aggregate events for. Either range or custom_range must be provided",
|
|
2896
|
+
},
|
|
2897
|
+
{
|
|
2898
|
+
name: "bin_size",
|
|
2899
|
+
type: "string",
|
|
2900
|
+
required: false,
|
|
2901
|
+
description:
|
|
2902
|
+
"Size of the time bins to aggregate events for. Defaults to hour if range is 24h, otherwise day",
|
|
2903
|
+
},
|
|
2904
|
+
{
|
|
2905
|
+
name: "custom_range",
|
|
2906
|
+
type: "json",
|
|
2907
|
+
required: false,
|
|
2908
|
+
description:
|
|
2909
|
+
"Custom time range to aggregate events for. If provided, range must not be provided",
|
|
2910
|
+
},
|
|
2911
|
+
{
|
|
2912
|
+
name: "filter_by",
|
|
2913
|
+
type: "json",
|
|
2914
|
+
required: false,
|
|
2915
|
+
description:
|
|
2916
|
+
'Filter events by property values, e.g. {"model": "gpt-4", "region": "us"}. Maximum 5 filters.',
|
|
2917
|
+
},
|
|
2918
|
+
{
|
|
2919
|
+
name: "max_groups",
|
|
2920
|
+
type: "number",
|
|
2921
|
+
required: false,
|
|
2922
|
+
description:
|
|
2923
|
+
"Maximum number of distinct group values to return per time bin when using group_by. Remaining values are bundled into an 'Other' bucket. Defaults to 9",
|
|
2924
|
+
},
|
|
2925
|
+
{
|
|
2926
|
+
name: "aggregate_on",
|
|
2927
|
+
type: "string",
|
|
2928
|
+
required: false,
|
|
2929
|
+
description:
|
|
2930
|
+
'Set to "deducted" to additionally return a per-balance breakdown of what each event consumed, under `deductions`. Purely additive: `list` and `total` are unchanged. Requires customer_id.',
|
|
2931
|
+
},
|
|
2932
|
+
],
|
|
2933
|
+
},
|
|
2934
|
+
{
|
|
2935
|
+
group: "invoices",
|
|
2936
|
+
method: "insert",
|
|
2937
|
+
path: "/v1/invoices.insert",
|
|
2938
|
+
description:
|
|
2939
|
+
"Inserts or updates up to 500 historical invoices without reading or mutating the billing processor.",
|
|
2940
|
+
body: "object",
|
|
2941
|
+
fields: [
|
|
2942
|
+
{
|
|
2943
|
+
name: "invoices",
|
|
2944
|
+
type: "json",
|
|
2945
|
+
required: true,
|
|
2946
|
+
description: "Invoices to insert or update, in response order.",
|
|
2947
|
+
},
|
|
2948
|
+
],
|
|
2949
|
+
},
|
|
2950
|
+
{
|
|
2951
|
+
group: "invoices",
|
|
2952
|
+
method: "list",
|
|
2953
|
+
path: "/v1/invoices.list",
|
|
2954
|
+
description:
|
|
2955
|
+
'Lists invoices with cursor pagination and optional filters (customer, entity, status, processor). Pass `start_cursor: ""` (or omit) for the first page; use `next_cursor` from a prior response for subsequent pages.',
|
|
2956
|
+
body: "object",
|
|
2957
|
+
fields: [
|
|
2958
|
+
{
|
|
2959
|
+
name: "start_cursor",
|
|
2960
|
+
type: "string",
|
|
2961
|
+
required: false,
|
|
2962
|
+
description:
|
|
2963
|
+
"Opaque pagination cursor. Empty string (default) requests the first page; use next_cursor from a prior response for subsequent pages.",
|
|
2964
|
+
},
|
|
2965
|
+
{
|
|
2966
|
+
name: "limit",
|
|
2967
|
+
type: "number",
|
|
2968
|
+
required: false,
|
|
2969
|
+
description:
|
|
2970
|
+
"Number of items to return. Default 50, hard ceiling 5000.",
|
|
2971
|
+
},
|
|
2972
|
+
{
|
|
2973
|
+
name: "customer_id",
|
|
2974
|
+
type: "string",
|
|
2975
|
+
required: false,
|
|
2976
|
+
description: "Filter invoices to a single customer by ID.",
|
|
2977
|
+
},
|
|
2978
|
+
{
|
|
2979
|
+
name: "entity_id",
|
|
2980
|
+
type: "string",
|
|
2981
|
+
required: false,
|
|
2982
|
+
description:
|
|
2983
|
+
"Filter invoices to a single entity by ID. Must be provided together with customer_id, since entity IDs are only unique per customer.",
|
|
2984
|
+
},
|
|
2985
|
+
{
|
|
2986
|
+
name: "status",
|
|
2987
|
+
type: "json",
|
|
2988
|
+
required: false,
|
|
2989
|
+
description:
|
|
2990
|
+
"Filter by invoice status (draft, open, paid, void, uncollectible).",
|
|
2991
|
+
},
|
|
2992
|
+
{
|
|
2993
|
+
name: "processor_types",
|
|
2994
|
+
type: "json",
|
|
2995
|
+
required: false,
|
|
2996
|
+
description:
|
|
2997
|
+
"Filter by billing processor (stripe, revenuecat). Invoices recorded before processor tracking count as stripe.",
|
|
2998
|
+
},
|
|
2999
|
+
],
|
|
3000
|
+
},
|
|
3001
|
+
{
|
|
3002
|
+
group: "invoices",
|
|
3003
|
+
method: "pay",
|
|
3004
|
+
path: "/v1/invoices.pay",
|
|
3005
|
+
description:
|
|
3006
|
+
"Marks an open Stripe invoice as paid out of band. No charge is attempted; use this when payment was collected elsewhere (e.g. a marketplace). Already-paid invoices are returned unchanged.",
|
|
3007
|
+
body: "object",
|
|
3008
|
+
fields: [
|
|
3009
|
+
{
|
|
3010
|
+
name: "invoice_id",
|
|
3011
|
+
type: "string",
|
|
3012
|
+
required: true,
|
|
3013
|
+
description: "The Autumn invoice ID to mark as paid.",
|
|
3014
|
+
},
|
|
3015
|
+
],
|
|
3016
|
+
},
|
|
3017
|
+
{
|
|
3018
|
+
group: "licenses",
|
|
3019
|
+
method: "attach",
|
|
3020
|
+
path: "/v1/licenses.attach",
|
|
3021
|
+
description: "Assigns licenses to one or more entities.",
|
|
3022
|
+
body: "object",
|
|
3023
|
+
fields: [
|
|
3024
|
+
{
|
|
3025
|
+
name: "customer_id",
|
|
3026
|
+
type: "string",
|
|
3027
|
+
required: true,
|
|
3028
|
+
},
|
|
3029
|
+
{
|
|
3030
|
+
name: "plan_id",
|
|
3031
|
+
type: "string",
|
|
3032
|
+
required: true,
|
|
3033
|
+
},
|
|
3034
|
+
{
|
|
3035
|
+
name: "entities",
|
|
3036
|
+
type: "json",
|
|
3037
|
+
required: true,
|
|
3038
|
+
},
|
|
3039
|
+
],
|
|
3040
|
+
},
|
|
3041
|
+
{
|
|
3042
|
+
group: "licenses",
|
|
3043
|
+
method: "release",
|
|
3044
|
+
path: "/v1/licenses.release",
|
|
3045
|
+
description: "Releases licenses assigned to one or more entities.",
|
|
3046
|
+
body: "object",
|
|
3047
|
+
fields: [
|
|
3048
|
+
{
|
|
3049
|
+
name: "customer_id",
|
|
3050
|
+
type: "string",
|
|
3051
|
+
required: true,
|
|
3052
|
+
},
|
|
3053
|
+
{
|
|
3054
|
+
name: "license_plan_id",
|
|
3055
|
+
type: "string",
|
|
3056
|
+
required: false,
|
|
3057
|
+
description:
|
|
3058
|
+
"Scopes the release when an entity holds licenses of multiple plans.",
|
|
3059
|
+
},
|
|
3060
|
+
{
|
|
3061
|
+
name: "entity_ids",
|
|
3062
|
+
type: "json",
|
|
3063
|
+
required: true,
|
|
3064
|
+
},
|
|
3065
|
+
],
|
|
3066
|
+
},
|
|
3067
|
+
{
|
|
3068
|
+
group: "licenses",
|
|
3069
|
+
method: "list_assignments",
|
|
3070
|
+
path: "/v1/licenses.list_assignments",
|
|
3071
|
+
description: "Lists license assignments for a customer.",
|
|
3072
|
+
body: "object",
|
|
3073
|
+
fields: [
|
|
3074
|
+
{
|
|
3075
|
+
name: "customer_id",
|
|
3076
|
+
type: "string",
|
|
3077
|
+
required: true,
|
|
3078
|
+
},
|
|
3079
|
+
{
|
|
3080
|
+
name: "entity_id",
|
|
3081
|
+
type: "string",
|
|
3082
|
+
required: false,
|
|
3083
|
+
},
|
|
3084
|
+
{
|
|
3085
|
+
name: "plan_id",
|
|
3086
|
+
type: "string",
|
|
3087
|
+
required: false,
|
|
3088
|
+
},
|
|
3089
|
+
{
|
|
3090
|
+
name: "active",
|
|
3091
|
+
type: "boolean",
|
|
3092
|
+
required: false,
|
|
3093
|
+
},
|
|
3094
|
+
],
|
|
3095
|
+
},
|
|
3096
|
+
{
|
|
3097
|
+
group: "licenses",
|
|
3098
|
+
method: "list",
|
|
3099
|
+
path: "/v1/licenses.list",
|
|
3100
|
+
description: "Lists a customer's license pools and available seats.",
|
|
3101
|
+
body: "object",
|
|
3102
|
+
fields: [
|
|
3103
|
+
{
|
|
3104
|
+
name: "customer_id",
|
|
3105
|
+
type: "string",
|
|
3106
|
+
required: true,
|
|
3107
|
+
},
|
|
3108
|
+
{
|
|
3109
|
+
name: "entity_id",
|
|
3110
|
+
type: "string",
|
|
3111
|
+
required: false,
|
|
3112
|
+
},
|
|
3113
|
+
],
|
|
3114
|
+
},
|
|
3115
|
+
{
|
|
3116
|
+
group: "entities",
|
|
3117
|
+
method: "create",
|
|
3118
|
+
path: "/v1/entities.create",
|
|
3119
|
+
description:
|
|
3120
|
+
"Creates an entity for a customer and feature, then returns the entity with balances and subscriptions.",
|
|
3121
|
+
body: "object",
|
|
3122
|
+
fields: [
|
|
3123
|
+
{
|
|
3124
|
+
name: "name",
|
|
3125
|
+
type: "string",
|
|
3126
|
+
required: false,
|
|
3127
|
+
description: "The name of the entity",
|
|
3128
|
+
},
|
|
3129
|
+
{
|
|
3130
|
+
name: "feature_id",
|
|
3131
|
+
type: "string",
|
|
3132
|
+
required: true,
|
|
3133
|
+
description: "The ID of the feature this entity is associated with",
|
|
3134
|
+
},
|
|
3135
|
+
{
|
|
3136
|
+
name: "billing_controls",
|
|
3137
|
+
type: "json",
|
|
3138
|
+
required: false,
|
|
3139
|
+
description: "Billing controls for the entity.",
|
|
3140
|
+
},
|
|
3141
|
+
{
|
|
3142
|
+
name: "customer_data",
|
|
3143
|
+
type: "json",
|
|
3144
|
+
required: false,
|
|
3145
|
+
description:
|
|
3146
|
+
"Customer attributes used to resolve the customer when customer_id is not provided.",
|
|
3147
|
+
},
|
|
3148
|
+
{
|
|
3149
|
+
name: "customer_id",
|
|
3150
|
+
type: "string",
|
|
3151
|
+
required: true,
|
|
3152
|
+
description: "The ID of the customer to create the entity for.",
|
|
3153
|
+
},
|
|
3154
|
+
{
|
|
3155
|
+
name: "entity_id",
|
|
3156
|
+
type: "string",
|
|
3157
|
+
required: true,
|
|
3158
|
+
description: "The ID of the entity.",
|
|
3159
|
+
},
|
|
3160
|
+
],
|
|
3161
|
+
},
|
|
3162
|
+
{
|
|
3163
|
+
group: "entities",
|
|
3164
|
+
method: "get",
|
|
3165
|
+
path: "/v1/entities.get",
|
|
3166
|
+
description: "Fetches an entity by its ID.",
|
|
3167
|
+
body: "object",
|
|
3168
|
+
fields: [
|
|
3169
|
+
{
|
|
3170
|
+
name: "customer_id",
|
|
3171
|
+
type: "string",
|
|
3172
|
+
required: false,
|
|
3173
|
+
description: "The ID of the customer to create the entity for.",
|
|
3174
|
+
},
|
|
3175
|
+
{
|
|
3176
|
+
name: "entity_id",
|
|
3177
|
+
type: "string",
|
|
3178
|
+
required: true,
|
|
3179
|
+
description: "The ID of the entity.",
|
|
3180
|
+
},
|
|
3181
|
+
],
|
|
3182
|
+
},
|
|
3183
|
+
{
|
|
3184
|
+
group: "entities",
|
|
3185
|
+
method: "list",
|
|
3186
|
+
path: "/v1/entities.list",
|
|
3187
|
+
description:
|
|
3188
|
+
"Lists entities across the organization with pagination and optional filters.",
|
|
3189
|
+
body: "object",
|
|
3190
|
+
fields: [
|
|
3191
|
+
{
|
|
3192
|
+
name: "start_cursor",
|
|
3193
|
+
type: "string",
|
|
3194
|
+
required: false,
|
|
3195
|
+
description:
|
|
3196
|
+
"Opaque pagination cursor. Empty string (default) requests the first page; use next_cursor from a prior response for subsequent pages.",
|
|
3197
|
+
},
|
|
3198
|
+
{
|
|
3199
|
+
name: "limit",
|
|
3200
|
+
type: "number",
|
|
3201
|
+
required: false,
|
|
3202
|
+
description:
|
|
3203
|
+
"Number of items to return. Default 50, hard ceiling 5000.",
|
|
3204
|
+
},
|
|
3205
|
+
{
|
|
3206
|
+
name: "plans",
|
|
3207
|
+
type: "json",
|
|
3208
|
+
required: false,
|
|
3209
|
+
description:
|
|
3210
|
+
"Filter by plan ID and version. Returns entities with active subscriptions to this plan, including plans inherited from the parent customer.",
|
|
3211
|
+
},
|
|
3212
|
+
{
|
|
3213
|
+
name: "subscription_status",
|
|
3214
|
+
type: "string",
|
|
3215
|
+
required: false,
|
|
3216
|
+
description:
|
|
3217
|
+
"Filter customer products used for entity hydration and plan matching. Defaults to active and scheduled.",
|
|
3218
|
+
},
|
|
3219
|
+
{
|
|
3220
|
+
name: "search",
|
|
3221
|
+
type: "string",
|
|
3222
|
+
required: false,
|
|
3223
|
+
description: "Search entities by id or name.",
|
|
3224
|
+
},
|
|
3225
|
+
{
|
|
3226
|
+
name: "processors",
|
|
3227
|
+
type: "json",
|
|
3228
|
+
required: false,
|
|
3229
|
+
description:
|
|
3230
|
+
"Filter by parent customer processor type (stripe, revenuecat, vercel).",
|
|
3231
|
+
},
|
|
3232
|
+
{
|
|
3233
|
+
name: "customer_id",
|
|
3234
|
+
type: "string",
|
|
3235
|
+
required: false,
|
|
3236
|
+
description:
|
|
3237
|
+
"Restrict the response to entities owned by this customer id. Use to bulk-fetch all entities for one customer in a single paginated call instead of iterating entities.get.",
|
|
3238
|
+
},
|
|
3239
|
+
],
|
|
3240
|
+
},
|
|
3241
|
+
{
|
|
3242
|
+
group: "entities",
|
|
3243
|
+
method: "update",
|
|
3244
|
+
path: "/v1/entities.update",
|
|
3245
|
+
description:
|
|
3246
|
+
"Updates an existing entity and returns the refreshed entity object.",
|
|
3247
|
+
body: "object",
|
|
3248
|
+
fields: [
|
|
3249
|
+
{
|
|
3250
|
+
name: "customer_id",
|
|
3251
|
+
type: "string",
|
|
3252
|
+
required: false,
|
|
3253
|
+
description: "The ID of the customer that owns the entity.",
|
|
3254
|
+
},
|
|
3255
|
+
{
|
|
3256
|
+
name: "entity_id",
|
|
3257
|
+
type: "string",
|
|
3258
|
+
required: true,
|
|
3259
|
+
description: "The ID of the entity.",
|
|
3260
|
+
},
|
|
3261
|
+
{
|
|
3262
|
+
name: "billing_controls",
|
|
3263
|
+
type: "json",
|
|
3264
|
+
required: false,
|
|
3265
|
+
description: "Billing controls to replace on the entity.",
|
|
3266
|
+
},
|
|
3267
|
+
],
|
|
3268
|
+
},
|
|
3269
|
+
{
|
|
3270
|
+
group: "entities",
|
|
3271
|
+
method: "delete",
|
|
3272
|
+
path: "/v1/entities.delete",
|
|
3273
|
+
description: "Deletes an entity by entity ID.",
|
|
3274
|
+
body: "object",
|
|
3275
|
+
fields: [
|
|
3276
|
+
{
|
|
3277
|
+
name: "customer_id",
|
|
3278
|
+
type: "string",
|
|
3279
|
+
required: false,
|
|
3280
|
+
description: "The ID of the customer.",
|
|
3281
|
+
},
|
|
3282
|
+
{
|
|
3283
|
+
name: "entity_id",
|
|
3284
|
+
type: "string",
|
|
3285
|
+
required: true,
|
|
3286
|
+
description: "The ID of the entity.",
|
|
3287
|
+
},
|
|
3288
|
+
],
|
|
3289
|
+
},
|
|
3290
|
+
{
|
|
3291
|
+
group: "referrals",
|
|
3292
|
+
method: "create_code",
|
|
3293
|
+
path: "/v1/referrals.create_code",
|
|
3294
|
+
description:
|
|
3295
|
+
"Create or fetch a referral code for a customer in a referral program.",
|
|
3296
|
+
body: "object",
|
|
3297
|
+
fields: [
|
|
3298
|
+
{
|
|
3299
|
+
name: "customer_id",
|
|
3300
|
+
type: "string",
|
|
3301
|
+
required: true,
|
|
3302
|
+
description: "The unique identifier of the customer",
|
|
3303
|
+
},
|
|
3304
|
+
{
|
|
3305
|
+
name: "program_id",
|
|
3306
|
+
type: "string",
|
|
3307
|
+
required: true,
|
|
3308
|
+
description: "ID of your referral program",
|
|
3309
|
+
},
|
|
3310
|
+
],
|
|
3311
|
+
},
|
|
3312
|
+
{
|
|
3313
|
+
group: "referrals",
|
|
3314
|
+
method: "redeem_code",
|
|
3315
|
+
path: "/v1/referrals.redeem_code",
|
|
3316
|
+
description: "Redeem a referral code for a customer.",
|
|
3317
|
+
body: "object",
|
|
3318
|
+
fields: [
|
|
3319
|
+
{
|
|
3320
|
+
name: "code",
|
|
3321
|
+
type: "string",
|
|
3322
|
+
required: true,
|
|
3323
|
+
description: "The referral code to redeem",
|
|
3324
|
+
},
|
|
3325
|
+
{
|
|
3326
|
+
name: "customer_id",
|
|
3327
|
+
type: "string",
|
|
3328
|
+
required: true,
|
|
3329
|
+
description: "The unique identifier of the customer redeeming the code",
|
|
3330
|
+
},
|
|
3331
|
+
],
|
|
3332
|
+
},
|
|
3333
|
+
{
|
|
3334
|
+
group: "referral_programs",
|
|
3335
|
+
method: "create",
|
|
3336
|
+
path: "/v1/referral_programs.create",
|
|
3337
|
+
description: "Create a referral program linked to an existing reward.",
|
|
3338
|
+
body: "object",
|
|
3339
|
+
fields: [
|
|
3340
|
+
{
|
|
3341
|
+
name: "id",
|
|
3342
|
+
type: "string",
|
|
3343
|
+
required: true,
|
|
3344
|
+
},
|
|
3345
|
+
{
|
|
3346
|
+
name: "reward_id",
|
|
3347
|
+
type: "string",
|
|
3348
|
+
required: true,
|
|
3349
|
+
},
|
|
3350
|
+
{
|
|
3351
|
+
name: "redeem_on",
|
|
3352
|
+
type: "string",
|
|
3353
|
+
required: true,
|
|
3354
|
+
description:
|
|
3355
|
+
"When the reward is granted: on redemption, or when the redeemer checks out.",
|
|
3356
|
+
},
|
|
3357
|
+
{
|
|
3358
|
+
name: "received_by",
|
|
3359
|
+
type: "string",
|
|
3360
|
+
required: true,
|
|
3361
|
+
description:
|
|
3362
|
+
"Who receives the reward: the referrer only, or both parties.",
|
|
3363
|
+
},
|
|
3364
|
+
{
|
|
3365
|
+
name: "max_redemptions",
|
|
3366
|
+
type: "number",
|
|
3367
|
+
required: false,
|
|
3368
|
+
description:
|
|
3369
|
+
"A positive redemption limit, or null for unlimited redemptions.",
|
|
3370
|
+
},
|
|
3371
|
+
{
|
|
3372
|
+
name: "plan_ids",
|
|
3373
|
+
type: "json",
|
|
3374
|
+
required: false,
|
|
3375
|
+
description:
|
|
3376
|
+
"Required when redeem_on is checkout. Plan IDs must be unique.",
|
|
3377
|
+
},
|
|
3378
|
+
{
|
|
3379
|
+
name: "exclude_trial",
|
|
3380
|
+
type: "boolean",
|
|
3381
|
+
required: false,
|
|
3382
|
+
description:
|
|
3383
|
+
"Whether checkouts that start a trial should skip granting the reward.",
|
|
3384
|
+
},
|
|
3385
|
+
{
|
|
3386
|
+
name: "internal_id",
|
|
3387
|
+
type: "string",
|
|
3388
|
+
required: false,
|
|
3389
|
+
description:
|
|
3390
|
+
"Address an existing referral program by its stable id. Omit when creating — the server generates one.",
|
|
3391
|
+
},
|
|
3392
|
+
],
|
|
3393
|
+
},
|
|
3394
|
+
{
|
|
3395
|
+
group: "referral_programs",
|
|
3396
|
+
method: "list",
|
|
3397
|
+
path: "/v1/referral_programs.list",
|
|
3398
|
+
description: "List the referral programs configured for the org.",
|
|
3399
|
+
body: "none",
|
|
3400
|
+
fields: [],
|
|
3401
|
+
},
|
|
3402
|
+
{
|
|
3403
|
+
group: "referral_programs",
|
|
3404
|
+
method: "get",
|
|
3405
|
+
path: "/v1/referral_programs.get",
|
|
3406
|
+
description: "Fetch a referral program by ID.",
|
|
3407
|
+
body: "object",
|
|
3408
|
+
fields: [
|
|
3409
|
+
{
|
|
3410
|
+
name: "referral_program_id",
|
|
3411
|
+
type: "string",
|
|
3412
|
+
required: true,
|
|
3413
|
+
description: "The ID of the referral program.",
|
|
3414
|
+
},
|
|
3415
|
+
],
|
|
3416
|
+
},
|
|
3417
|
+
{
|
|
3418
|
+
group: "referral_programs",
|
|
3419
|
+
method: "update",
|
|
3420
|
+
path: "/v1/referral_programs.update",
|
|
3421
|
+
description:
|
|
3422
|
+
"Update a referral program. Omitted fields keep their current value.",
|
|
3423
|
+
body: "object",
|
|
3424
|
+
fields: [
|
|
3425
|
+
{
|
|
3426
|
+
name: "referral_program_id",
|
|
3427
|
+
type: "string",
|
|
3428
|
+
required: true,
|
|
3429
|
+
description: "The ID of the referral program.",
|
|
3430
|
+
},
|
|
3431
|
+
{
|
|
3432
|
+
name: "reward_id",
|
|
3433
|
+
type: "string",
|
|
3434
|
+
required: false,
|
|
3435
|
+
description: "The ID of the reward granted when a code is redeemed.",
|
|
3436
|
+
},
|
|
3437
|
+
{
|
|
3438
|
+
name: "redeem_on",
|
|
3439
|
+
type: "string",
|
|
3440
|
+
required: false,
|
|
3441
|
+
description:
|
|
3442
|
+
"When the reward is granted: on redemption, or when the redeemer checks out.",
|
|
3443
|
+
},
|
|
3444
|
+
{
|
|
3445
|
+
name: "received_by",
|
|
3446
|
+
type: "string",
|
|
3447
|
+
required: false,
|
|
3448
|
+
description:
|
|
3449
|
+
"Who receives the reward: the referrer only, or both parties.",
|
|
3450
|
+
},
|
|
3451
|
+
{
|
|
3452
|
+
name: "max_redemptions",
|
|
3453
|
+
type: "number",
|
|
3454
|
+
required: false,
|
|
3455
|
+
description:
|
|
3456
|
+
"A positive redemption limit. Omit to leave unchanged; null removes it.",
|
|
3457
|
+
},
|
|
3458
|
+
{
|
|
3459
|
+
name: "plan_ids",
|
|
3460
|
+
type: "json",
|
|
3461
|
+
required: false,
|
|
3462
|
+
description:
|
|
3463
|
+
"Required when redeem_on is checkout. Plan IDs must be unique. Omit to leave unchanged; null removes them.",
|
|
3464
|
+
},
|
|
3465
|
+
{
|
|
3466
|
+
name: "exclude_trial",
|
|
3467
|
+
type: "boolean",
|
|
3468
|
+
required: false,
|
|
3469
|
+
description: "Omit to leave unchanged; null removes it.",
|
|
3470
|
+
},
|
|
3471
|
+
],
|
|
3472
|
+
},
|
|
3473
|
+
{
|
|
3474
|
+
group: "referral_programs",
|
|
3475
|
+
method: "delete",
|
|
3476
|
+
path: "/v1/referral_programs.delete",
|
|
3477
|
+
description: "Delete a referral program.",
|
|
3478
|
+
body: "object",
|
|
3479
|
+
fields: [
|
|
3480
|
+
{
|
|
3481
|
+
name: "referral_program_id",
|
|
3482
|
+
type: "string",
|
|
3483
|
+
required: true,
|
|
3484
|
+
description: "The ID of the referral program.",
|
|
3485
|
+
},
|
|
3486
|
+
],
|
|
3487
|
+
},
|
|
3488
|
+
{
|
|
3489
|
+
group: "rewards",
|
|
3490
|
+
method: "create",
|
|
3491
|
+
path: "/v1/rewards.create",
|
|
3492
|
+
description: "Create a coupon or feature grant.",
|
|
3493
|
+
body: "object",
|
|
3494
|
+
fields: [
|
|
3495
|
+
{
|
|
3496
|
+
name: "coupon",
|
|
3497
|
+
type: "json",
|
|
3498
|
+
required: false,
|
|
3499
|
+
description:
|
|
3500
|
+
"Provide exactly one of coupon or feature_grant, not both.",
|
|
3501
|
+
},
|
|
3502
|
+
{
|
|
3503
|
+
name: "feature_grant",
|
|
3504
|
+
type: "json",
|
|
3505
|
+
required: false,
|
|
3506
|
+
description:
|
|
3507
|
+
"Provide exactly one of coupon or feature_grant, not both.",
|
|
3508
|
+
},
|
|
3509
|
+
],
|
|
3510
|
+
},
|
|
3511
|
+
{
|
|
3512
|
+
group: "rewards",
|
|
3513
|
+
method: "list",
|
|
3514
|
+
path: "/v1/rewards.list",
|
|
3515
|
+
description: "List the coupons and feature grants configured for the org.",
|
|
3516
|
+
body: "none",
|
|
3517
|
+
fields: [],
|
|
3518
|
+
},
|
|
3519
|
+
{
|
|
3520
|
+
group: "rewards",
|
|
3521
|
+
method: "get",
|
|
3522
|
+
path: "/v1/rewards.get",
|
|
3523
|
+
description: "Fetch a coupon or feature grant by ID.",
|
|
3524
|
+
body: "object",
|
|
3525
|
+
fields: [
|
|
3526
|
+
{
|
|
3527
|
+
name: "reward_id",
|
|
3528
|
+
type: "string",
|
|
3529
|
+
required: true,
|
|
3530
|
+
description: "The ID of the coupon or feature grant.",
|
|
3531
|
+
},
|
|
3532
|
+
],
|
|
3533
|
+
},
|
|
3534
|
+
{
|
|
3535
|
+
group: "rewards",
|
|
3536
|
+
method: "update",
|
|
3537
|
+
path: "/v1/rewards.update",
|
|
3538
|
+
description:
|
|
3539
|
+
"Update a coupon or feature grant. Omitted fields keep their current value.",
|
|
3540
|
+
body: "object",
|
|
3541
|
+
fields: [
|
|
3542
|
+
{
|
|
3543
|
+
name: "reward_id",
|
|
3544
|
+
type: "string",
|
|
3545
|
+
required: true,
|
|
3546
|
+
description: "The ID of the coupon or feature grant.",
|
|
3547
|
+
},
|
|
3548
|
+
{
|
|
3549
|
+
name: "coupon",
|
|
3550
|
+
type: "json",
|
|
3551
|
+
required: false,
|
|
3552
|
+
},
|
|
3553
|
+
{
|
|
3554
|
+
name: "feature_grant",
|
|
3555
|
+
type: "json",
|
|
3556
|
+
required: false,
|
|
3557
|
+
},
|
|
3558
|
+
],
|
|
3559
|
+
},
|
|
3560
|
+
{
|
|
3561
|
+
group: "rewards",
|
|
3562
|
+
method: "delete",
|
|
3563
|
+
path: "/v1/rewards.delete",
|
|
3564
|
+
description: "Delete a coupon or feature grant.",
|
|
3565
|
+
body: "object",
|
|
3566
|
+
fields: [
|
|
3567
|
+
{
|
|
3568
|
+
name: "reward_id",
|
|
3569
|
+
type: "string",
|
|
3570
|
+
required: true,
|
|
3571
|
+
description: "The ID of the coupon or feature grant.",
|
|
3572
|
+
},
|
|
3573
|
+
],
|
|
3574
|
+
},
|
|
3575
|
+
{
|
|
3576
|
+
group: "rewards",
|
|
3577
|
+
method: "redeem",
|
|
3578
|
+
path: "/v1/rewards.redeem",
|
|
3579
|
+
description: "Redeem a reward promo code for a customer.",
|
|
3580
|
+
body: "object",
|
|
3581
|
+
fields: [
|
|
3582
|
+
{
|
|
3583
|
+
name: "code",
|
|
3584
|
+
type: "string",
|
|
3585
|
+
required: true,
|
|
3586
|
+
description: "The reward promo code to redeem",
|
|
3587
|
+
},
|
|
3588
|
+
{
|
|
3589
|
+
name: "customer_id",
|
|
3590
|
+
type: "string",
|
|
3591
|
+
required: true,
|
|
3592
|
+
description: "The unique identifier of the customer redeeming the code",
|
|
3593
|
+
},
|
|
3594
|
+
],
|
|
3595
|
+
},
|
|
3596
|
+
{
|
|
3597
|
+
group: "platform",
|
|
3598
|
+
method: "link_revenuecat",
|
|
3599
|
+
path: "/v1/platform.link_revenuecat",
|
|
3600
|
+
description:
|
|
3601
|
+
"Generate a RevenueCat OAuth URL for linking a project to an organization.",
|
|
3602
|
+
body: "object",
|
|
3603
|
+
fields: [
|
|
3604
|
+
{
|
|
3605
|
+
name: "organization_slug",
|
|
3606
|
+
type: "string",
|
|
3607
|
+
required: true,
|
|
3608
|
+
},
|
|
3609
|
+
{
|
|
3610
|
+
name: "env",
|
|
3611
|
+
type: "string",
|
|
3612
|
+
required: true,
|
|
3613
|
+
},
|
|
3614
|
+
{
|
|
3615
|
+
name: "project_name",
|
|
3616
|
+
type: "string",
|
|
3617
|
+
required: true,
|
|
3618
|
+
},
|
|
3619
|
+
{
|
|
3620
|
+
name: "redirect_url",
|
|
3621
|
+
type: "string",
|
|
3622
|
+
required: true,
|
|
3623
|
+
},
|
|
3624
|
+
],
|
|
3625
|
+
},
|
|
3626
|
+
{
|
|
3627
|
+
group: "platform",
|
|
3628
|
+
method: "sync_revenuecat",
|
|
3629
|
+
path: "/v1/platform.sync_revenuecat",
|
|
3630
|
+
description:
|
|
3631
|
+
"Push an organization's plans into RevenueCat as products (creating or renaming them across the project's apps) and set test-store prices from each plan's price. Requires the org to have linked RevenueCat via OAuth.",
|
|
3632
|
+
body: "object",
|
|
3633
|
+
fields: [
|
|
3634
|
+
{
|
|
3635
|
+
name: "organization_slug",
|
|
3636
|
+
type: "string",
|
|
3637
|
+
required: true,
|
|
3638
|
+
},
|
|
3639
|
+
{
|
|
3640
|
+
name: "env",
|
|
3641
|
+
type: "string",
|
|
3642
|
+
required: true,
|
|
3643
|
+
description: '"test" and "sandbox" both target the sandbox environment',
|
|
3644
|
+
},
|
|
3645
|
+
{
|
|
3646
|
+
name: "product_ids",
|
|
3647
|
+
type: "json",
|
|
3648
|
+
required: false,
|
|
3649
|
+
description: "Plans to push. Omit to sync every plan in the org/env.",
|
|
3650
|
+
},
|
|
3651
|
+
],
|
|
3652
|
+
},
|
|
3653
|
+
{
|
|
3654
|
+
group: "platform",
|
|
3655
|
+
method: "get_revenuecat_keys",
|
|
3656
|
+
path: "/v1/platform.get_revenuecat_keys",
|
|
3657
|
+
description:
|
|
3658
|
+
"Retrieve a managed organization's RevenueCat public (SDK) API keys, grouped by app — for the test store, App Store, and Google Play Store. Use these to configure the RevenueCat SDK in the org's mobile app.",
|
|
3659
|
+
body: "object",
|
|
3660
|
+
fields: [
|
|
3661
|
+
{
|
|
3662
|
+
name: "organization_slug",
|
|
3663
|
+
type: "string",
|
|
3664
|
+
required: true,
|
|
3665
|
+
},
|
|
3666
|
+
{
|
|
3667
|
+
name: "env",
|
|
3668
|
+
type: "string",
|
|
3669
|
+
required: true,
|
|
3670
|
+
description: '"test" and "sandbox" both target the sandbox environment',
|
|
3671
|
+
},
|
|
3672
|
+
],
|
|
3673
|
+
},
|
|
3674
|
+
{
|
|
3675
|
+
group: "keys",
|
|
3676
|
+
method: "mint",
|
|
3677
|
+
path: "/v1/keys.mint",
|
|
3678
|
+
description:
|
|
3679
|
+
"Mints a per-customer token (a scoped `am_jwt_` credential) so a downstream / self-hosted app can call Autumn directly without your secret key. Returns a short-lived access token plus a rotating refresh token, both bound to the given customer. Authenticated with your secret key.",
|
|
3680
|
+
body: "object",
|
|
3681
|
+
fields: [
|
|
3682
|
+
{
|
|
3683
|
+
name: "customer_id",
|
|
3684
|
+
type: "string",
|
|
3685
|
+
required: true,
|
|
3686
|
+
description: "The customer to mint a token for.",
|
|
3687
|
+
},
|
|
3688
|
+
{
|
|
3689
|
+
name: "indefinite",
|
|
3690
|
+
type: "boolean",
|
|
3691
|
+
required: false,
|
|
3692
|
+
description:
|
|
3693
|
+
"If true, mint a non-expiring access token (no refresh token). Revoke via keys.revoke.",
|
|
3694
|
+
},
|
|
3695
|
+
],
|
|
3696
|
+
},
|
|
3697
|
+
{
|
|
3698
|
+
group: "keys",
|
|
3699
|
+
method: "refresh",
|
|
3700
|
+
path: "/v1/keys.refresh",
|
|
3701
|
+
description:
|
|
3702
|
+
"Exchanges a refresh token (sent as the Bearer credential) for a freshly rotated access + refresh pair. Self-service for the token holder — no secret key required. The previous refresh token is honored for one rotation as a grace window; replaying an older one revokes the customer's tokens.",
|
|
3703
|
+
body: "none",
|
|
3704
|
+
fields: [],
|
|
3705
|
+
},
|
|
3706
|
+
{
|
|
3707
|
+
group: "keys",
|
|
3708
|
+
method: "revoke",
|
|
3709
|
+
path: "/v1/keys.revoke",
|
|
3710
|
+
description:
|
|
3711
|
+
"Revokes every outstanding token (access and refresh) for a customer. Authenticated with your secret key. New tokens can be issued afterwards with `keys.mint`.",
|
|
3712
|
+
body: "object",
|
|
3713
|
+
fields: [
|
|
3714
|
+
{
|
|
3715
|
+
name: "customer_id",
|
|
3716
|
+
type: "string",
|
|
3717
|
+
required: true,
|
|
3718
|
+
description:
|
|
3719
|
+
"The customer whose tokens (every outstanding access + refresh token) should be revoked.",
|
|
3720
|
+
},
|
|
3721
|
+
],
|
|
3722
|
+
},
|
|
3723
|
+
{
|
|
3724
|
+
group: "sandboxes",
|
|
3725
|
+
method: "create",
|
|
3726
|
+
path: "/v1/sandboxes.create",
|
|
3727
|
+
description:
|
|
3728
|
+
"Creates a sandbox: an isolated copy of your organization with its own catalog, customers and secret key. Returns the sandbox's secret key once, in this response — store it, it cannot be read back. Authenticated with your organization's secret key (a sandbox's own key cannot create sandboxes).",
|
|
3729
|
+
body: "object",
|
|
3730
|
+
fields: [
|
|
3731
|
+
{
|
|
3732
|
+
name: "name",
|
|
3733
|
+
type: "string",
|
|
3734
|
+
required: true,
|
|
3735
|
+
description: "A name for the sandbox, unique within your organization.",
|
|
3736
|
+
},
|
|
3737
|
+
{
|
|
3738
|
+
name: "color",
|
|
3739
|
+
type: "string",
|
|
3740
|
+
required: false,
|
|
3741
|
+
description:
|
|
3742
|
+
"Colour the dashboard uses to label the sandbox. Defaults to `gray`.",
|
|
3743
|
+
},
|
|
3744
|
+
{
|
|
3745
|
+
name: "icon",
|
|
3746
|
+
type: "string",
|
|
3747
|
+
required: false,
|
|
3748
|
+
description:
|
|
3749
|
+
"Icon the dashboard uses to label the sandbox. Defaults to `Flask`.",
|
|
3750
|
+
},
|
|
3751
|
+
],
|
|
3752
|
+
},
|
|
3753
|
+
{
|
|
3754
|
+
group: "sandboxes",
|
|
3755
|
+
method: "list",
|
|
3756
|
+
path: "/v1/sandboxes.list",
|
|
3757
|
+
description:
|
|
3758
|
+
"Lists every sandbox belonging to your organization, newest first. Secret keys are never returned here — only `sandboxes.create` shows one.",
|
|
3759
|
+
body: "none",
|
|
3760
|
+
fields: [],
|
|
3761
|
+
},
|
|
3762
|
+
{
|
|
3763
|
+
group: "sandboxes",
|
|
3764
|
+
method: "delete",
|
|
3765
|
+
path: "/v1/sandboxes.delete",
|
|
3766
|
+
description:
|
|
3767
|
+
"Permanently deletes a sandbox and everything inside it: its catalog, customers and secret key. Cannot be undone.",
|
|
3768
|
+
body: "object",
|
|
3769
|
+
fields: [
|
|
3770
|
+
{
|
|
3771
|
+
name: "id",
|
|
3772
|
+
type: "string",
|
|
3773
|
+
required: true,
|
|
3774
|
+
description: "The ID of the sandbox to delete.",
|
|
3775
|
+
},
|
|
3776
|
+
],
|
|
3777
|
+
},
|
|
3778
|
+
{
|
|
3779
|
+
group: "sandboxes",
|
|
3780
|
+
method: "reset",
|
|
3781
|
+
path: "/v1/sandboxes.reset",
|
|
3782
|
+
description:
|
|
3783
|
+
"Wipes every customer, plan, feature and migration draft in the sandbox the calling key belongs to, leaving the sandbox itself, its secret keys and its settings in place. There is no id to pass: a sandbox's own key resets that sandbox, and an organization's test-mode key resets its default sandbox environment. Refused for live keys — only sandboxes can be reset. Cannot be undone.",
|
|
3784
|
+
body: "none",
|
|
3785
|
+
fields: [],
|
|
3786
|
+
},
|
|
3787
|
+
];
|