@tenthbilling/node 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +133 -2
- package/dist/client.d.ts +115 -0
- package/dist/client.js +220 -0
- package/dist/errors.d.ts +32 -0
- package/dist/errors.js +37 -0
- package/dist/generated/openapi.d.ts +3208 -0
- package/dist/generated/openapi.js +1 -0
- package/dist/http.d.ts +46 -0
- package/dist/http.js +165 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +6 -0
- package/dist/token.d.ts +16 -0
- package/dist/token.js +44 -0
- package/dist/types.d.ts +81 -0
- package/dist/types.js +38 -0
- package/dist/webhook.d.ts +16 -0
- package/dist/webhook.js +85 -0
- package/package.json +44 -3
|
@@ -0,0 +1,3208 @@
|
|
|
1
|
+
export interface paths {
|
|
2
|
+
"/v1/customers/me": {
|
|
3
|
+
parameters: {
|
|
4
|
+
query?: never;
|
|
5
|
+
header?: never;
|
|
6
|
+
path?: never;
|
|
7
|
+
cookie?: never;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The calling customer's entitlements, credit balances and subscriptions
|
|
11
|
+
* @description Authenticate with a publishable key plus X-Customer-Token (or X-Anonymous-Id). The customer is created on first call.
|
|
12
|
+
*/
|
|
13
|
+
get: {
|
|
14
|
+
parameters: {
|
|
15
|
+
query?: never;
|
|
16
|
+
header?: never;
|
|
17
|
+
path?: never;
|
|
18
|
+
cookie?: never;
|
|
19
|
+
};
|
|
20
|
+
requestBody?: never;
|
|
21
|
+
responses: {
|
|
22
|
+
/** @description Default Response */
|
|
23
|
+
200: {
|
|
24
|
+
headers: {
|
|
25
|
+
[name: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
content: {
|
|
28
|
+
"application/json": components["schemas"]["CustomerState"];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/** @description Default Response */
|
|
32
|
+
400: {
|
|
33
|
+
headers: {
|
|
34
|
+
[name: string]: unknown;
|
|
35
|
+
};
|
|
36
|
+
content: {
|
|
37
|
+
"application/json": components["schemas"]["Problem"];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/** @description Default Response */
|
|
41
|
+
401: {
|
|
42
|
+
headers: {
|
|
43
|
+
[name: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
content: {
|
|
46
|
+
"application/json": components["schemas"]["Problem"];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/** @description Default Response */
|
|
50
|
+
403: {
|
|
51
|
+
headers: {
|
|
52
|
+
[name: string]: unknown;
|
|
53
|
+
};
|
|
54
|
+
content: {
|
|
55
|
+
"application/json": components["schemas"]["Problem"];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
/** @description Default Response */
|
|
59
|
+
404: {
|
|
60
|
+
headers: {
|
|
61
|
+
[name: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
content: {
|
|
64
|
+
"application/json": components["schemas"]["Problem"];
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/** @description Default Response */
|
|
68
|
+
409: {
|
|
69
|
+
headers: {
|
|
70
|
+
[name: string]: unknown;
|
|
71
|
+
};
|
|
72
|
+
content: {
|
|
73
|
+
"application/json": components["schemas"]["Problem"];
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/** @description Default Response */
|
|
77
|
+
422: {
|
|
78
|
+
headers: {
|
|
79
|
+
[name: string]: unknown;
|
|
80
|
+
};
|
|
81
|
+
content: {
|
|
82
|
+
"application/json": components["schemas"]["Problem"];
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
put?: never;
|
|
88
|
+
post?: never;
|
|
89
|
+
delete?: never;
|
|
90
|
+
options?: never;
|
|
91
|
+
head?: never;
|
|
92
|
+
patch?: never;
|
|
93
|
+
trace?: never;
|
|
94
|
+
};
|
|
95
|
+
"/v1/customers/{id}": {
|
|
96
|
+
parameters: {
|
|
97
|
+
query?: never;
|
|
98
|
+
header?: never;
|
|
99
|
+
path?: never;
|
|
100
|
+
cookie?: never;
|
|
101
|
+
};
|
|
102
|
+
/** A customer by app_user_id (secret key) */
|
|
103
|
+
get: {
|
|
104
|
+
parameters: {
|
|
105
|
+
query?: never;
|
|
106
|
+
header?: never;
|
|
107
|
+
path: {
|
|
108
|
+
/** @description app_user_id, or `me` with a publishable key */
|
|
109
|
+
id: string;
|
|
110
|
+
};
|
|
111
|
+
cookie?: never;
|
|
112
|
+
};
|
|
113
|
+
requestBody?: never;
|
|
114
|
+
responses: {
|
|
115
|
+
/** @description Default Response */
|
|
116
|
+
200: {
|
|
117
|
+
headers: {
|
|
118
|
+
[name: string]: unknown;
|
|
119
|
+
};
|
|
120
|
+
content: {
|
|
121
|
+
"application/json": components["schemas"]["CustomerState"];
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
/** @description Default Response */
|
|
125
|
+
400: {
|
|
126
|
+
headers: {
|
|
127
|
+
[name: string]: unknown;
|
|
128
|
+
};
|
|
129
|
+
content: {
|
|
130
|
+
"application/json": components["schemas"]["Problem"];
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
/** @description Default Response */
|
|
134
|
+
401: {
|
|
135
|
+
headers: {
|
|
136
|
+
[name: string]: unknown;
|
|
137
|
+
};
|
|
138
|
+
content: {
|
|
139
|
+
"application/json": components["schemas"]["Problem"];
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
/** @description Default Response */
|
|
143
|
+
403: {
|
|
144
|
+
headers: {
|
|
145
|
+
[name: string]: unknown;
|
|
146
|
+
};
|
|
147
|
+
content: {
|
|
148
|
+
"application/json": components["schemas"]["Problem"];
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
/** @description Default Response */
|
|
152
|
+
404: {
|
|
153
|
+
headers: {
|
|
154
|
+
[name: string]: unknown;
|
|
155
|
+
};
|
|
156
|
+
content: {
|
|
157
|
+
"application/json": components["schemas"]["Problem"];
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
/** @description Default Response */
|
|
161
|
+
409: {
|
|
162
|
+
headers: {
|
|
163
|
+
[name: string]: unknown;
|
|
164
|
+
};
|
|
165
|
+
content: {
|
|
166
|
+
"application/json": components["schemas"]["Problem"];
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
/** @description Default Response */
|
|
170
|
+
422: {
|
|
171
|
+
headers: {
|
|
172
|
+
[name: string]: unknown;
|
|
173
|
+
};
|
|
174
|
+
content: {
|
|
175
|
+
"application/json": components["schemas"]["Problem"];
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
put?: never;
|
|
181
|
+
post?: never;
|
|
182
|
+
/**
|
|
183
|
+
* Privacy delete: remove personal data, keep financial records
|
|
184
|
+
* @description Email, attributes and every app_user_id for this customer are removed. Purchases, revenue and credit history stay, without personal data, because tenants need them for accounting.
|
|
185
|
+
*/
|
|
186
|
+
delete: {
|
|
187
|
+
parameters: {
|
|
188
|
+
query?: never;
|
|
189
|
+
header?: never;
|
|
190
|
+
path: {
|
|
191
|
+
/** @description app_user_id, or `me` with a publishable key */
|
|
192
|
+
id: string;
|
|
193
|
+
};
|
|
194
|
+
cookie?: never;
|
|
195
|
+
};
|
|
196
|
+
requestBody?: never;
|
|
197
|
+
responses: {
|
|
198
|
+
/** @description Default Response */
|
|
199
|
+
204: {
|
|
200
|
+
headers: {
|
|
201
|
+
[name: string]: unknown;
|
|
202
|
+
};
|
|
203
|
+
content?: never;
|
|
204
|
+
};
|
|
205
|
+
/** @description Default Response */
|
|
206
|
+
400: {
|
|
207
|
+
headers: {
|
|
208
|
+
[name: string]: unknown;
|
|
209
|
+
};
|
|
210
|
+
content: {
|
|
211
|
+
"application/json": components["schemas"]["Problem"];
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
/** @description Default Response */
|
|
215
|
+
401: {
|
|
216
|
+
headers: {
|
|
217
|
+
[name: string]: unknown;
|
|
218
|
+
};
|
|
219
|
+
content: {
|
|
220
|
+
"application/json": components["schemas"]["Problem"];
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
/** @description Default Response */
|
|
224
|
+
403: {
|
|
225
|
+
headers: {
|
|
226
|
+
[name: string]: unknown;
|
|
227
|
+
};
|
|
228
|
+
content: {
|
|
229
|
+
"application/json": components["schemas"]["Problem"];
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
/** @description Default Response */
|
|
233
|
+
404: {
|
|
234
|
+
headers: {
|
|
235
|
+
[name: string]: unknown;
|
|
236
|
+
};
|
|
237
|
+
content: {
|
|
238
|
+
"application/json": components["schemas"]["Problem"];
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
/** @description Default Response */
|
|
242
|
+
409: {
|
|
243
|
+
headers: {
|
|
244
|
+
[name: string]: unknown;
|
|
245
|
+
};
|
|
246
|
+
content: {
|
|
247
|
+
"application/json": components["schemas"]["Problem"];
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
/** @description Default Response */
|
|
251
|
+
422: {
|
|
252
|
+
headers: {
|
|
253
|
+
[name: string]: unknown;
|
|
254
|
+
};
|
|
255
|
+
content: {
|
|
256
|
+
"application/json": components["schemas"]["Problem"];
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
options?: never;
|
|
262
|
+
head?: never;
|
|
263
|
+
/**
|
|
264
|
+
* Update a customer's email or attributes
|
|
265
|
+
* @description Attributes merge into the existing ones; set a key to null to remove it.
|
|
266
|
+
*/
|
|
267
|
+
patch: {
|
|
268
|
+
parameters: {
|
|
269
|
+
query?: never;
|
|
270
|
+
header?: never;
|
|
271
|
+
path: {
|
|
272
|
+
/** @description app_user_id, or `me` with a publishable key */
|
|
273
|
+
id: string;
|
|
274
|
+
};
|
|
275
|
+
cookie?: never;
|
|
276
|
+
};
|
|
277
|
+
requestBody: {
|
|
278
|
+
content: {
|
|
279
|
+
"application/json": {
|
|
280
|
+
email?: string | null;
|
|
281
|
+
attributes?: {
|
|
282
|
+
[key: string]: string | number | boolean | null;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
responses: {
|
|
288
|
+
/** @description Default Response */
|
|
289
|
+
200: {
|
|
290
|
+
headers: {
|
|
291
|
+
[name: string]: unknown;
|
|
292
|
+
};
|
|
293
|
+
content: {
|
|
294
|
+
"application/json": components["schemas"]["CustomerState"];
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
/** @description Default Response */
|
|
298
|
+
400: {
|
|
299
|
+
headers: {
|
|
300
|
+
[name: string]: unknown;
|
|
301
|
+
};
|
|
302
|
+
content: {
|
|
303
|
+
"application/json": components["schemas"]["Problem"];
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
/** @description Default Response */
|
|
307
|
+
401: {
|
|
308
|
+
headers: {
|
|
309
|
+
[name: string]: unknown;
|
|
310
|
+
};
|
|
311
|
+
content: {
|
|
312
|
+
"application/json": components["schemas"]["Problem"];
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
/** @description Default Response */
|
|
316
|
+
403: {
|
|
317
|
+
headers: {
|
|
318
|
+
[name: string]: unknown;
|
|
319
|
+
};
|
|
320
|
+
content: {
|
|
321
|
+
"application/json": components["schemas"]["Problem"];
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
/** @description Default Response */
|
|
325
|
+
404: {
|
|
326
|
+
headers: {
|
|
327
|
+
[name: string]: unknown;
|
|
328
|
+
};
|
|
329
|
+
content: {
|
|
330
|
+
"application/json": components["schemas"]["Problem"];
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
/** @description Default Response */
|
|
334
|
+
409: {
|
|
335
|
+
headers: {
|
|
336
|
+
[name: string]: unknown;
|
|
337
|
+
};
|
|
338
|
+
content: {
|
|
339
|
+
"application/json": components["schemas"]["Problem"];
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
/** @description Default Response */
|
|
343
|
+
422: {
|
|
344
|
+
headers: {
|
|
345
|
+
[name: string]: unknown;
|
|
346
|
+
};
|
|
347
|
+
content: {
|
|
348
|
+
"application/json": components["schemas"]["Problem"];
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
trace?: never;
|
|
354
|
+
};
|
|
355
|
+
"/v1/customers/{id}/entitlements": {
|
|
356
|
+
parameters: {
|
|
357
|
+
query?: never;
|
|
358
|
+
header?: never;
|
|
359
|
+
path?: never;
|
|
360
|
+
cookie?: never;
|
|
361
|
+
};
|
|
362
|
+
/** A customer's entitlements (the hot path) */
|
|
363
|
+
get: {
|
|
364
|
+
parameters: {
|
|
365
|
+
query?: never;
|
|
366
|
+
header?: never;
|
|
367
|
+
path: {
|
|
368
|
+
/** @description app_user_id, or `me` with a publishable key */
|
|
369
|
+
id: string;
|
|
370
|
+
};
|
|
371
|
+
cookie?: never;
|
|
372
|
+
};
|
|
373
|
+
requestBody?: never;
|
|
374
|
+
responses: {
|
|
375
|
+
/** @description Default Response */
|
|
376
|
+
200: {
|
|
377
|
+
headers: {
|
|
378
|
+
[name: string]: unknown;
|
|
379
|
+
};
|
|
380
|
+
content: {
|
|
381
|
+
"application/json": {
|
|
382
|
+
entitlements: {
|
|
383
|
+
[key: string]: components["schemas"]["EntitlementState"];
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
/** @description Default Response */
|
|
389
|
+
400: {
|
|
390
|
+
headers: {
|
|
391
|
+
[name: string]: unknown;
|
|
392
|
+
};
|
|
393
|
+
content: {
|
|
394
|
+
"application/json": components["schemas"]["Problem"];
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
/** @description Default Response */
|
|
398
|
+
401: {
|
|
399
|
+
headers: {
|
|
400
|
+
[name: string]: unknown;
|
|
401
|
+
};
|
|
402
|
+
content: {
|
|
403
|
+
"application/json": components["schemas"]["Problem"];
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
/** @description Default Response */
|
|
407
|
+
403: {
|
|
408
|
+
headers: {
|
|
409
|
+
[name: string]: unknown;
|
|
410
|
+
};
|
|
411
|
+
content: {
|
|
412
|
+
"application/json": components["schemas"]["Problem"];
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
/** @description Default Response */
|
|
416
|
+
404: {
|
|
417
|
+
headers: {
|
|
418
|
+
[name: string]: unknown;
|
|
419
|
+
};
|
|
420
|
+
content: {
|
|
421
|
+
"application/json": components["schemas"]["Problem"];
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
/** @description Default Response */
|
|
425
|
+
409: {
|
|
426
|
+
headers: {
|
|
427
|
+
[name: string]: unknown;
|
|
428
|
+
};
|
|
429
|
+
content: {
|
|
430
|
+
"application/json": components["schemas"]["Problem"];
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
/** @description Default Response */
|
|
434
|
+
422: {
|
|
435
|
+
headers: {
|
|
436
|
+
[name: string]: unknown;
|
|
437
|
+
};
|
|
438
|
+
content: {
|
|
439
|
+
"application/json": components["schemas"]["Problem"];
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
put?: never;
|
|
445
|
+
post?: never;
|
|
446
|
+
delete?: never;
|
|
447
|
+
options?: never;
|
|
448
|
+
head?: never;
|
|
449
|
+
patch?: never;
|
|
450
|
+
trace?: never;
|
|
451
|
+
};
|
|
452
|
+
"/v1/customers/{id}/alias": {
|
|
453
|
+
parameters: {
|
|
454
|
+
query?: never;
|
|
455
|
+
header?: never;
|
|
456
|
+
path?: never;
|
|
457
|
+
cookie?: never;
|
|
458
|
+
};
|
|
459
|
+
get?: never;
|
|
460
|
+
put?: never;
|
|
461
|
+
/**
|
|
462
|
+
* Make another app_user_id resolve to this customer (identify, or merge)
|
|
463
|
+
* @description With a publishable key, `alias` must be the SDK's anonymous id ($tenth_anon_…): it's merged into the signed-in customer. The app's merge policy decides what happens when the id already belongs to another customer.
|
|
464
|
+
*/
|
|
465
|
+
post: {
|
|
466
|
+
parameters: {
|
|
467
|
+
query?: never;
|
|
468
|
+
header?: never;
|
|
469
|
+
path: {
|
|
470
|
+
/** @description app_user_id, or `me` with a publishable key */
|
|
471
|
+
id: string;
|
|
472
|
+
};
|
|
473
|
+
cookie?: never;
|
|
474
|
+
};
|
|
475
|
+
requestBody: {
|
|
476
|
+
content: {
|
|
477
|
+
"application/json": {
|
|
478
|
+
alias: string;
|
|
479
|
+
/** @enum {string} */
|
|
480
|
+
merge_policy?: "transfer_purchases" | "keep_existing" | "reject";
|
|
481
|
+
};
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
responses: {
|
|
485
|
+
/** @description Default Response */
|
|
486
|
+
200: {
|
|
487
|
+
headers: {
|
|
488
|
+
[name: string]: unknown;
|
|
489
|
+
};
|
|
490
|
+
content: {
|
|
491
|
+
"application/json": {
|
|
492
|
+
/** @enum {string} */
|
|
493
|
+
outcome: "added" | "already_aliased" | "merged" | "kept_existing";
|
|
494
|
+
customer: components["schemas"]["CustomerState"];
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
/** @description Default Response */
|
|
499
|
+
400: {
|
|
500
|
+
headers: {
|
|
501
|
+
[name: string]: unknown;
|
|
502
|
+
};
|
|
503
|
+
content: {
|
|
504
|
+
"application/json": components["schemas"]["Problem"];
|
|
505
|
+
};
|
|
506
|
+
};
|
|
507
|
+
/** @description Default Response */
|
|
508
|
+
401: {
|
|
509
|
+
headers: {
|
|
510
|
+
[name: string]: unknown;
|
|
511
|
+
};
|
|
512
|
+
content: {
|
|
513
|
+
"application/json": components["schemas"]["Problem"];
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
/** @description Default Response */
|
|
517
|
+
403: {
|
|
518
|
+
headers: {
|
|
519
|
+
[name: string]: unknown;
|
|
520
|
+
};
|
|
521
|
+
content: {
|
|
522
|
+
"application/json": components["schemas"]["Problem"];
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
/** @description Default Response */
|
|
526
|
+
404: {
|
|
527
|
+
headers: {
|
|
528
|
+
[name: string]: unknown;
|
|
529
|
+
};
|
|
530
|
+
content: {
|
|
531
|
+
"application/json": components["schemas"]["Problem"];
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
/** @description Default Response */
|
|
535
|
+
409: {
|
|
536
|
+
headers: {
|
|
537
|
+
[name: string]: unknown;
|
|
538
|
+
};
|
|
539
|
+
content: {
|
|
540
|
+
"application/json": components["schemas"]["Problem"];
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
/** @description Default Response */
|
|
544
|
+
422: {
|
|
545
|
+
headers: {
|
|
546
|
+
[name: string]: unknown;
|
|
547
|
+
};
|
|
548
|
+
content: {
|
|
549
|
+
"application/json": components["schemas"]["Problem"];
|
|
550
|
+
};
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
};
|
|
554
|
+
delete?: never;
|
|
555
|
+
options?: never;
|
|
556
|
+
head?: never;
|
|
557
|
+
patch?: never;
|
|
558
|
+
trace?: never;
|
|
559
|
+
};
|
|
560
|
+
"/v1/customers/{id}/export": {
|
|
561
|
+
parameters: {
|
|
562
|
+
query?: never;
|
|
563
|
+
header?: never;
|
|
564
|
+
path?: never;
|
|
565
|
+
cookie?: never;
|
|
566
|
+
};
|
|
567
|
+
/** Everything Tenth holds about one customer, as JSON, for an access request */
|
|
568
|
+
get: {
|
|
569
|
+
parameters: {
|
|
570
|
+
query?: never;
|
|
571
|
+
header?: never;
|
|
572
|
+
path: {
|
|
573
|
+
/** @description app_user_id, or `me` with a publishable key */
|
|
574
|
+
id: string;
|
|
575
|
+
};
|
|
576
|
+
cookie?: never;
|
|
577
|
+
};
|
|
578
|
+
requestBody?: never;
|
|
579
|
+
responses: {
|
|
580
|
+
/** @description Default Response */
|
|
581
|
+
200: {
|
|
582
|
+
headers: {
|
|
583
|
+
[name: string]: unknown;
|
|
584
|
+
};
|
|
585
|
+
content: {
|
|
586
|
+
"application/json": {
|
|
587
|
+
[key: string]: unknown;
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
/** @description Default Response */
|
|
592
|
+
400: {
|
|
593
|
+
headers: {
|
|
594
|
+
[name: string]: unknown;
|
|
595
|
+
};
|
|
596
|
+
content: {
|
|
597
|
+
"application/json": components["schemas"]["Problem"];
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
/** @description Default Response */
|
|
601
|
+
401: {
|
|
602
|
+
headers: {
|
|
603
|
+
[name: string]: unknown;
|
|
604
|
+
};
|
|
605
|
+
content: {
|
|
606
|
+
"application/json": components["schemas"]["Problem"];
|
|
607
|
+
};
|
|
608
|
+
};
|
|
609
|
+
/** @description Default Response */
|
|
610
|
+
403: {
|
|
611
|
+
headers: {
|
|
612
|
+
[name: string]: unknown;
|
|
613
|
+
};
|
|
614
|
+
content: {
|
|
615
|
+
"application/json": components["schemas"]["Problem"];
|
|
616
|
+
};
|
|
617
|
+
};
|
|
618
|
+
/** @description Default Response */
|
|
619
|
+
404: {
|
|
620
|
+
headers: {
|
|
621
|
+
[name: string]: unknown;
|
|
622
|
+
};
|
|
623
|
+
content: {
|
|
624
|
+
"application/json": components["schemas"]["Problem"];
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
/** @description Default Response */
|
|
628
|
+
409: {
|
|
629
|
+
headers: {
|
|
630
|
+
[name: string]: unknown;
|
|
631
|
+
};
|
|
632
|
+
content: {
|
|
633
|
+
"application/json": components["schemas"]["Problem"];
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
/** @description Default Response */
|
|
637
|
+
422: {
|
|
638
|
+
headers: {
|
|
639
|
+
[name: string]: unknown;
|
|
640
|
+
};
|
|
641
|
+
content: {
|
|
642
|
+
"application/json": components["schemas"]["Problem"];
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
put?: never;
|
|
648
|
+
post?: never;
|
|
649
|
+
delete?: never;
|
|
650
|
+
options?: never;
|
|
651
|
+
head?: never;
|
|
652
|
+
patch?: never;
|
|
653
|
+
trace?: never;
|
|
654
|
+
};
|
|
655
|
+
"/v1/customers/{id}/credits": {
|
|
656
|
+
parameters: {
|
|
657
|
+
query?: never;
|
|
658
|
+
header?: never;
|
|
659
|
+
path?: never;
|
|
660
|
+
cookie?: never;
|
|
661
|
+
};
|
|
662
|
+
/** Credit balances and recent transactions */
|
|
663
|
+
get: {
|
|
664
|
+
parameters: {
|
|
665
|
+
query?: {
|
|
666
|
+
credit_type?: string;
|
|
667
|
+
before?: string;
|
|
668
|
+
limit?: number;
|
|
669
|
+
};
|
|
670
|
+
header?: never;
|
|
671
|
+
path: {
|
|
672
|
+
id: string;
|
|
673
|
+
};
|
|
674
|
+
cookie?: never;
|
|
675
|
+
};
|
|
676
|
+
requestBody?: never;
|
|
677
|
+
responses: {
|
|
678
|
+
/** @description Default Response */
|
|
679
|
+
200: {
|
|
680
|
+
headers: {
|
|
681
|
+
[name: string]: unknown;
|
|
682
|
+
};
|
|
683
|
+
content: {
|
|
684
|
+
"application/json": {
|
|
685
|
+
balances: {
|
|
686
|
+
[key: string]: components["schemas"]["CreditBalance"];
|
|
687
|
+
};
|
|
688
|
+
transactions: components["schemas"]["CreditTransaction"][];
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
};
|
|
692
|
+
/** @description Default Response */
|
|
693
|
+
400: {
|
|
694
|
+
headers: {
|
|
695
|
+
[name: string]: unknown;
|
|
696
|
+
};
|
|
697
|
+
content: {
|
|
698
|
+
"application/json": components["schemas"]["Problem"];
|
|
699
|
+
};
|
|
700
|
+
};
|
|
701
|
+
/** @description Default Response */
|
|
702
|
+
401: {
|
|
703
|
+
headers: {
|
|
704
|
+
[name: string]: unknown;
|
|
705
|
+
};
|
|
706
|
+
content: {
|
|
707
|
+
"application/json": components["schemas"]["Problem"];
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
/** @description Default Response */
|
|
711
|
+
403: {
|
|
712
|
+
headers: {
|
|
713
|
+
[name: string]: unknown;
|
|
714
|
+
};
|
|
715
|
+
content: {
|
|
716
|
+
"application/json": components["schemas"]["Problem"];
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
/** @description Default Response */
|
|
720
|
+
404: {
|
|
721
|
+
headers: {
|
|
722
|
+
[name: string]: unknown;
|
|
723
|
+
};
|
|
724
|
+
content: {
|
|
725
|
+
"application/json": components["schemas"]["Problem"];
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
/** @description Default Response */
|
|
729
|
+
409: {
|
|
730
|
+
headers: {
|
|
731
|
+
[name: string]: unknown;
|
|
732
|
+
};
|
|
733
|
+
content: {
|
|
734
|
+
"application/json": components["schemas"]["Problem"];
|
|
735
|
+
};
|
|
736
|
+
};
|
|
737
|
+
/** @description Default Response */
|
|
738
|
+
422: {
|
|
739
|
+
headers: {
|
|
740
|
+
[name: string]: unknown;
|
|
741
|
+
};
|
|
742
|
+
content: {
|
|
743
|
+
"application/json": components["schemas"]["Problem"];
|
|
744
|
+
};
|
|
745
|
+
};
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
put?: never;
|
|
749
|
+
post?: never;
|
|
750
|
+
delete?: never;
|
|
751
|
+
options?: never;
|
|
752
|
+
head?: never;
|
|
753
|
+
patch?: never;
|
|
754
|
+
trace?: never;
|
|
755
|
+
};
|
|
756
|
+
"/v1/customers/{id}/credits/{type}/debit": {
|
|
757
|
+
parameters: {
|
|
758
|
+
query?: never;
|
|
759
|
+
header?: never;
|
|
760
|
+
path?: never;
|
|
761
|
+
cookie?: never;
|
|
762
|
+
};
|
|
763
|
+
get?: never;
|
|
764
|
+
put?: never;
|
|
765
|
+
/**
|
|
766
|
+
* Spend credits
|
|
767
|
+
* @description Secret key by default. A publishable key works only when the credit type allows app-side debits, and only for the signed-in customer. Anyone who modifies an app can skip an app-side debit, so use server-side debits when payment matters.
|
|
768
|
+
*/
|
|
769
|
+
post: {
|
|
770
|
+
parameters: {
|
|
771
|
+
query?: never;
|
|
772
|
+
header?: never;
|
|
773
|
+
path: {
|
|
774
|
+
id: string;
|
|
775
|
+
type: string;
|
|
776
|
+
};
|
|
777
|
+
cookie?: never;
|
|
778
|
+
};
|
|
779
|
+
requestBody: {
|
|
780
|
+
content: {
|
|
781
|
+
"application/json": {
|
|
782
|
+
amount: number;
|
|
783
|
+
/** @description Same key → same result, never a second debit. */
|
|
784
|
+
idempotency_key: string;
|
|
785
|
+
/** @default {} */
|
|
786
|
+
metadata?: {
|
|
787
|
+
[key: string]: string | number | boolean | null;
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
responses: {
|
|
793
|
+
/** @description Default Response */
|
|
794
|
+
200: {
|
|
795
|
+
headers: {
|
|
796
|
+
[name: string]: unknown;
|
|
797
|
+
};
|
|
798
|
+
content: {
|
|
799
|
+
"application/json": {
|
|
800
|
+
credit_type: string;
|
|
801
|
+
amount: number;
|
|
802
|
+
balance: number;
|
|
803
|
+
available: number;
|
|
804
|
+
/** @description True when this idempotency_key was used before; nothing new was debited. */
|
|
805
|
+
replayed: boolean;
|
|
806
|
+
transactions: components["schemas"]["CreditTransaction"][];
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
/** @description Default Response */
|
|
811
|
+
400: {
|
|
812
|
+
headers: {
|
|
813
|
+
[name: string]: unknown;
|
|
814
|
+
};
|
|
815
|
+
content: {
|
|
816
|
+
"application/json": components["schemas"]["Problem"];
|
|
817
|
+
};
|
|
818
|
+
};
|
|
819
|
+
/** @description Default Response */
|
|
820
|
+
401: {
|
|
821
|
+
headers: {
|
|
822
|
+
[name: string]: unknown;
|
|
823
|
+
};
|
|
824
|
+
content: {
|
|
825
|
+
"application/json": components["schemas"]["Problem"];
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
/** @description Default Response */
|
|
829
|
+
403: {
|
|
830
|
+
headers: {
|
|
831
|
+
[name: string]: unknown;
|
|
832
|
+
};
|
|
833
|
+
content: {
|
|
834
|
+
"application/json": components["schemas"]["Problem"];
|
|
835
|
+
};
|
|
836
|
+
};
|
|
837
|
+
/** @description Default Response */
|
|
838
|
+
404: {
|
|
839
|
+
headers: {
|
|
840
|
+
[name: string]: unknown;
|
|
841
|
+
};
|
|
842
|
+
content: {
|
|
843
|
+
"application/json": components["schemas"]["Problem"];
|
|
844
|
+
};
|
|
845
|
+
};
|
|
846
|
+
/** @description Default Response */
|
|
847
|
+
409: {
|
|
848
|
+
headers: {
|
|
849
|
+
[name: string]: unknown;
|
|
850
|
+
};
|
|
851
|
+
content: {
|
|
852
|
+
"application/json": components["schemas"]["Problem"];
|
|
853
|
+
};
|
|
854
|
+
};
|
|
855
|
+
/** @description Default Response */
|
|
856
|
+
422: {
|
|
857
|
+
headers: {
|
|
858
|
+
[name: string]: unknown;
|
|
859
|
+
};
|
|
860
|
+
content: {
|
|
861
|
+
"application/json": components["schemas"]["Problem"];
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
delete?: never;
|
|
867
|
+
options?: never;
|
|
868
|
+
head?: never;
|
|
869
|
+
patch?: never;
|
|
870
|
+
trace?: never;
|
|
871
|
+
};
|
|
872
|
+
"/v1/customers/{id}/credits/{type}/reserve": {
|
|
873
|
+
parameters: {
|
|
874
|
+
query?: never;
|
|
875
|
+
header?: never;
|
|
876
|
+
path?: never;
|
|
877
|
+
cookie?: never;
|
|
878
|
+
};
|
|
879
|
+
get?: never;
|
|
880
|
+
put?: never;
|
|
881
|
+
/**
|
|
882
|
+
* Hold credits for long-running work; commit or release the hold later
|
|
883
|
+
* @description Held credits can't be spent by other debits. A hold that isn't committed or released expires after ttl_seconds (default 900).
|
|
884
|
+
*/
|
|
885
|
+
post: {
|
|
886
|
+
parameters: {
|
|
887
|
+
query?: never;
|
|
888
|
+
header?: never;
|
|
889
|
+
path: {
|
|
890
|
+
id: string;
|
|
891
|
+
type: string;
|
|
892
|
+
};
|
|
893
|
+
cookie?: never;
|
|
894
|
+
};
|
|
895
|
+
requestBody: {
|
|
896
|
+
content: {
|
|
897
|
+
"application/json": {
|
|
898
|
+
amount: number;
|
|
899
|
+
/** @description Same key → same result, never a second debit. */
|
|
900
|
+
idempotency_key: string;
|
|
901
|
+
/** @default 900 */
|
|
902
|
+
ttl_seconds?: number;
|
|
903
|
+
};
|
|
904
|
+
};
|
|
905
|
+
};
|
|
906
|
+
responses: {
|
|
907
|
+
/** @description Default Response */
|
|
908
|
+
201: {
|
|
909
|
+
headers: {
|
|
910
|
+
[name: string]: unknown;
|
|
911
|
+
};
|
|
912
|
+
content: {
|
|
913
|
+
"application/json": components["schemas"]["CreditHold"];
|
|
914
|
+
};
|
|
915
|
+
};
|
|
916
|
+
/** @description Default Response */
|
|
917
|
+
400: {
|
|
918
|
+
headers: {
|
|
919
|
+
[name: string]: unknown;
|
|
920
|
+
};
|
|
921
|
+
content: {
|
|
922
|
+
"application/json": components["schemas"]["Problem"];
|
|
923
|
+
};
|
|
924
|
+
};
|
|
925
|
+
/** @description Default Response */
|
|
926
|
+
401: {
|
|
927
|
+
headers: {
|
|
928
|
+
[name: string]: unknown;
|
|
929
|
+
};
|
|
930
|
+
content: {
|
|
931
|
+
"application/json": components["schemas"]["Problem"];
|
|
932
|
+
};
|
|
933
|
+
};
|
|
934
|
+
/** @description Default Response */
|
|
935
|
+
403: {
|
|
936
|
+
headers: {
|
|
937
|
+
[name: string]: unknown;
|
|
938
|
+
};
|
|
939
|
+
content: {
|
|
940
|
+
"application/json": components["schemas"]["Problem"];
|
|
941
|
+
};
|
|
942
|
+
};
|
|
943
|
+
/** @description Default Response */
|
|
944
|
+
404: {
|
|
945
|
+
headers: {
|
|
946
|
+
[name: string]: unknown;
|
|
947
|
+
};
|
|
948
|
+
content: {
|
|
949
|
+
"application/json": components["schemas"]["Problem"];
|
|
950
|
+
};
|
|
951
|
+
};
|
|
952
|
+
/** @description Default Response */
|
|
953
|
+
409: {
|
|
954
|
+
headers: {
|
|
955
|
+
[name: string]: unknown;
|
|
956
|
+
};
|
|
957
|
+
content: {
|
|
958
|
+
"application/json": components["schemas"]["Problem"];
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
/** @description Default Response */
|
|
962
|
+
422: {
|
|
963
|
+
headers: {
|
|
964
|
+
[name: string]: unknown;
|
|
965
|
+
};
|
|
966
|
+
content: {
|
|
967
|
+
"application/json": components["schemas"]["Problem"];
|
|
968
|
+
};
|
|
969
|
+
};
|
|
970
|
+
};
|
|
971
|
+
};
|
|
972
|
+
delete?: never;
|
|
973
|
+
options?: never;
|
|
974
|
+
head?: never;
|
|
975
|
+
patch?: never;
|
|
976
|
+
trace?: never;
|
|
977
|
+
};
|
|
978
|
+
"/v1/customers/{id}/credits/{type}/holds/{holdId}/commit": {
|
|
979
|
+
parameters: {
|
|
980
|
+
query?: never;
|
|
981
|
+
header?: never;
|
|
982
|
+
path?: never;
|
|
983
|
+
cookie?: never;
|
|
984
|
+
};
|
|
985
|
+
get?: never;
|
|
986
|
+
put?: never;
|
|
987
|
+
/** Spend held credits. Commit less than the hold to release the rest. */
|
|
988
|
+
post: {
|
|
989
|
+
parameters: {
|
|
990
|
+
query?: never;
|
|
991
|
+
header?: never;
|
|
992
|
+
path: {
|
|
993
|
+
id: string;
|
|
994
|
+
type: string;
|
|
995
|
+
holdId: string;
|
|
996
|
+
};
|
|
997
|
+
cookie?: never;
|
|
998
|
+
};
|
|
999
|
+
requestBody: {
|
|
1000
|
+
content: {
|
|
1001
|
+
"application/json": {
|
|
1002
|
+
amount?: number;
|
|
1003
|
+
};
|
|
1004
|
+
};
|
|
1005
|
+
};
|
|
1006
|
+
responses: {
|
|
1007
|
+
/** @description Default Response */
|
|
1008
|
+
200: {
|
|
1009
|
+
headers: {
|
|
1010
|
+
[name: string]: unknown;
|
|
1011
|
+
};
|
|
1012
|
+
content: {
|
|
1013
|
+
"application/json": {
|
|
1014
|
+
credit_type: string;
|
|
1015
|
+
amount: number;
|
|
1016
|
+
balance: number;
|
|
1017
|
+
available: number;
|
|
1018
|
+
/** @description True when this idempotency_key was used before; nothing new was debited. */
|
|
1019
|
+
replayed: boolean;
|
|
1020
|
+
transactions: components["schemas"]["CreditTransaction"][];
|
|
1021
|
+
};
|
|
1022
|
+
};
|
|
1023
|
+
};
|
|
1024
|
+
/** @description Default Response */
|
|
1025
|
+
400: {
|
|
1026
|
+
headers: {
|
|
1027
|
+
[name: string]: unknown;
|
|
1028
|
+
};
|
|
1029
|
+
content: {
|
|
1030
|
+
"application/json": components["schemas"]["Problem"];
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
/** @description Default Response */
|
|
1034
|
+
401: {
|
|
1035
|
+
headers: {
|
|
1036
|
+
[name: string]: unknown;
|
|
1037
|
+
};
|
|
1038
|
+
content: {
|
|
1039
|
+
"application/json": components["schemas"]["Problem"];
|
|
1040
|
+
};
|
|
1041
|
+
};
|
|
1042
|
+
/** @description Default Response */
|
|
1043
|
+
403: {
|
|
1044
|
+
headers: {
|
|
1045
|
+
[name: string]: unknown;
|
|
1046
|
+
};
|
|
1047
|
+
content: {
|
|
1048
|
+
"application/json": components["schemas"]["Problem"];
|
|
1049
|
+
};
|
|
1050
|
+
};
|
|
1051
|
+
/** @description Default Response */
|
|
1052
|
+
404: {
|
|
1053
|
+
headers: {
|
|
1054
|
+
[name: string]: unknown;
|
|
1055
|
+
};
|
|
1056
|
+
content: {
|
|
1057
|
+
"application/json": components["schemas"]["Problem"];
|
|
1058
|
+
};
|
|
1059
|
+
};
|
|
1060
|
+
/** @description Default Response */
|
|
1061
|
+
409: {
|
|
1062
|
+
headers: {
|
|
1063
|
+
[name: string]: unknown;
|
|
1064
|
+
};
|
|
1065
|
+
content: {
|
|
1066
|
+
"application/json": components["schemas"]["Problem"];
|
|
1067
|
+
};
|
|
1068
|
+
};
|
|
1069
|
+
/** @description Default Response */
|
|
1070
|
+
422: {
|
|
1071
|
+
headers: {
|
|
1072
|
+
[name: string]: unknown;
|
|
1073
|
+
};
|
|
1074
|
+
content: {
|
|
1075
|
+
"application/json": components["schemas"]["Problem"];
|
|
1076
|
+
};
|
|
1077
|
+
};
|
|
1078
|
+
};
|
|
1079
|
+
};
|
|
1080
|
+
delete?: never;
|
|
1081
|
+
options?: never;
|
|
1082
|
+
head?: never;
|
|
1083
|
+
patch?: never;
|
|
1084
|
+
trace?: never;
|
|
1085
|
+
};
|
|
1086
|
+
"/v1/customers/{id}/credits/{type}/holds/{holdId}/release": {
|
|
1087
|
+
parameters: {
|
|
1088
|
+
query?: never;
|
|
1089
|
+
header?: never;
|
|
1090
|
+
path?: never;
|
|
1091
|
+
cookie?: never;
|
|
1092
|
+
};
|
|
1093
|
+
get?: never;
|
|
1094
|
+
put?: never;
|
|
1095
|
+
/** Release a hold without spending */
|
|
1096
|
+
post: {
|
|
1097
|
+
parameters: {
|
|
1098
|
+
query?: never;
|
|
1099
|
+
header?: never;
|
|
1100
|
+
path: {
|
|
1101
|
+
id: string;
|
|
1102
|
+
type: string;
|
|
1103
|
+
holdId: string;
|
|
1104
|
+
};
|
|
1105
|
+
cookie?: never;
|
|
1106
|
+
};
|
|
1107
|
+
requestBody?: never;
|
|
1108
|
+
responses: {
|
|
1109
|
+
/** @description Default Response */
|
|
1110
|
+
200: {
|
|
1111
|
+
headers: {
|
|
1112
|
+
[name: string]: unknown;
|
|
1113
|
+
};
|
|
1114
|
+
content: {
|
|
1115
|
+
"application/json": components["schemas"]["CreditHold"];
|
|
1116
|
+
};
|
|
1117
|
+
};
|
|
1118
|
+
/** @description Default Response */
|
|
1119
|
+
400: {
|
|
1120
|
+
headers: {
|
|
1121
|
+
[name: string]: unknown;
|
|
1122
|
+
};
|
|
1123
|
+
content: {
|
|
1124
|
+
"application/json": components["schemas"]["Problem"];
|
|
1125
|
+
};
|
|
1126
|
+
};
|
|
1127
|
+
/** @description Default Response */
|
|
1128
|
+
401: {
|
|
1129
|
+
headers: {
|
|
1130
|
+
[name: string]: unknown;
|
|
1131
|
+
};
|
|
1132
|
+
content: {
|
|
1133
|
+
"application/json": components["schemas"]["Problem"];
|
|
1134
|
+
};
|
|
1135
|
+
};
|
|
1136
|
+
/** @description Default Response */
|
|
1137
|
+
403: {
|
|
1138
|
+
headers: {
|
|
1139
|
+
[name: string]: unknown;
|
|
1140
|
+
};
|
|
1141
|
+
content: {
|
|
1142
|
+
"application/json": components["schemas"]["Problem"];
|
|
1143
|
+
};
|
|
1144
|
+
};
|
|
1145
|
+
/** @description Default Response */
|
|
1146
|
+
404: {
|
|
1147
|
+
headers: {
|
|
1148
|
+
[name: string]: unknown;
|
|
1149
|
+
};
|
|
1150
|
+
content: {
|
|
1151
|
+
"application/json": components["schemas"]["Problem"];
|
|
1152
|
+
};
|
|
1153
|
+
};
|
|
1154
|
+
/** @description Default Response */
|
|
1155
|
+
409: {
|
|
1156
|
+
headers: {
|
|
1157
|
+
[name: string]: unknown;
|
|
1158
|
+
};
|
|
1159
|
+
content: {
|
|
1160
|
+
"application/json": components["schemas"]["Problem"];
|
|
1161
|
+
};
|
|
1162
|
+
};
|
|
1163
|
+
/** @description Default Response */
|
|
1164
|
+
422: {
|
|
1165
|
+
headers: {
|
|
1166
|
+
[name: string]: unknown;
|
|
1167
|
+
};
|
|
1168
|
+
content: {
|
|
1169
|
+
"application/json": components["schemas"]["Problem"];
|
|
1170
|
+
};
|
|
1171
|
+
};
|
|
1172
|
+
};
|
|
1173
|
+
};
|
|
1174
|
+
delete?: never;
|
|
1175
|
+
options?: never;
|
|
1176
|
+
head?: never;
|
|
1177
|
+
patch?: never;
|
|
1178
|
+
trace?: never;
|
|
1179
|
+
};
|
|
1180
|
+
"/v1/customers/{id}/grants": {
|
|
1181
|
+
parameters: {
|
|
1182
|
+
query?: never;
|
|
1183
|
+
header?: never;
|
|
1184
|
+
path?: never;
|
|
1185
|
+
cookie?: never;
|
|
1186
|
+
};
|
|
1187
|
+
get?: never;
|
|
1188
|
+
put?: never;
|
|
1189
|
+
/**
|
|
1190
|
+
* Give an entitlement or credits without payment
|
|
1191
|
+
* @description Creates the customer if this app_user_id is new. Grants never create revenue.
|
|
1192
|
+
*/
|
|
1193
|
+
post: {
|
|
1194
|
+
parameters: {
|
|
1195
|
+
query?: never;
|
|
1196
|
+
header?: never;
|
|
1197
|
+
path: {
|
|
1198
|
+
id: string;
|
|
1199
|
+
};
|
|
1200
|
+
cookie?: never;
|
|
1201
|
+
};
|
|
1202
|
+
requestBody: {
|
|
1203
|
+
content: {
|
|
1204
|
+
"application/json": {
|
|
1205
|
+
entitlement?: string;
|
|
1206
|
+
credit_type?: string;
|
|
1207
|
+
/** @description Credits to grant (credit grants only). */
|
|
1208
|
+
amount?: number;
|
|
1209
|
+
/**
|
|
1210
|
+
* Format: date-time
|
|
1211
|
+
* @description Entitlement grants can start later. Credits are granted now.
|
|
1212
|
+
*/
|
|
1213
|
+
starts_at?: string;
|
|
1214
|
+
/**
|
|
1215
|
+
* Format: date-time
|
|
1216
|
+
* @description Leave out for no expiry.
|
|
1217
|
+
*/
|
|
1218
|
+
expires_at?: string;
|
|
1219
|
+
reason: string;
|
|
1220
|
+
};
|
|
1221
|
+
};
|
|
1222
|
+
};
|
|
1223
|
+
responses: {
|
|
1224
|
+
/** @description Default Response */
|
|
1225
|
+
201: {
|
|
1226
|
+
headers: {
|
|
1227
|
+
[name: string]: unknown;
|
|
1228
|
+
};
|
|
1229
|
+
content: {
|
|
1230
|
+
"application/json": components["schemas"]["Grant"];
|
|
1231
|
+
};
|
|
1232
|
+
};
|
|
1233
|
+
/** @description Default Response */
|
|
1234
|
+
400: {
|
|
1235
|
+
headers: {
|
|
1236
|
+
[name: string]: unknown;
|
|
1237
|
+
};
|
|
1238
|
+
content: {
|
|
1239
|
+
"application/json": components["schemas"]["Problem"];
|
|
1240
|
+
};
|
|
1241
|
+
};
|
|
1242
|
+
/** @description Default Response */
|
|
1243
|
+
401: {
|
|
1244
|
+
headers: {
|
|
1245
|
+
[name: string]: unknown;
|
|
1246
|
+
};
|
|
1247
|
+
content: {
|
|
1248
|
+
"application/json": components["schemas"]["Problem"];
|
|
1249
|
+
};
|
|
1250
|
+
};
|
|
1251
|
+
/** @description Default Response */
|
|
1252
|
+
403: {
|
|
1253
|
+
headers: {
|
|
1254
|
+
[name: string]: unknown;
|
|
1255
|
+
};
|
|
1256
|
+
content: {
|
|
1257
|
+
"application/json": components["schemas"]["Problem"];
|
|
1258
|
+
};
|
|
1259
|
+
};
|
|
1260
|
+
/** @description Default Response */
|
|
1261
|
+
404: {
|
|
1262
|
+
headers: {
|
|
1263
|
+
[name: string]: unknown;
|
|
1264
|
+
};
|
|
1265
|
+
content: {
|
|
1266
|
+
"application/json": components["schemas"]["Problem"];
|
|
1267
|
+
};
|
|
1268
|
+
};
|
|
1269
|
+
/** @description Default Response */
|
|
1270
|
+
409: {
|
|
1271
|
+
headers: {
|
|
1272
|
+
[name: string]: unknown;
|
|
1273
|
+
};
|
|
1274
|
+
content: {
|
|
1275
|
+
"application/json": components["schemas"]["Problem"];
|
|
1276
|
+
};
|
|
1277
|
+
};
|
|
1278
|
+
/** @description Default Response */
|
|
1279
|
+
422: {
|
|
1280
|
+
headers: {
|
|
1281
|
+
[name: string]: unknown;
|
|
1282
|
+
};
|
|
1283
|
+
content: {
|
|
1284
|
+
"application/json": components["schemas"]["Problem"];
|
|
1285
|
+
};
|
|
1286
|
+
};
|
|
1287
|
+
};
|
|
1288
|
+
};
|
|
1289
|
+
delete?: never;
|
|
1290
|
+
options?: never;
|
|
1291
|
+
head?: never;
|
|
1292
|
+
patch?: never;
|
|
1293
|
+
trace?: never;
|
|
1294
|
+
};
|
|
1295
|
+
"/v1/grants/{grantId}": {
|
|
1296
|
+
parameters: {
|
|
1297
|
+
query?: never;
|
|
1298
|
+
header?: never;
|
|
1299
|
+
path?: never;
|
|
1300
|
+
cookie?: never;
|
|
1301
|
+
};
|
|
1302
|
+
get?: never;
|
|
1303
|
+
put?: never;
|
|
1304
|
+
post?: never;
|
|
1305
|
+
/** Revoke a grant. Unspent granted credits are removed. */
|
|
1306
|
+
delete: {
|
|
1307
|
+
parameters: {
|
|
1308
|
+
query?: never;
|
|
1309
|
+
header?: never;
|
|
1310
|
+
path: {
|
|
1311
|
+
grantId: string;
|
|
1312
|
+
};
|
|
1313
|
+
cookie?: never;
|
|
1314
|
+
};
|
|
1315
|
+
requestBody?: never;
|
|
1316
|
+
responses: {
|
|
1317
|
+
/** @description Default Response */
|
|
1318
|
+
200: {
|
|
1319
|
+
headers: {
|
|
1320
|
+
[name: string]: unknown;
|
|
1321
|
+
};
|
|
1322
|
+
content: {
|
|
1323
|
+
"application/json": components["schemas"]["Grant"];
|
|
1324
|
+
};
|
|
1325
|
+
};
|
|
1326
|
+
/** @description Default Response */
|
|
1327
|
+
400: {
|
|
1328
|
+
headers: {
|
|
1329
|
+
[name: string]: unknown;
|
|
1330
|
+
};
|
|
1331
|
+
content: {
|
|
1332
|
+
"application/json": components["schemas"]["Problem"];
|
|
1333
|
+
};
|
|
1334
|
+
};
|
|
1335
|
+
/** @description Default Response */
|
|
1336
|
+
401: {
|
|
1337
|
+
headers: {
|
|
1338
|
+
[name: string]: unknown;
|
|
1339
|
+
};
|
|
1340
|
+
content: {
|
|
1341
|
+
"application/json": components["schemas"]["Problem"];
|
|
1342
|
+
};
|
|
1343
|
+
};
|
|
1344
|
+
/** @description Default Response */
|
|
1345
|
+
403: {
|
|
1346
|
+
headers: {
|
|
1347
|
+
[name: string]: unknown;
|
|
1348
|
+
};
|
|
1349
|
+
content: {
|
|
1350
|
+
"application/json": components["schemas"]["Problem"];
|
|
1351
|
+
};
|
|
1352
|
+
};
|
|
1353
|
+
/** @description Default Response */
|
|
1354
|
+
404: {
|
|
1355
|
+
headers: {
|
|
1356
|
+
[name: string]: unknown;
|
|
1357
|
+
};
|
|
1358
|
+
content: {
|
|
1359
|
+
"application/json": components["schemas"]["Problem"];
|
|
1360
|
+
};
|
|
1361
|
+
};
|
|
1362
|
+
/** @description Default Response */
|
|
1363
|
+
409: {
|
|
1364
|
+
headers: {
|
|
1365
|
+
[name: string]: unknown;
|
|
1366
|
+
};
|
|
1367
|
+
content: {
|
|
1368
|
+
"application/json": components["schemas"]["Problem"];
|
|
1369
|
+
};
|
|
1370
|
+
};
|
|
1371
|
+
/** @description Default Response */
|
|
1372
|
+
422: {
|
|
1373
|
+
headers: {
|
|
1374
|
+
[name: string]: unknown;
|
|
1375
|
+
};
|
|
1376
|
+
content: {
|
|
1377
|
+
"application/json": components["schemas"]["Problem"];
|
|
1378
|
+
};
|
|
1379
|
+
};
|
|
1380
|
+
};
|
|
1381
|
+
};
|
|
1382
|
+
options?: never;
|
|
1383
|
+
head?: never;
|
|
1384
|
+
patch?: never;
|
|
1385
|
+
trace?: never;
|
|
1386
|
+
};
|
|
1387
|
+
"/v1/offerings/current": {
|
|
1388
|
+
parameters: {
|
|
1389
|
+
query?: never;
|
|
1390
|
+
header?: never;
|
|
1391
|
+
path?: never;
|
|
1392
|
+
cookie?: never;
|
|
1393
|
+
};
|
|
1394
|
+
/**
|
|
1395
|
+
* The offering this user should see, for their platform
|
|
1396
|
+
* @description Targeted offerings whose rules all match win by priority; otherwise the default offering. `offering` is null when the app has none.
|
|
1397
|
+
*/
|
|
1398
|
+
get: {
|
|
1399
|
+
parameters: {
|
|
1400
|
+
query: {
|
|
1401
|
+
platform: "ios" | "android" | "web";
|
|
1402
|
+
/** @description Store storefront country, ISO 3166-1 alpha-2. */
|
|
1403
|
+
country?: string;
|
|
1404
|
+
app_version?: string;
|
|
1405
|
+
/** @description The highest paywall config schema version the SDK renders. Without it, `paywall` is null. */
|
|
1406
|
+
paywall_schema?: number;
|
|
1407
|
+
};
|
|
1408
|
+
header?: never;
|
|
1409
|
+
path?: never;
|
|
1410
|
+
cookie?: never;
|
|
1411
|
+
};
|
|
1412
|
+
requestBody?: never;
|
|
1413
|
+
responses: {
|
|
1414
|
+
/** @description Default Response */
|
|
1415
|
+
200: {
|
|
1416
|
+
headers: {
|
|
1417
|
+
[name: string]: unknown;
|
|
1418
|
+
};
|
|
1419
|
+
content: {
|
|
1420
|
+
"application/json": components["schemas"]["CurrentOffering"];
|
|
1421
|
+
};
|
|
1422
|
+
};
|
|
1423
|
+
/** @description Default Response */
|
|
1424
|
+
400: {
|
|
1425
|
+
headers: {
|
|
1426
|
+
[name: string]: unknown;
|
|
1427
|
+
};
|
|
1428
|
+
content: {
|
|
1429
|
+
"application/json": components["schemas"]["Problem"];
|
|
1430
|
+
};
|
|
1431
|
+
};
|
|
1432
|
+
/** @description Default Response */
|
|
1433
|
+
401: {
|
|
1434
|
+
headers: {
|
|
1435
|
+
[name: string]: unknown;
|
|
1436
|
+
};
|
|
1437
|
+
content: {
|
|
1438
|
+
"application/json": components["schemas"]["Problem"];
|
|
1439
|
+
};
|
|
1440
|
+
};
|
|
1441
|
+
/** @description Default Response */
|
|
1442
|
+
403: {
|
|
1443
|
+
headers: {
|
|
1444
|
+
[name: string]: unknown;
|
|
1445
|
+
};
|
|
1446
|
+
content: {
|
|
1447
|
+
"application/json": components["schemas"]["Problem"];
|
|
1448
|
+
};
|
|
1449
|
+
};
|
|
1450
|
+
/** @description Default Response */
|
|
1451
|
+
404: {
|
|
1452
|
+
headers: {
|
|
1453
|
+
[name: string]: unknown;
|
|
1454
|
+
};
|
|
1455
|
+
content: {
|
|
1456
|
+
"application/json": components["schemas"]["Problem"];
|
|
1457
|
+
};
|
|
1458
|
+
};
|
|
1459
|
+
/** @description Default Response */
|
|
1460
|
+
409: {
|
|
1461
|
+
headers: {
|
|
1462
|
+
[name: string]: unknown;
|
|
1463
|
+
};
|
|
1464
|
+
content: {
|
|
1465
|
+
"application/json": components["schemas"]["Problem"];
|
|
1466
|
+
};
|
|
1467
|
+
};
|
|
1468
|
+
/** @description Default Response */
|
|
1469
|
+
422: {
|
|
1470
|
+
headers: {
|
|
1471
|
+
[name: string]: unknown;
|
|
1472
|
+
};
|
|
1473
|
+
content: {
|
|
1474
|
+
"application/json": components["schemas"]["Problem"];
|
|
1475
|
+
};
|
|
1476
|
+
};
|
|
1477
|
+
};
|
|
1478
|
+
};
|
|
1479
|
+
put?: never;
|
|
1480
|
+
post?: never;
|
|
1481
|
+
delete?: never;
|
|
1482
|
+
options?: never;
|
|
1483
|
+
head?: never;
|
|
1484
|
+
patch?: never;
|
|
1485
|
+
trace?: never;
|
|
1486
|
+
};
|
|
1487
|
+
"/v1/offerings/{key}": {
|
|
1488
|
+
parameters: {
|
|
1489
|
+
query?: never;
|
|
1490
|
+
header?: never;
|
|
1491
|
+
path?: never;
|
|
1492
|
+
cookie?: never;
|
|
1493
|
+
};
|
|
1494
|
+
/** An offering by key, for a platform */
|
|
1495
|
+
get: {
|
|
1496
|
+
parameters: {
|
|
1497
|
+
query: {
|
|
1498
|
+
platform: "ios" | "android" | "web";
|
|
1499
|
+
/** @description The highest paywall config schema version the SDK renders. Without it, `paywall` is null. */
|
|
1500
|
+
paywall_schema?: number;
|
|
1501
|
+
};
|
|
1502
|
+
header?: never;
|
|
1503
|
+
path: {
|
|
1504
|
+
key: string;
|
|
1505
|
+
};
|
|
1506
|
+
cookie?: never;
|
|
1507
|
+
};
|
|
1508
|
+
requestBody?: never;
|
|
1509
|
+
responses: {
|
|
1510
|
+
/** @description Default Response */
|
|
1511
|
+
200: {
|
|
1512
|
+
headers: {
|
|
1513
|
+
[name: string]: unknown;
|
|
1514
|
+
};
|
|
1515
|
+
content: {
|
|
1516
|
+
"application/json": components["schemas"]["CurrentOffering"];
|
|
1517
|
+
};
|
|
1518
|
+
};
|
|
1519
|
+
/** @description Default Response */
|
|
1520
|
+
400: {
|
|
1521
|
+
headers: {
|
|
1522
|
+
[name: string]: unknown;
|
|
1523
|
+
};
|
|
1524
|
+
content: {
|
|
1525
|
+
"application/json": components["schemas"]["Problem"];
|
|
1526
|
+
};
|
|
1527
|
+
};
|
|
1528
|
+
/** @description Default Response */
|
|
1529
|
+
401: {
|
|
1530
|
+
headers: {
|
|
1531
|
+
[name: string]: unknown;
|
|
1532
|
+
};
|
|
1533
|
+
content: {
|
|
1534
|
+
"application/json": components["schemas"]["Problem"];
|
|
1535
|
+
};
|
|
1536
|
+
};
|
|
1537
|
+
/** @description Default Response */
|
|
1538
|
+
403: {
|
|
1539
|
+
headers: {
|
|
1540
|
+
[name: string]: unknown;
|
|
1541
|
+
};
|
|
1542
|
+
content: {
|
|
1543
|
+
"application/json": components["schemas"]["Problem"];
|
|
1544
|
+
};
|
|
1545
|
+
};
|
|
1546
|
+
/** @description Default Response */
|
|
1547
|
+
404: {
|
|
1548
|
+
headers: {
|
|
1549
|
+
[name: string]: unknown;
|
|
1550
|
+
};
|
|
1551
|
+
content: {
|
|
1552
|
+
"application/json": components["schemas"]["Problem"];
|
|
1553
|
+
};
|
|
1554
|
+
};
|
|
1555
|
+
/** @description Default Response */
|
|
1556
|
+
409: {
|
|
1557
|
+
headers: {
|
|
1558
|
+
[name: string]: unknown;
|
|
1559
|
+
};
|
|
1560
|
+
content: {
|
|
1561
|
+
"application/json": components["schemas"]["Problem"];
|
|
1562
|
+
};
|
|
1563
|
+
};
|
|
1564
|
+
/** @description Default Response */
|
|
1565
|
+
422: {
|
|
1566
|
+
headers: {
|
|
1567
|
+
[name: string]: unknown;
|
|
1568
|
+
};
|
|
1569
|
+
content: {
|
|
1570
|
+
"application/json": components["schemas"]["Problem"];
|
|
1571
|
+
};
|
|
1572
|
+
};
|
|
1573
|
+
};
|
|
1574
|
+
};
|
|
1575
|
+
put?: never;
|
|
1576
|
+
post?: never;
|
|
1577
|
+
delete?: never;
|
|
1578
|
+
options?: never;
|
|
1579
|
+
head?: never;
|
|
1580
|
+
patch?: never;
|
|
1581
|
+
trace?: never;
|
|
1582
|
+
};
|
|
1583
|
+
"/v1/events": {
|
|
1584
|
+
parameters: {
|
|
1585
|
+
query?: never;
|
|
1586
|
+
header?: never;
|
|
1587
|
+
path?: never;
|
|
1588
|
+
cookie?: never;
|
|
1589
|
+
};
|
|
1590
|
+
/**
|
|
1591
|
+
* Events for this app and environment, oldest first
|
|
1592
|
+
* @description The same events webhooks deliver, for apps that prefer to poll. Pass the last id you processed as `after`.
|
|
1593
|
+
*/
|
|
1594
|
+
get: {
|
|
1595
|
+
parameters: {
|
|
1596
|
+
query?: {
|
|
1597
|
+
after?: string;
|
|
1598
|
+
limit?: number;
|
|
1599
|
+
type?: string;
|
|
1600
|
+
/** @description Only events for this app_user_id. */
|
|
1601
|
+
customer?: string;
|
|
1602
|
+
};
|
|
1603
|
+
header?: never;
|
|
1604
|
+
path?: never;
|
|
1605
|
+
cookie?: never;
|
|
1606
|
+
};
|
|
1607
|
+
requestBody?: never;
|
|
1608
|
+
responses: {
|
|
1609
|
+
/** @description Default Response */
|
|
1610
|
+
200: {
|
|
1611
|
+
headers: {
|
|
1612
|
+
[name: string]: unknown;
|
|
1613
|
+
};
|
|
1614
|
+
content: {
|
|
1615
|
+
"application/json": {
|
|
1616
|
+
data: components["schemas"]["Event"][];
|
|
1617
|
+
has_more: boolean;
|
|
1618
|
+
};
|
|
1619
|
+
};
|
|
1620
|
+
};
|
|
1621
|
+
/** @description Default Response */
|
|
1622
|
+
400: {
|
|
1623
|
+
headers: {
|
|
1624
|
+
[name: string]: unknown;
|
|
1625
|
+
};
|
|
1626
|
+
content: {
|
|
1627
|
+
"application/json": components["schemas"]["Problem"];
|
|
1628
|
+
};
|
|
1629
|
+
};
|
|
1630
|
+
/** @description Default Response */
|
|
1631
|
+
401: {
|
|
1632
|
+
headers: {
|
|
1633
|
+
[name: string]: unknown;
|
|
1634
|
+
};
|
|
1635
|
+
content: {
|
|
1636
|
+
"application/json": components["schemas"]["Problem"];
|
|
1637
|
+
};
|
|
1638
|
+
};
|
|
1639
|
+
/** @description Default Response */
|
|
1640
|
+
403: {
|
|
1641
|
+
headers: {
|
|
1642
|
+
[name: string]: unknown;
|
|
1643
|
+
};
|
|
1644
|
+
content: {
|
|
1645
|
+
"application/json": components["schemas"]["Problem"];
|
|
1646
|
+
};
|
|
1647
|
+
};
|
|
1648
|
+
/** @description Default Response */
|
|
1649
|
+
404: {
|
|
1650
|
+
headers: {
|
|
1651
|
+
[name: string]: unknown;
|
|
1652
|
+
};
|
|
1653
|
+
content: {
|
|
1654
|
+
"application/json": components["schemas"]["Problem"];
|
|
1655
|
+
};
|
|
1656
|
+
};
|
|
1657
|
+
/** @description Default Response */
|
|
1658
|
+
409: {
|
|
1659
|
+
headers: {
|
|
1660
|
+
[name: string]: unknown;
|
|
1661
|
+
};
|
|
1662
|
+
content: {
|
|
1663
|
+
"application/json": components["schemas"]["Problem"];
|
|
1664
|
+
};
|
|
1665
|
+
};
|
|
1666
|
+
/** @description Default Response */
|
|
1667
|
+
422: {
|
|
1668
|
+
headers: {
|
|
1669
|
+
[name: string]: unknown;
|
|
1670
|
+
};
|
|
1671
|
+
content: {
|
|
1672
|
+
"application/json": components["schemas"]["Problem"];
|
|
1673
|
+
};
|
|
1674
|
+
};
|
|
1675
|
+
};
|
|
1676
|
+
};
|
|
1677
|
+
put?: never;
|
|
1678
|
+
post?: never;
|
|
1679
|
+
delete?: never;
|
|
1680
|
+
options?: never;
|
|
1681
|
+
head?: never;
|
|
1682
|
+
patch?: never;
|
|
1683
|
+
trace?: never;
|
|
1684
|
+
};
|
|
1685
|
+
"/v1/revenue/transactions": {
|
|
1686
|
+
parameters: {
|
|
1687
|
+
query?: never;
|
|
1688
|
+
header?: never;
|
|
1689
|
+
path?: never;
|
|
1690
|
+
cookie?: never;
|
|
1691
|
+
};
|
|
1692
|
+
/**
|
|
1693
|
+
* Revenue rows for this app and environment (the data behind the transactions export)
|
|
1694
|
+
* @description One row per money movement. Store fees are estimates from your commission settings; Stripe fees are actual.
|
|
1695
|
+
*/
|
|
1696
|
+
get: {
|
|
1697
|
+
parameters: {
|
|
1698
|
+
query?: {
|
|
1699
|
+
after?: string;
|
|
1700
|
+
limit?: number;
|
|
1701
|
+
/** @description occurred_at at or after */
|
|
1702
|
+
from?: string;
|
|
1703
|
+
/** @description occurred_at before */
|
|
1704
|
+
to?: string;
|
|
1705
|
+
};
|
|
1706
|
+
header?: never;
|
|
1707
|
+
path?: never;
|
|
1708
|
+
cookie?: never;
|
|
1709
|
+
};
|
|
1710
|
+
requestBody?: never;
|
|
1711
|
+
responses: {
|
|
1712
|
+
/** @description Default Response */
|
|
1713
|
+
200: {
|
|
1714
|
+
headers: {
|
|
1715
|
+
[name: string]: unknown;
|
|
1716
|
+
};
|
|
1717
|
+
content: {
|
|
1718
|
+
"application/json": {
|
|
1719
|
+
data: components["schemas"]["RevenueTransaction"][];
|
|
1720
|
+
has_more: boolean;
|
|
1721
|
+
};
|
|
1722
|
+
};
|
|
1723
|
+
};
|
|
1724
|
+
/** @description Default Response */
|
|
1725
|
+
400: {
|
|
1726
|
+
headers: {
|
|
1727
|
+
[name: string]: unknown;
|
|
1728
|
+
};
|
|
1729
|
+
content: {
|
|
1730
|
+
"application/json": components["schemas"]["Problem"];
|
|
1731
|
+
};
|
|
1732
|
+
};
|
|
1733
|
+
/** @description Default Response */
|
|
1734
|
+
401: {
|
|
1735
|
+
headers: {
|
|
1736
|
+
[name: string]: unknown;
|
|
1737
|
+
};
|
|
1738
|
+
content: {
|
|
1739
|
+
"application/json": components["schemas"]["Problem"];
|
|
1740
|
+
};
|
|
1741
|
+
};
|
|
1742
|
+
/** @description Default Response */
|
|
1743
|
+
403: {
|
|
1744
|
+
headers: {
|
|
1745
|
+
[name: string]: unknown;
|
|
1746
|
+
};
|
|
1747
|
+
content: {
|
|
1748
|
+
"application/json": components["schemas"]["Problem"];
|
|
1749
|
+
};
|
|
1750
|
+
};
|
|
1751
|
+
/** @description Default Response */
|
|
1752
|
+
404: {
|
|
1753
|
+
headers: {
|
|
1754
|
+
[name: string]: unknown;
|
|
1755
|
+
};
|
|
1756
|
+
content: {
|
|
1757
|
+
"application/json": components["schemas"]["Problem"];
|
|
1758
|
+
};
|
|
1759
|
+
};
|
|
1760
|
+
/** @description Default Response */
|
|
1761
|
+
409: {
|
|
1762
|
+
headers: {
|
|
1763
|
+
[name: string]: unknown;
|
|
1764
|
+
};
|
|
1765
|
+
content: {
|
|
1766
|
+
"application/json": components["schemas"]["Problem"];
|
|
1767
|
+
};
|
|
1768
|
+
};
|
|
1769
|
+
/** @description Default Response */
|
|
1770
|
+
422: {
|
|
1771
|
+
headers: {
|
|
1772
|
+
[name: string]: unknown;
|
|
1773
|
+
};
|
|
1774
|
+
content: {
|
|
1775
|
+
"application/json": components["schemas"]["Problem"];
|
|
1776
|
+
};
|
|
1777
|
+
};
|
|
1778
|
+
};
|
|
1779
|
+
};
|
|
1780
|
+
put?: never;
|
|
1781
|
+
post?: never;
|
|
1782
|
+
delete?: never;
|
|
1783
|
+
options?: never;
|
|
1784
|
+
head?: never;
|
|
1785
|
+
patch?: never;
|
|
1786
|
+
trace?: never;
|
|
1787
|
+
};
|
|
1788
|
+
"/v1/checkout-sessions": {
|
|
1789
|
+
parameters: {
|
|
1790
|
+
query?: never;
|
|
1791
|
+
header?: never;
|
|
1792
|
+
path?: never;
|
|
1793
|
+
cookie?: never;
|
|
1794
|
+
};
|
|
1795
|
+
get?: never;
|
|
1796
|
+
put?: never;
|
|
1797
|
+
/**
|
|
1798
|
+
* Start a hosted Stripe Checkout for a product
|
|
1799
|
+
* @description Send `success_url` and `cancel_url` (web), or `return: "app"` (native link-out): Checkout then returns through Tenth to the app's `return_url_scheme` as `<scheme>://tenth/checkout-return?status=success|cancel`.
|
|
1800
|
+
*/
|
|
1801
|
+
post: {
|
|
1802
|
+
parameters: {
|
|
1803
|
+
query?: never;
|
|
1804
|
+
header?: never;
|
|
1805
|
+
path?: never;
|
|
1806
|
+
cookie?: never;
|
|
1807
|
+
};
|
|
1808
|
+
requestBody: {
|
|
1809
|
+
content: {
|
|
1810
|
+
"application/json": {
|
|
1811
|
+
/**
|
|
1812
|
+
* @description `me` with a publishable key and customer token; any app_user_id with a secret key.
|
|
1813
|
+
* @default me
|
|
1814
|
+
*/
|
|
1815
|
+
app_user_id?: string;
|
|
1816
|
+
product: string;
|
|
1817
|
+
success_url?: string;
|
|
1818
|
+
cancel_url?: string;
|
|
1819
|
+
/**
|
|
1820
|
+
* @description Return to the app through its return_url_scheme, instead of URLs.
|
|
1821
|
+
* @enum {string}
|
|
1822
|
+
*/
|
|
1823
|
+
return?: "app";
|
|
1824
|
+
};
|
|
1825
|
+
};
|
|
1826
|
+
};
|
|
1827
|
+
responses: {
|
|
1828
|
+
/** @description Default Response */
|
|
1829
|
+
200: {
|
|
1830
|
+
headers: {
|
|
1831
|
+
[name: string]: unknown;
|
|
1832
|
+
};
|
|
1833
|
+
content: {
|
|
1834
|
+
"application/json": {
|
|
1835
|
+
id: string;
|
|
1836
|
+
url: string;
|
|
1837
|
+
};
|
|
1838
|
+
};
|
|
1839
|
+
};
|
|
1840
|
+
/** @description Default Response */
|
|
1841
|
+
400: {
|
|
1842
|
+
headers: {
|
|
1843
|
+
[name: string]: unknown;
|
|
1844
|
+
};
|
|
1845
|
+
content: {
|
|
1846
|
+
"application/json": components["schemas"]["Problem"];
|
|
1847
|
+
};
|
|
1848
|
+
};
|
|
1849
|
+
/** @description Default Response */
|
|
1850
|
+
401: {
|
|
1851
|
+
headers: {
|
|
1852
|
+
[name: string]: unknown;
|
|
1853
|
+
};
|
|
1854
|
+
content: {
|
|
1855
|
+
"application/json": components["schemas"]["Problem"];
|
|
1856
|
+
};
|
|
1857
|
+
};
|
|
1858
|
+
/** @description Default Response */
|
|
1859
|
+
403: {
|
|
1860
|
+
headers: {
|
|
1861
|
+
[name: string]: unknown;
|
|
1862
|
+
};
|
|
1863
|
+
content: {
|
|
1864
|
+
"application/json": components["schemas"]["Problem"];
|
|
1865
|
+
};
|
|
1866
|
+
};
|
|
1867
|
+
/** @description Default Response */
|
|
1868
|
+
404: {
|
|
1869
|
+
headers: {
|
|
1870
|
+
[name: string]: unknown;
|
|
1871
|
+
};
|
|
1872
|
+
content: {
|
|
1873
|
+
"application/json": components["schemas"]["Problem"];
|
|
1874
|
+
};
|
|
1875
|
+
};
|
|
1876
|
+
/** @description Default Response */
|
|
1877
|
+
409: {
|
|
1878
|
+
headers: {
|
|
1879
|
+
[name: string]: unknown;
|
|
1880
|
+
};
|
|
1881
|
+
content: {
|
|
1882
|
+
"application/json": components["schemas"]["Problem"];
|
|
1883
|
+
};
|
|
1884
|
+
};
|
|
1885
|
+
/** @description Default Response */
|
|
1886
|
+
422: {
|
|
1887
|
+
headers: {
|
|
1888
|
+
[name: string]: unknown;
|
|
1889
|
+
};
|
|
1890
|
+
content: {
|
|
1891
|
+
"application/json": components["schemas"]["Problem"];
|
|
1892
|
+
};
|
|
1893
|
+
};
|
|
1894
|
+
};
|
|
1895
|
+
};
|
|
1896
|
+
delete?: never;
|
|
1897
|
+
options?: never;
|
|
1898
|
+
head?: never;
|
|
1899
|
+
patch?: never;
|
|
1900
|
+
trace?: never;
|
|
1901
|
+
};
|
|
1902
|
+
"/v1/payment-intents": {
|
|
1903
|
+
parameters: {
|
|
1904
|
+
query?: never;
|
|
1905
|
+
header?: never;
|
|
1906
|
+
path?: never;
|
|
1907
|
+
cookie?: never;
|
|
1908
|
+
};
|
|
1909
|
+
get?: never;
|
|
1910
|
+
put?: never;
|
|
1911
|
+
/**
|
|
1912
|
+
* Start an embedded Stripe payment for a product
|
|
1913
|
+
* @description `elements` (default, web): the Payment Element over a Checkout Session; tax, trials and billing anchors all apply. `payment_sheet` (native, where store rules allow): a PaymentIntent, or an unpaid subscription; Stripe Tax is not available on it.
|
|
1914
|
+
*/
|
|
1915
|
+
post: {
|
|
1916
|
+
parameters: {
|
|
1917
|
+
query?: never;
|
|
1918
|
+
header?: never;
|
|
1919
|
+
path?: never;
|
|
1920
|
+
cookie?: never;
|
|
1921
|
+
};
|
|
1922
|
+
requestBody: {
|
|
1923
|
+
content: {
|
|
1924
|
+
"application/json": {
|
|
1925
|
+
/**
|
|
1926
|
+
* @description `me` with a publishable key and customer token; any app_user_id with a secret key.
|
|
1927
|
+
* @default me
|
|
1928
|
+
*/
|
|
1929
|
+
app_user_id?: string;
|
|
1930
|
+
product: string;
|
|
1931
|
+
/**
|
|
1932
|
+
* @default elements
|
|
1933
|
+
* @enum {string}
|
|
1934
|
+
*/
|
|
1935
|
+
form?: "elements" | "payment_sheet";
|
|
1936
|
+
/** @description Where redirect-based payment methods return (elements). */
|
|
1937
|
+
return_url?: string;
|
|
1938
|
+
};
|
|
1939
|
+
};
|
|
1940
|
+
};
|
|
1941
|
+
responses: {
|
|
1942
|
+
/** @description Default Response */
|
|
1943
|
+
200: {
|
|
1944
|
+
headers: {
|
|
1945
|
+
[name: string]: unknown;
|
|
1946
|
+
};
|
|
1947
|
+
content: {
|
|
1948
|
+
"application/json": {
|
|
1949
|
+
id: string;
|
|
1950
|
+
/** @enum {string} */
|
|
1951
|
+
form: "elements" | "payment_sheet";
|
|
1952
|
+
client_secret: string | null;
|
|
1953
|
+
publishable_key: string | null;
|
|
1954
|
+
/** @description Pass to Stripe.js for Connect accounts. */
|
|
1955
|
+
stripe_account: string | null;
|
|
1956
|
+
};
|
|
1957
|
+
};
|
|
1958
|
+
};
|
|
1959
|
+
/** @description Default Response */
|
|
1960
|
+
400: {
|
|
1961
|
+
headers: {
|
|
1962
|
+
[name: string]: unknown;
|
|
1963
|
+
};
|
|
1964
|
+
content: {
|
|
1965
|
+
"application/json": components["schemas"]["Problem"];
|
|
1966
|
+
};
|
|
1967
|
+
};
|
|
1968
|
+
/** @description Default Response */
|
|
1969
|
+
401: {
|
|
1970
|
+
headers: {
|
|
1971
|
+
[name: string]: unknown;
|
|
1972
|
+
};
|
|
1973
|
+
content: {
|
|
1974
|
+
"application/json": components["schemas"]["Problem"];
|
|
1975
|
+
};
|
|
1976
|
+
};
|
|
1977
|
+
/** @description Default Response */
|
|
1978
|
+
403: {
|
|
1979
|
+
headers: {
|
|
1980
|
+
[name: string]: unknown;
|
|
1981
|
+
};
|
|
1982
|
+
content: {
|
|
1983
|
+
"application/json": components["schemas"]["Problem"];
|
|
1984
|
+
};
|
|
1985
|
+
};
|
|
1986
|
+
/** @description Default Response */
|
|
1987
|
+
404: {
|
|
1988
|
+
headers: {
|
|
1989
|
+
[name: string]: unknown;
|
|
1990
|
+
};
|
|
1991
|
+
content: {
|
|
1992
|
+
"application/json": components["schemas"]["Problem"];
|
|
1993
|
+
};
|
|
1994
|
+
};
|
|
1995
|
+
/** @description Default Response */
|
|
1996
|
+
409: {
|
|
1997
|
+
headers: {
|
|
1998
|
+
[name: string]: unknown;
|
|
1999
|
+
};
|
|
2000
|
+
content: {
|
|
2001
|
+
"application/json": components["schemas"]["Problem"];
|
|
2002
|
+
};
|
|
2003
|
+
};
|
|
2004
|
+
/** @description Default Response */
|
|
2005
|
+
422: {
|
|
2006
|
+
headers: {
|
|
2007
|
+
[name: string]: unknown;
|
|
2008
|
+
};
|
|
2009
|
+
content: {
|
|
2010
|
+
"application/json": components["schemas"]["Problem"];
|
|
2011
|
+
};
|
|
2012
|
+
};
|
|
2013
|
+
};
|
|
2014
|
+
};
|
|
2015
|
+
delete?: never;
|
|
2016
|
+
options?: never;
|
|
2017
|
+
head?: never;
|
|
2018
|
+
patch?: never;
|
|
2019
|
+
trace?: never;
|
|
2020
|
+
};
|
|
2021
|
+
"/v1/customers/me/management-url": {
|
|
2022
|
+
parameters: {
|
|
2023
|
+
query?: never;
|
|
2024
|
+
header?: never;
|
|
2025
|
+
path?: never;
|
|
2026
|
+
cookie?: never;
|
|
2027
|
+
};
|
|
2028
|
+
/**
|
|
2029
|
+
* Where the signed-in customer manages a subscription
|
|
2030
|
+
* @description The App Store settings page, the Google Play subscription page, or a Stripe customer portal session.
|
|
2031
|
+
*/
|
|
2032
|
+
get: {
|
|
2033
|
+
parameters: {
|
|
2034
|
+
query: {
|
|
2035
|
+
subscription_id: string;
|
|
2036
|
+
/** @description Stripe portal only: where its back link goes. */
|
|
2037
|
+
return_url?: string;
|
|
2038
|
+
};
|
|
2039
|
+
header?: never;
|
|
2040
|
+
path?: never;
|
|
2041
|
+
cookie?: never;
|
|
2042
|
+
};
|
|
2043
|
+
requestBody?: never;
|
|
2044
|
+
responses: {
|
|
2045
|
+
/** @description Default Response */
|
|
2046
|
+
200: {
|
|
2047
|
+
headers: {
|
|
2048
|
+
[name: string]: unknown;
|
|
2049
|
+
};
|
|
2050
|
+
content: {
|
|
2051
|
+
"application/json": {
|
|
2052
|
+
url: string;
|
|
2053
|
+
};
|
|
2054
|
+
};
|
|
2055
|
+
};
|
|
2056
|
+
/** @description Default Response */
|
|
2057
|
+
400: {
|
|
2058
|
+
headers: {
|
|
2059
|
+
[name: string]: unknown;
|
|
2060
|
+
};
|
|
2061
|
+
content: {
|
|
2062
|
+
"application/json": components["schemas"]["Problem"];
|
|
2063
|
+
};
|
|
2064
|
+
};
|
|
2065
|
+
/** @description Default Response */
|
|
2066
|
+
401: {
|
|
2067
|
+
headers: {
|
|
2068
|
+
[name: string]: unknown;
|
|
2069
|
+
};
|
|
2070
|
+
content: {
|
|
2071
|
+
"application/json": components["schemas"]["Problem"];
|
|
2072
|
+
};
|
|
2073
|
+
};
|
|
2074
|
+
/** @description Default Response */
|
|
2075
|
+
403: {
|
|
2076
|
+
headers: {
|
|
2077
|
+
[name: string]: unknown;
|
|
2078
|
+
};
|
|
2079
|
+
content: {
|
|
2080
|
+
"application/json": components["schemas"]["Problem"];
|
|
2081
|
+
};
|
|
2082
|
+
};
|
|
2083
|
+
/** @description Default Response */
|
|
2084
|
+
404: {
|
|
2085
|
+
headers: {
|
|
2086
|
+
[name: string]: unknown;
|
|
2087
|
+
};
|
|
2088
|
+
content: {
|
|
2089
|
+
"application/json": components["schemas"]["Problem"];
|
|
2090
|
+
};
|
|
2091
|
+
};
|
|
2092
|
+
/** @description Default Response */
|
|
2093
|
+
409: {
|
|
2094
|
+
headers: {
|
|
2095
|
+
[name: string]: unknown;
|
|
2096
|
+
};
|
|
2097
|
+
content: {
|
|
2098
|
+
"application/json": components["schemas"]["Problem"];
|
|
2099
|
+
};
|
|
2100
|
+
};
|
|
2101
|
+
/** @description Default Response */
|
|
2102
|
+
422: {
|
|
2103
|
+
headers: {
|
|
2104
|
+
[name: string]: unknown;
|
|
2105
|
+
};
|
|
2106
|
+
content: {
|
|
2107
|
+
"application/json": components["schemas"]["Problem"];
|
|
2108
|
+
};
|
|
2109
|
+
};
|
|
2110
|
+
};
|
|
2111
|
+
};
|
|
2112
|
+
put?: never;
|
|
2113
|
+
post?: never;
|
|
2114
|
+
delete?: never;
|
|
2115
|
+
options?: never;
|
|
2116
|
+
head?: never;
|
|
2117
|
+
patch?: never;
|
|
2118
|
+
trace?: never;
|
|
2119
|
+
};
|
|
2120
|
+
"/v1/subscriptions/{id}/change": {
|
|
2121
|
+
parameters: {
|
|
2122
|
+
query?: never;
|
|
2123
|
+
header?: never;
|
|
2124
|
+
path?: never;
|
|
2125
|
+
cookie?: never;
|
|
2126
|
+
};
|
|
2127
|
+
get?: never;
|
|
2128
|
+
put?: never;
|
|
2129
|
+
/** Move a Stripe subscription to another product (upgrade, downgrade) */
|
|
2130
|
+
post: {
|
|
2131
|
+
parameters: {
|
|
2132
|
+
query?: never;
|
|
2133
|
+
header?: never;
|
|
2134
|
+
path: {
|
|
2135
|
+
id: string;
|
|
2136
|
+
};
|
|
2137
|
+
cookie?: never;
|
|
2138
|
+
};
|
|
2139
|
+
requestBody: {
|
|
2140
|
+
content: {
|
|
2141
|
+
"application/json": {
|
|
2142
|
+
product: string;
|
|
2143
|
+
/**
|
|
2144
|
+
* @description Defaults to the new product's setting.
|
|
2145
|
+
* @enum {string}
|
|
2146
|
+
*/
|
|
2147
|
+
timing?: "immediately" | "period_end";
|
|
2148
|
+
/** @enum {string} */
|
|
2149
|
+
proration?: "create_prorations" | "none" | "always_invoice";
|
|
2150
|
+
};
|
|
2151
|
+
};
|
|
2152
|
+
};
|
|
2153
|
+
responses: {
|
|
2154
|
+
/** @description Default Response */
|
|
2155
|
+
200: {
|
|
2156
|
+
headers: {
|
|
2157
|
+
[name: string]: unknown;
|
|
2158
|
+
};
|
|
2159
|
+
content: {
|
|
2160
|
+
"application/json": components["schemas"]["CustomerState"];
|
|
2161
|
+
};
|
|
2162
|
+
};
|
|
2163
|
+
/** @description Default Response */
|
|
2164
|
+
400: {
|
|
2165
|
+
headers: {
|
|
2166
|
+
[name: string]: unknown;
|
|
2167
|
+
};
|
|
2168
|
+
content: {
|
|
2169
|
+
"application/json": components["schemas"]["Problem"];
|
|
2170
|
+
};
|
|
2171
|
+
};
|
|
2172
|
+
/** @description Default Response */
|
|
2173
|
+
401: {
|
|
2174
|
+
headers: {
|
|
2175
|
+
[name: string]: unknown;
|
|
2176
|
+
};
|
|
2177
|
+
content: {
|
|
2178
|
+
"application/json": components["schemas"]["Problem"];
|
|
2179
|
+
};
|
|
2180
|
+
};
|
|
2181
|
+
/** @description Default Response */
|
|
2182
|
+
403: {
|
|
2183
|
+
headers: {
|
|
2184
|
+
[name: string]: unknown;
|
|
2185
|
+
};
|
|
2186
|
+
content: {
|
|
2187
|
+
"application/json": components["schemas"]["Problem"];
|
|
2188
|
+
};
|
|
2189
|
+
};
|
|
2190
|
+
/** @description Default Response */
|
|
2191
|
+
404: {
|
|
2192
|
+
headers: {
|
|
2193
|
+
[name: string]: unknown;
|
|
2194
|
+
};
|
|
2195
|
+
content: {
|
|
2196
|
+
"application/json": components["schemas"]["Problem"];
|
|
2197
|
+
};
|
|
2198
|
+
};
|
|
2199
|
+
/** @description Default Response */
|
|
2200
|
+
409: {
|
|
2201
|
+
headers: {
|
|
2202
|
+
[name: string]: unknown;
|
|
2203
|
+
};
|
|
2204
|
+
content: {
|
|
2205
|
+
"application/json": components["schemas"]["Problem"];
|
|
2206
|
+
};
|
|
2207
|
+
};
|
|
2208
|
+
/** @description Default Response */
|
|
2209
|
+
422: {
|
|
2210
|
+
headers: {
|
|
2211
|
+
[name: string]: unknown;
|
|
2212
|
+
};
|
|
2213
|
+
content: {
|
|
2214
|
+
"application/json": components["schemas"]["Problem"];
|
|
2215
|
+
};
|
|
2216
|
+
};
|
|
2217
|
+
};
|
|
2218
|
+
};
|
|
2219
|
+
delete?: never;
|
|
2220
|
+
options?: never;
|
|
2221
|
+
head?: never;
|
|
2222
|
+
patch?: never;
|
|
2223
|
+
trace?: never;
|
|
2224
|
+
};
|
|
2225
|
+
"/v1/subscriptions/{id}/cancel": {
|
|
2226
|
+
parameters: {
|
|
2227
|
+
query?: never;
|
|
2228
|
+
header?: never;
|
|
2229
|
+
path?: never;
|
|
2230
|
+
cookie?: never;
|
|
2231
|
+
};
|
|
2232
|
+
get?: never;
|
|
2233
|
+
put?: never;
|
|
2234
|
+
/** Cancel a Stripe subscription, at period end (default) or now */
|
|
2235
|
+
post: {
|
|
2236
|
+
parameters: {
|
|
2237
|
+
query?: never;
|
|
2238
|
+
header?: never;
|
|
2239
|
+
path: {
|
|
2240
|
+
id: string;
|
|
2241
|
+
};
|
|
2242
|
+
cookie?: never;
|
|
2243
|
+
};
|
|
2244
|
+
requestBody: {
|
|
2245
|
+
content: {
|
|
2246
|
+
"application/json": {
|
|
2247
|
+
/** @default true */
|
|
2248
|
+
at_period_end?: boolean;
|
|
2249
|
+
};
|
|
2250
|
+
};
|
|
2251
|
+
};
|
|
2252
|
+
responses: {
|
|
2253
|
+
/** @description Default Response */
|
|
2254
|
+
200: {
|
|
2255
|
+
headers: {
|
|
2256
|
+
[name: string]: unknown;
|
|
2257
|
+
};
|
|
2258
|
+
content: {
|
|
2259
|
+
"application/json": components["schemas"]["CustomerState"];
|
|
2260
|
+
};
|
|
2261
|
+
};
|
|
2262
|
+
/** @description Default Response */
|
|
2263
|
+
400: {
|
|
2264
|
+
headers: {
|
|
2265
|
+
[name: string]: unknown;
|
|
2266
|
+
};
|
|
2267
|
+
content: {
|
|
2268
|
+
"application/json": components["schemas"]["Problem"];
|
|
2269
|
+
};
|
|
2270
|
+
};
|
|
2271
|
+
/** @description Default Response */
|
|
2272
|
+
401: {
|
|
2273
|
+
headers: {
|
|
2274
|
+
[name: string]: unknown;
|
|
2275
|
+
};
|
|
2276
|
+
content: {
|
|
2277
|
+
"application/json": components["schemas"]["Problem"];
|
|
2278
|
+
};
|
|
2279
|
+
};
|
|
2280
|
+
/** @description Default Response */
|
|
2281
|
+
403: {
|
|
2282
|
+
headers: {
|
|
2283
|
+
[name: string]: unknown;
|
|
2284
|
+
};
|
|
2285
|
+
content: {
|
|
2286
|
+
"application/json": components["schemas"]["Problem"];
|
|
2287
|
+
};
|
|
2288
|
+
};
|
|
2289
|
+
/** @description Default Response */
|
|
2290
|
+
404: {
|
|
2291
|
+
headers: {
|
|
2292
|
+
[name: string]: unknown;
|
|
2293
|
+
};
|
|
2294
|
+
content: {
|
|
2295
|
+
"application/json": components["schemas"]["Problem"];
|
|
2296
|
+
};
|
|
2297
|
+
};
|
|
2298
|
+
/** @description Default Response */
|
|
2299
|
+
409: {
|
|
2300
|
+
headers: {
|
|
2301
|
+
[name: string]: unknown;
|
|
2302
|
+
};
|
|
2303
|
+
content: {
|
|
2304
|
+
"application/json": components["schemas"]["Problem"];
|
|
2305
|
+
};
|
|
2306
|
+
};
|
|
2307
|
+
/** @description Default Response */
|
|
2308
|
+
422: {
|
|
2309
|
+
headers: {
|
|
2310
|
+
[name: string]: unknown;
|
|
2311
|
+
};
|
|
2312
|
+
content: {
|
|
2313
|
+
"application/json": components["schemas"]["Problem"];
|
|
2314
|
+
};
|
|
2315
|
+
};
|
|
2316
|
+
};
|
|
2317
|
+
};
|
|
2318
|
+
delete?: never;
|
|
2319
|
+
options?: never;
|
|
2320
|
+
head?: never;
|
|
2321
|
+
patch?: never;
|
|
2322
|
+
trace?: never;
|
|
2323
|
+
};
|
|
2324
|
+
"/v1/subscriptions/{id}/resume": {
|
|
2325
|
+
parameters: {
|
|
2326
|
+
query?: never;
|
|
2327
|
+
header?: never;
|
|
2328
|
+
path?: never;
|
|
2329
|
+
cookie?: never;
|
|
2330
|
+
};
|
|
2331
|
+
get?: never;
|
|
2332
|
+
put?: never;
|
|
2333
|
+
/** Undo a scheduled cancellation, or resume a paused Stripe subscription */
|
|
2334
|
+
post: {
|
|
2335
|
+
parameters: {
|
|
2336
|
+
query?: never;
|
|
2337
|
+
header?: never;
|
|
2338
|
+
path: {
|
|
2339
|
+
id: string;
|
|
2340
|
+
};
|
|
2341
|
+
cookie?: never;
|
|
2342
|
+
};
|
|
2343
|
+
requestBody?: never;
|
|
2344
|
+
responses: {
|
|
2345
|
+
/** @description Default Response */
|
|
2346
|
+
200: {
|
|
2347
|
+
headers: {
|
|
2348
|
+
[name: string]: unknown;
|
|
2349
|
+
};
|
|
2350
|
+
content: {
|
|
2351
|
+
"application/json": components["schemas"]["CustomerState"];
|
|
2352
|
+
};
|
|
2353
|
+
};
|
|
2354
|
+
/** @description Default Response */
|
|
2355
|
+
400: {
|
|
2356
|
+
headers: {
|
|
2357
|
+
[name: string]: unknown;
|
|
2358
|
+
};
|
|
2359
|
+
content: {
|
|
2360
|
+
"application/json": components["schemas"]["Problem"];
|
|
2361
|
+
};
|
|
2362
|
+
};
|
|
2363
|
+
/** @description Default Response */
|
|
2364
|
+
401: {
|
|
2365
|
+
headers: {
|
|
2366
|
+
[name: string]: unknown;
|
|
2367
|
+
};
|
|
2368
|
+
content: {
|
|
2369
|
+
"application/json": components["schemas"]["Problem"];
|
|
2370
|
+
};
|
|
2371
|
+
};
|
|
2372
|
+
/** @description Default Response */
|
|
2373
|
+
403: {
|
|
2374
|
+
headers: {
|
|
2375
|
+
[name: string]: unknown;
|
|
2376
|
+
};
|
|
2377
|
+
content: {
|
|
2378
|
+
"application/json": components["schemas"]["Problem"];
|
|
2379
|
+
};
|
|
2380
|
+
};
|
|
2381
|
+
/** @description Default Response */
|
|
2382
|
+
404: {
|
|
2383
|
+
headers: {
|
|
2384
|
+
[name: string]: unknown;
|
|
2385
|
+
};
|
|
2386
|
+
content: {
|
|
2387
|
+
"application/json": components["schemas"]["Problem"];
|
|
2388
|
+
};
|
|
2389
|
+
};
|
|
2390
|
+
/** @description Default Response */
|
|
2391
|
+
409: {
|
|
2392
|
+
headers: {
|
|
2393
|
+
[name: string]: unknown;
|
|
2394
|
+
};
|
|
2395
|
+
content: {
|
|
2396
|
+
"application/json": components["schemas"]["Problem"];
|
|
2397
|
+
};
|
|
2398
|
+
};
|
|
2399
|
+
/** @description Default Response */
|
|
2400
|
+
422: {
|
|
2401
|
+
headers: {
|
|
2402
|
+
[name: string]: unknown;
|
|
2403
|
+
};
|
|
2404
|
+
content: {
|
|
2405
|
+
"application/json": components["schemas"]["Problem"];
|
|
2406
|
+
};
|
|
2407
|
+
};
|
|
2408
|
+
};
|
|
2409
|
+
};
|
|
2410
|
+
delete?: never;
|
|
2411
|
+
options?: never;
|
|
2412
|
+
head?: never;
|
|
2413
|
+
patch?: never;
|
|
2414
|
+
trace?: never;
|
|
2415
|
+
};
|
|
2416
|
+
"/v1/subscriptions/{id}/anchor": {
|
|
2417
|
+
parameters: {
|
|
2418
|
+
query?: never;
|
|
2419
|
+
header?: never;
|
|
2420
|
+
path?: never;
|
|
2421
|
+
cookie?: never;
|
|
2422
|
+
};
|
|
2423
|
+
get?: never;
|
|
2424
|
+
put?: never;
|
|
2425
|
+
/** Move a Stripe subscription to a fixed billing day */
|
|
2426
|
+
post: {
|
|
2427
|
+
parameters: {
|
|
2428
|
+
query?: never;
|
|
2429
|
+
header?: never;
|
|
2430
|
+
path: {
|
|
2431
|
+
id: string;
|
|
2432
|
+
};
|
|
2433
|
+
cookie?: never;
|
|
2434
|
+
};
|
|
2435
|
+
requestBody: {
|
|
2436
|
+
content: {
|
|
2437
|
+
"application/json": {
|
|
2438
|
+
day: number;
|
|
2439
|
+
month?: number;
|
|
2440
|
+
timezone?: string;
|
|
2441
|
+
/** @enum {string} */
|
|
2442
|
+
first_period: "prorate" | "free_until_anchor" | "full_then_anchor";
|
|
2443
|
+
minimum_first_period_days?: number;
|
|
2444
|
+
};
|
|
2445
|
+
};
|
|
2446
|
+
};
|
|
2447
|
+
responses: {
|
|
2448
|
+
/** @description Default Response */
|
|
2449
|
+
200: {
|
|
2450
|
+
headers: {
|
|
2451
|
+
[name: string]: unknown;
|
|
2452
|
+
};
|
|
2453
|
+
content: {
|
|
2454
|
+
"application/json": components["schemas"]["CustomerState"];
|
|
2455
|
+
};
|
|
2456
|
+
};
|
|
2457
|
+
/** @description Default Response */
|
|
2458
|
+
400: {
|
|
2459
|
+
headers: {
|
|
2460
|
+
[name: string]: unknown;
|
|
2461
|
+
};
|
|
2462
|
+
content: {
|
|
2463
|
+
"application/json": components["schemas"]["Problem"];
|
|
2464
|
+
};
|
|
2465
|
+
};
|
|
2466
|
+
/** @description Default Response */
|
|
2467
|
+
401: {
|
|
2468
|
+
headers: {
|
|
2469
|
+
[name: string]: unknown;
|
|
2470
|
+
};
|
|
2471
|
+
content: {
|
|
2472
|
+
"application/json": components["schemas"]["Problem"];
|
|
2473
|
+
};
|
|
2474
|
+
};
|
|
2475
|
+
/** @description Default Response */
|
|
2476
|
+
403: {
|
|
2477
|
+
headers: {
|
|
2478
|
+
[name: string]: unknown;
|
|
2479
|
+
};
|
|
2480
|
+
content: {
|
|
2481
|
+
"application/json": components["schemas"]["Problem"];
|
|
2482
|
+
};
|
|
2483
|
+
};
|
|
2484
|
+
/** @description Default Response */
|
|
2485
|
+
404: {
|
|
2486
|
+
headers: {
|
|
2487
|
+
[name: string]: unknown;
|
|
2488
|
+
};
|
|
2489
|
+
content: {
|
|
2490
|
+
"application/json": components["schemas"]["Problem"];
|
|
2491
|
+
};
|
|
2492
|
+
};
|
|
2493
|
+
/** @description Default Response */
|
|
2494
|
+
409: {
|
|
2495
|
+
headers: {
|
|
2496
|
+
[name: string]: unknown;
|
|
2497
|
+
};
|
|
2498
|
+
content: {
|
|
2499
|
+
"application/json": components["schemas"]["Problem"];
|
|
2500
|
+
};
|
|
2501
|
+
};
|
|
2502
|
+
/** @description Default Response */
|
|
2503
|
+
422: {
|
|
2504
|
+
headers: {
|
|
2505
|
+
[name: string]: unknown;
|
|
2506
|
+
};
|
|
2507
|
+
content: {
|
|
2508
|
+
"application/json": components["schemas"]["Problem"];
|
|
2509
|
+
};
|
|
2510
|
+
};
|
|
2511
|
+
};
|
|
2512
|
+
};
|
|
2513
|
+
delete?: never;
|
|
2514
|
+
options?: never;
|
|
2515
|
+
head?: never;
|
|
2516
|
+
patch?: never;
|
|
2517
|
+
trace?: never;
|
|
2518
|
+
};
|
|
2519
|
+
"/v1/purchases/{id}/refund": {
|
|
2520
|
+
parameters: {
|
|
2521
|
+
query?: never;
|
|
2522
|
+
header?: never;
|
|
2523
|
+
path?: never;
|
|
2524
|
+
cookie?: never;
|
|
2525
|
+
};
|
|
2526
|
+
get?: never;
|
|
2527
|
+
put?: never;
|
|
2528
|
+
/** Refund a Stripe one-time purchase, fully or in part */
|
|
2529
|
+
post: {
|
|
2530
|
+
parameters: {
|
|
2531
|
+
query?: never;
|
|
2532
|
+
header?: never;
|
|
2533
|
+
path: {
|
|
2534
|
+
id: string;
|
|
2535
|
+
};
|
|
2536
|
+
cookie?: never;
|
|
2537
|
+
};
|
|
2538
|
+
requestBody: {
|
|
2539
|
+
content: {
|
|
2540
|
+
"application/json": {
|
|
2541
|
+
/** @description Minor units; leave out for the full amount. */
|
|
2542
|
+
amount?: number;
|
|
2543
|
+
};
|
|
2544
|
+
};
|
|
2545
|
+
};
|
|
2546
|
+
responses: {
|
|
2547
|
+
/** @description Default Response */
|
|
2548
|
+
200: {
|
|
2549
|
+
headers: {
|
|
2550
|
+
[name: string]: unknown;
|
|
2551
|
+
};
|
|
2552
|
+
content: {
|
|
2553
|
+
"application/json": components["schemas"]["CustomerState"];
|
|
2554
|
+
};
|
|
2555
|
+
};
|
|
2556
|
+
/** @description Default Response */
|
|
2557
|
+
400: {
|
|
2558
|
+
headers: {
|
|
2559
|
+
[name: string]: unknown;
|
|
2560
|
+
};
|
|
2561
|
+
content: {
|
|
2562
|
+
"application/json": components["schemas"]["Problem"];
|
|
2563
|
+
};
|
|
2564
|
+
};
|
|
2565
|
+
/** @description Default Response */
|
|
2566
|
+
401: {
|
|
2567
|
+
headers: {
|
|
2568
|
+
[name: string]: unknown;
|
|
2569
|
+
};
|
|
2570
|
+
content: {
|
|
2571
|
+
"application/json": components["schemas"]["Problem"];
|
|
2572
|
+
};
|
|
2573
|
+
};
|
|
2574
|
+
/** @description Default Response */
|
|
2575
|
+
403: {
|
|
2576
|
+
headers: {
|
|
2577
|
+
[name: string]: unknown;
|
|
2578
|
+
};
|
|
2579
|
+
content: {
|
|
2580
|
+
"application/json": components["schemas"]["Problem"];
|
|
2581
|
+
};
|
|
2582
|
+
};
|
|
2583
|
+
/** @description Default Response */
|
|
2584
|
+
404: {
|
|
2585
|
+
headers: {
|
|
2586
|
+
[name: string]: unknown;
|
|
2587
|
+
};
|
|
2588
|
+
content: {
|
|
2589
|
+
"application/json": components["schemas"]["Problem"];
|
|
2590
|
+
};
|
|
2591
|
+
};
|
|
2592
|
+
/** @description Default Response */
|
|
2593
|
+
409: {
|
|
2594
|
+
headers: {
|
|
2595
|
+
[name: string]: unknown;
|
|
2596
|
+
};
|
|
2597
|
+
content: {
|
|
2598
|
+
"application/json": components["schemas"]["Problem"];
|
|
2599
|
+
};
|
|
2600
|
+
};
|
|
2601
|
+
/** @description Default Response */
|
|
2602
|
+
422: {
|
|
2603
|
+
headers: {
|
|
2604
|
+
[name: string]: unknown;
|
|
2605
|
+
};
|
|
2606
|
+
content: {
|
|
2607
|
+
"application/json": components["schemas"]["Problem"];
|
|
2608
|
+
};
|
|
2609
|
+
};
|
|
2610
|
+
};
|
|
2611
|
+
};
|
|
2612
|
+
delete?: never;
|
|
2613
|
+
options?: never;
|
|
2614
|
+
head?: never;
|
|
2615
|
+
patch?: never;
|
|
2616
|
+
trace?: never;
|
|
2617
|
+
};
|
|
2618
|
+
"/v1/paywall-assets/{id}": {
|
|
2619
|
+
parameters: {
|
|
2620
|
+
query?: never;
|
|
2621
|
+
header?: never;
|
|
2622
|
+
path?: never;
|
|
2623
|
+
cookie?: never;
|
|
2624
|
+
};
|
|
2625
|
+
/**
|
|
2626
|
+
* A paywall image (no authentication)
|
|
2627
|
+
* @description The image bytes with their stored content type. Offerings return these URLs in `paywall.assets`.
|
|
2628
|
+
*/
|
|
2629
|
+
get: {
|
|
2630
|
+
parameters: {
|
|
2631
|
+
query?: never;
|
|
2632
|
+
header?: never;
|
|
2633
|
+
path: {
|
|
2634
|
+
id: string;
|
|
2635
|
+
};
|
|
2636
|
+
cookie?: never;
|
|
2637
|
+
};
|
|
2638
|
+
requestBody?: never;
|
|
2639
|
+
responses: {
|
|
2640
|
+
/** @description Default Response */
|
|
2641
|
+
200: {
|
|
2642
|
+
headers: {
|
|
2643
|
+
[name: string]: unknown;
|
|
2644
|
+
};
|
|
2645
|
+
content?: never;
|
|
2646
|
+
};
|
|
2647
|
+
};
|
|
2648
|
+
};
|
|
2649
|
+
put?: never;
|
|
2650
|
+
post?: never;
|
|
2651
|
+
delete?: never;
|
|
2652
|
+
options?: never;
|
|
2653
|
+
head?: never;
|
|
2654
|
+
patch?: never;
|
|
2655
|
+
trace?: never;
|
|
2656
|
+
};
|
|
2657
|
+
"/v1/apple/offer-signatures": {
|
|
2658
|
+
parameters: {
|
|
2659
|
+
query?: never;
|
|
2660
|
+
header?: never;
|
|
2661
|
+
path?: never;
|
|
2662
|
+
cookie?: never;
|
|
2663
|
+
};
|
|
2664
|
+
get?: never;
|
|
2665
|
+
put?: never;
|
|
2666
|
+
/**
|
|
2667
|
+
* Sign an App Store promotional offer for the signed-in customer
|
|
2668
|
+
* @description Only offers configured on the app's product in Tenth can be signed (apple_promotional_offer_ids). Pass the result to StoreKit's promotional offer purchase option, with the customer's app_account_token.
|
|
2669
|
+
*/
|
|
2670
|
+
post: {
|
|
2671
|
+
parameters: {
|
|
2672
|
+
query?: never;
|
|
2673
|
+
header?: never;
|
|
2674
|
+
path?: never;
|
|
2675
|
+
cookie?: never;
|
|
2676
|
+
};
|
|
2677
|
+
requestBody: {
|
|
2678
|
+
content: {
|
|
2679
|
+
"application/json": {
|
|
2680
|
+
/** @description The App Store product id */
|
|
2681
|
+
product_id: string;
|
|
2682
|
+
offer_id: string;
|
|
2683
|
+
};
|
|
2684
|
+
};
|
|
2685
|
+
};
|
|
2686
|
+
responses: {
|
|
2687
|
+
/** @description Default Response */
|
|
2688
|
+
200: {
|
|
2689
|
+
headers: {
|
|
2690
|
+
[name: string]: unknown;
|
|
2691
|
+
};
|
|
2692
|
+
content: {
|
|
2693
|
+
"application/json": {
|
|
2694
|
+
key_identifier: string;
|
|
2695
|
+
nonce: string;
|
|
2696
|
+
timestamp: number;
|
|
2697
|
+
signature: string;
|
|
2698
|
+
app_account_token: string;
|
|
2699
|
+
};
|
|
2700
|
+
};
|
|
2701
|
+
};
|
|
2702
|
+
/** @description Default Response */
|
|
2703
|
+
400: {
|
|
2704
|
+
headers: {
|
|
2705
|
+
[name: string]: unknown;
|
|
2706
|
+
};
|
|
2707
|
+
content: {
|
|
2708
|
+
"application/json": components["schemas"]["Problem"];
|
|
2709
|
+
};
|
|
2710
|
+
};
|
|
2711
|
+
/** @description Default Response */
|
|
2712
|
+
401: {
|
|
2713
|
+
headers: {
|
|
2714
|
+
[name: string]: unknown;
|
|
2715
|
+
};
|
|
2716
|
+
content: {
|
|
2717
|
+
"application/json": components["schemas"]["Problem"];
|
|
2718
|
+
};
|
|
2719
|
+
};
|
|
2720
|
+
/** @description Default Response */
|
|
2721
|
+
403: {
|
|
2722
|
+
headers: {
|
|
2723
|
+
[name: string]: unknown;
|
|
2724
|
+
};
|
|
2725
|
+
content: {
|
|
2726
|
+
"application/json": components["schemas"]["Problem"];
|
|
2727
|
+
};
|
|
2728
|
+
};
|
|
2729
|
+
/** @description Default Response */
|
|
2730
|
+
404: {
|
|
2731
|
+
headers: {
|
|
2732
|
+
[name: string]: unknown;
|
|
2733
|
+
};
|
|
2734
|
+
content: {
|
|
2735
|
+
"application/json": components["schemas"]["Problem"];
|
|
2736
|
+
};
|
|
2737
|
+
};
|
|
2738
|
+
/** @description Default Response */
|
|
2739
|
+
409: {
|
|
2740
|
+
headers: {
|
|
2741
|
+
[name: string]: unknown;
|
|
2742
|
+
};
|
|
2743
|
+
content: {
|
|
2744
|
+
"application/json": components["schemas"]["Problem"];
|
|
2745
|
+
};
|
|
2746
|
+
};
|
|
2747
|
+
/** @description Default Response */
|
|
2748
|
+
422: {
|
|
2749
|
+
headers: {
|
|
2750
|
+
[name: string]: unknown;
|
|
2751
|
+
};
|
|
2752
|
+
content: {
|
|
2753
|
+
"application/json": components["schemas"]["Problem"];
|
|
2754
|
+
};
|
|
2755
|
+
};
|
|
2756
|
+
};
|
|
2757
|
+
};
|
|
2758
|
+
delete?: never;
|
|
2759
|
+
options?: never;
|
|
2760
|
+
head?: never;
|
|
2761
|
+
patch?: never;
|
|
2762
|
+
trace?: never;
|
|
2763
|
+
};
|
|
2764
|
+
"/v1/receipts": {
|
|
2765
|
+
parameters: {
|
|
2766
|
+
query?: never;
|
|
2767
|
+
header?: never;
|
|
2768
|
+
path?: never;
|
|
2769
|
+
cookie?: never;
|
|
2770
|
+
};
|
|
2771
|
+
get?: never;
|
|
2772
|
+
put?: never;
|
|
2773
|
+
/**
|
|
2774
|
+
* Submit an App Store or Google Play purchase for verification
|
|
2775
|
+
* @description iOS: send StoreKit 2's signed transaction after a purchase, and finish the transaction only once this succeeds. Android: send Play Billing's purchase token, product id and type; Tenth acknowledges or consumes the purchase itself once it's recorded, so the app must not. With a secret key, name the customer in app_user_id. A purchase whose appAccountToken or obfuscatedAccountId belongs to another customer is refused; use restore for that.
|
|
2776
|
+
*/
|
|
2777
|
+
post: {
|
|
2778
|
+
parameters: {
|
|
2779
|
+
query?: never;
|
|
2780
|
+
header?: never;
|
|
2781
|
+
path?: never;
|
|
2782
|
+
cookie?: never;
|
|
2783
|
+
};
|
|
2784
|
+
requestBody: {
|
|
2785
|
+
content: {
|
|
2786
|
+
"application/json": {
|
|
2787
|
+
/** @enum {string} */
|
|
2788
|
+
platform: "ios";
|
|
2789
|
+
signed_transaction: string;
|
|
2790
|
+
app_user_id?: string;
|
|
2791
|
+
} | {
|
|
2792
|
+
purchase_token: string;
|
|
2793
|
+
/** @description The Play product id (for subscriptions, the subscription id). */
|
|
2794
|
+
product_id: string;
|
|
2795
|
+
/** @enum {string} */
|
|
2796
|
+
type: "subscription" | "one_time";
|
|
2797
|
+
/** @enum {string} */
|
|
2798
|
+
platform: "android";
|
|
2799
|
+
app_user_id?: string;
|
|
2800
|
+
};
|
|
2801
|
+
};
|
|
2802
|
+
};
|
|
2803
|
+
responses: {
|
|
2804
|
+
/** @description Default Response */
|
|
2805
|
+
200: {
|
|
2806
|
+
headers: {
|
|
2807
|
+
[name: string]: unknown;
|
|
2808
|
+
};
|
|
2809
|
+
content: {
|
|
2810
|
+
"application/json": {
|
|
2811
|
+
/** @description Granted from the verified transaction while Apple was unreachable. */
|
|
2812
|
+
provisional: boolean;
|
|
2813
|
+
customer: components["schemas"]["CustomerState"];
|
|
2814
|
+
};
|
|
2815
|
+
};
|
|
2816
|
+
};
|
|
2817
|
+
/** @description Default Response */
|
|
2818
|
+
400: {
|
|
2819
|
+
headers: {
|
|
2820
|
+
[name: string]: unknown;
|
|
2821
|
+
};
|
|
2822
|
+
content: {
|
|
2823
|
+
"application/json": components["schemas"]["Problem"];
|
|
2824
|
+
};
|
|
2825
|
+
};
|
|
2826
|
+
/** @description Default Response */
|
|
2827
|
+
401: {
|
|
2828
|
+
headers: {
|
|
2829
|
+
[name: string]: unknown;
|
|
2830
|
+
};
|
|
2831
|
+
content: {
|
|
2832
|
+
"application/json": components["schemas"]["Problem"];
|
|
2833
|
+
};
|
|
2834
|
+
};
|
|
2835
|
+
/** @description Default Response */
|
|
2836
|
+
403: {
|
|
2837
|
+
headers: {
|
|
2838
|
+
[name: string]: unknown;
|
|
2839
|
+
};
|
|
2840
|
+
content: {
|
|
2841
|
+
"application/json": components["schemas"]["Problem"];
|
|
2842
|
+
};
|
|
2843
|
+
};
|
|
2844
|
+
/** @description Default Response */
|
|
2845
|
+
404: {
|
|
2846
|
+
headers: {
|
|
2847
|
+
[name: string]: unknown;
|
|
2848
|
+
};
|
|
2849
|
+
content: {
|
|
2850
|
+
"application/json": components["schemas"]["Problem"];
|
|
2851
|
+
};
|
|
2852
|
+
};
|
|
2853
|
+
/** @description Default Response */
|
|
2854
|
+
409: {
|
|
2855
|
+
headers: {
|
|
2856
|
+
[name: string]: unknown;
|
|
2857
|
+
};
|
|
2858
|
+
content: {
|
|
2859
|
+
"application/json": components["schemas"]["Problem"];
|
|
2860
|
+
};
|
|
2861
|
+
};
|
|
2862
|
+
/** @description Default Response */
|
|
2863
|
+
422: {
|
|
2864
|
+
headers: {
|
|
2865
|
+
[name: string]: unknown;
|
|
2866
|
+
};
|
|
2867
|
+
content: {
|
|
2868
|
+
"application/json": components["schemas"]["Problem"];
|
|
2869
|
+
};
|
|
2870
|
+
};
|
|
2871
|
+
};
|
|
2872
|
+
};
|
|
2873
|
+
delete?: never;
|
|
2874
|
+
options?: never;
|
|
2875
|
+
head?: never;
|
|
2876
|
+
patch?: never;
|
|
2877
|
+
trace?: never;
|
|
2878
|
+
};
|
|
2879
|
+
"/v1/receipts/restore": {
|
|
2880
|
+
parameters: {
|
|
2881
|
+
query?: never;
|
|
2882
|
+
header?: never;
|
|
2883
|
+
path?: never;
|
|
2884
|
+
cookie?: never;
|
|
2885
|
+
};
|
|
2886
|
+
get?: never;
|
|
2887
|
+
put?: never;
|
|
2888
|
+
/**
|
|
2889
|
+
* Restore App Store or Google Play purchases
|
|
2890
|
+
* @description iOS: send StoreKit 2's Transaction.currentEntitlements. Android: send what queryPurchasesAsync returned. A purchase that belongs to another customer of this app follows the app's restore transfer policy. Restores never create revenue.
|
|
2891
|
+
*/
|
|
2892
|
+
post: {
|
|
2893
|
+
parameters: {
|
|
2894
|
+
query?: never;
|
|
2895
|
+
header?: never;
|
|
2896
|
+
path?: never;
|
|
2897
|
+
cookie?: never;
|
|
2898
|
+
};
|
|
2899
|
+
requestBody: {
|
|
2900
|
+
content: {
|
|
2901
|
+
"application/json": {
|
|
2902
|
+
/** @enum {string} */
|
|
2903
|
+
platform: "ios";
|
|
2904
|
+
signed_transactions: string[];
|
|
2905
|
+
} | {
|
|
2906
|
+
/** @enum {string} */
|
|
2907
|
+
platform: "android";
|
|
2908
|
+
purchases: {
|
|
2909
|
+
purchase_token: string;
|
|
2910
|
+
/** @description The Play product id (for subscriptions, the subscription id). */
|
|
2911
|
+
product_id: string;
|
|
2912
|
+
/** @enum {string} */
|
|
2913
|
+
type: "subscription" | "one_time";
|
|
2914
|
+
}[];
|
|
2915
|
+
};
|
|
2916
|
+
};
|
|
2917
|
+
};
|
|
2918
|
+
responses: {
|
|
2919
|
+
/** @description Default Response */
|
|
2920
|
+
200: {
|
|
2921
|
+
headers: {
|
|
2922
|
+
[name: string]: unknown;
|
|
2923
|
+
};
|
|
2924
|
+
content: {
|
|
2925
|
+
"application/json": {
|
|
2926
|
+
results: {
|
|
2927
|
+
/** @description The App Store transaction id, or the Play purchase token. */
|
|
2928
|
+
transaction_id: string | null;
|
|
2929
|
+
/** @enum {string} */
|
|
2930
|
+
outcome: "owned" | "transferred" | "shared" | "kept_with_original" | "invalid";
|
|
2931
|
+
}[];
|
|
2932
|
+
customer: components["schemas"]["CustomerState"];
|
|
2933
|
+
};
|
|
2934
|
+
};
|
|
2935
|
+
};
|
|
2936
|
+
/** @description Default Response */
|
|
2937
|
+
400: {
|
|
2938
|
+
headers: {
|
|
2939
|
+
[name: string]: unknown;
|
|
2940
|
+
};
|
|
2941
|
+
content: {
|
|
2942
|
+
"application/json": components["schemas"]["Problem"];
|
|
2943
|
+
};
|
|
2944
|
+
};
|
|
2945
|
+
/** @description Default Response */
|
|
2946
|
+
401: {
|
|
2947
|
+
headers: {
|
|
2948
|
+
[name: string]: unknown;
|
|
2949
|
+
};
|
|
2950
|
+
content: {
|
|
2951
|
+
"application/json": components["schemas"]["Problem"];
|
|
2952
|
+
};
|
|
2953
|
+
};
|
|
2954
|
+
/** @description Default Response */
|
|
2955
|
+
403: {
|
|
2956
|
+
headers: {
|
|
2957
|
+
[name: string]: unknown;
|
|
2958
|
+
};
|
|
2959
|
+
content: {
|
|
2960
|
+
"application/json": components["schemas"]["Problem"];
|
|
2961
|
+
};
|
|
2962
|
+
};
|
|
2963
|
+
/** @description Default Response */
|
|
2964
|
+
404: {
|
|
2965
|
+
headers: {
|
|
2966
|
+
[name: string]: unknown;
|
|
2967
|
+
};
|
|
2968
|
+
content: {
|
|
2969
|
+
"application/json": components["schemas"]["Problem"];
|
|
2970
|
+
};
|
|
2971
|
+
};
|
|
2972
|
+
/** @description Default Response */
|
|
2973
|
+
409: {
|
|
2974
|
+
headers: {
|
|
2975
|
+
[name: string]: unknown;
|
|
2976
|
+
};
|
|
2977
|
+
content: {
|
|
2978
|
+
"application/json": components["schemas"]["Problem"];
|
|
2979
|
+
};
|
|
2980
|
+
};
|
|
2981
|
+
/** @description Default Response */
|
|
2982
|
+
422: {
|
|
2983
|
+
headers: {
|
|
2984
|
+
[name: string]: unknown;
|
|
2985
|
+
};
|
|
2986
|
+
content: {
|
|
2987
|
+
"application/json": components["schemas"]["Problem"];
|
|
2988
|
+
};
|
|
2989
|
+
};
|
|
2990
|
+
};
|
|
2991
|
+
};
|
|
2992
|
+
delete?: never;
|
|
2993
|
+
options?: never;
|
|
2994
|
+
head?: never;
|
|
2995
|
+
patch?: never;
|
|
2996
|
+
trace?: never;
|
|
2997
|
+
};
|
|
2998
|
+
}
|
|
2999
|
+
export type webhooks = Record<string, never>;
|
|
3000
|
+
export interface components {
|
|
3001
|
+
schemas: {
|
|
3002
|
+
Problem: {
|
|
3003
|
+
type: string;
|
|
3004
|
+
title: string;
|
|
3005
|
+
status: number;
|
|
3006
|
+
code: string;
|
|
3007
|
+
detail?: string;
|
|
3008
|
+
request_id?: string;
|
|
3009
|
+
errors?: unknown;
|
|
3010
|
+
};
|
|
3011
|
+
EntitlementState: {
|
|
3012
|
+
active: boolean;
|
|
3013
|
+
source: ("purchase" | "subscription" | "grant") | null;
|
|
3014
|
+
/** @description Where to manage it: App Store, Google Play or web (Stripe). */
|
|
3015
|
+
store: ("stripe" | "apple" | "google") | null;
|
|
3016
|
+
expires_at: string | null;
|
|
3017
|
+
will_renew: boolean;
|
|
3018
|
+
in_grace: boolean;
|
|
3019
|
+
billing_issue: boolean;
|
|
3020
|
+
quantity: number | null;
|
|
3021
|
+
};
|
|
3022
|
+
CreditBalance: {
|
|
3023
|
+
balance: number;
|
|
3024
|
+
/** @description Balance minus credits reserved by open holds. */
|
|
3025
|
+
available: number;
|
|
3026
|
+
};
|
|
3027
|
+
SubscriptionSummary: {
|
|
3028
|
+
id: string;
|
|
3029
|
+
product: string | null;
|
|
3030
|
+
/** @enum {string} */
|
|
3031
|
+
store: "stripe" | "apple" | "google";
|
|
3032
|
+
status: string;
|
|
3033
|
+
current_period_start: string | null;
|
|
3034
|
+
current_period_end: string | null;
|
|
3035
|
+
trial_end: string | null;
|
|
3036
|
+
grace_period_end: string | null;
|
|
3037
|
+
cancel_at: string | null;
|
|
3038
|
+
will_renew: boolean;
|
|
3039
|
+
provisional: boolean;
|
|
3040
|
+
};
|
|
3041
|
+
CustomerState: {
|
|
3042
|
+
customer: {
|
|
3043
|
+
id: string;
|
|
3044
|
+
app_user_id: string;
|
|
3045
|
+
/** @description Set this as appAccountToken on every StoreKit purchase, so Tenth can tell whose it is. */
|
|
3046
|
+
app_account_token: string;
|
|
3047
|
+
/** @description Set this as obfuscatedAccountId on every Play Billing purchase, so Tenth can tell whose it is. */
|
|
3048
|
+
obfuscated_account_id: string;
|
|
3049
|
+
created_at: string;
|
|
3050
|
+
};
|
|
3051
|
+
entitlements: {
|
|
3052
|
+
[key: string]: components["schemas"]["EntitlementState"];
|
|
3053
|
+
};
|
|
3054
|
+
credits: {
|
|
3055
|
+
[key: string]: components["schemas"]["CreditBalance"];
|
|
3056
|
+
};
|
|
3057
|
+
subscriptions: components["schemas"]["SubscriptionSummary"][];
|
|
3058
|
+
};
|
|
3059
|
+
CreditTransaction: {
|
|
3060
|
+
id: string;
|
|
3061
|
+
credit_type: string;
|
|
3062
|
+
/** @enum {string} */
|
|
3063
|
+
type: "grant" | "debit" | "expire" | "clawback" | "adjustment" | "refill";
|
|
3064
|
+
amount: number;
|
|
3065
|
+
lot_id: string | null;
|
|
3066
|
+
metadata: {
|
|
3067
|
+
[key: string]: unknown;
|
|
3068
|
+
};
|
|
3069
|
+
/** Format: date-time */
|
|
3070
|
+
occurred_at: string;
|
|
3071
|
+
};
|
|
3072
|
+
CreditHold: {
|
|
3073
|
+
id: string;
|
|
3074
|
+
credit_type: string;
|
|
3075
|
+
amount: number;
|
|
3076
|
+
/** @enum {string} */
|
|
3077
|
+
status: "held" | "committed" | "released" | "expired";
|
|
3078
|
+
/** Format: date-time */
|
|
3079
|
+
expires_at: string;
|
|
3080
|
+
/** Format: date-time */
|
|
3081
|
+
created_at: string;
|
|
3082
|
+
};
|
|
3083
|
+
Grant: {
|
|
3084
|
+
id: string;
|
|
3085
|
+
customer_id: string;
|
|
3086
|
+
entitlement: string | null;
|
|
3087
|
+
credit_type: string | null;
|
|
3088
|
+
amount: number | null;
|
|
3089
|
+
/** Format: date-time */
|
|
3090
|
+
starts_at: string;
|
|
3091
|
+
expires_at: string | null;
|
|
3092
|
+
reason: string;
|
|
3093
|
+
created_by: string;
|
|
3094
|
+
revoked_at: string | null;
|
|
3095
|
+
/** Format: date-time */
|
|
3096
|
+
created_at: string;
|
|
3097
|
+
};
|
|
3098
|
+
Event: {
|
|
3099
|
+
id: string;
|
|
3100
|
+
type: string;
|
|
3101
|
+
/** Format: date-time */
|
|
3102
|
+
created_at: string;
|
|
3103
|
+
payload: {
|
|
3104
|
+
[key: string]: unknown;
|
|
3105
|
+
};
|
|
3106
|
+
};
|
|
3107
|
+
RevenueTransaction: {
|
|
3108
|
+
id: string;
|
|
3109
|
+
customer_id: string;
|
|
3110
|
+
/** @enum {string} */
|
|
3111
|
+
provider: "stripe" | "apple" | "google";
|
|
3112
|
+
/** @enum {string} */
|
|
3113
|
+
platform: "ios" | "android" | "web";
|
|
3114
|
+
/** @enum {string} */
|
|
3115
|
+
type: "purchase" | "renewal" | "refund" | "refund_reversal" | "chargeback" | "chargeback_reversal";
|
|
3116
|
+
provider_transaction_id: string;
|
|
3117
|
+
original_transaction_id: string | null;
|
|
3118
|
+
refunded_transaction_id: string | null;
|
|
3119
|
+
subscription_id: string | null;
|
|
3120
|
+
purchase_id: string | null;
|
|
3121
|
+
product_id: string | null;
|
|
3122
|
+
/** Format: date-time */
|
|
3123
|
+
occurred_at: string;
|
|
3124
|
+
period_start: string | null;
|
|
3125
|
+
period_end: string | null;
|
|
3126
|
+
country: string | null;
|
|
3127
|
+
currency: string;
|
|
3128
|
+
/** @description Minor units of `currency`. */
|
|
3129
|
+
gross_amount: number;
|
|
3130
|
+
tax_amount: number | null;
|
|
3131
|
+
fee_amount: number;
|
|
3132
|
+
net_amount: number;
|
|
3133
|
+
fee_is_estimated: boolean;
|
|
3134
|
+
amount_is_estimated: boolean;
|
|
3135
|
+
/** @description USD cents. Null until the day’s FX rate is known. */
|
|
3136
|
+
gross_amount_usd: number | null;
|
|
3137
|
+
fee_amount_usd: number | null;
|
|
3138
|
+
net_amount_usd: number | null;
|
|
3139
|
+
fx_rate: string | null;
|
|
3140
|
+
fx_rate_date: string | null;
|
|
3141
|
+
fx_source: ("identity" | "stripe_balance_transaction" | "daily_rate") | null;
|
|
3142
|
+
is_trial_conversion: boolean;
|
|
3143
|
+
};
|
|
3144
|
+
DisplayPrice: {
|
|
3145
|
+
/** @description Minor units of `currency`, as an integer string. */
|
|
3146
|
+
amount_minor: string;
|
|
3147
|
+
/** @description ISO 4217, uppercase. */
|
|
3148
|
+
currency: string;
|
|
3149
|
+
/** @description Null for one-time prices. */
|
|
3150
|
+
recurring: {
|
|
3151
|
+
/** @enum {string} */
|
|
3152
|
+
interval: "day" | "week" | "month" | "year";
|
|
3153
|
+
interval_count: number;
|
|
3154
|
+
} | null;
|
|
3155
|
+
trial_period_days: number | null;
|
|
3156
|
+
};
|
|
3157
|
+
ServedPaywall: {
|
|
3158
|
+
id: string;
|
|
3159
|
+
version: number;
|
|
3160
|
+
/** @description A published paywall config (@tenthbilling/paywall/schema) whose schema_version is at most `paywall_schema`. Parse it with parseServedPaywall. */
|
|
3161
|
+
config: {
|
|
3162
|
+
[key: string]: unknown;
|
|
3163
|
+
};
|
|
3164
|
+
/** @description Image id → URL, on the API's own origin. */
|
|
3165
|
+
assets: {
|
|
3166
|
+
[key: string]: string;
|
|
3167
|
+
};
|
|
3168
|
+
};
|
|
3169
|
+
CurrentOffering: {
|
|
3170
|
+
offering: {
|
|
3171
|
+
key: string;
|
|
3172
|
+
/** @enum {string} */
|
|
3173
|
+
purchase_path: "store" | "web_link_out" | "in_app_stripe" | "none";
|
|
3174
|
+
products: {
|
|
3175
|
+
key: string;
|
|
3176
|
+
/** @enum {string} */
|
|
3177
|
+
type: "subscription" | "non_consumable" | "consumable";
|
|
3178
|
+
display_name: string | null;
|
|
3179
|
+
label: string | null;
|
|
3180
|
+
badge: string | null;
|
|
3181
|
+
is_highlighted: boolean;
|
|
3182
|
+
/** @description App Store product id, Google Play product id, or Stripe price id, for this platform and purchase path. */
|
|
3183
|
+
store_product_id: string;
|
|
3184
|
+
google_base_plan_id: string | null;
|
|
3185
|
+
google_offer_id: string | null;
|
|
3186
|
+
/** @description Web (Stripe) products only: Stripe's current price. Null for store products (the device reads store prices) and when Stripe can't be reached; hide a web product without a price. */
|
|
3187
|
+
price: components["schemas"]["DisplayPrice"] | null;
|
|
3188
|
+
entitlements: string[];
|
|
3189
|
+
credits: {
|
|
3190
|
+
credit_type: string;
|
|
3191
|
+
amount: number;
|
|
3192
|
+
/** @enum {string} */
|
|
3193
|
+
per: "purchase" | "period";
|
|
3194
|
+
}[];
|
|
3195
|
+
}[];
|
|
3196
|
+
} | null;
|
|
3197
|
+
/** @description The newest published paywall for this offering (else the app's default paywall) at or below `paywall_schema`. Null when there's none; the SDK then uses its bundled default. */
|
|
3198
|
+
paywall: components["schemas"]["ServedPaywall"] | null;
|
|
3199
|
+
};
|
|
3200
|
+
};
|
|
3201
|
+
responses: never;
|
|
3202
|
+
parameters: never;
|
|
3203
|
+
requestBodies: never;
|
|
3204
|
+
headers: never;
|
|
3205
|
+
pathItems: never;
|
|
3206
|
+
}
|
|
3207
|
+
export type $defs = Record<string, never>;
|
|
3208
|
+
export type operations = Record<string, never>;
|