@leaflow/sdk 0.116.0 → 0.117.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/dist/billing/v1/generated/functions.d.ts +172 -35
- package/dist/billing/v1/generated/functions.js +199 -29
- package/dist/billing/v1/generated/models.d.ts +247 -105
- package/dist/billing/v1/generated/models.js +14 -5
- package/dist/billing/v1/generated/schemas.zod.d.ts +125 -31
- package/dist/billing/v1/generated/schemas.zod.js +128 -22
- package/dist/billing/v1/generated/validators/accountBalance.zod.d.ts +3 -1
- package/dist/billing/v1/generated/validators/accountBalance.zod.js +5 -3
- package/dist/billing/v1/generated/validators/billingAccount.zod.d.ts +1 -9
- package/dist/billing/v1/generated/validators/billingAccount.zod.js +4 -12
- package/dist/billing/v1/generated/validators/billingAccountCreate.zod.d.ts +0 -4
- package/dist/billing/v1/generated/validators/billingAccountCreate.zod.js +0 -4
- package/dist/billing/v1/generated/validators/billingAccountList.zod.d.ts +1 -9
- package/dist/billing/v1/generated/validators/billingAccountUpdate.zod.d.ts +1 -19
- package/dist/billing/v1/generated/validators/billingAccountUpdate.zod.js +4 -23
- package/dist/billing/v1/generated/validators/contact.zod.d.ts +37 -0
- package/dist/billing/v1/generated/validators/contact.zod.js +37 -0
- package/dist/billing/v1/generated/validators/contactCreate.zod.d.ts +32 -0
- package/dist/billing/v1/generated/validators/contactCreate.zod.js +30 -0
- package/dist/billing/v1/generated/validators/contactList.zod.d.ts +34 -0
- package/dist/billing/v1/generated/validators/contactList.zod.js +14 -0
- package/dist/billing/v1/generated/validators/contactUpdate.zod.d.ts +33 -0
- package/dist/billing/v1/generated/validators/contactUpdate.zod.js +31 -0
- package/dist/billing/v1/generated/validators/getStatementUsageParams.zod.d.ts +29 -0
- package/dist/billing/v1/generated/validators/getStatementUsageParams.zod.js +33 -0
- package/dist/billing/v1/generated/validators/invoice.zod.d.ts +1 -6
- package/dist/billing/v1/generated/validators/invoice.zod.js +4 -8
- package/dist/billing/v1/generated/validators/invoiceItem.zod.d.ts +0 -2
- package/dist/billing/v1/generated/validators/invoiceItem.zod.js +0 -5
- package/dist/billing/v1/generated/validators/invoiceItemList.zod.d.ts +0 -2
- package/dist/billing/v1/generated/validators/invoiceList.zod.d.ts +1 -6
- package/dist/billing/v1/generated/validators/invoiceStatus.zod.js +1 -1
- package/dist/billing/v1/generated/validators/listContactsParams.zod.d.ts +18 -0
- package/dist/billing/v1/generated/validators/listContactsParams.zod.js +20 -0
- package/dist/billing/v1/generated/validators/listStatementsParams.zod.d.ts +25 -0
- package/dist/billing/v1/generated/validators/listStatementsParams.zod.js +25 -0
- package/dist/billing/v1/generated/validators/listUsageChargesParams.zod.d.ts +1 -0
- package/dist/billing/v1/generated/validators/listUsageChargesParams.zod.js +1 -0
- package/dist/billing/v1/generated/validators/order.zod.d.ts +1 -0
- package/dist/billing/v1/generated/validators/orderItem.zod.d.ts +1 -0
- package/dist/billing/v1/generated/validators/orderItem.zod.js +4 -0
- package/dist/billing/v1/generated/validators/orderItemList.zod.d.ts +1 -0
- package/dist/billing/v1/generated/validators/orderList.zod.d.ts +1 -0
- package/dist/billing/v1/generated/validators/statement.zod.d.ts +34 -0
- package/dist/billing/v1/generated/validators/statement.zod.js +36 -0
- package/dist/billing/v1/generated/validators/statementAmounts.zod.d.ts +16 -0
- package/dist/billing/v1/generated/validators/statementAmounts.zod.js +15 -0
- package/dist/billing/v1/generated/validators/statementItem.zod.d.ts +20 -0
- package/dist/billing/v1/generated/validators/statementItem.zod.js +25 -0
- package/dist/billing/v1/generated/validators/statementList.zod.d.ts +41 -0
- package/dist/billing/v1/generated/validators/statementList.zod.js +14 -0
- package/dist/billing/v1/generated/validators/statementStatus.zod.d.ts +14 -0
- package/dist/billing/v1/generated/validators/statementStatus.zod.js +9 -0
- package/dist/billing/v1/generated/validators/statementSummary.zod.d.ts +36 -0
- package/dist/billing/v1/generated/validators/statementSummary.zod.js +19 -0
- package/dist/billing/v1/generated/validators/usageCharge.zod.d.ts +1 -0
- package/dist/billing/v1/generated/validators/usageCharge.zod.js +3 -2
- package/dist/billing/v1/generated/validators/usageChargeList.zod.d.ts +1 -0
- package/dist/routes.d.ts +64 -8
- package/dist/routes.js +72 -9
- package/package.json +1 -1
- package/dist/billing/v1/generated/validators/meteredUsage.zod.d.ts +0 -20
- package/dist/billing/v1/generated/validators/meteredUsage.zod.js +0 -27
|
@@ -517,21 +517,14 @@ export declare const BillingAccountStatus: {
|
|
|
517
517
|
readonly closed: "closed";
|
|
518
518
|
};
|
|
519
519
|
export interface BillingAccount {
|
|
520
|
+
/**
|
|
521
|
+
* The active contact used for invoicing. Must belong to this account; null clears the selection.
|
|
522
|
+
* @nullable
|
|
523
|
+
*/
|
|
524
|
+
invoice_contact_id?: string | null;
|
|
520
525
|
id: number;
|
|
521
526
|
/** What you call this account. */
|
|
522
527
|
name?: string;
|
|
523
|
-
/** The name invoices are made out to. Copied onto each invoice when it is issued. */
|
|
524
|
-
legal_name?: string;
|
|
525
|
-
/** Where invoices are sent. */
|
|
526
|
-
email?: string;
|
|
527
|
-
address_line1?: string;
|
|
528
|
-
address_line2?: string;
|
|
529
|
-
address_city?: string;
|
|
530
|
-
address_state?: string;
|
|
531
|
-
address_postal_code?: string;
|
|
532
|
-
/** Two-letter code. */
|
|
533
|
-
address_country?: string;
|
|
534
|
-
tax_id?: string;
|
|
535
528
|
/** Fixed when the account was opened. */
|
|
536
529
|
currency: string;
|
|
537
530
|
status: BillingAccountStatus;
|
|
@@ -588,35 +581,15 @@ export interface BillingAccountCreate {
|
|
|
588
581
|
currency: string;
|
|
589
582
|
/** @maxLength 255 */
|
|
590
583
|
name?: string;
|
|
591
|
-
/** @maxLength 255 */
|
|
592
|
-
legal_name?: string;
|
|
593
|
-
/** @maxLength 255 */
|
|
594
|
-
email?: string;
|
|
595
584
|
}
|
|
596
585
|
export interface BillingAccountUpdate {
|
|
597
|
-
/** @maxLength 255 */
|
|
598
|
-
name?: string;
|
|
599
|
-
/** @maxLength 255 */
|
|
600
|
-
legal_name?: string;
|
|
601
|
-
/** @maxLength 255 */
|
|
602
|
-
email?: string;
|
|
603
|
-
/** @maxLength 255 */
|
|
604
|
-
address_line1?: string;
|
|
605
|
-
/** @maxLength 255 */
|
|
606
|
-
address_line2?: string;
|
|
607
|
-
/** @maxLength 128 */
|
|
608
|
-
address_city?: string;
|
|
609
|
-
/** @maxLength 128 */
|
|
610
|
-
address_state?: string;
|
|
611
|
-
/** @maxLength 32 */
|
|
612
|
-
address_postal_code?: string;
|
|
613
586
|
/**
|
|
614
|
-
*
|
|
615
|
-
* @
|
|
587
|
+
* The active contact used for invoicing. Must belong to this account; null clears the selection.
|
|
588
|
+
* @nullable
|
|
616
589
|
*/
|
|
617
|
-
|
|
618
|
-
/** @maxLength
|
|
619
|
-
|
|
590
|
+
invoice_contact_id?: string | null;
|
|
591
|
+
/** @maxLength 255 */
|
|
592
|
+
name?: string;
|
|
620
593
|
}
|
|
621
594
|
export interface BillingAccountList {
|
|
622
595
|
items: BillingAccount[];
|
|
@@ -721,6 +694,10 @@ export interface CreditGroup {
|
|
|
721
694
|
* Account balance, credits, and unpaid charges are reported separately.
|
|
722
695
|
*/
|
|
723
696
|
export interface AccountBalance {
|
|
697
|
+
/** Balance minus pending balance returns, unbilled usage estimates and issued unpaid amounts. Credit grants are excluded; the result may be negative. */
|
|
698
|
+
available_credit: Money;
|
|
699
|
+
/** Current estimate of rated usage that has not been invoiced. Final pricing and tax are fixed at issuance. */
|
|
700
|
+
unbilled_amount: Money;
|
|
724
701
|
billing_account_id: number;
|
|
725
702
|
currency: string;
|
|
726
703
|
/**
|
|
@@ -734,17 +711,7 @@ export interface AccountBalance {
|
|
|
734
711
|
* credits balance does not imply that due is zero.
|
|
735
712
|
*/
|
|
736
713
|
credits: Money;
|
|
737
|
-
/**
|
|
738
|
-
* balance plus credits, the sum shown as the account's funds. Credits count at their recorded remaining
|
|
739
|
-
* amount, including restricted grants that only pay for what they allow, so total is an upper bound of what
|
|
740
|
-
* the account can pay with rather than a withdrawable amount. due is reported separately and is not subtracted.
|
|
741
|
-
*/
|
|
742
|
-
total: Money;
|
|
743
|
-
/**
|
|
744
|
-
* The part of currently valid credit that only pays for what its restrictions allow, such as a single
|
|
745
|
-
* service, a billing type or a first purchase. The rest of the valid credit pays for anything on the account.
|
|
746
|
-
* Included in credits and therefore in total.
|
|
747
|
-
*/
|
|
714
|
+
/** Currently valid credit whose use has applicable product, operation or eligibility conditions. Included in credits, separate from the balance. */
|
|
748
715
|
restricted_credits: Money;
|
|
749
716
|
/**
|
|
750
717
|
* Currently valid, unspent credit grouped by permitted use. Restrictions and
|
|
@@ -752,31 +719,9 @@ export interface AccountBalance {
|
|
|
752
719
|
* spendable balance and may differ from the recorded credits total.
|
|
753
720
|
*/
|
|
754
721
|
credit_groups: CreditGroup[];
|
|
755
|
-
/**
|
|
756
|
-
* Owed and not yet paid: metered usage that balance and applicable credit could not cover as it was
|
|
757
|
-
* charged, and issued usage invoices still unpaid. The account is in arrears while this
|
|
758
|
-
* is above zero. Topping up pays it on the next collection.
|
|
759
|
-
*/
|
|
722
|
+
/** Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
|
|
760
723
|
due: Money;
|
|
761
|
-
|
|
762
|
-
export interface MeteredUsage {
|
|
763
|
-
billing_account_id: number;
|
|
764
|
-
currency: string;
|
|
765
|
-
/** Resources still metered in the projects the account currently pays for. */
|
|
766
|
-
active_resource_count: number;
|
|
767
|
-
/** Subscriptions billed by usage that the account currently pays for and that have not ended. */
|
|
768
|
-
postpaid_subscription_count: number;
|
|
769
|
-
/** The start of the seven days the amounts cover. */
|
|
770
|
-
window_start: string;
|
|
771
|
-
/** The end of those seven days, the time usage was last priced. */
|
|
772
|
-
window_end: string;
|
|
773
|
-
/** Usage priced in the window, before tax and before credit grants. Usage not yet priced is not included. */
|
|
774
|
-
amount: Money;
|
|
775
|
-
/**
|
|
776
|
-
* `amount` per day. Over the window, or over the part of it since the account's usage began
|
|
777
|
-
* when that is shorter, counting at least one day.
|
|
778
|
-
*/
|
|
779
|
-
average_daily_amount: Money;
|
|
724
|
+
pending_returns_amount: Money;
|
|
780
725
|
}
|
|
781
726
|
/**
|
|
782
727
|
* A project's assignment to a billing account for the interval from effective_from to effective_to. An open-ended assignment has no end time.
|
|
@@ -1243,20 +1188,11 @@ export interface PaymentResult {
|
|
|
1243
1188
|
failure_reason?: string;
|
|
1244
1189
|
}
|
|
1245
1190
|
/**
|
|
1246
|
-
*
|
|
1247
|
-
*
|
|
1248
|
-
*
|
|
1249
|
-
*
|
|
1250
|
-
*
|
|
1251
|
-
* and paid from credits and balance as it goes. It is issued at the end of the month, becoming
|
|
1252
|
-
* `paid` when everything was covered and `open` when something is still owed.
|
|
1253
|
-
*
|
|
1254
|
-
* `refunded` means the invoice was paid and has since been refunded in full; a partial refund
|
|
1255
|
-
* leaves it `paid`, with the refunded part in `amount_refunded`.
|
|
1256
|
-
*
|
|
1257
|
-
* `void` means the invoice will not be paid and holds no money: nothing was paid, or its order
|
|
1258
|
-
* failed or was canceled and everything paid toward it has been returned, as `amount_paid` and
|
|
1259
|
-
* `amount_refunded` show.
|
|
1191
|
+
* Draft invoices are private to administrators and cannot be read, listed or paid by customers.
|
|
1192
|
+
* An issued invoice is open until settled; a zero-total issued invoice is immediately paid.
|
|
1193
|
+
* Unbilled usage remains separate from invoices until it is invoiced.
|
|
1194
|
+
* refunded means a full refund; a partial refund leaves the invoice paid.
|
|
1195
|
+
* void means collection has stopped and any funds received have been returned.
|
|
1260
1196
|
*/
|
|
1261
1197
|
export type InvoiceStatus = (typeof InvoiceStatus)[keyof typeof InvoiceStatus];
|
|
1262
1198
|
export declare const InvoiceStatus: {
|
|
@@ -1267,15 +1203,6 @@ export declare const InvoiceStatus: {
|
|
|
1267
1203
|
readonly void: "void";
|
|
1268
1204
|
readonly uncollectible: "uncollectible";
|
|
1269
1205
|
};
|
|
1270
|
-
/**
|
|
1271
|
-
* What produced it — metered usage for a period, a purchase, or a correction.
|
|
1272
|
-
*/
|
|
1273
|
-
export type InvoiceType = (typeof InvoiceType)[keyof typeof InvoiceType];
|
|
1274
|
-
export declare const InvoiceType: {
|
|
1275
|
-
readonly usage: "usage";
|
|
1276
|
-
readonly order: "order";
|
|
1277
|
-
readonly adjustment: "adjustment";
|
|
1278
|
-
};
|
|
1279
1206
|
/**
|
|
1280
1207
|
* Tax name, rate and amounts frozen on the invoice.
|
|
1281
1208
|
*/
|
|
@@ -1291,17 +1218,15 @@ export interface TaxItem {
|
|
|
1291
1218
|
currency: string;
|
|
1292
1219
|
}
|
|
1293
1220
|
export interface Invoice {
|
|
1221
|
+
/** Collection has been stopped; any accepted return obligations are completed before final voiding. */
|
|
1222
|
+
void_requested_at?: string;
|
|
1294
1223
|
due_at?: string;
|
|
1295
1224
|
amount_refunded?: string;
|
|
1296
1225
|
tax_items: TaxItem[];
|
|
1297
|
-
/** The purchase that produced this invoice. Absent on usage invoices. */
|
|
1298
|
-
order_id?: string;
|
|
1299
1226
|
id: string;
|
|
1300
1227
|
billing_account_id: number;
|
|
1301
1228
|
/** Numbered per account and per month. */
|
|
1302
1229
|
number: string;
|
|
1303
|
-
/** What produced it — metered usage for a period, a purchase, or a correction. */
|
|
1304
|
-
type?: InvoiceType;
|
|
1305
1230
|
currency: string;
|
|
1306
1231
|
status: InvoiceStatus;
|
|
1307
1232
|
/**
|
|
@@ -1360,7 +1285,6 @@ export declare const InvoiceItemType: {
|
|
|
1360
1285
|
readonly adjustment: "adjustment";
|
|
1361
1286
|
};
|
|
1362
1287
|
export interface InvoiceItem {
|
|
1363
|
-
recurring_amount?: string;
|
|
1364
1288
|
taxable?: boolean;
|
|
1365
1289
|
/** Discount applied to this line before tax. */
|
|
1366
1290
|
discount_amount?: string;
|
|
@@ -1368,8 +1292,6 @@ export interface InvoiceItem {
|
|
|
1368
1292
|
tax_amount?: string;
|
|
1369
1293
|
/** The part of tax_amount already included in amount. */
|
|
1370
1294
|
tax_included_amount?: string;
|
|
1371
|
-
/** The original order line. Refunds follow that line's original payment sources. */
|
|
1372
|
-
order_item_id?: string;
|
|
1373
1295
|
id: string;
|
|
1374
1296
|
type?: InvoiceItemType;
|
|
1375
1297
|
/** @nullable */
|
|
@@ -1628,15 +1550,17 @@ export interface UsageCharge {
|
|
|
1628
1550
|
amount?: Money;
|
|
1629
1551
|
currency: string;
|
|
1630
1552
|
/**
|
|
1631
|
-
* The usage invoice this charge was added to. Absent
|
|
1553
|
+
* The usage invoice this charge was added to. Absent until its statement closes and always absent for unrated charges.
|
|
1632
1554
|
* @nullable
|
|
1633
1555
|
*/
|
|
1634
1556
|
invoice_id?: string | null;
|
|
1635
1557
|
/**
|
|
1636
|
-
* The usage invoice line this charge was summed into. Absent
|
|
1558
|
+
* The usage invoice line this charge was summed into. Absent until its statement closes and always absent for unrated charges.
|
|
1637
1559
|
* @nullable
|
|
1638
1560
|
*/
|
|
1639
1561
|
invoice_item_id?: string | null;
|
|
1562
|
+
/** The statement this charge was collected into. */
|
|
1563
|
+
statement_id?: string;
|
|
1640
1564
|
}
|
|
1641
1565
|
export interface UsageChargeList {
|
|
1642
1566
|
items: UsageCharge[];
|
|
@@ -2014,6 +1938,8 @@ export type OrderItemConfiguration = {
|
|
|
2014
1938
|
* purchase creates its pending subscription when this item is recorded, not when payment succeeds.
|
|
2015
1939
|
*/
|
|
2016
1940
|
export interface OrderItem {
|
|
1941
|
+
/** Financial lines produced by this purchase item, including setup charges. */
|
|
1942
|
+
invoice_item_ids?: string[];
|
|
2017
1943
|
/** @minimum 0 */
|
|
2018
1944
|
position?: number;
|
|
2019
1945
|
configuration?: OrderItemConfiguration;
|
|
@@ -2647,6 +2573,94 @@ export interface QuoteRequest {
|
|
|
2647
2573
|
promotion_code?: string;
|
|
2648
2574
|
refund?: OrderRefundQuoteInput;
|
|
2649
2575
|
}
|
|
2576
|
+
/**
|
|
2577
|
+
* A billing-account contact profile with one address. An account can hold multiple contacts; this is not a login identity.
|
|
2578
|
+
*/
|
|
2579
|
+
export interface Contact {
|
|
2580
|
+
id: string;
|
|
2581
|
+
billing_account_id: number;
|
|
2582
|
+
/**
|
|
2583
|
+
* @minLength 1
|
|
2584
|
+
* @maxLength 255
|
|
2585
|
+
*/
|
|
2586
|
+
name: string;
|
|
2587
|
+
/** @maxLength 255 */
|
|
2588
|
+
legal_name?: string;
|
|
2589
|
+
/** @maxLength 255 */
|
|
2590
|
+
email?: string;
|
|
2591
|
+
/** @maxLength 64 */
|
|
2592
|
+
tax_id?: string;
|
|
2593
|
+
/** @maxLength 255 */
|
|
2594
|
+
address_line1?: string;
|
|
2595
|
+
/** @maxLength 255 */
|
|
2596
|
+
address_line2?: string;
|
|
2597
|
+
/** @maxLength 128 */
|
|
2598
|
+
address_city?: string;
|
|
2599
|
+
/** @maxLength 128 */
|
|
2600
|
+
address_state?: string;
|
|
2601
|
+
/** @maxLength 32 */
|
|
2602
|
+
address_postal_code?: string;
|
|
2603
|
+
/** @pattern ^([A-Z]{2})?$ */
|
|
2604
|
+
address_country?: string;
|
|
2605
|
+
tax_exempt: boolean;
|
|
2606
|
+
active: boolean;
|
|
2607
|
+
created_at: string;
|
|
2608
|
+
}
|
|
2609
|
+
export interface ContactCreate {
|
|
2610
|
+
/**
|
|
2611
|
+
* @minLength 1
|
|
2612
|
+
* @maxLength 255
|
|
2613
|
+
*/
|
|
2614
|
+
name: string;
|
|
2615
|
+
/** @maxLength 255 */
|
|
2616
|
+
legal_name?: string;
|
|
2617
|
+
/** @maxLength 255 */
|
|
2618
|
+
email?: string;
|
|
2619
|
+
/** @maxLength 64 */
|
|
2620
|
+
tax_id?: string;
|
|
2621
|
+
/** @maxLength 255 */
|
|
2622
|
+
address_line1?: string;
|
|
2623
|
+
/** @maxLength 255 */
|
|
2624
|
+
address_line2?: string;
|
|
2625
|
+
/** @maxLength 128 */
|
|
2626
|
+
address_city?: string;
|
|
2627
|
+
/** @maxLength 128 */
|
|
2628
|
+
address_state?: string;
|
|
2629
|
+
/** @maxLength 32 */
|
|
2630
|
+
address_postal_code?: string;
|
|
2631
|
+
/** @pattern ^([A-Z]{2})?$ */
|
|
2632
|
+
address_country?: string;
|
|
2633
|
+
}
|
|
2634
|
+
export interface ContactUpdate {
|
|
2635
|
+
/**
|
|
2636
|
+
* @minLength 1
|
|
2637
|
+
* @maxLength 255
|
|
2638
|
+
*/
|
|
2639
|
+
name?: string;
|
|
2640
|
+
/** @maxLength 255 */
|
|
2641
|
+
legal_name?: string;
|
|
2642
|
+
/** @maxLength 255 */
|
|
2643
|
+
email?: string;
|
|
2644
|
+
/** @maxLength 64 */
|
|
2645
|
+
tax_id?: string;
|
|
2646
|
+
/** @maxLength 255 */
|
|
2647
|
+
address_line1?: string;
|
|
2648
|
+
/** @maxLength 255 */
|
|
2649
|
+
address_line2?: string;
|
|
2650
|
+
/** @maxLength 128 */
|
|
2651
|
+
address_city?: string;
|
|
2652
|
+
/** @maxLength 128 */
|
|
2653
|
+
address_state?: string;
|
|
2654
|
+
/** @maxLength 32 */
|
|
2655
|
+
address_postal_code?: string;
|
|
2656
|
+
/** @pattern ^([A-Z]{2})?$ */
|
|
2657
|
+
address_country?: string;
|
|
2658
|
+
active?: boolean;
|
|
2659
|
+
}
|
|
2660
|
+
export interface ContactList {
|
|
2661
|
+
items: Contact[];
|
|
2662
|
+
pagination: OffsetPagination;
|
|
2663
|
+
}
|
|
2650
2664
|
/**
|
|
2651
2665
|
* Pagination metadata for keyset traversal. Pass next_cursor as cursor to read the following page; null means there is no following page.
|
|
2652
2666
|
*/
|
|
@@ -2665,6 +2679,70 @@ export interface CancelSubscriptionRequest {
|
|
|
2665
2679
|
/** @maxLength 1024 */
|
|
2666
2680
|
reason?: string;
|
|
2667
2681
|
}
|
|
2682
|
+
export interface StatementAmounts {
|
|
2683
|
+
subtotal: Money;
|
|
2684
|
+
discount_amount: Money;
|
|
2685
|
+
tax_amount: Money;
|
|
2686
|
+
total: Money;
|
|
2687
|
+
}
|
|
2688
|
+
export type StatementStatus = (typeof StatementStatus)[keyof typeof StatementStatus];
|
|
2689
|
+
export declare const StatementStatus: {
|
|
2690
|
+
readonly open: "open";
|
|
2691
|
+
readonly closed: "closed";
|
|
2692
|
+
};
|
|
2693
|
+
/**
|
|
2694
|
+
* An account's consumption for one billing period, collected at one closing. The first statement of a period (sequence 1) closes after the period ends. Usage priced after that closing is collected in a later statement for the same period, which closes and invoices separately; a closed statement is never rewritten. Payments apply to issued invoices.
|
|
2695
|
+
*/
|
|
2696
|
+
export interface Statement {
|
|
2697
|
+
id: string;
|
|
2698
|
+
billing_account_id: number;
|
|
2699
|
+
currency: string;
|
|
2700
|
+
period_start: string;
|
|
2701
|
+
period_end: string;
|
|
2702
|
+
/** 1 for the first closing of the period; higher for statements that collect usage priced after an earlier closing. */
|
|
2703
|
+
sequence: number;
|
|
2704
|
+
status: StatementStatus;
|
|
2705
|
+
/** True while the statement is open. The estimate applies tier pricing to the period's usage so far and adds tax for the current invoice contact. Minimum charges are added at closing, and a tier reduction larger than this statement's own charges is credited to earlier invoices of the period at closing. */
|
|
2706
|
+
estimated: boolean;
|
|
2707
|
+
amounts: StatementAmounts;
|
|
2708
|
+
closed_at?: string;
|
|
2709
|
+
/** The invoice issued at this closing, when it produced one. */
|
|
2710
|
+
invoice_id?: string;
|
|
2711
|
+
created_at: string;
|
|
2712
|
+
calculated_at?: string;
|
|
2713
|
+
credited_amount: Money;
|
|
2714
|
+
}
|
|
2715
|
+
export interface StatementList {
|
|
2716
|
+
items: Statement[];
|
|
2717
|
+
pagination: OffsetPagination;
|
|
2718
|
+
}
|
|
2719
|
+
export interface StatementItem {
|
|
2720
|
+
project_id?: string;
|
|
2721
|
+
product_id?: string;
|
|
2722
|
+
meter_id?: string;
|
|
2723
|
+
unit?: string;
|
|
2724
|
+
/** Net usage quantity. Included only when grouping by meter. */
|
|
2725
|
+
quantity?: string;
|
|
2726
|
+
deducted_quantity?: string;
|
|
2727
|
+
/** Usage that had no applicable price when it occurred. It is not charged, either now or later. */
|
|
2728
|
+
unrated_quantity?: string;
|
|
2729
|
+
amount: Money;
|
|
2730
|
+
}
|
|
2731
|
+
export type StatementSummaryGroupBy = (typeof StatementSummaryGroupBy)[keyof typeof StatementSummaryGroupBy];
|
|
2732
|
+
export declare const StatementSummaryGroupBy: {
|
|
2733
|
+
readonly project: "project";
|
|
2734
|
+
readonly product: "product";
|
|
2735
|
+
readonly meter: "meter";
|
|
2736
|
+
};
|
|
2737
|
+
export interface StatementSummary {
|
|
2738
|
+
statement_id: string;
|
|
2739
|
+
currency: string;
|
|
2740
|
+
estimated: boolean;
|
|
2741
|
+
calculated_at?: string;
|
|
2742
|
+
group_by: StatementSummaryGroupBy;
|
|
2743
|
+
items: StatementItem[];
|
|
2744
|
+
pagination: OffsetPagination;
|
|
2745
|
+
}
|
|
2668
2746
|
/**
|
|
2669
2747
|
* Error
|
|
2670
2748
|
*/
|
|
@@ -2698,6 +2776,20 @@ export type ToRequiredParameter = string;
|
|
|
2698
2776
|
* Restrict the account-authorized results to these projects. Omit for all projects and account-level records. This filter does not grant access to another billing account.
|
|
2699
2777
|
*/
|
|
2700
2778
|
export type ProjectIdsQueryParameter = string[];
|
|
2779
|
+
export type ListContactsParams = {
|
|
2780
|
+
/**
|
|
2781
|
+
* 1-based page number. Defaults to 1.
|
|
2782
|
+
* @minimum 1
|
|
2783
|
+
* @maximum 2147483647
|
|
2784
|
+
*/
|
|
2785
|
+
page?: number;
|
|
2786
|
+
/**
|
|
2787
|
+
* Items per page. Defaults to 50; at most 200.
|
|
2788
|
+
* @minimum 1
|
|
2789
|
+
* @maximum 200
|
|
2790
|
+
*/
|
|
2791
|
+
page_size?: number;
|
|
2792
|
+
};
|
|
2701
2793
|
export type ListCurrenciesParams = {
|
|
2702
2794
|
/**
|
|
2703
2795
|
* 1-based page number. Defaults to 1.
|
|
@@ -3011,6 +3103,7 @@ export type ListUsageChargesParams = {
|
|
|
3011
3103
|
*/
|
|
3012
3104
|
project_ids?: ProjectIdsQueryParameter;
|
|
3013
3105
|
meter_id?: string;
|
|
3106
|
+
statement_id?: string;
|
|
3014
3107
|
};
|
|
3015
3108
|
export type ListSubscriptionsParams = {
|
|
3016
3109
|
expiring_before?: string;
|
|
@@ -3410,7 +3503,8 @@ export type ListSpendParams = {
|
|
|
3410
3503
|
*/
|
|
3411
3504
|
to: ToRequiredParameter;
|
|
3412
3505
|
/**
|
|
3413
|
-
* `
|
|
3506
|
+
* `plan` groups by the plan of the price each charge was priced with, which stays the same after the
|
|
3507
|
+
* subscription changes plan. `resource` groups by the resource each charge names. Items billed under their own
|
|
3414
3508
|
* identifier — a disk, a public address — appear as their own rows rather than under
|
|
3415
3509
|
* the machine they are attached to, since the relationship between them is known to
|
|
3416
3510
|
* the owning service and not here.
|
|
@@ -3449,3 +3543,51 @@ export declare const ListSpendGroupBy: {
|
|
|
3449
3543
|
readonly plan: "plan";
|
|
3450
3544
|
readonly resource: "resource";
|
|
3451
3545
|
};
|
|
3546
|
+
export type ListStatementsParams = {
|
|
3547
|
+
billing_account_id?: number;
|
|
3548
|
+
status?: StatementStatus;
|
|
3549
|
+
from?: string;
|
|
3550
|
+
to?: string;
|
|
3551
|
+
/**
|
|
3552
|
+
* 1-based page number. Defaults to 1.
|
|
3553
|
+
* @minimum 1
|
|
3554
|
+
* @maximum 2147483647
|
|
3555
|
+
*/
|
|
3556
|
+
page?: number;
|
|
3557
|
+
/**
|
|
3558
|
+
* Items per page. Defaults to 50; at most 200.
|
|
3559
|
+
* @minimum 1
|
|
3560
|
+
* @maximum 200
|
|
3561
|
+
*/
|
|
3562
|
+
page_size?: number;
|
|
3563
|
+
};
|
|
3564
|
+
export type GetStatementUsageParams = {
|
|
3565
|
+
group_by?: GetStatementUsageGroupBy;
|
|
3566
|
+
/**
|
|
3567
|
+
* @maxItems 100
|
|
3568
|
+
*/
|
|
3569
|
+
project_ids?: string[];
|
|
3570
|
+
/**
|
|
3571
|
+
* @maxLength 64
|
|
3572
|
+
*/
|
|
3573
|
+
product_id?: string;
|
|
3574
|
+
meter_id?: string;
|
|
3575
|
+
/**
|
|
3576
|
+
* 1-based page number. Defaults to 1.
|
|
3577
|
+
* @minimum 1
|
|
3578
|
+
* @maximum 2147483647
|
|
3579
|
+
*/
|
|
3580
|
+
page?: number;
|
|
3581
|
+
/**
|
|
3582
|
+
* Items per page. Defaults to 50; at most 200.
|
|
3583
|
+
* @minimum 1
|
|
3584
|
+
* @maximum 200
|
|
3585
|
+
*/
|
|
3586
|
+
page_size?: number;
|
|
3587
|
+
};
|
|
3588
|
+
export type GetStatementUsageGroupBy = (typeof GetStatementUsageGroupBy)[keyof typeof GetStatementUsageGroupBy];
|
|
3589
|
+
export declare const GetStatementUsageGroupBy: {
|
|
3590
|
+
readonly project: "project";
|
|
3591
|
+
readonly product: "product";
|
|
3592
|
+
readonly meter: "meter";
|
|
3593
|
+
};
|
|
@@ -141,11 +141,6 @@ export const InvoiceStatus = {
|
|
|
141
141
|
void: "void",
|
|
142
142
|
uncollectible: "uncollectible",
|
|
143
143
|
};
|
|
144
|
-
export const InvoiceType = {
|
|
145
|
-
usage: "usage",
|
|
146
|
-
order: "order",
|
|
147
|
-
adjustment: "adjustment",
|
|
148
|
-
};
|
|
149
144
|
export const InvoiceItemType = {
|
|
150
145
|
usage: "usage",
|
|
151
146
|
subscription: "subscription",
|
|
@@ -320,6 +315,15 @@ export const ActiveResourceStatus = {
|
|
|
320
315
|
closing: "closing",
|
|
321
316
|
completed: "completed",
|
|
322
317
|
};
|
|
318
|
+
export const StatementStatus = {
|
|
319
|
+
open: "open",
|
|
320
|
+
closed: "closed",
|
|
321
|
+
};
|
|
322
|
+
export const StatementSummaryGroupBy = {
|
|
323
|
+
project: "project",
|
|
324
|
+
product: "product",
|
|
325
|
+
meter: "meter",
|
|
326
|
+
};
|
|
323
327
|
export const ListCreditGrantsStatus = {
|
|
324
328
|
active: "active",
|
|
325
329
|
depleted: "depleted",
|
|
@@ -357,3 +361,8 @@ export const ListSpendGroupBy = {
|
|
|
357
361
|
plan: "plan",
|
|
358
362
|
resource: "resource",
|
|
359
363
|
};
|
|
364
|
+
export const GetStatementUsageGroupBy = {
|
|
365
|
+
project: "project",
|
|
366
|
+
product: "product",
|
|
367
|
+
meter: "meter",
|
|
368
|
+
};
|