@leaflow/sdk 0.115.1 → 0.117.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/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 +252 -112
- package/dist/billing/v1/generated/models.js +16 -8
- 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 +5 -4
- package/dist/billing/v1/generated/validators/accountBalance.zod.js +5 -3
- package/dist/billing/v1/generated/validators/applicability.zod.d.ts +2 -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/creditGrant.zod.d.ts +2 -3
- package/dist/billing/v1/generated/validators/creditGrantList.zod.d.ts +2 -3
- package/dist/billing/v1/generated/validators/creditGroup.zod.d.ts +2 -3
- package/dist/billing/v1/generated/validators/discount.zod.d.ts +2 -3
- package/dist/billing/v1/generated/validators/discountList.zod.d.ts +2 -3
- 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 +2 -1
- 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 +2 -1
- package/dist/billing/v1/generated/validators/purchaseOperation.zod.d.ts +2 -3
- package/dist/billing/v1/generated/validators/purchaseOperation.zod.js +2 -2
- 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 +1 -0
- 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[];
|
|
@@ -676,19 +649,17 @@ export interface PriceOption {
|
|
|
676
649
|
active: boolean;
|
|
677
650
|
}
|
|
678
651
|
/**
|
|
679
|
-
* Which purchase this applies to. `
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
*
|
|
683
|
-
*
|
|
684
|
-
* account's first purchase.
|
|
652
|
+
* Which purchase operation this applies to. `new` covers every new purchase, including
|
|
653
|
+
* zero-charge purchases. It does not mean the account's first purchase; use
|
|
654
|
+
* `first_purchase_only` for that restriction. `renew` covers renewals. `change` covers
|
|
655
|
+
* configuration or billing-term changes, including changes that increase or decrease
|
|
656
|
+
* the amount due and changes with no additional charge or refund.
|
|
685
657
|
*/
|
|
686
658
|
export type PurchaseOperation = (typeof PurchaseOperation)[keyof typeof PurchaseOperation];
|
|
687
659
|
export declare const PurchaseOperation: {
|
|
688
|
-
readonly
|
|
660
|
+
readonly new: "new";
|
|
689
661
|
readonly renew: "renew";
|
|
690
|
-
readonly
|
|
691
|
-
readonly downgrade: "downgrade";
|
|
662
|
+
readonly change: "change";
|
|
692
663
|
};
|
|
693
664
|
/**
|
|
694
665
|
* Anything not excluded that matches an inclusion, or anything not excluded when no inclusion is
|
|
@@ -723,6 +694,10 @@ export interface CreditGroup {
|
|
|
723
694
|
* Account balance, credits, and unpaid charges are reported separately.
|
|
724
695
|
*/
|
|
725
696
|
export interface AccountBalance {
|
|
697
|
+
/** Cash balance minus pending cash 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;
|
|
726
701
|
billing_account_id: number;
|
|
727
702
|
currency: string;
|
|
728
703
|
/**
|
|
@@ -736,17 +711,7 @@ export interface AccountBalance {
|
|
|
736
711
|
* credits balance does not imply that due is zero.
|
|
737
712
|
*/
|
|
738
713
|
credits: Money;
|
|
739
|
-
/**
|
|
740
|
-
* balance plus credits, the sum shown as the account's funds. Credits count at their recorded remaining
|
|
741
|
-
* amount, including restricted grants that only pay for what they allow, so total is an upper bound of what
|
|
742
|
-
* the account can pay with rather than a withdrawable amount. due is reported separately and is not subtracted.
|
|
743
|
-
*/
|
|
744
|
-
total: Money;
|
|
745
|
-
/**
|
|
746
|
-
* The part of currently valid credit that only pays for what its restrictions allow, such as a single
|
|
747
|
-
* service, a billing type or a first purchase. The rest of the valid credit pays for anything on the account.
|
|
748
|
-
* Included in credits and therefore in total.
|
|
749
|
-
*/
|
|
714
|
+
/** Currently valid credit whose use has applicable product, operation or eligibility conditions. Included in credits, separate from cash balance. */
|
|
750
715
|
restricted_credits: Money;
|
|
751
716
|
/**
|
|
752
717
|
* Currently valid, unspent credit grouped by permitted use. Restrictions and
|
|
@@ -754,31 +719,9 @@ export interface AccountBalance {
|
|
|
754
719
|
* spendable balance and may differ from the recorded credits total.
|
|
755
720
|
*/
|
|
756
721
|
credit_groups: CreditGroup[];
|
|
757
|
-
/**
|
|
758
|
-
* Owed and not yet paid: metered usage that balance and applicable credit could not cover as it was
|
|
759
|
-
* charged, and issued usage invoices still unpaid. The account is in arrears while this
|
|
760
|
-
* is above zero. Topping up pays it on the next collection.
|
|
761
|
-
*/
|
|
722
|
+
/** Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
|
|
762
723
|
due: Money;
|
|
763
|
-
|
|
764
|
-
export interface MeteredUsage {
|
|
765
|
-
billing_account_id: number;
|
|
766
|
-
currency: string;
|
|
767
|
-
/** Resources still metered in the projects the account currently pays for. */
|
|
768
|
-
active_resource_count: number;
|
|
769
|
-
/** Subscriptions billed by usage that the account currently pays for and that have not ended. */
|
|
770
|
-
postpaid_subscription_count: number;
|
|
771
|
-
/** The start of the seven days the amounts cover. */
|
|
772
|
-
window_start: string;
|
|
773
|
-
/** The end of those seven days, the time usage was last priced. */
|
|
774
|
-
window_end: string;
|
|
775
|
-
/** Usage priced in the window, before tax and before credit grants. Usage not yet priced is not included. */
|
|
776
|
-
amount: Money;
|
|
777
|
-
/**
|
|
778
|
-
* `amount` per day. Over the window, or over the part of it since the account's usage began
|
|
779
|
-
* when that is shorter, counting at least one day.
|
|
780
|
-
*/
|
|
781
|
-
average_daily_amount: Money;
|
|
724
|
+
pending_returns_amount: Money;
|
|
782
725
|
}
|
|
783
726
|
/**
|
|
784
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.
|
|
@@ -1245,20 +1188,11 @@ export interface PaymentResult {
|
|
|
1245
1188
|
failure_reason?: string;
|
|
1246
1189
|
}
|
|
1247
1190
|
/**
|
|
1248
|
-
*
|
|
1249
|
-
*
|
|
1250
|
-
*
|
|
1251
|
-
*
|
|
1252
|
-
*
|
|
1253
|
-
* and paid from credits and balance as it goes. It is issued at the end of the month, becoming
|
|
1254
|
-
* `paid` when everything was covered and `open` when something is still owed.
|
|
1255
|
-
*
|
|
1256
|
-
* `refunded` means the invoice was paid and has since been refunded in full; a partial refund
|
|
1257
|
-
* leaves it `paid`, with the refunded part in `amount_refunded`.
|
|
1258
|
-
*
|
|
1259
|
-
* `void` means the invoice will not be paid and holds no money: nothing was paid, or its order
|
|
1260
|
-
* failed or was canceled and everything paid toward it has been returned, as `amount_paid` and
|
|
1261
|
-
* `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.
|
|
1262
1196
|
*/
|
|
1263
1197
|
export type InvoiceStatus = (typeof InvoiceStatus)[keyof typeof InvoiceStatus];
|
|
1264
1198
|
export declare const InvoiceStatus: {
|
|
@@ -1269,15 +1203,6 @@ export declare const InvoiceStatus: {
|
|
|
1269
1203
|
readonly void: "void";
|
|
1270
1204
|
readonly uncollectible: "uncollectible";
|
|
1271
1205
|
};
|
|
1272
|
-
/**
|
|
1273
|
-
* What produced it — metered usage for a period, a purchase, or a correction.
|
|
1274
|
-
*/
|
|
1275
|
-
export type InvoiceType = (typeof InvoiceType)[keyof typeof InvoiceType];
|
|
1276
|
-
export declare const InvoiceType: {
|
|
1277
|
-
readonly usage: "usage";
|
|
1278
|
-
readonly order: "order";
|
|
1279
|
-
readonly adjustment: "adjustment";
|
|
1280
|
-
};
|
|
1281
1206
|
/**
|
|
1282
1207
|
* Tax name, rate and amounts frozen on the invoice.
|
|
1283
1208
|
*/
|
|
@@ -1293,17 +1218,15 @@ export interface TaxItem {
|
|
|
1293
1218
|
currency: string;
|
|
1294
1219
|
}
|
|
1295
1220
|
export interface Invoice {
|
|
1221
|
+
/** Collection has been stopped; any accepted return obligations are completed before final voiding. */
|
|
1222
|
+
void_requested_at?: string;
|
|
1296
1223
|
due_at?: string;
|
|
1297
1224
|
amount_refunded?: string;
|
|
1298
1225
|
tax_items: TaxItem[];
|
|
1299
|
-
/** The purchase that produced this invoice. Absent on usage invoices. */
|
|
1300
|
-
order_id?: string;
|
|
1301
1226
|
id: string;
|
|
1302
1227
|
billing_account_id: number;
|
|
1303
1228
|
/** Numbered per account and per month. */
|
|
1304
1229
|
number: string;
|
|
1305
|
-
/** What produced it — metered usage for a period, a purchase, or a correction. */
|
|
1306
|
-
type?: InvoiceType;
|
|
1307
1230
|
currency: string;
|
|
1308
1231
|
status: InvoiceStatus;
|
|
1309
1232
|
/**
|
|
@@ -1362,7 +1285,6 @@ export declare const InvoiceItemType: {
|
|
|
1362
1285
|
readonly adjustment: "adjustment";
|
|
1363
1286
|
};
|
|
1364
1287
|
export interface InvoiceItem {
|
|
1365
|
-
recurring_amount?: string;
|
|
1366
1288
|
taxable?: boolean;
|
|
1367
1289
|
/** Discount applied to this line before tax. */
|
|
1368
1290
|
discount_amount?: string;
|
|
@@ -1370,8 +1292,6 @@ export interface InvoiceItem {
|
|
|
1370
1292
|
tax_amount?: string;
|
|
1371
1293
|
/** The part of tax_amount already included in amount. */
|
|
1372
1294
|
tax_included_amount?: string;
|
|
1373
|
-
/** The original order line. Refunds follow that line's original payment sources. */
|
|
1374
|
-
order_item_id?: string;
|
|
1375
1295
|
id: string;
|
|
1376
1296
|
type?: InvoiceItemType;
|
|
1377
1297
|
/** @nullable */
|
|
@@ -1639,6 +1559,8 @@ export interface UsageCharge {
|
|
|
1639
1559
|
* @nullable
|
|
1640
1560
|
*/
|
|
1641
1561
|
invoice_item_id?: string | null;
|
|
1562
|
+
/** The statement this charge was collected into. */
|
|
1563
|
+
statement_id?: string;
|
|
1642
1564
|
}
|
|
1643
1565
|
export interface UsageChargeList {
|
|
1644
1566
|
items: UsageCharge[];
|
|
@@ -2016,6 +1938,8 @@ export type OrderItemConfiguration = {
|
|
|
2016
1938
|
* purchase creates its pending subscription when this item is recorded, not when payment succeeds.
|
|
2017
1939
|
*/
|
|
2018
1940
|
export interface OrderItem {
|
|
1941
|
+
/** Financial lines produced by this purchase item, including setup charges. */
|
|
1942
|
+
invoice_item_ids?: string[];
|
|
2019
1943
|
/** @minimum 0 */
|
|
2020
1944
|
position?: number;
|
|
2021
1945
|
configuration?: OrderItemConfiguration;
|
|
@@ -2649,6 +2573,94 @@ export interface QuoteRequest {
|
|
|
2649
2573
|
promotion_code?: string;
|
|
2650
2574
|
refund?: OrderRefundQuoteInput;
|
|
2651
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
|
+
}
|
|
2652
2664
|
/**
|
|
2653
2665
|
* Pagination metadata for keyset traversal. Pass next_cursor as cursor to read the following page; null means there is no following page.
|
|
2654
2666
|
*/
|
|
@@ -2667,6 +2679,70 @@ export interface CancelSubscriptionRequest {
|
|
|
2667
2679
|
/** @maxLength 1024 */
|
|
2668
2680
|
reason?: string;
|
|
2669
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 is the priced usage plus tax for the current invoice contact; tier adjustments over the whole period and minimum charges are determined 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 not yet priced; not a zero-cost charge. */
|
|
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
|
+
}
|
|
2670
2746
|
/**
|
|
2671
2747
|
* Error
|
|
2672
2748
|
*/
|
|
@@ -2700,6 +2776,20 @@ export type ToRequiredParameter = string;
|
|
|
2700
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.
|
|
2701
2777
|
*/
|
|
2702
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
|
+
};
|
|
2703
2793
|
export type ListCurrenciesParams = {
|
|
2704
2794
|
/**
|
|
2705
2795
|
* 1-based page number. Defaults to 1.
|
|
@@ -3013,6 +3103,7 @@ export type ListUsageChargesParams = {
|
|
|
3013
3103
|
*/
|
|
3014
3104
|
project_ids?: ProjectIdsQueryParameter;
|
|
3015
3105
|
meter_id?: string;
|
|
3106
|
+
statement_id?: string;
|
|
3016
3107
|
};
|
|
3017
3108
|
export type ListSubscriptionsParams = {
|
|
3018
3109
|
expiring_before?: string;
|
|
@@ -3412,7 +3503,8 @@ export type ListSpendParams = {
|
|
|
3412
3503
|
*/
|
|
3413
3504
|
to: ToRequiredParameter;
|
|
3414
3505
|
/**
|
|
3415
|
-
* `
|
|
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
|
|
3416
3508
|
* identifier — a disk, a public address — appear as their own rows rather than under
|
|
3417
3509
|
* the machine they are attached to, since the relationship between them is known to
|
|
3418
3510
|
* the owning service and not here.
|
|
@@ -3451,3 +3543,51 @@ export declare const ListSpendGroupBy: {
|
|
|
3451
3543
|
readonly plan: "plan";
|
|
3452
3544
|
readonly resource: "resource";
|
|
3453
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
|
+
};
|
|
@@ -85,10 +85,9 @@ export const PriceOptionInterval = {
|
|
|
85
85
|
year: "year",
|
|
86
86
|
};
|
|
87
87
|
export const PurchaseOperation = {
|
|
88
|
-
|
|
88
|
+
new: "new",
|
|
89
89
|
renew: "renew",
|
|
90
|
-
|
|
91
|
-
downgrade: "downgrade",
|
|
90
|
+
change: "change",
|
|
92
91
|
};
|
|
93
92
|
export const TopUpStatus = {
|
|
94
93
|
pending: "pending",
|
|
@@ -142,11 +141,6 @@ export const InvoiceStatus = {
|
|
|
142
141
|
void: "void",
|
|
143
142
|
uncollectible: "uncollectible",
|
|
144
143
|
};
|
|
145
|
-
export const InvoiceType = {
|
|
146
|
-
usage: "usage",
|
|
147
|
-
order: "order",
|
|
148
|
-
adjustment: "adjustment",
|
|
149
|
-
};
|
|
150
144
|
export const InvoiceItemType = {
|
|
151
145
|
usage: "usage",
|
|
152
146
|
subscription: "subscription",
|
|
@@ -321,6 +315,15 @@ export const ActiveResourceStatus = {
|
|
|
321
315
|
closing: "closing",
|
|
322
316
|
completed: "completed",
|
|
323
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
|
+
};
|
|
324
327
|
export const ListCreditGrantsStatus = {
|
|
325
328
|
active: "active",
|
|
326
329
|
depleted: "depleted",
|
|
@@ -358,3 +361,8 @@ export const ListSpendGroupBy = {
|
|
|
358
361
|
plan: "plan",
|
|
359
362
|
resource: "resource",
|
|
360
363
|
};
|
|
364
|
+
export const GetStatementUsageGroupBy = {
|
|
365
|
+
project: "project",
|
|
366
|
+
product: "product",
|
|
367
|
+
meter: "meter",
|
|
368
|
+
};
|