@leaflow/sdk 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assistant/v1/schema.d.ts +1 -1
- package/dist/billing/v1/index.d.ts +38 -0
- package/dist/billing/v1/index.js +5 -0
- package/dist/billing/v1/schema.d.ts +1253 -0
- package/dist/billing/v1/schema.js +5 -0
- package/dist/iam/v1/index.d.ts +4 -0
- package/dist/iam/v1/schema.d.ts +76 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
export interface paths {
|
|
6
|
+
"/account/v1/billing-accounts": {
|
|
7
|
+
parameters: {
|
|
8
|
+
query?: never;
|
|
9
|
+
header?: never;
|
|
10
|
+
path?: never;
|
|
11
|
+
cookie?: never;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* List my billing accounts
|
|
15
|
+
* @description Every billing account belonging to the caller, with the projects each one currently pays for.
|
|
16
|
+
*
|
|
17
|
+
* Not paginated: how many accounts one person holds is bounded by how many they bothered to
|
|
18
|
+
* create, and that is a small number.
|
|
19
|
+
*/
|
|
20
|
+
get: operations["list-billing-accounts"];
|
|
21
|
+
put?: never;
|
|
22
|
+
/**
|
|
23
|
+
* Create a billing account
|
|
24
|
+
* @description Creates a billing account for the caller.
|
|
25
|
+
*
|
|
26
|
+
* **`seq` is supplied by the client, not assigned here.** Assigning it would mean reading the
|
|
27
|
+
* existing accounts and adding one, which is a read-modify-write race: two concurrent "create"
|
|
28
|
+
* clicks compute the same `seq`. Having the client name it turns that race into a plain
|
|
29
|
+
* idempotent repeat — the second request returns the first account instead of failing.
|
|
30
|
+
*
|
|
31
|
+
* The new account pays for nothing. Binding a project is a separate, deliberate act; doing it
|
|
32
|
+
* here would quietly turn "I want to add a card" into "I have changed who pays".
|
|
33
|
+
*/
|
|
34
|
+
post: operations["create-billing-account"];
|
|
35
|
+
delete?: never;
|
|
36
|
+
options?: never;
|
|
37
|
+
head?: never;
|
|
38
|
+
patch?: never;
|
|
39
|
+
trace?: never;
|
|
40
|
+
};
|
|
41
|
+
"/account/v1/billing-accounts/{accountKey}/balance": {
|
|
42
|
+
parameters: {
|
|
43
|
+
query?: never;
|
|
44
|
+
header?: never;
|
|
45
|
+
path?: never;
|
|
46
|
+
cookie?: never;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Read an account's balance
|
|
50
|
+
* @description What is left on the account.
|
|
51
|
+
*
|
|
52
|
+
* The figure is the **live** balance: usage that has been reported but not yet settled is
|
|
53
|
+
* already subtracted. The settled figure is larger, and the difference is precisely what the
|
|
54
|
+
* holder has just spent — showing that instead would tell them they can afford something they
|
|
55
|
+
* cannot.
|
|
56
|
+
*
|
|
57
|
+
* An account that has never been topped up reports `"0"` — not an absent field, and not an
|
|
58
|
+
* empty string.
|
|
59
|
+
*/
|
|
60
|
+
get: operations["read-billing-account-balance"];
|
|
61
|
+
put?: never;
|
|
62
|
+
post?: never;
|
|
63
|
+
delete?: never;
|
|
64
|
+
options?: never;
|
|
65
|
+
head?: never;
|
|
66
|
+
patch?: never;
|
|
67
|
+
trace?: never;
|
|
68
|
+
};
|
|
69
|
+
"/account/v1/billing-accounts/{accountKey}/projects/{projectId}": {
|
|
70
|
+
parameters: {
|
|
71
|
+
query?: never;
|
|
72
|
+
header?: never;
|
|
73
|
+
path?: never;
|
|
74
|
+
cookie?: never;
|
|
75
|
+
};
|
|
76
|
+
get?: never;
|
|
77
|
+
/**
|
|
78
|
+
* Make this account pay for a project
|
|
79
|
+
* @description Binds a project to this account. A project bound to another account is moved.
|
|
80
|
+
*
|
|
81
|
+
* **Both the account and the project must belong to the caller.** Either one failing refuses the
|
|
82
|
+
* request. Requiring the project as well as the account is what stops somebody attaching a
|
|
83
|
+
* project that is not theirs — which sounds generous, since they would be paying for it, but it
|
|
84
|
+
* would also expose that project's usage to them, and let them detach it again at any moment,
|
|
85
|
+
* leaving the project with no account and therefore unable to allocate anything.
|
|
86
|
+
*
|
|
87
|
+
* Idempotent: binding a project already bound to this account changes nothing.
|
|
88
|
+
*
|
|
89
|
+
* Only subsequent usage is affected; see the hard constraint on rebinding.
|
|
90
|
+
*/
|
|
91
|
+
put: operations["bind-project-to-billing-account"];
|
|
92
|
+
post?: never;
|
|
93
|
+
delete?: never;
|
|
94
|
+
options?: never;
|
|
95
|
+
head?: never;
|
|
96
|
+
patch?: never;
|
|
97
|
+
trace?: never;
|
|
98
|
+
};
|
|
99
|
+
"/account/v1/billing-accounts/{accountKey}/top-ups": {
|
|
100
|
+
parameters: {
|
|
101
|
+
query?: never;
|
|
102
|
+
header?: never;
|
|
103
|
+
path?: never;
|
|
104
|
+
cookie?: never;
|
|
105
|
+
};
|
|
106
|
+
get?: never;
|
|
107
|
+
put?: never;
|
|
108
|
+
/**
|
|
109
|
+
* Start a top-up
|
|
110
|
+
* @description Begins adding money to this account. Returns a URL to send the browser to; the card is
|
|
111
|
+
* entered there, on the payment provider's own page.
|
|
112
|
+
*
|
|
113
|
+
* **No card data ever reaches this platform**, in any field, in any log. That is the entire
|
|
114
|
+
* reason this returns a redirect instead of accepting card details.
|
|
115
|
+
*
|
|
116
|
+
* **Credit is not added here.** It is added once the payment provider confirms the money
|
|
117
|
+
* arrived, which happens out of band and usually within seconds. The balance is unchanged when
|
|
118
|
+
* this call returns, and polling it immediately will show the old figure.
|
|
119
|
+
*
|
|
120
|
+
* That ordering is deliberate. Credit is spendable as soon as it exists, so anything added
|
|
121
|
+
* before the charge succeeds is money the holder can spend against a payment that then fails.
|
|
122
|
+
*
|
|
123
|
+
* Abandoning the page costs nothing; nothing is created on the account until the money arrives.
|
|
124
|
+
*/
|
|
125
|
+
post: operations["start-top-up"];
|
|
126
|
+
delete?: never;
|
|
127
|
+
options?: never;
|
|
128
|
+
head?: never;
|
|
129
|
+
patch?: never;
|
|
130
|
+
trace?: never;
|
|
131
|
+
};
|
|
132
|
+
"/account/v1/billing-accounts/{accountKey}/charges": {
|
|
133
|
+
parameters: {
|
|
134
|
+
query?: never;
|
|
135
|
+
header?: never;
|
|
136
|
+
path?: never;
|
|
137
|
+
cookie?: never;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* What this period has run up so far
|
|
141
|
+
* @description The itemised version of `unsettled`: what has been used this period and not yet billed.
|
|
142
|
+
*
|
|
143
|
+
* It has to come from charges rather than from invoices. An invoice only exists once a period has
|
|
144
|
+
* been billed, and the one for the period in progress is in a state that does not appear in the
|
|
145
|
+
* invoice list at all — reading invoices would show nothing and suggest the account has used
|
|
146
|
+
* nothing, while the spend keeps climbing.
|
|
147
|
+
*/
|
|
148
|
+
get: operations["list-charges"];
|
|
149
|
+
put?: never;
|
|
150
|
+
post?: never;
|
|
151
|
+
delete?: never;
|
|
152
|
+
options?: never;
|
|
153
|
+
head?: never;
|
|
154
|
+
patch?: never;
|
|
155
|
+
trace?: never;
|
|
156
|
+
};
|
|
157
|
+
"/account/v1/billing-accounts/{accountKey}/invoices": {
|
|
158
|
+
parameters: {
|
|
159
|
+
query?: never;
|
|
160
|
+
header?: never;
|
|
161
|
+
path?: never;
|
|
162
|
+
cookie?: never;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* List this account's invoices
|
|
166
|
+
* @description Past periods, most recent first. The period in progress is not here — see the charges
|
|
167
|
+
* endpoint for that.
|
|
168
|
+
*/
|
|
169
|
+
get: operations["list-invoices"];
|
|
170
|
+
put?: never;
|
|
171
|
+
post?: never;
|
|
172
|
+
delete?: never;
|
|
173
|
+
options?: never;
|
|
174
|
+
head?: never;
|
|
175
|
+
patch?: never;
|
|
176
|
+
trace?: never;
|
|
177
|
+
};
|
|
178
|
+
"/account/v1/billing-accounts/{accountKey}/invoices/{invoiceId}": {
|
|
179
|
+
parameters: {
|
|
180
|
+
query?: never;
|
|
181
|
+
header?: never;
|
|
182
|
+
path?: never;
|
|
183
|
+
cookie?: never;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Read one invoice with its lines
|
|
187
|
+
* @description A total does not answer "why is it this much", and that is the question a bill provokes. Each
|
|
188
|
+
* line carries its service period, without which lines of the same name — hundreds of them on an
|
|
189
|
+
* hourly bill — cannot be told apart, and how much of it credit covered, which is the answer to
|
|
190
|
+
* "I have a balance, why am I being charged".
|
|
191
|
+
*/
|
|
192
|
+
get: operations["get-invoice"];
|
|
193
|
+
put?: never;
|
|
194
|
+
post?: never;
|
|
195
|
+
delete?: never;
|
|
196
|
+
options?: never;
|
|
197
|
+
head?: never;
|
|
198
|
+
patch?: never;
|
|
199
|
+
trace?: never;
|
|
200
|
+
};
|
|
201
|
+
"/account/v1/billing-accounts/{accountKey}/subscription": {
|
|
202
|
+
parameters: {
|
|
203
|
+
query?: never;
|
|
204
|
+
header?: never;
|
|
205
|
+
path?: never;
|
|
206
|
+
cookie?: never;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Which plan this account is on
|
|
210
|
+
* @description `404` means no plan, which is worth showing rather than hiding: an account without one is
|
|
211
|
+
* refused admission, so nothing can be allocated in it.
|
|
212
|
+
*
|
|
213
|
+
* A subscription that has been cancelled but has not reached the end of its period still counts
|
|
214
|
+
* as being on a plan — it is still serving, still billing, and the period has already been paid
|
|
215
|
+
* for.
|
|
216
|
+
*/
|
|
217
|
+
get: operations["read-subscription"];
|
|
218
|
+
put?: never;
|
|
219
|
+
post?: never;
|
|
220
|
+
delete?: never;
|
|
221
|
+
options?: never;
|
|
222
|
+
head?: never;
|
|
223
|
+
patch?: never;
|
|
224
|
+
trace?: never;
|
|
225
|
+
};
|
|
226
|
+
"/account/v1/billing-accounts/{accountKey}/subscription/cancel": {
|
|
227
|
+
parameters: {
|
|
228
|
+
query?: never;
|
|
229
|
+
header?: never;
|
|
230
|
+
path?: never;
|
|
231
|
+
cookie?: never;
|
|
232
|
+
};
|
|
233
|
+
get?: never;
|
|
234
|
+
put?: never;
|
|
235
|
+
/**
|
|
236
|
+
* Come off the paid plan
|
|
237
|
+
* @description Moves the account off whatever plan it is on.
|
|
238
|
+
*
|
|
239
|
+
* Where a default plan is configured this is a switch to it rather than a cancellation — an
|
|
240
|
+
* account with no plan is refused admission, so cancelling outright would cut off someone who
|
|
241
|
+
* only meant to drop back to the free tier. Without a default plan it is a real cancellation and
|
|
242
|
+
* the account is left with no plan on purpose.
|
|
243
|
+
*
|
|
244
|
+
* `timing` has to be stated. Ending immediately on an account that has already paid for the
|
|
245
|
+
* current period takes back what they paid for; ending at the end of the period does not. There
|
|
246
|
+
* is no default because the two are materially different and picking one silently would make the
|
|
247
|
+
* wrong one happen whenever the field is forgotten.
|
|
248
|
+
*
|
|
249
|
+
* Without this, someone who bought a paid plan can only stop paying by contacting support —
|
|
250
|
+
* which is how a cancellation becomes a chargeback.
|
|
251
|
+
*/
|
|
252
|
+
post: operations["cancel-subscription"];
|
|
253
|
+
delete?: never;
|
|
254
|
+
options?: never;
|
|
255
|
+
head?: never;
|
|
256
|
+
patch?: never;
|
|
257
|
+
trace?: never;
|
|
258
|
+
};
|
|
259
|
+
"/account/v1/billing-accounts/{accountKey}/top-ups/{paymentId}": {
|
|
260
|
+
parameters: {
|
|
261
|
+
query?: never;
|
|
262
|
+
header?: never;
|
|
263
|
+
path?: never;
|
|
264
|
+
cookie?: never;
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* How far along a top-up is
|
|
268
|
+
* @description Credit arrives asynchronously, shortly after the payment provider confirms the money. Coming
|
|
269
|
+
* back from the payment page the balance has usually not moved yet, and without this there is no
|
|
270
|
+
* way to tell "it is on its way" from "it failed" — the only recourse is refreshing the balance
|
|
271
|
+
* and guessing.
|
|
272
|
+
*
|
|
273
|
+
* `settled` means the credit has landed. `pending` means the money arrived and the credit has
|
|
274
|
+
* not been issued yet, or the payment method is an asynchronous one and the money itself is
|
|
275
|
+
* still in transit.
|
|
276
|
+
*/
|
|
277
|
+
get: operations["read-top-up"];
|
|
278
|
+
put?: never;
|
|
279
|
+
post?: never;
|
|
280
|
+
delete?: never;
|
|
281
|
+
options?: never;
|
|
282
|
+
head?: never;
|
|
283
|
+
patch?: never;
|
|
284
|
+
trace?: never;
|
|
285
|
+
};
|
|
286
|
+
"/account/v1/billing-accounts/{accountKey}/card": {
|
|
287
|
+
parameters: {
|
|
288
|
+
query?: never;
|
|
289
|
+
header?: never;
|
|
290
|
+
path?: never;
|
|
291
|
+
cookie?: never;
|
|
292
|
+
};
|
|
293
|
+
get?: never;
|
|
294
|
+
put?: never;
|
|
295
|
+
/**
|
|
296
|
+
* Add or replace the card on file
|
|
297
|
+
* @description Begins adding a card. Returns a URL to send the browser to; the card is entered there, on the
|
|
298
|
+
* payment provider's own page, and **no card data ever reaches this platform**.
|
|
299
|
+
*
|
|
300
|
+
* ## This is a prerequisite for buying a plan, not a convenience
|
|
301
|
+
*
|
|
302
|
+
* A plan is charged by invoice, and the invoice is collected from the card on file. The billing
|
|
303
|
+
* a subscription cannot start for an account that has none — so "add a card, then
|
|
304
|
+
* buy" is the order the system requires, not a flow that was chosen.
|
|
305
|
+
*
|
|
306
|
+
* It is *not* a prerequisite for topping up: a top-up collects the money there and then.
|
|
307
|
+
*
|
|
308
|
+
* Replacing the card uses the same operation. The new card becomes the default and the old one
|
|
309
|
+
* stops being used; nothing else about the account changes.
|
|
310
|
+
*/
|
|
311
|
+
post: operations["start-card-setup"];
|
|
312
|
+
delete?: never;
|
|
313
|
+
options?: never;
|
|
314
|
+
head?: never;
|
|
315
|
+
patch?: never;
|
|
316
|
+
trace?: never;
|
|
317
|
+
};
|
|
318
|
+
"/account/v1/billing-accounts/{accountKey}/offers": {
|
|
319
|
+
parameters: {
|
|
320
|
+
query?: never;
|
|
321
|
+
header?: never;
|
|
322
|
+
path?: never;
|
|
323
|
+
cookie?: never;
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* List the offers this account can buy
|
|
327
|
+
* @description Lists what is actually purchasable by this account, right now.
|
|
328
|
+
*
|
|
329
|
+
* ## Every offer here has passed the full eligibility check
|
|
330
|
+
*
|
|
331
|
+
* The list is not "everything on sale" filtered by status. A promotion whose places are gone, a
|
|
332
|
+
* first-month discount this person already used, a beta price they are not on the list for —
|
|
333
|
+
* none of them appear. Returning them and rejecting the purchase afterwards reads as a broken
|
|
334
|
+
* system rather than as a rule.
|
|
335
|
+
*
|
|
336
|
+
* The price is not here, and not because it was left out: an offer states **who may buy, and
|
|
337
|
+
* when**. What it costs comes from the plan it points at, and is reported by the offers list.
|
|
338
|
+
*/
|
|
339
|
+
get: operations["list-offers"];
|
|
340
|
+
put?: never;
|
|
341
|
+
post?: never;
|
|
342
|
+
delete?: never;
|
|
343
|
+
options?: never;
|
|
344
|
+
head?: never;
|
|
345
|
+
patch?: never;
|
|
346
|
+
trace?: never;
|
|
347
|
+
};
|
|
348
|
+
"/account/v1/billing-accounts/{accountKey}/offers/{offerKey}/purchase": {
|
|
349
|
+
parameters: {
|
|
350
|
+
query?: never;
|
|
351
|
+
header?: never;
|
|
352
|
+
path?: never;
|
|
353
|
+
cookie?: never;
|
|
354
|
+
};
|
|
355
|
+
get?: never;
|
|
356
|
+
put?: never;
|
|
357
|
+
/**
|
|
358
|
+
* Buy an offer
|
|
359
|
+
* @description Puts the account on the plan this offer points at, taking one of its places if it has a limit.
|
|
360
|
+
*
|
|
361
|
+
* ## A card has to be on file first
|
|
362
|
+
*
|
|
363
|
+
* Unless the offer points at a free plan. A paid plan is collected from the card on file
|
|
364
|
+
* and refuses to start the subscription without one; that refusal arrives here as a
|
|
365
|
+
* precondition error rather than as a conflict.
|
|
366
|
+
*
|
|
367
|
+
* ## `timing` is required only when the account already has a plan
|
|
368
|
+
*
|
|
369
|
+
* Moving between plans immediately is what an upgrade wants — the customer paid more and wants
|
|
370
|
+
* it now. Waiting for the end of the period is what a downgrade wants — they already paid for
|
|
371
|
+
* this one. Neither is a safe default, and picking one silently gets the money wrong whenever
|
|
372
|
+
* the field is forgotten.
|
|
373
|
+
*
|
|
374
|
+
* ## Being refused says which rule refused
|
|
375
|
+
*
|
|
376
|
+
* Places gone, window closed, already used, not on the list — each needs the customer to do
|
|
377
|
+
* something different, and several of them need them to do nothing at all. A single "not
|
|
378
|
+
* eligible" sends everyone to support.
|
|
379
|
+
*
|
|
380
|
+
* ## Retrying is safe
|
|
381
|
+
*
|
|
382
|
+
* A place is taken before the subscription is created, so a failure in between leaves the place
|
|
383
|
+
* held rather than the discount given away. Retrying the same purchase finishes it instead of
|
|
384
|
+
* taking a second place.
|
|
385
|
+
*/
|
|
386
|
+
post: operations["purchase-offer"];
|
|
387
|
+
delete?: never;
|
|
388
|
+
options?: never;
|
|
389
|
+
head?: never;
|
|
390
|
+
patch?: never;
|
|
391
|
+
trace?: never;
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
export type webhooks = Record<string, never>;
|
|
395
|
+
export interface components {
|
|
396
|
+
schemas: {
|
|
397
|
+
/**
|
|
398
|
+
* @description When a plan change takes effect. There is no default: an upgrade and a downgrade want opposite
|
|
399
|
+
* answers, and the difference is money
|
|
400
|
+
* @enum {string}
|
|
401
|
+
*/
|
|
402
|
+
PlanChangeTiming: "immediate" | "next_billing_cycle";
|
|
403
|
+
OfferList: {
|
|
404
|
+
offers: components["schemas"]["Offer"][];
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* @description One thing this account can buy. It carries no price — the price is on the plan it points at,
|
|
408
|
+
* recorded in exactly one place
|
|
409
|
+
*/
|
|
410
|
+
Offer: {
|
|
411
|
+
/** @description The stable identifier operations and support use for this offer */
|
|
412
|
+
offer_key: string;
|
|
413
|
+
name: string;
|
|
414
|
+
description?: string;
|
|
415
|
+
/** @description A short label for the pricing page, e.g. the one marking the recommended tier */
|
|
416
|
+
badge?: string;
|
|
417
|
+
/**
|
|
418
|
+
* Format: date-time
|
|
419
|
+
* @description When this offer stops being purchasable. Absent means it does not expire
|
|
420
|
+
*/
|
|
421
|
+
valid_until?: string;
|
|
422
|
+
/** @description Present on offers that sell a plan */
|
|
423
|
+
pricing?: components["schemas"]["Pricing"];
|
|
424
|
+
/** @description Present on offers that sell credit */
|
|
425
|
+
top_up?: components["schemas"]["TopUpPricing"];
|
|
426
|
+
};
|
|
427
|
+
/**
|
|
428
|
+
* @description What this offer costs, as a structure rather than a number.
|
|
429
|
+
*
|
|
430
|
+
* A plan is rarely one number: an introductory period at one price followed by another, a monthly
|
|
431
|
+
* fee alongside metered usage, an allowance of free units before metering starts. Flattening that
|
|
432
|
+
* into a single figure means deciding which part to show, and every such decision is wrong for
|
|
433
|
+
* some plan.
|
|
434
|
+
*
|
|
435
|
+
* This is read on each request rather than stored alongside the offer. The plan owns
|
|
436
|
+
* prices; a second copy would be a second answer, and the two would drift without anything saying
|
|
437
|
+
* so — the visible symptom being a pricing page that disagrees with the invoice.
|
|
438
|
+
*/
|
|
439
|
+
Pricing: {
|
|
440
|
+
currency: components["schemas"]["Currency"];
|
|
441
|
+
/** @description How often this recurs, as an ISO 8601 duration. `P1M` is monthly */
|
|
442
|
+
billing_period?: string;
|
|
443
|
+
/**
|
|
444
|
+
* @description In order. A phase with no `duration` runs until the subscription ends, and there is at most
|
|
445
|
+
* one of those, last
|
|
446
|
+
*/
|
|
447
|
+
phases: components["schemas"]["PricingPhase"][];
|
|
448
|
+
};
|
|
449
|
+
PricingPhase: {
|
|
450
|
+
name: string;
|
|
451
|
+
/** @description How long this phase lasts, as an ISO 8601 duration. Absent means "until the end" */
|
|
452
|
+
duration?: string;
|
|
453
|
+
lines: components["schemas"]["PricingLine"][];
|
|
454
|
+
};
|
|
455
|
+
/** @description One charge within a phase — a fee, or a rate for something metered */
|
|
456
|
+
PricingLine: {
|
|
457
|
+
name: string;
|
|
458
|
+
/**
|
|
459
|
+
* @description `free` costs nothing. `flat` is charged once per period regardless of use. `unit` is charged
|
|
460
|
+
* per unit consumed
|
|
461
|
+
* @enum {string}
|
|
462
|
+
*/
|
|
463
|
+
type: "free" | "flat" | "unit";
|
|
464
|
+
/** @description A decimal string. Money is never a float */
|
|
465
|
+
amount?: string;
|
|
466
|
+
/**
|
|
467
|
+
* @description For `unit` lines whose meter counts something finer than what is charged for: how many
|
|
468
|
+
* metered units one charge covers. A price of `10` with `units_per_charge` of `1000000` is
|
|
469
|
+
* ten currency units per million.
|
|
470
|
+
*
|
|
471
|
+
* Absent means one for one. **Showing the amount without this is wrong by whatever this
|
|
472
|
+
* factor is**, which for token pricing is six orders of magnitude
|
|
473
|
+
*/
|
|
474
|
+
units_per_charge?: string;
|
|
475
|
+
/** @description How many units are not charged for before charging starts */
|
|
476
|
+
free_units?: string;
|
|
477
|
+
/**
|
|
478
|
+
* Format: float
|
|
479
|
+
* @description A reduction applied to this line, 0 to 100
|
|
480
|
+
*/
|
|
481
|
+
percent_off?: number;
|
|
482
|
+
/**
|
|
483
|
+
* @description True when this is charged once at the start rather than every period. Absent or false means
|
|
484
|
+
* it recurs
|
|
485
|
+
*/
|
|
486
|
+
one_time?: boolean;
|
|
487
|
+
};
|
|
488
|
+
/**
|
|
489
|
+
* @description What a top-up bundle costs and what it grants. Present only on offers that sell credit.
|
|
490
|
+
*
|
|
491
|
+
* Unlike a plan price, this is stated on the bundle itself: credit is granted per
|
|
492
|
+
* transaction and has no catalog of bundles to read from. There is no second copy to drift
|
|
493
|
+
* against, because there is no first one anywhere else
|
|
494
|
+
*/
|
|
495
|
+
TopUpPricing: {
|
|
496
|
+
/** @description What is charged, as a decimal string */
|
|
497
|
+
pay: string;
|
|
498
|
+
/** @description How much credit is granted. Equal to `pay` when there is no bonus */
|
|
499
|
+
credit: string;
|
|
500
|
+
};
|
|
501
|
+
Purchase: {
|
|
502
|
+
offer_key: string;
|
|
503
|
+
/**
|
|
504
|
+
* @description The subscription now serving this account. When the change was set to take effect at the
|
|
505
|
+
* end of the period, this is the one that takes over then, and its status says `scheduled`
|
|
506
|
+
*/
|
|
507
|
+
subscription_id: string;
|
|
508
|
+
};
|
|
509
|
+
Error: {
|
|
510
|
+
code?: string;
|
|
511
|
+
message: string;
|
|
512
|
+
meta?: {
|
|
513
|
+
[key: string]: unknown;
|
|
514
|
+
};
|
|
515
|
+
/** Format: int64 */
|
|
516
|
+
status: number;
|
|
517
|
+
};
|
|
518
|
+
/**
|
|
519
|
+
* @description A billing account.
|
|
520
|
+
*
|
|
521
|
+
* Any internal identifier is deliberately absent: the key addresses everything on
|
|
522
|
+
* this API, and a second identifier is one more thing a client can pass in the wrong place, for
|
|
523
|
+
* no benefit to anyone reading the page.
|
|
524
|
+
*/
|
|
525
|
+
BillingAccount: {
|
|
526
|
+
/** @description Addresses the account and states who owns it. Of the form `u_<user_id>_<seq>` */
|
|
527
|
+
key: string;
|
|
528
|
+
/** @description What the holder called it. Not unique, and it addresses nothing */
|
|
529
|
+
display_name: string;
|
|
530
|
+
currency: components["schemas"]["Currency"];
|
|
531
|
+
/** @description The projects this account pays for. Empty when it pays for none, never `null` */
|
|
532
|
+
project_ids: string[];
|
|
533
|
+
};
|
|
534
|
+
BillingAccountList: {
|
|
535
|
+
/** @description Every account belonging to the caller. Empty when they hold none */
|
|
536
|
+
accounts: components["schemas"]["BillingAccount"][];
|
|
537
|
+
};
|
|
538
|
+
CreateBillingAccountRequestBody: {
|
|
539
|
+
/**
|
|
540
|
+
* Format: int32
|
|
541
|
+
* @description Which of the caller's accounts this is. Two requests carrying the same `seq` describe the
|
|
542
|
+
* same account, so a retry is safe; a different `seq` creates a different account.
|
|
543
|
+
*
|
|
544
|
+
* It is not optional. Defaulting it would mean that a client which forgot the field
|
|
545
|
+
* silently receives the account it already had, and reads that as a successful creation.
|
|
546
|
+
*/
|
|
547
|
+
seq: number;
|
|
548
|
+
/** @description A name for the holder's own benefit */
|
|
549
|
+
display_name: string;
|
|
550
|
+
currency?: components["schemas"]["Currency"];
|
|
551
|
+
/**
|
|
552
|
+
* @description Buy one of the top-up bundles from `/offers` instead of an arbitrary amount. When given,
|
|
553
|
+
* `amount` is ignored: the bundle says what is charged and how much credit it grants.
|
|
554
|
+
*
|
|
555
|
+
* How much credit arrives is decided when the money does, not now — and only if the amount
|
|
556
|
+
* collected matches what the bundle costs. A bundle whose places ran out, or whose window
|
|
557
|
+
* closed, in between still grants what was paid for; it just does not grant the bonus.
|
|
558
|
+
*/
|
|
559
|
+
offer_key?: string;
|
|
560
|
+
};
|
|
561
|
+
/**
|
|
562
|
+
* @description The three numbers a billing page needs, which are not the same number.
|
|
563
|
+
*
|
|
564
|
+
* `balance` answers "can I start another one" and is floored at zero, so it cannot express
|
|
565
|
+
* being past zero. `unsettled` is what the current period has run up. `available` is the
|
|
566
|
+
* difference between the two and **may be negative**.
|
|
567
|
+
*
|
|
568
|
+
* Reporting only the first would make an account that has overspent indistinguishable from one
|
|
569
|
+
* that spent exactly what it had, and those two call for different actions.
|
|
570
|
+
*/
|
|
571
|
+
Balance: {
|
|
572
|
+
currency: components["schemas"]["Currency"];
|
|
573
|
+
/**
|
|
574
|
+
* @description What is spendable right now, with usage reported but not yet settled already subtracted.
|
|
575
|
+
* Never negative — it is floored at zero, so it answers "can I start another machine" but
|
|
576
|
+
* not "how much do I owe". A decimal string; `"0"` when the account has never been topped up
|
|
577
|
+
*/
|
|
578
|
+
balance: string;
|
|
579
|
+
/** @description The amount booked to the ledger, before this period's usage is taken off */
|
|
580
|
+
cash: string;
|
|
581
|
+
/**
|
|
582
|
+
* @description What this period has run up and not yet been billed for. It keeps growing past the cash
|
|
583
|
+
* balance, which is precisely the case the live figure cannot show
|
|
584
|
+
*/
|
|
585
|
+
unsettled: string;
|
|
586
|
+
/**
|
|
587
|
+
* @description `cash` minus `unsettled`. **Negative means already in arrears**, and being able to say that
|
|
588
|
+
* is the whole reason this field exists — the positive range is already covered by `balance`
|
|
589
|
+
*/
|
|
590
|
+
available: string;
|
|
591
|
+
};
|
|
592
|
+
/** @description Which account pays for which project, as it stands once the request has been applied */
|
|
593
|
+
ProjectBinding: {
|
|
594
|
+
account_key: string;
|
|
595
|
+
/** Format: uuid */
|
|
596
|
+
project_id: string;
|
|
597
|
+
};
|
|
598
|
+
StartTopUpRequestBody: {
|
|
599
|
+
/**
|
|
600
|
+
* @description How much to add, as a decimal string — `"20"`, `"19.99"`.
|
|
601
|
+
*
|
|
602
|
+
* **Anything below one cent is rejected rather than rounded.** Rounding up overcharges and
|
|
603
|
+
* rounding down undercharges; both alter the amount somewhere the payer cannot see it, and
|
|
604
|
+
* this is the one number on this API where being wrong means money is wrong.
|
|
605
|
+
*/
|
|
606
|
+
amount: string;
|
|
607
|
+
currency?: components["schemas"]["Currency"];
|
|
608
|
+
/**
|
|
609
|
+
* @description Buy one of the top-up bundles from `/offers` instead of an arbitrary amount. When given,
|
|
610
|
+
* `amount` is ignored: the bundle says what is charged and how much credit it grants.
|
|
611
|
+
*
|
|
612
|
+
* How much credit arrives is decided when the money does, not now — and only if the amount
|
|
613
|
+
* collected matches what the bundle costs. A bundle whose places ran out, or whose window
|
|
614
|
+
* closed, in between still grants what was paid for; it just does not grant the bonus.
|
|
615
|
+
*/
|
|
616
|
+
offer_key?: string;
|
|
617
|
+
};
|
|
618
|
+
CardSetupSession: {
|
|
619
|
+
/**
|
|
620
|
+
* Format: uri
|
|
621
|
+
* @description Send the browser here. It expires, so do not store it
|
|
622
|
+
*/
|
|
623
|
+
url: string;
|
|
624
|
+
};
|
|
625
|
+
TopUpSession: {
|
|
626
|
+
/**
|
|
627
|
+
* @description Identifies this attempt. Quote it in a support conversation — it is what ties the payment
|
|
628
|
+
* provider's record to the credit that was granted
|
|
629
|
+
*/
|
|
630
|
+
payment_id: string;
|
|
631
|
+
/**
|
|
632
|
+
* Format: uri
|
|
633
|
+
* @description Send the browser here. It expires, so do not store it
|
|
634
|
+
*/
|
|
635
|
+
url: string;
|
|
636
|
+
};
|
|
637
|
+
/** @description One thing this period has been charged for */
|
|
638
|
+
Charge: {
|
|
639
|
+
id: string;
|
|
640
|
+
name: string;
|
|
641
|
+
/**
|
|
642
|
+
* @description Decimal string, the real-time figure. The booked figure would show a machine that only
|
|
643
|
+
* just started as zero
|
|
644
|
+
*/
|
|
645
|
+
total: string;
|
|
646
|
+
};
|
|
647
|
+
ChargeList: {
|
|
648
|
+
currency: components["schemas"]["Currency"];
|
|
649
|
+
charges: components["schemas"]["Charge"][];
|
|
650
|
+
/** @description The sum, which is the same number as `unsettled` on the balance */
|
|
651
|
+
total: string;
|
|
652
|
+
};
|
|
653
|
+
/** @enum {string} */
|
|
654
|
+
InvoiceStatus: "draft" | "issuing" | "issued" | "payment_processing" | "overdue" | "paid" | "uncollectible" | "voided";
|
|
655
|
+
Invoice: {
|
|
656
|
+
id: string;
|
|
657
|
+
number?: string;
|
|
658
|
+
status: components["schemas"]["InvoiceStatus"];
|
|
659
|
+
currency: components["schemas"]["Currency"];
|
|
660
|
+
total: string;
|
|
661
|
+
/** Format: date-time */
|
|
662
|
+
due_at?: string;
|
|
663
|
+
/** Format: date-time */
|
|
664
|
+
issued_at?: string;
|
|
665
|
+
/** Format: date-time */
|
|
666
|
+
created_at: string;
|
|
667
|
+
};
|
|
668
|
+
InvoiceList: {
|
|
669
|
+
invoices: components["schemas"]["Invoice"][];
|
|
670
|
+
};
|
|
671
|
+
InvoiceLine: {
|
|
672
|
+
name: string;
|
|
673
|
+
description?: string;
|
|
674
|
+
/**
|
|
675
|
+
* Format: date-time
|
|
676
|
+
* @description Required. Lines of the same name repeat many times on one invoice — hundreds on an hourly
|
|
677
|
+
* bill — and without the period they cannot be told apart
|
|
678
|
+
*/
|
|
679
|
+
period_from: string;
|
|
680
|
+
/** Format: date-time */
|
|
681
|
+
period_to: string;
|
|
682
|
+
/** @description Before discounts and credit */
|
|
683
|
+
amount: string;
|
|
684
|
+
discounts_total?: string;
|
|
685
|
+
/** @description How much of this line credit covered */
|
|
686
|
+
credits_total?: string;
|
|
687
|
+
total: string;
|
|
688
|
+
};
|
|
689
|
+
InvoiceDetail: {
|
|
690
|
+
id: string;
|
|
691
|
+
number?: string;
|
|
692
|
+
status: components["schemas"]["InvoiceStatus"];
|
|
693
|
+
currency: components["schemas"]["Currency"];
|
|
694
|
+
total: string;
|
|
695
|
+
charges_total?: string;
|
|
696
|
+
discounts_total?: string;
|
|
697
|
+
credits_total?: string;
|
|
698
|
+
taxes_total?: string;
|
|
699
|
+
/** Format: date-time */
|
|
700
|
+
period_from?: string;
|
|
701
|
+
/** Format: date-time */
|
|
702
|
+
period_to?: string;
|
|
703
|
+
/** Format: date-time */
|
|
704
|
+
due_at?: string;
|
|
705
|
+
/** Format: date-time */
|
|
706
|
+
issued_at?: string;
|
|
707
|
+
/** Format: date-time */
|
|
708
|
+
created_at: string;
|
|
709
|
+
lines: components["schemas"]["InvoiceLine"][];
|
|
710
|
+
};
|
|
711
|
+
Subscription: {
|
|
712
|
+
id: string;
|
|
713
|
+
plan_key: string;
|
|
714
|
+
plan_version?: number;
|
|
715
|
+
/**
|
|
716
|
+
* @description `canceled` still counts as being on a plan — it is serving until the end of the period,
|
|
717
|
+
* which has already been paid for
|
|
718
|
+
*/
|
|
719
|
+
status: string;
|
|
720
|
+
};
|
|
721
|
+
TopUpStatus: {
|
|
722
|
+
payment_id: string;
|
|
723
|
+
/**
|
|
724
|
+
* @description `settled` means the credit has landed. `pending` means it has not yet — the payment is
|
|
725
|
+
* still being confirmed, or the money itself is still in transit
|
|
726
|
+
* @enum {string}
|
|
727
|
+
*/
|
|
728
|
+
state: "settled" | "pending";
|
|
729
|
+
/** @description The credit that was issued, present once settled */
|
|
730
|
+
amount?: string;
|
|
731
|
+
currency?: components["schemas"]["Currency"];
|
|
732
|
+
};
|
|
733
|
+
/**
|
|
734
|
+
* @description ISO 4217. `USD` is the only value the platform issues today; the field is carried so that an
|
|
735
|
+
* amount is never ambiguous about what it is denominated in.
|
|
736
|
+
* @enum {string}
|
|
737
|
+
*/
|
|
738
|
+
Currency: "USD";
|
|
739
|
+
};
|
|
740
|
+
responses: never;
|
|
741
|
+
parameters: {
|
|
742
|
+
/**
|
|
743
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
744
|
+
* which is why the key is what addresses the account.
|
|
745
|
+
*/
|
|
746
|
+
AccountKey: string;
|
|
747
|
+
};
|
|
748
|
+
requestBodies: never;
|
|
749
|
+
headers: never;
|
|
750
|
+
pathItems: never;
|
|
751
|
+
}
|
|
752
|
+
export type $defs = Record<string, never>;
|
|
753
|
+
export interface operations {
|
|
754
|
+
"list-billing-accounts": {
|
|
755
|
+
parameters: {
|
|
756
|
+
query?: never;
|
|
757
|
+
header?: never;
|
|
758
|
+
path?: never;
|
|
759
|
+
cookie?: never;
|
|
760
|
+
};
|
|
761
|
+
requestBody?: never;
|
|
762
|
+
responses: {
|
|
763
|
+
/** @description OK */
|
|
764
|
+
200: {
|
|
765
|
+
headers: {
|
|
766
|
+
[name: string]: unknown;
|
|
767
|
+
};
|
|
768
|
+
content: {
|
|
769
|
+
"application/json": components["schemas"]["BillingAccountList"];
|
|
770
|
+
};
|
|
771
|
+
};
|
|
772
|
+
/** @description Error */
|
|
773
|
+
default: {
|
|
774
|
+
headers: {
|
|
775
|
+
[name: string]: unknown;
|
|
776
|
+
};
|
|
777
|
+
content: {
|
|
778
|
+
"application/json": components["schemas"]["Error"];
|
|
779
|
+
};
|
|
780
|
+
};
|
|
781
|
+
};
|
|
782
|
+
};
|
|
783
|
+
"create-billing-account": {
|
|
784
|
+
parameters: {
|
|
785
|
+
query?: never;
|
|
786
|
+
header?: never;
|
|
787
|
+
path?: never;
|
|
788
|
+
cookie?: never;
|
|
789
|
+
};
|
|
790
|
+
requestBody: {
|
|
791
|
+
content: {
|
|
792
|
+
"application/json": components["schemas"]["CreateBillingAccountRequestBody"];
|
|
793
|
+
};
|
|
794
|
+
};
|
|
795
|
+
responses: {
|
|
796
|
+
/** @description OK */
|
|
797
|
+
200: {
|
|
798
|
+
headers: {
|
|
799
|
+
[name: string]: unknown;
|
|
800
|
+
};
|
|
801
|
+
content: {
|
|
802
|
+
"application/json": components["schemas"]["BillingAccount"];
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
/** @description Error */
|
|
806
|
+
default: {
|
|
807
|
+
headers: {
|
|
808
|
+
[name: string]: unknown;
|
|
809
|
+
};
|
|
810
|
+
content: {
|
|
811
|
+
"application/json": components["schemas"]["Error"];
|
|
812
|
+
};
|
|
813
|
+
};
|
|
814
|
+
};
|
|
815
|
+
};
|
|
816
|
+
"read-billing-account-balance": {
|
|
817
|
+
parameters: {
|
|
818
|
+
query?: never;
|
|
819
|
+
header?: never;
|
|
820
|
+
path: {
|
|
821
|
+
/**
|
|
822
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
823
|
+
* which is why the key is what addresses the account.
|
|
824
|
+
*/
|
|
825
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
826
|
+
};
|
|
827
|
+
cookie?: never;
|
|
828
|
+
};
|
|
829
|
+
requestBody?: never;
|
|
830
|
+
responses: {
|
|
831
|
+
/** @description OK */
|
|
832
|
+
200: {
|
|
833
|
+
headers: {
|
|
834
|
+
[name: string]: unknown;
|
|
835
|
+
};
|
|
836
|
+
content: {
|
|
837
|
+
"application/json": components["schemas"]["Balance"];
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
/** @description Error */
|
|
841
|
+
default: {
|
|
842
|
+
headers: {
|
|
843
|
+
[name: string]: unknown;
|
|
844
|
+
};
|
|
845
|
+
content: {
|
|
846
|
+
"application/json": components["schemas"]["Error"];
|
|
847
|
+
};
|
|
848
|
+
};
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
"bind-project-to-billing-account": {
|
|
852
|
+
parameters: {
|
|
853
|
+
query?: never;
|
|
854
|
+
header?: never;
|
|
855
|
+
path: {
|
|
856
|
+
/**
|
|
857
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
858
|
+
* which is why the key is what addresses the account.
|
|
859
|
+
*/
|
|
860
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
861
|
+
/** @description The project this account should pay for */
|
|
862
|
+
projectId: string;
|
|
863
|
+
};
|
|
864
|
+
cookie?: never;
|
|
865
|
+
};
|
|
866
|
+
requestBody?: never;
|
|
867
|
+
responses: {
|
|
868
|
+
/** @description OK */
|
|
869
|
+
200: {
|
|
870
|
+
headers: {
|
|
871
|
+
[name: string]: unknown;
|
|
872
|
+
};
|
|
873
|
+
content: {
|
|
874
|
+
"application/json": components["schemas"]["ProjectBinding"];
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
/** @description Error */
|
|
878
|
+
default: {
|
|
879
|
+
headers: {
|
|
880
|
+
[name: string]: unknown;
|
|
881
|
+
};
|
|
882
|
+
content: {
|
|
883
|
+
"application/json": components["schemas"]["Error"];
|
|
884
|
+
};
|
|
885
|
+
};
|
|
886
|
+
};
|
|
887
|
+
};
|
|
888
|
+
"start-top-up": {
|
|
889
|
+
parameters: {
|
|
890
|
+
query?: never;
|
|
891
|
+
header?: never;
|
|
892
|
+
path: {
|
|
893
|
+
/**
|
|
894
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
895
|
+
* which is why the key is what addresses the account.
|
|
896
|
+
*/
|
|
897
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
898
|
+
};
|
|
899
|
+
cookie?: never;
|
|
900
|
+
};
|
|
901
|
+
requestBody: {
|
|
902
|
+
content: {
|
|
903
|
+
"application/json": components["schemas"]["StartTopUpRequestBody"];
|
|
904
|
+
};
|
|
905
|
+
};
|
|
906
|
+
responses: {
|
|
907
|
+
/** @description OK */
|
|
908
|
+
200: {
|
|
909
|
+
headers: {
|
|
910
|
+
[name: string]: unknown;
|
|
911
|
+
};
|
|
912
|
+
content: {
|
|
913
|
+
"application/json": components["schemas"]["TopUpSession"];
|
|
914
|
+
};
|
|
915
|
+
};
|
|
916
|
+
/** @description Error */
|
|
917
|
+
default: {
|
|
918
|
+
headers: {
|
|
919
|
+
[name: string]: unknown;
|
|
920
|
+
};
|
|
921
|
+
content: {
|
|
922
|
+
"application/json": components["schemas"]["Error"];
|
|
923
|
+
};
|
|
924
|
+
};
|
|
925
|
+
};
|
|
926
|
+
};
|
|
927
|
+
"list-charges": {
|
|
928
|
+
parameters: {
|
|
929
|
+
query?: never;
|
|
930
|
+
header?: never;
|
|
931
|
+
path: {
|
|
932
|
+
/**
|
|
933
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
934
|
+
* which is why the key is what addresses the account.
|
|
935
|
+
*/
|
|
936
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
937
|
+
};
|
|
938
|
+
cookie?: never;
|
|
939
|
+
};
|
|
940
|
+
requestBody?: never;
|
|
941
|
+
responses: {
|
|
942
|
+
/** @description OK */
|
|
943
|
+
200: {
|
|
944
|
+
headers: {
|
|
945
|
+
[name: string]: unknown;
|
|
946
|
+
};
|
|
947
|
+
content: {
|
|
948
|
+
"application/json": components["schemas"]["ChargeList"];
|
|
949
|
+
};
|
|
950
|
+
};
|
|
951
|
+
/** @description Error */
|
|
952
|
+
default: {
|
|
953
|
+
headers: {
|
|
954
|
+
[name: string]: unknown;
|
|
955
|
+
};
|
|
956
|
+
content: {
|
|
957
|
+
"application/json": components["schemas"]["Error"];
|
|
958
|
+
};
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
"list-invoices": {
|
|
963
|
+
parameters: {
|
|
964
|
+
query?: never;
|
|
965
|
+
header?: never;
|
|
966
|
+
path: {
|
|
967
|
+
/**
|
|
968
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
969
|
+
* which is why the key is what addresses the account.
|
|
970
|
+
*/
|
|
971
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
972
|
+
};
|
|
973
|
+
cookie?: never;
|
|
974
|
+
};
|
|
975
|
+
requestBody?: never;
|
|
976
|
+
responses: {
|
|
977
|
+
/** @description OK */
|
|
978
|
+
200: {
|
|
979
|
+
headers: {
|
|
980
|
+
[name: string]: unknown;
|
|
981
|
+
};
|
|
982
|
+
content: {
|
|
983
|
+
"application/json": components["schemas"]["InvoiceList"];
|
|
984
|
+
};
|
|
985
|
+
};
|
|
986
|
+
/** @description Error */
|
|
987
|
+
default: {
|
|
988
|
+
headers: {
|
|
989
|
+
[name: string]: unknown;
|
|
990
|
+
};
|
|
991
|
+
content: {
|
|
992
|
+
"application/json": components["schemas"]["Error"];
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
};
|
|
996
|
+
};
|
|
997
|
+
"get-invoice": {
|
|
998
|
+
parameters: {
|
|
999
|
+
query?: never;
|
|
1000
|
+
header?: never;
|
|
1001
|
+
path: {
|
|
1002
|
+
/**
|
|
1003
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
1004
|
+
* which is why the key is what addresses the account.
|
|
1005
|
+
*/
|
|
1006
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
1007
|
+
invoiceId: string;
|
|
1008
|
+
};
|
|
1009
|
+
cookie?: never;
|
|
1010
|
+
};
|
|
1011
|
+
requestBody?: never;
|
|
1012
|
+
responses: {
|
|
1013
|
+
/** @description OK */
|
|
1014
|
+
200: {
|
|
1015
|
+
headers: {
|
|
1016
|
+
[name: string]: unknown;
|
|
1017
|
+
};
|
|
1018
|
+
content: {
|
|
1019
|
+
"application/json": components["schemas"]["InvoiceDetail"];
|
|
1020
|
+
};
|
|
1021
|
+
};
|
|
1022
|
+
/** @description Error */
|
|
1023
|
+
default: {
|
|
1024
|
+
headers: {
|
|
1025
|
+
[name: string]: unknown;
|
|
1026
|
+
};
|
|
1027
|
+
content: {
|
|
1028
|
+
"application/json": components["schemas"]["Error"];
|
|
1029
|
+
};
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
"read-subscription": {
|
|
1034
|
+
parameters: {
|
|
1035
|
+
query?: never;
|
|
1036
|
+
header?: never;
|
|
1037
|
+
path: {
|
|
1038
|
+
/**
|
|
1039
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
1040
|
+
* which is why the key is what addresses the account.
|
|
1041
|
+
*/
|
|
1042
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
1043
|
+
};
|
|
1044
|
+
cookie?: never;
|
|
1045
|
+
};
|
|
1046
|
+
requestBody?: never;
|
|
1047
|
+
responses: {
|
|
1048
|
+
/** @description OK */
|
|
1049
|
+
200: {
|
|
1050
|
+
headers: {
|
|
1051
|
+
[name: string]: unknown;
|
|
1052
|
+
};
|
|
1053
|
+
content: {
|
|
1054
|
+
"application/json": components["schemas"]["Subscription"];
|
|
1055
|
+
};
|
|
1056
|
+
};
|
|
1057
|
+
/** @description Error */
|
|
1058
|
+
default: {
|
|
1059
|
+
headers: {
|
|
1060
|
+
[name: string]: unknown;
|
|
1061
|
+
};
|
|
1062
|
+
content: {
|
|
1063
|
+
"application/json": components["schemas"]["Error"];
|
|
1064
|
+
};
|
|
1065
|
+
};
|
|
1066
|
+
};
|
|
1067
|
+
};
|
|
1068
|
+
"cancel-subscription": {
|
|
1069
|
+
parameters: {
|
|
1070
|
+
query: {
|
|
1071
|
+
/** @description When it takes effect */
|
|
1072
|
+
timing: "immediate" | "next_billing_cycle";
|
|
1073
|
+
};
|
|
1074
|
+
header?: never;
|
|
1075
|
+
path: {
|
|
1076
|
+
/**
|
|
1077
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
1078
|
+
* which is why the key is what addresses the account.
|
|
1079
|
+
*/
|
|
1080
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
1081
|
+
};
|
|
1082
|
+
cookie?: never;
|
|
1083
|
+
};
|
|
1084
|
+
requestBody?: never;
|
|
1085
|
+
responses: {
|
|
1086
|
+
/** @description OK */
|
|
1087
|
+
200: {
|
|
1088
|
+
headers: {
|
|
1089
|
+
[name: string]: unknown;
|
|
1090
|
+
};
|
|
1091
|
+
content: {
|
|
1092
|
+
"application/json": components["schemas"]["Subscription"];
|
|
1093
|
+
};
|
|
1094
|
+
};
|
|
1095
|
+
/** @description Error */
|
|
1096
|
+
default: {
|
|
1097
|
+
headers: {
|
|
1098
|
+
[name: string]: unknown;
|
|
1099
|
+
};
|
|
1100
|
+
content: {
|
|
1101
|
+
"application/json": components["schemas"]["Error"];
|
|
1102
|
+
};
|
|
1103
|
+
};
|
|
1104
|
+
};
|
|
1105
|
+
};
|
|
1106
|
+
"read-top-up": {
|
|
1107
|
+
parameters: {
|
|
1108
|
+
query?: never;
|
|
1109
|
+
header?: never;
|
|
1110
|
+
path: {
|
|
1111
|
+
/**
|
|
1112
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
1113
|
+
* which is why the key is what addresses the account.
|
|
1114
|
+
*/
|
|
1115
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
1116
|
+
/** @description The payment id returned when the top-up was started */
|
|
1117
|
+
paymentId: string;
|
|
1118
|
+
};
|
|
1119
|
+
cookie?: never;
|
|
1120
|
+
};
|
|
1121
|
+
requestBody?: never;
|
|
1122
|
+
responses: {
|
|
1123
|
+
/** @description OK */
|
|
1124
|
+
200: {
|
|
1125
|
+
headers: {
|
|
1126
|
+
[name: string]: unknown;
|
|
1127
|
+
};
|
|
1128
|
+
content: {
|
|
1129
|
+
"application/json": components["schemas"]["TopUpStatus"];
|
|
1130
|
+
};
|
|
1131
|
+
};
|
|
1132
|
+
/** @description Error */
|
|
1133
|
+
default: {
|
|
1134
|
+
headers: {
|
|
1135
|
+
[name: string]: unknown;
|
|
1136
|
+
};
|
|
1137
|
+
content: {
|
|
1138
|
+
"application/json": components["schemas"]["Error"];
|
|
1139
|
+
};
|
|
1140
|
+
};
|
|
1141
|
+
};
|
|
1142
|
+
};
|
|
1143
|
+
"start-card-setup": {
|
|
1144
|
+
parameters: {
|
|
1145
|
+
query?: never;
|
|
1146
|
+
header?: never;
|
|
1147
|
+
path: {
|
|
1148
|
+
/**
|
|
1149
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
1150
|
+
* which is why the key is what addresses the account.
|
|
1151
|
+
*/
|
|
1152
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
1153
|
+
};
|
|
1154
|
+
cookie?: never;
|
|
1155
|
+
};
|
|
1156
|
+
requestBody?: never;
|
|
1157
|
+
responses: {
|
|
1158
|
+
/** @description OK */
|
|
1159
|
+
200: {
|
|
1160
|
+
headers: {
|
|
1161
|
+
[name: string]: unknown;
|
|
1162
|
+
};
|
|
1163
|
+
content: {
|
|
1164
|
+
"application/json": components["schemas"]["CardSetupSession"];
|
|
1165
|
+
};
|
|
1166
|
+
};
|
|
1167
|
+
/** @description Error */
|
|
1168
|
+
default: {
|
|
1169
|
+
headers: {
|
|
1170
|
+
[name: string]: unknown;
|
|
1171
|
+
};
|
|
1172
|
+
content: {
|
|
1173
|
+
"application/json": components["schemas"]["Error"];
|
|
1174
|
+
};
|
|
1175
|
+
};
|
|
1176
|
+
};
|
|
1177
|
+
};
|
|
1178
|
+
"list-offers": {
|
|
1179
|
+
parameters: {
|
|
1180
|
+
query?: never;
|
|
1181
|
+
header?: never;
|
|
1182
|
+
path: {
|
|
1183
|
+
/**
|
|
1184
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
1185
|
+
* which is why the key is what addresses the account.
|
|
1186
|
+
*/
|
|
1187
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
1188
|
+
};
|
|
1189
|
+
cookie?: never;
|
|
1190
|
+
};
|
|
1191
|
+
requestBody?: never;
|
|
1192
|
+
responses: {
|
|
1193
|
+
/** @description OK */
|
|
1194
|
+
200: {
|
|
1195
|
+
headers: {
|
|
1196
|
+
[name: string]: unknown;
|
|
1197
|
+
};
|
|
1198
|
+
content: {
|
|
1199
|
+
"application/json": components["schemas"]["OfferList"];
|
|
1200
|
+
};
|
|
1201
|
+
};
|
|
1202
|
+
/** @description Error */
|
|
1203
|
+
default: {
|
|
1204
|
+
headers: {
|
|
1205
|
+
[name: string]: unknown;
|
|
1206
|
+
};
|
|
1207
|
+
content: {
|
|
1208
|
+
"application/json": components["schemas"]["Error"];
|
|
1209
|
+
};
|
|
1210
|
+
};
|
|
1211
|
+
};
|
|
1212
|
+
};
|
|
1213
|
+
"purchase-offer": {
|
|
1214
|
+
parameters: {
|
|
1215
|
+
query?: {
|
|
1216
|
+
/** @description When the switch takes effect. Required if the account already has a plan, ignored otherwise */
|
|
1217
|
+
timing?: components["schemas"]["PlanChangeTiming"];
|
|
1218
|
+
};
|
|
1219
|
+
header?: never;
|
|
1220
|
+
path: {
|
|
1221
|
+
/**
|
|
1222
|
+
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
1223
|
+
* which is why the key is what addresses the account.
|
|
1224
|
+
*/
|
|
1225
|
+
accountKey: components["parameters"]["AccountKey"];
|
|
1226
|
+
/** @description Which offer */
|
|
1227
|
+
offerKey: string;
|
|
1228
|
+
};
|
|
1229
|
+
cookie?: never;
|
|
1230
|
+
};
|
|
1231
|
+
requestBody?: never;
|
|
1232
|
+
responses: {
|
|
1233
|
+
/** @description OK */
|
|
1234
|
+
200: {
|
|
1235
|
+
headers: {
|
|
1236
|
+
[name: string]: unknown;
|
|
1237
|
+
};
|
|
1238
|
+
content: {
|
|
1239
|
+
"application/json": components["schemas"]["Purchase"];
|
|
1240
|
+
};
|
|
1241
|
+
};
|
|
1242
|
+
/** @description Error */
|
|
1243
|
+
default: {
|
|
1244
|
+
headers: {
|
|
1245
|
+
[name: string]: unknown;
|
|
1246
|
+
};
|
|
1247
|
+
content: {
|
|
1248
|
+
"application/json": components["schemas"]["Error"];
|
|
1249
|
+
};
|
|
1250
|
+
};
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1253
|
+
}
|