@leaflow/sdk 0.54.1 → 0.54.3
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/billing/v1/index.d.ts +8 -0
- package/dist/billing/v1/schema.d.ts +363 -28
- package/package.json +1 -1
|
@@ -74,6 +74,8 @@ export type ListInvoicesQuery = operations["list-invoices"]["parameters"]["query
|
|
|
74
74
|
export type GetInvoiceResult = operations["get-invoice"]["responses"][200]["content"]["application/json"];
|
|
75
75
|
/** `GET /account/v1/invoices/{invoiceId}/items` 成功时的响应体。 */
|
|
76
76
|
export type ListInvoiceItemsResult = operations["list-invoice-items"]["responses"][200]["content"]["application/json"];
|
|
77
|
+
/** `GET /account/v1/invoices/{invoiceId}/refund-quote` 成功时的响应体。 */
|
|
78
|
+
export type GetInvoiceRefundQuoteResult = operations["get-invoice-refund-quote"]["responses"][200]["content"]["application/json"];
|
|
77
79
|
/** `GET /account/v1/transactions` 成功时的响应体。 */
|
|
78
80
|
export type ListTransactionsResult = operations["list-transactions"]["responses"][200]["content"]["application/json"];
|
|
79
81
|
/** `GET /account/v1/credit-grants` 成功时的响应体。 */
|
|
@@ -84,6 +86,10 @@ export type ListCreditGrantsQuery = operations["list-credit-grants"]["parameters
|
|
|
84
86
|
export type ListAllocationsResult = operations["list-allocations"]["responses"][200]["content"]["application/json"];
|
|
85
87
|
/** `GET /account/v1/allocations` 的查询参数。 */
|
|
86
88
|
export type ListAllocationsQuery = operations["list-allocations"]["parameters"]["query"];
|
|
89
|
+
/** `POST /account/v1/refunds` 成功时的响应体。 */
|
|
90
|
+
export type RequestRefundResult = operations["request-refund"]["responses"][201]["content"]["application/json"];
|
|
91
|
+
/** `POST /account/v1/refunds` 的请求体。 */
|
|
92
|
+
export type RequestRefundBody = NonNullable<operations["request-refund"]["requestBody"]>["content"]["application/json"];
|
|
87
93
|
/** `GET /account/v1/refunds` 成功时的响应体。 */
|
|
88
94
|
export type ListRefundsResult = operations["list-refunds"]["responses"][200]["content"]["application/json"];
|
|
89
95
|
/** `GET /account/v1/usage-charges` 成功时的响应体。 */
|
|
@@ -162,6 +168,8 @@ export type ListOrdersQuery = operations["list-orders"]["parameters"]["query"];
|
|
|
162
168
|
export type GetOrderResult = operations["get-order"]["responses"][200]["content"]["application/json"];
|
|
163
169
|
/** `GET /account/v1/orders/{orderId}/items` 成功时的响应体。 */
|
|
164
170
|
export type ListOrderItemsResult = operations["list-order-items"]["responses"][200]["content"]["application/json"];
|
|
171
|
+
/** `GET /account/v1/orders/{orderId}/refund-quote` 成功时的响应体。 */
|
|
172
|
+
export type GetOrderRefundQuoteResult = operations["get-order-refund-quote"]["responses"][200]["content"]["application/json"];
|
|
165
173
|
/** `GET /api/v1/projects/{projectId}/orders/{orderId}/items` 成功时的响应体。 */
|
|
166
174
|
export type ListProjectOrderItemsResult = operations["list-project-order-items"]["responses"][200]["content"]["application/json"];
|
|
167
175
|
/** `GET /api/v1/projects/{projectId}/allowances` 成功时的响应体。 */
|
|
@@ -336,8 +336,9 @@ export interface paths {
|
|
|
336
336
|
put?: never;
|
|
337
337
|
/**
|
|
338
338
|
* Begin adding a payment method
|
|
339
|
-
* @description Returns
|
|
340
|
-
*
|
|
339
|
+
* @description Returns what is needed to hand the browser over to the payment provider's own card
|
|
340
|
+
* form. Nothing is charged, and the method appears in the list once the provider
|
|
341
|
+
* confirms it.
|
|
341
342
|
*
|
|
342
343
|
* Card numbers are never sent to or stored by this service.
|
|
343
344
|
*/
|
|
@@ -497,6 +498,33 @@ export interface paths {
|
|
|
497
498
|
patch?: never;
|
|
498
499
|
trace?: never;
|
|
499
500
|
};
|
|
501
|
+
"/account/v1/invoices/{invoiceId}/refund-quote": {
|
|
502
|
+
parameters: {
|
|
503
|
+
query?: never;
|
|
504
|
+
header?: never;
|
|
505
|
+
path: {
|
|
506
|
+
invoiceId: components["parameters"]["InvoiceId"];
|
|
507
|
+
};
|
|
508
|
+
cookie?: never;
|
|
509
|
+
};
|
|
510
|
+
/**
|
|
511
|
+
* What refunding this invoice would give back
|
|
512
|
+
* @description Show this before asking for a refund. Nothing is recorded and nothing is reserved; the
|
|
513
|
+
* answer follows from what has been paid and what has already been returned, so it may
|
|
514
|
+
* be read as often as required.
|
|
515
|
+
*
|
|
516
|
+
* `refundable_amount` is `"0"` once nothing is left, which is also the answer for an
|
|
517
|
+
* invoice already refunded in full.
|
|
518
|
+
*/
|
|
519
|
+
get: operations["get-invoice-refund-quote"];
|
|
520
|
+
put?: never;
|
|
521
|
+
post?: never;
|
|
522
|
+
delete?: never;
|
|
523
|
+
options?: never;
|
|
524
|
+
head?: never;
|
|
525
|
+
patch?: never;
|
|
526
|
+
trace?: never;
|
|
527
|
+
};
|
|
500
528
|
"/account/v1/transactions": {
|
|
501
529
|
parameters: {
|
|
502
530
|
query?: never;
|
|
@@ -546,6 +574,9 @@ export interface paths {
|
|
|
546
574
|
* Where each amount went
|
|
547
575
|
* @description Give `source_id` to follow one top-up or grant through to everything it paid for. Give
|
|
548
576
|
* `target_id` to see which sources paid for one line of an invoice.
|
|
577
|
+
*
|
|
578
|
+
* Give `source_type` on its own to separate what cash paid for from what granted credit
|
|
579
|
+
* paid for.
|
|
549
580
|
*/
|
|
550
581
|
get: operations["list-allocations"];
|
|
551
582
|
put?: never;
|
|
@@ -565,7 +596,20 @@ export interface paths {
|
|
|
565
596
|
};
|
|
566
597
|
get: operations["list-refunds"];
|
|
567
598
|
put?: never;
|
|
568
|
-
|
|
599
|
+
/**
|
|
600
|
+
* Ask for a refund
|
|
601
|
+
* @description Refunding ends the subscription and reclaims whatever it provisioned. That is the
|
|
602
|
+
* difference from letting a period lapse: a lapsed period keeps the machine around
|
|
603
|
+
* for a while so that topping up brings it back, whereas a refund returns the money
|
|
604
|
+
* and therefore cannot leave the thing running.
|
|
605
|
+
*
|
|
606
|
+
* What can be refunded, for how long, and how much, is decided here rather than by
|
|
607
|
+
* the caller. A request outside those bounds is refused with the reason.
|
|
608
|
+
*
|
|
609
|
+
* The money goes back the way it came: card charges to the card, balance to the
|
|
610
|
+
* balance, credit to credit. A grant never turns into cash.
|
|
611
|
+
*/
|
|
612
|
+
post: operations["request-refund"];
|
|
569
613
|
delete?: never;
|
|
570
614
|
options?: never;
|
|
571
615
|
head?: never;
|
|
@@ -1064,6 +1108,36 @@ export interface paths {
|
|
|
1064
1108
|
patch?: never;
|
|
1065
1109
|
trace?: never;
|
|
1066
1110
|
};
|
|
1111
|
+
"/account/v1/orders/{orderId}/refund-quote": {
|
|
1112
|
+
parameters: {
|
|
1113
|
+
query?: never;
|
|
1114
|
+
header?: never;
|
|
1115
|
+
path: {
|
|
1116
|
+
orderId: components["parameters"]["OrderId"];
|
|
1117
|
+
};
|
|
1118
|
+
cookie?: never;
|
|
1119
|
+
};
|
|
1120
|
+
/**
|
|
1121
|
+
* What refunding this order would give back
|
|
1122
|
+
* @description Show this before asking for a refund. Nothing is recorded and nothing is reserved; the
|
|
1123
|
+
* answer follows from what has been paid and what has already been returned, so it may
|
|
1124
|
+
* be read as often as required.
|
|
1125
|
+
*
|
|
1126
|
+
* `refundable_amount` is `"0"` once nothing is left, which is also the answer for an
|
|
1127
|
+
* order already refunded in full.
|
|
1128
|
+
*
|
|
1129
|
+
* Refunding an order also ends what it bought and reclaims whatever it provisioned. That
|
|
1130
|
+
* is not reflected in the amounts here.
|
|
1131
|
+
*/
|
|
1132
|
+
get: operations["get-order-refund-quote"];
|
|
1133
|
+
put?: never;
|
|
1134
|
+
post?: never;
|
|
1135
|
+
delete?: never;
|
|
1136
|
+
options?: never;
|
|
1137
|
+
head?: never;
|
|
1138
|
+
patch?: never;
|
|
1139
|
+
trace?: never;
|
|
1140
|
+
};
|
|
1067
1141
|
"/api/v1/projects/{projectId}/orders/{orderId}/items": {
|
|
1068
1142
|
parameters: {
|
|
1069
1143
|
query?: never;
|
|
@@ -1235,11 +1309,13 @@ export interface components {
|
|
|
1235
1309
|
/** @description Present for `per_unit`. */
|
|
1236
1310
|
unit_amount?: components["schemas"]["Money"];
|
|
1237
1311
|
/**
|
|
1238
|
-
* @description
|
|
1239
|
-
*
|
|
1312
|
+
* @description `none` for a price that is not tiered, which is most of them.
|
|
1313
|
+
*
|
|
1314
|
+
* Otherwise `graduated` charges each band at its own rate, and `volume` charges
|
|
1315
|
+
* everything at the rate of the band the total falls in.
|
|
1240
1316
|
* @enum {string}
|
|
1241
1317
|
*/
|
|
1242
|
-
tiers_mode?: "graduated" | "volume";
|
|
1318
|
+
tiers_mode?: "none" | "graduated" | "volume";
|
|
1243
1319
|
/** @description Present for `tiered`, in ascending order. */
|
|
1244
1320
|
tiers?: components["schemas"]["Tier"][];
|
|
1245
1321
|
/**
|
|
@@ -1393,17 +1469,38 @@ export interface components {
|
|
|
1393
1469
|
QuoteLineResult: {
|
|
1394
1470
|
/** @description Which line of the request this answers. */
|
|
1395
1471
|
index: number;
|
|
1472
|
+
/**
|
|
1473
|
+
* @description Whether a price was found for this line. Read this before anything else.
|
|
1474
|
+
*
|
|
1475
|
+
* A single item with no price no longer fails the whole request. A catalogue
|
|
1476
|
+
* almost always has something not yet priced, and refusing the request would
|
|
1477
|
+
* leave no way to render a list in which a few entries are simply not on sale.
|
|
1478
|
+
*
|
|
1479
|
+
* When false, `price_id`, `unit_amount` and `amount` are absent and
|
|
1480
|
+
* `unpriced_reason` states what is missing.
|
|
1481
|
+
*/
|
|
1482
|
+
priced: boolean;
|
|
1483
|
+
/**
|
|
1484
|
+
* @description Why no price was found; `none` while `priced` is true.
|
|
1485
|
+
*
|
|
1486
|
+
* The last four are told apart because their remedies differ: the price points
|
|
1487
|
+
* at no price list, the list holds no rate for that meter, that exact combination
|
|
1488
|
+
* of attributes is not configured, or it is configured but nothing is in effect
|
|
1489
|
+
* at the moment asked about.
|
|
1490
|
+
* @enum {string}
|
|
1491
|
+
*/
|
|
1492
|
+
unpriced_reason?: "none" | "no_price" | "no_rate_card" | "no_meter" | "no_dimensions" | "no_effective_rule";
|
|
1396
1493
|
/**
|
|
1397
1494
|
* Format: uuid
|
|
1398
|
-
* @description The price selected.
|
|
1399
|
-
* indirectly, so that the choice can be confirmed.
|
|
1495
|
+
* @description The price selected. Returned whenever `priced` is true, including when the
|
|
1496
|
+
* request identified the item indirectly, so that the choice can be confirmed.
|
|
1400
1497
|
*/
|
|
1401
|
-
price_id
|
|
1498
|
+
price_id?: string;
|
|
1402
1499
|
plan_name?: string;
|
|
1403
1500
|
unit_amount?: components["schemas"]["Money"];
|
|
1404
1501
|
quantity?: string;
|
|
1405
1502
|
/** @description Not rounded. Round only for display. */
|
|
1406
|
-
amount
|
|
1503
|
+
amount?: components["schemas"]["Money"];
|
|
1407
1504
|
currency: string;
|
|
1408
1505
|
};
|
|
1409
1506
|
QuoteChangeResult: {
|
|
@@ -1590,22 +1687,61 @@ export interface components {
|
|
|
1590
1687
|
id: string;
|
|
1591
1688
|
/** Format: int64 */
|
|
1592
1689
|
billing_account_id: number;
|
|
1690
|
+
/** @description What is credited to the account, in the account's own currency. */
|
|
1593
1691
|
amount: components["schemas"]["Money"];
|
|
1594
1692
|
currency: string;
|
|
1693
|
+
/**
|
|
1694
|
+
* @description How much of this top-up has not been spent yet. This is the part that can still be
|
|
1695
|
+
* returned to where it was paid from.
|
|
1696
|
+
*/
|
|
1697
|
+
remaining_amount?: components["schemas"]["Money"];
|
|
1595
1698
|
/**
|
|
1596
1699
|
* @description `pending` until the payment provider confirms. The balance increases on `succeeded`.
|
|
1700
|
+
*
|
|
1701
|
+
* A checkout the payer abandoned ends up `failed` too, with `failure_reason` saying
|
|
1702
|
+
* so. Nothing was charged in that case.
|
|
1597
1703
|
* @enum {string}
|
|
1598
1704
|
*/
|
|
1599
1705
|
status: "pending" | "succeeded" | "failed";
|
|
1706
|
+
/** @description Which payment provider collected it. */
|
|
1707
|
+
provider?: string;
|
|
1708
|
+
/**
|
|
1709
|
+
* @description The currency the payer was actually charged in, when the checkout page collected a
|
|
1710
|
+
* local one. Absent when it was the same as the account's.
|
|
1711
|
+
*/
|
|
1712
|
+
presentment_currency?: string;
|
|
1713
|
+
/**
|
|
1714
|
+
* @description What was charged, in `presentment_currency`. It will not equal `amount`, and it is
|
|
1715
|
+
* the figure that appears on the payer's card or wallet statement.
|
|
1716
|
+
*/
|
|
1717
|
+
presentment_amount?: components["schemas"]["Money"];
|
|
1718
|
+
/** @description Why it did not go through. Present with `failed`. */
|
|
1719
|
+
failure_reason?: string;
|
|
1600
1720
|
/** @description Where the payer completes the payment. Absent once it has completed. */
|
|
1601
1721
|
checkout_url?: string;
|
|
1602
1722
|
/** Format: date-time */
|
|
1603
1723
|
created_at: string;
|
|
1724
|
+
/**
|
|
1725
|
+
* Format: date-time
|
|
1726
|
+
* @description When the funds arrived. Later than `created_at` — by days for a bank transfer — so
|
|
1727
|
+
* reconciling against a statement uses this rather than the moment it was started.
|
|
1728
|
+
* Absent until the payment completes.
|
|
1729
|
+
*/
|
|
1730
|
+
settled_at?: string | null;
|
|
1604
1731
|
};
|
|
1605
1732
|
TopUpCreate: {
|
|
1606
1733
|
/** Format: int64 */
|
|
1607
1734
|
billing_account_id: number;
|
|
1608
|
-
/**
|
|
1735
|
+
/**
|
|
1736
|
+
* @description In the account's currency, and no finer than that currency's smallest unit:
|
|
1737
|
+
* two decimals for most, none for the yen. A finer amount is refused here rather
|
|
1738
|
+
* than at the checkout page, where the payer would see the provider's own wording
|
|
1739
|
+
* instead of an explanation.
|
|
1740
|
+
*
|
|
1741
|
+
* There is a minimum, which differs by currency. Below it the provider's fee
|
|
1742
|
+
* exceeds the top-up itself, so such a payment costs more to accept than it brings.
|
|
1743
|
+
* The minimum in force is returned with the rejection.
|
|
1744
|
+
*/
|
|
1609
1745
|
amount: components["schemas"]["Money"];
|
|
1610
1746
|
/**
|
|
1611
1747
|
* Format: uuid
|
|
@@ -1649,9 +1785,27 @@ export interface components {
|
|
|
1649
1785
|
billing_account_id: number;
|
|
1650
1786
|
return_url?: string;
|
|
1651
1787
|
};
|
|
1788
|
+
/**
|
|
1789
|
+
* @description What the payment provider's browser library needs in order to collect a card. There is
|
|
1790
|
+
* no address to redirect to: the form is rendered in the page, and the card goes straight
|
|
1791
|
+
* from the browser to the provider.
|
|
1792
|
+
*/
|
|
1652
1793
|
PaymentMethodSetupResult: {
|
|
1653
|
-
/**
|
|
1654
|
-
|
|
1794
|
+
/**
|
|
1795
|
+
* @description The provider's identifier for this attempt. Use it to tell a reloaded page apart
|
|
1796
|
+
* from a second attempt.
|
|
1797
|
+
*/
|
|
1798
|
+
setup_id: string;
|
|
1799
|
+
/**
|
|
1800
|
+
* @description Authorises this one attempt with the provider, and nothing else. Pass it to the
|
|
1801
|
+
* provider's library; it is not an API credential and grants no access here.
|
|
1802
|
+
*/
|
|
1803
|
+
client_secret: string;
|
|
1804
|
+
/**
|
|
1805
|
+
* @description The provider's public key to initialise its library with. It differs between test
|
|
1806
|
+
* and live, so read it from here rather than compiling it in.
|
|
1807
|
+
*/
|
|
1808
|
+
publishable_key: string;
|
|
1655
1809
|
/** Format: date-time */
|
|
1656
1810
|
expires_at?: string;
|
|
1657
1811
|
};
|
|
@@ -1745,7 +1899,7 @@ export interface components {
|
|
|
1745
1899
|
/** Format: int64 */
|
|
1746
1900
|
billing_account_id: number;
|
|
1747
1901
|
/** @description Numbered per account and per month. */
|
|
1748
|
-
number
|
|
1902
|
+
number: string;
|
|
1749
1903
|
/**
|
|
1750
1904
|
* @description What produced it — metered usage for a period, a purchase, or a correction.
|
|
1751
1905
|
* @enum {string}
|
|
@@ -1845,9 +1999,13 @@ export interface components {
|
|
|
1845
1999
|
/**
|
|
1846
2000
|
* @description `pending` is a payment still with the provider. Only one may be pending against any
|
|
1847
2001
|
* one invoice or order.
|
|
2002
|
+
*
|
|
2003
|
+
* `failed` covers a payment the provider refused and one the payer walked away from
|
|
2004
|
+
* alike; `failure_reason` says which. There is no separate cancelled state, because
|
|
2005
|
+
* what to do next is the same either way — start a new one.
|
|
1848
2006
|
* @enum {string}
|
|
1849
2007
|
*/
|
|
1850
|
-
status: "pending" | "succeeded" | "failed"
|
|
2008
|
+
status: "pending" | "succeeded" | "failed";
|
|
1851
2009
|
/** Format: date-time */
|
|
1852
2010
|
created_at: string;
|
|
1853
2011
|
};
|
|
@@ -1861,8 +2019,12 @@ export interface components {
|
|
|
1861
2019
|
id: string;
|
|
1862
2020
|
/** Format: int64 */
|
|
1863
2021
|
billing_account_id?: number;
|
|
1864
|
-
/**
|
|
1865
|
-
|
|
2022
|
+
/**
|
|
2023
|
+
* @description Where it came from. `voucher` was redeemed from a code and carries its own
|
|
2024
|
+
* restrictions; `manual` was issued directly, typically to put something right.
|
|
2025
|
+
* @enum {string}
|
|
2026
|
+
*/
|
|
2027
|
+
source_type?: "promotion" | "voucher" | "manual" | "membership";
|
|
1866
2028
|
name: string;
|
|
1867
2029
|
amount: components["schemas"]["Money"];
|
|
1868
2030
|
remaining_amount: components["schemas"]["Money"];
|
|
@@ -1872,7 +2034,7 @@ export interface components {
|
|
|
1872
2034
|
/** @description The restrictions in one sentence, ready to display. */
|
|
1873
2035
|
applies_to_summary?: string;
|
|
1874
2036
|
/** @enum {string} */
|
|
1875
|
-
status: "active" | "
|
|
2037
|
+
status: "active" | "depleted" | "expired" | "voided";
|
|
1876
2038
|
/** Format: date-time */
|
|
1877
2039
|
valid_from: string;
|
|
1878
2040
|
/** Format: date-time */
|
|
@@ -1890,13 +2052,10 @@ export interface components {
|
|
|
1890
2052
|
source_type: "transaction" | "credit_grant";
|
|
1891
2053
|
/** Format: uuid */
|
|
1892
2054
|
source_id: string;
|
|
1893
|
-
/** @description A readable line, such as "Top-up of 100.00 on 3 September". */
|
|
1894
|
-
source_description?: string;
|
|
1895
2055
|
/** @enum {string} */
|
|
1896
2056
|
target_type: "hold" | "order_item" | "invoice_item";
|
|
1897
2057
|
/** Format: uuid */
|
|
1898
2058
|
target_id: string;
|
|
1899
|
-
target_description?: string;
|
|
1900
2059
|
amount: components["schemas"]["Money"];
|
|
1901
2060
|
currency: string;
|
|
1902
2061
|
/** Format: date-time */
|
|
@@ -1909,6 +2068,32 @@ export interface components {
|
|
|
1909
2068
|
/** Format: int64 */
|
|
1910
2069
|
total_count?: number;
|
|
1911
2070
|
};
|
|
2071
|
+
/**
|
|
2072
|
+
* @description Name exactly one of the three targets. Naming none leaves the amount undecided;
|
|
2073
|
+
* naming two leaves it ambiguous, and both would have to be resolved by guessing.
|
|
2074
|
+
*/
|
|
2075
|
+
RefundRequest: {
|
|
2076
|
+
/** Format: uuid */
|
|
2077
|
+
invoice_id?: string;
|
|
2078
|
+
/** Format: uuid */
|
|
2079
|
+
order_id?: string;
|
|
2080
|
+
/**
|
|
2081
|
+
* Format: uuid
|
|
2082
|
+
* @description The period to end early. Use this to give back a prepaid term that still has
|
|
2083
|
+
* time left on it.
|
|
2084
|
+
*/
|
|
2085
|
+
subscription_period_id?: string;
|
|
2086
|
+
/**
|
|
2087
|
+
* @description How much to give back. Absent asks for everything still refundable on the target.
|
|
2088
|
+
*
|
|
2089
|
+
* More than what remains is refused rather than reduced to the remainder: a caller
|
|
2090
|
+
* asking for more than it can have has miscounted, and quietly giving it less
|
|
2091
|
+
* hides that.
|
|
2092
|
+
*/
|
|
2093
|
+
amount?: components["schemas"]["Money"];
|
|
2094
|
+
reason: string;
|
|
2095
|
+
idempotency_key: string;
|
|
2096
|
+
};
|
|
1912
2097
|
Refund: {
|
|
1913
2098
|
/** Format: uuid */
|
|
1914
2099
|
id: string;
|
|
@@ -1918,17 +2103,31 @@ export interface components {
|
|
|
1918
2103
|
invoice_id?: string | null;
|
|
1919
2104
|
/** Format: uuid */
|
|
1920
2105
|
order_id?: string | null;
|
|
1921
|
-
requested_amount
|
|
2106
|
+
requested_amount: components["schemas"]["Money"];
|
|
1922
2107
|
/** @description What has actually been returned. */
|
|
1923
2108
|
settled_amount?: components["schemas"]["Money"];
|
|
2109
|
+
/**
|
|
2110
|
+
* @description Withheld from what reaches the payer. It applies only to cash returned to a payment
|
|
2111
|
+
* method, so it is zero when `destination` is `balance`, and it is never taken out of
|
|
2112
|
+
* credit or a voucher.
|
|
2113
|
+
*
|
|
2114
|
+
* `settled_amount` is the amount put back against what was paid; the payer receives
|
|
2115
|
+
* that less this.
|
|
2116
|
+
*/
|
|
2117
|
+
fee_amount?: components["schemas"]["Money"];
|
|
1924
2118
|
currency: string;
|
|
1925
2119
|
/**
|
|
1926
2120
|
* @description Where the cash went.
|
|
1927
2121
|
* @enum {string}
|
|
1928
2122
|
*/
|
|
1929
2123
|
destination?: "balance" | "provider";
|
|
1930
|
-
/**
|
|
1931
|
-
|
|
2124
|
+
/**
|
|
2125
|
+
* @description `pending` — accepted, not yet sent to the payment provider. `processing` — with the
|
|
2126
|
+
* provider and awaiting its answer, which takes days for some methods. Neither is
|
|
2127
|
+
* final, and neither means the money has moved.
|
|
2128
|
+
* @enum {string}
|
|
2129
|
+
*/
|
|
2130
|
+
status: "pending" | "processing" | "succeeded" | "failed";
|
|
1932
2131
|
reason?: string;
|
|
1933
2132
|
/** Format: date-time */
|
|
1934
2133
|
created_at: string;
|
|
@@ -1938,6 +2137,51 @@ export interface components {
|
|
|
1938
2137
|
/** Format: int64 */
|
|
1939
2138
|
total_count?: number;
|
|
1940
2139
|
};
|
|
2140
|
+
RefundSource: {
|
|
2141
|
+
/**
|
|
2142
|
+
* @description Where this part of the money came from, and therefore where it goes back to.
|
|
2143
|
+
* Only `cash` can reach a card or a spendable balance; credit and vouchers return
|
|
2144
|
+
* to themselves and never become cash.
|
|
2145
|
+
* @enum {string}
|
|
2146
|
+
*/
|
|
2147
|
+
type: "cash" | "credit" | "voucher";
|
|
2148
|
+
amount: components["schemas"]["Money"];
|
|
2149
|
+
};
|
|
2150
|
+
/** @description What a full refund would return, and where each part of it would go. */
|
|
2151
|
+
RefundQuote: {
|
|
2152
|
+
/** @description The most that can still be returned, before any fee. */
|
|
2153
|
+
refundable_amount: components["schemas"]["Money"];
|
|
2154
|
+
/**
|
|
2155
|
+
* @description Withheld from the cash part. Zero when `destination` is `balance`, and never taken
|
|
2156
|
+
* out of credit or a voucher.
|
|
2157
|
+
*/
|
|
2158
|
+
fee_amount: components["schemas"]["Money"];
|
|
2159
|
+
/** @description `refundable_amount` less `fee_amount`. */
|
|
2160
|
+
net_amount: components["schemas"]["Money"];
|
|
2161
|
+
currency: string;
|
|
2162
|
+
/**
|
|
2163
|
+
* @description Where the cash part would go. `provider` returns it to the method it was paid
|
|
2164
|
+
* with; `balance` credits the account instead, which is the answer whenever the cash
|
|
2165
|
+
* came from more than one place or never went through a provider at all.
|
|
2166
|
+
* @enum {string}
|
|
2167
|
+
*/
|
|
2168
|
+
destination: "balance" | "provider";
|
|
2169
|
+
/**
|
|
2170
|
+
* @description How `refundable_amount` splits by where the money came from. The amounts sum to it.
|
|
2171
|
+
*
|
|
2172
|
+
* Show this rather than a single figure. A part returned as credit or as a voucher
|
|
2173
|
+
* does not appear on a card statement, so a customer told only the net amount will
|
|
2174
|
+
* ask why less than that arrived.
|
|
2175
|
+
*/
|
|
2176
|
+
sources: components["schemas"]["RefundSource"][];
|
|
2177
|
+
/**
|
|
2178
|
+
* Format: date-time
|
|
2179
|
+
* @description The last moment a refund can be asked for here. Measured from when the purchase was
|
|
2180
|
+
* paid for, not from today. Absent when this cannot be refunded without support at
|
|
2181
|
+
* all — metered usage, for one, which is never self-service.
|
|
2182
|
+
*/
|
|
2183
|
+
self_service_until?: string | null;
|
|
2184
|
+
};
|
|
1941
2185
|
UsageCharge: {
|
|
1942
2186
|
/** Format: uuid */
|
|
1943
2187
|
id: string;
|
|
@@ -2012,8 +2256,12 @@ export interface components {
|
|
|
2012
2256
|
/** Format: uuid */
|
|
2013
2257
|
product_id: string;
|
|
2014
2258
|
product_key?: string;
|
|
2015
|
-
/**
|
|
2016
|
-
|
|
2259
|
+
/**
|
|
2260
|
+
* @description `pending` is a subscription created by an order that has not completed, so it
|
|
2261
|
+
* appears in the list before anything under it is running.
|
|
2262
|
+
* @enum {string}
|
|
2263
|
+
*/
|
|
2264
|
+
status: "pending" | "active" | "suspended" | "canceled" | "terminated";
|
|
2017
2265
|
/** Format: int64 */
|
|
2018
2266
|
item_count?: number;
|
|
2019
2267
|
};
|
|
@@ -2048,7 +2296,7 @@ export interface components {
|
|
|
2048
2296
|
paid_until?: string | null;
|
|
2049
2297
|
auto_renew?: boolean;
|
|
2050
2298
|
/** @enum {string} */
|
|
2051
|
-
status: "pending" | "active" | "suspended" | "
|
|
2299
|
+
status: "pending" | "active" | "suspended" | "canceled" | "terminated";
|
|
2052
2300
|
/** Format: date-time */
|
|
2053
2301
|
started_at?: string | null;
|
|
2054
2302
|
/** Format: date-time */
|
|
@@ -2326,6 +2574,12 @@ export interface components {
|
|
|
2326
2574
|
id: string;
|
|
2327
2575
|
/** Format: int64 */
|
|
2328
2576
|
billing_account_id?: number;
|
|
2577
|
+
/**
|
|
2578
|
+
* @description Which service it covers, such as `compute`. Read it alongside `meter_key`: a meter
|
|
2579
|
+
* name is unique only within its own service, so two allowances for `egress_bytes`
|
|
2580
|
+
* may belong to different services and cover different traffic.
|
|
2581
|
+
*/
|
|
2582
|
+
product_key: string;
|
|
2329
2583
|
/** @description What it covers, such as `egress_bytes`. */
|
|
2330
2584
|
meter_key: string;
|
|
2331
2585
|
/** @description The unit it is counted in, such as `MiB`. */
|
|
@@ -3265,6 +3519,29 @@ export interface operations {
|
|
|
3265
3519
|
default: components["responses"]["Error"];
|
|
3266
3520
|
};
|
|
3267
3521
|
};
|
|
3522
|
+
"get-invoice-refund-quote": {
|
|
3523
|
+
parameters: {
|
|
3524
|
+
query?: never;
|
|
3525
|
+
header?: never;
|
|
3526
|
+
path: {
|
|
3527
|
+
invoiceId: components["parameters"]["InvoiceId"];
|
|
3528
|
+
};
|
|
3529
|
+
cookie?: never;
|
|
3530
|
+
};
|
|
3531
|
+
requestBody?: never;
|
|
3532
|
+
responses: {
|
|
3533
|
+
/** @description OK */
|
|
3534
|
+
200: {
|
|
3535
|
+
headers: {
|
|
3536
|
+
[name: string]: unknown;
|
|
3537
|
+
};
|
|
3538
|
+
content: {
|
|
3539
|
+
"application/json": components["schemas"]["RefundQuote"];
|
|
3540
|
+
};
|
|
3541
|
+
};
|
|
3542
|
+
default: components["responses"]["Error"];
|
|
3543
|
+
};
|
|
3544
|
+
};
|
|
3268
3545
|
"list-transactions": {
|
|
3269
3546
|
parameters: {
|
|
3270
3547
|
query?: {
|
|
@@ -3305,7 +3582,7 @@ export interface operations {
|
|
|
3305
3582
|
page_size?: components["parameters"]["PageSize"];
|
|
3306
3583
|
/** @description Restrict to one of your accounts. All of them when omitted. */
|
|
3307
3584
|
billing_account_id?: components["parameters"]["AccountIdQuery"];
|
|
3308
|
-
status?: "active" | "
|
|
3585
|
+
status?: "active" | "depleted" | "expired" | "voided";
|
|
3309
3586
|
};
|
|
3310
3587
|
header?: never;
|
|
3311
3588
|
path?: never;
|
|
@@ -3334,6 +3611,8 @@ export interface operations {
|
|
|
3334
3611
|
page_size?: components["parameters"]["PageSize"];
|
|
3335
3612
|
/** @description Restrict to one of your accounts. All of them when omitted. */
|
|
3336
3613
|
billing_account_id?: components["parameters"]["AccountIdQuery"];
|
|
3614
|
+
/** @description `transaction` is money paid in, `credit_grant` is granted credit or a voucher. */
|
|
3615
|
+
source_type?: "transaction" | "credit_grant";
|
|
3337
3616
|
source_id?: string;
|
|
3338
3617
|
target_id?: string;
|
|
3339
3618
|
};
|
|
@@ -3383,6 +3662,31 @@ export interface operations {
|
|
|
3383
3662
|
default: components["responses"]["Error"];
|
|
3384
3663
|
};
|
|
3385
3664
|
};
|
|
3665
|
+
"request-refund": {
|
|
3666
|
+
parameters: {
|
|
3667
|
+
query?: never;
|
|
3668
|
+
header?: never;
|
|
3669
|
+
path?: never;
|
|
3670
|
+
cookie?: never;
|
|
3671
|
+
};
|
|
3672
|
+
requestBody: {
|
|
3673
|
+
content: {
|
|
3674
|
+
"application/json": components["schemas"]["RefundRequest"];
|
|
3675
|
+
};
|
|
3676
|
+
};
|
|
3677
|
+
responses: {
|
|
3678
|
+
/** @description Accepted for processing */
|
|
3679
|
+
201: {
|
|
3680
|
+
headers: {
|
|
3681
|
+
[name: string]: unknown;
|
|
3682
|
+
};
|
|
3683
|
+
content: {
|
|
3684
|
+
"application/json": components["schemas"]["Refund"];
|
|
3685
|
+
};
|
|
3686
|
+
};
|
|
3687
|
+
default: components["responses"]["Error"];
|
|
3688
|
+
};
|
|
3689
|
+
};
|
|
3386
3690
|
"list-usage-charges": {
|
|
3387
3691
|
parameters: {
|
|
3388
3692
|
query?: {
|
|
@@ -3393,6 +3697,8 @@ export interface operations {
|
|
|
3393
3697
|
/** @description Restrict to one of your accounts. All of them when omitted. */
|
|
3394
3698
|
billing_account_id?: components["parameters"]["AccountIdQuery"];
|
|
3395
3699
|
project_id?: string;
|
|
3700
|
+
/** @description Restrict to one service, such as `compute`. */
|
|
3701
|
+
product_key?: string;
|
|
3396
3702
|
resource_id?: string;
|
|
3397
3703
|
from?: components["parameters"]["From"];
|
|
3398
3704
|
/** @description Exclusive. */
|
|
@@ -3649,6 +3955,12 @@ export interface operations {
|
|
|
3649
3955
|
/** @description How many per page, 100 at most. */
|
|
3650
3956
|
page_size?: components["parameters"]["PageSize"];
|
|
3651
3957
|
resource_id?: string;
|
|
3958
|
+
/**
|
|
3959
|
+
* @description Restrict to one service, such as `compute`. Give it alongside `meter_key`: a meter
|
|
3960
|
+
* name is unique only within its own service, and more than one service may measure
|
|
3961
|
+
* `traffic_bytes`, so `meter_key` on its own can return charges from several.
|
|
3962
|
+
*/
|
|
3963
|
+
product_key?: string;
|
|
3652
3964
|
meter_key?: string;
|
|
3653
3965
|
from?: components["parameters"]["From"];
|
|
3654
3966
|
/** @description Exclusive. */
|
|
@@ -4013,6 +4325,29 @@ export interface operations {
|
|
|
4013
4325
|
default: components["responses"]["Error"];
|
|
4014
4326
|
};
|
|
4015
4327
|
};
|
|
4328
|
+
"get-order-refund-quote": {
|
|
4329
|
+
parameters: {
|
|
4330
|
+
query?: never;
|
|
4331
|
+
header?: never;
|
|
4332
|
+
path: {
|
|
4333
|
+
orderId: components["parameters"]["OrderId"];
|
|
4334
|
+
};
|
|
4335
|
+
cookie?: never;
|
|
4336
|
+
};
|
|
4337
|
+
requestBody?: never;
|
|
4338
|
+
responses: {
|
|
4339
|
+
/** @description OK */
|
|
4340
|
+
200: {
|
|
4341
|
+
headers: {
|
|
4342
|
+
[name: string]: unknown;
|
|
4343
|
+
};
|
|
4344
|
+
content: {
|
|
4345
|
+
"application/json": components["schemas"]["RefundQuote"];
|
|
4346
|
+
};
|
|
4347
|
+
};
|
|
4348
|
+
default: components["responses"]["Error"];
|
|
4349
|
+
};
|
|
4350
|
+
};
|
|
4016
4351
|
"list-project-order-items": {
|
|
4017
4352
|
parameters: {
|
|
4018
4353
|
query?: {
|