@metronome/sdk 3.5.0 → 3.6.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/CHANGELOG.md +56 -0
- package/bin/cli +12 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts.map +1 -1
- package/client.js +11 -0
- package/client.js.map +1 -1
- package/client.mjs +11 -0
- package/client.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -0
- package/internal/utils/log.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/shared.d.mts +95 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +95 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +1 -1
- package/resources/v1/alerts.d.mts.map +1 -1
- package/resources/v1/alerts.d.ts +1 -1
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +233 -152
- package/resources/v1/contracts/contracts.d.mts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +233 -152
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +47 -2
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +47 -2
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.mts +1 -1
- package/resources/v1/contracts/index.d.mts.map +1 -1
- package/resources/v1/contracts/index.d.ts +1 -1
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/products.d.mts +18 -0
- package/resources/v1/contracts/products.d.mts.map +1 -1
- package/resources/v1/contracts/products.d.ts +18 -0
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/customers/alerts.d.mts +1 -1
- package/resources/v1/customers/alerts.d.mts.map +1 -1
- package/resources/v1/customers/alerts.d.ts +1 -1
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/invoices.d.mts +9 -0
- package/resources/v1/customers/invoices.d.mts.map +1 -1
- package/resources/v1/customers/invoices.d.ts +9 -0
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/index.d.mts +1 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/packages.d.mts +0 -1
- package/resources/v1/packages.d.mts.map +1 -1
- package/resources/v1/packages.d.ts +0 -1
- package/resources/v1/packages.d.ts.map +1 -1
- package/resources/v1/v1.d.mts +2 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.mts +94 -1
- package/resources/v2/contracts.d.mts.map +1 -1
- package/resources/v2/contracts.d.ts +94 -1
- package/resources/v2/contracts.d.ts.map +1 -1
- package/src/client.ts +12 -0
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/log.ts +2 -0
- package/src/resources/shared.ts +127 -1
- package/src/resources/v1/alerts.ts +1 -1
- package/src/resources/v1/contracts/contracts.ts +295 -167
- package/src/resources/v1/contracts/index.ts +2 -0
- package/src/resources/v1/contracts/products.ts +20 -0
- package/src/resources/v1/customers/alerts.ts +1 -1
- package/src/resources/v1/customers/invoices.ts +12 -0
- package/src/resources/v1/index.ts +2 -0
- package/src/resources/v1/packages.ts +0 -2
- package/src/resources/v1/v1.ts +4 -0
- package/src/resources/v2/contracts.ts +125 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -107,6 +107,8 @@ export const formatRequestDetails = (details: {
|
|
|
107
107
|
name,
|
|
108
108
|
(
|
|
109
109
|
name.toLowerCase() === 'authorization' ||
|
|
110
|
+
name.toLowerCase() === 'api-key' ||
|
|
111
|
+
name.toLowerCase() === 'x-api-key' ||
|
|
110
112
|
name.toLowerCase() === 'cookie' ||
|
|
111
113
|
name.toLowerCase() === 'set-cookie'
|
|
112
114
|
) ?
|
package/src/resources/shared.ts
CHANGED
|
@@ -761,7 +761,7 @@ export interface ContractV2 {
|
|
|
761
761
|
/**
|
|
762
762
|
* List of subscriptions on the contract.
|
|
763
763
|
*/
|
|
764
|
-
subscriptions?: Array<Subscription>;
|
|
764
|
+
subscriptions?: Array<ContractV2.Subscription>;
|
|
765
765
|
|
|
766
766
|
total_contract_value?: number;
|
|
767
767
|
|
|
@@ -1227,6 +1227,8 @@ export namespace ContractV2 {
|
|
|
1227
1227
|
|
|
1228
1228
|
applicable_product_tags?: Array<string>;
|
|
1229
1229
|
|
|
1230
|
+
archived_at?: string;
|
|
1231
|
+
|
|
1230
1232
|
/**
|
|
1231
1233
|
* The current balance of the credit or commit. This balance reflects the amount of
|
|
1232
1234
|
* credit or commit that the customer has access to use at this moment - thus,
|
|
@@ -1855,6 +1857,130 @@ export namespace ContractV2 {
|
|
|
1855
1857
|
reseller_contract_value?: number;
|
|
1856
1858
|
}
|
|
1857
1859
|
}
|
|
1860
|
+
|
|
1861
|
+
export interface Subscription {
|
|
1862
|
+
/**
|
|
1863
|
+
* Previous, current, and next billing periods for the subscription.
|
|
1864
|
+
*/
|
|
1865
|
+
billing_periods: Subscription.BillingPeriods;
|
|
1866
|
+
|
|
1867
|
+
collection_schedule: 'ADVANCE' | 'ARREARS';
|
|
1868
|
+
|
|
1869
|
+
proration: Subscription.Proration;
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* Determines how the subscription's quantity is controlled. Defaults to
|
|
1873
|
+
* QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
1874
|
+
* directly on the subscription. `initial_quantity` must be provided with this
|
|
1875
|
+
* option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
1876
|
+
* **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
|
|
1877
|
+
* user_123) to increment and decrement a subscription quantity, rather than
|
|
1878
|
+
* directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
1879
|
+
* use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
1880
|
+
* provided with this option.
|
|
1881
|
+
*/
|
|
1882
|
+
quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* List of quantity schedule items for the subscription. Only includes the current
|
|
1886
|
+
* quantity and future quantity changes.
|
|
1887
|
+
*/
|
|
1888
|
+
quantity_schedule: Array<Subscription.QuantitySchedule>;
|
|
1889
|
+
|
|
1890
|
+
starting_at: string;
|
|
1891
|
+
|
|
1892
|
+
subscription_rate: Subscription.SubscriptionRate;
|
|
1893
|
+
|
|
1894
|
+
id?: string;
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
1898
|
+
*/
|
|
1899
|
+
custom_fields?: { [key: string]: string };
|
|
1900
|
+
|
|
1901
|
+
description?: string;
|
|
1902
|
+
|
|
1903
|
+
ending_before?: string;
|
|
1904
|
+
|
|
1905
|
+
fiat_credit_type_id?: string;
|
|
1906
|
+
|
|
1907
|
+
name?: string;
|
|
1908
|
+
|
|
1909
|
+
seat_config?: Subscription.SeatConfig;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
export namespace Subscription {
|
|
1913
|
+
/**
|
|
1914
|
+
* Previous, current, and next billing periods for the subscription.
|
|
1915
|
+
*/
|
|
1916
|
+
export interface BillingPeriods {
|
|
1917
|
+
current?: BillingPeriods.Current;
|
|
1918
|
+
|
|
1919
|
+
next?: BillingPeriods.Next;
|
|
1920
|
+
|
|
1921
|
+
previous?: BillingPeriods.Previous;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
export namespace BillingPeriods {
|
|
1925
|
+
export interface Current {
|
|
1926
|
+
ending_before: string;
|
|
1927
|
+
|
|
1928
|
+
starting_at: string;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
export interface Next {
|
|
1932
|
+
ending_before: string;
|
|
1933
|
+
|
|
1934
|
+
starting_at: string;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
export interface Previous {
|
|
1938
|
+
ending_before: string;
|
|
1939
|
+
|
|
1940
|
+
starting_at: string;
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
export interface Proration {
|
|
1945
|
+
invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
|
|
1946
|
+
|
|
1947
|
+
is_prorated: boolean;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
export interface QuantitySchedule {
|
|
1951
|
+
quantity: number;
|
|
1952
|
+
|
|
1953
|
+
starting_at: string;
|
|
1954
|
+
|
|
1955
|
+
ending_before?: string;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
export interface SubscriptionRate {
|
|
1959
|
+
billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1960
|
+
|
|
1961
|
+
product: SubscriptionRate.Product;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
export namespace SubscriptionRate {
|
|
1965
|
+
export interface Product {
|
|
1966
|
+
id: string;
|
|
1967
|
+
|
|
1968
|
+
name: string;
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
export interface SeatConfig {
|
|
1973
|
+
/**
|
|
1974
|
+
* The property name, sent on usage events, that identifies the seat ID associated
|
|
1975
|
+
* with the usage event. For example, the property name might be seat_id or
|
|
1976
|
+
* user_id. The property must be set as a group key on billable metrics and a
|
|
1977
|
+
* presentation/pricing group key on contract products. This allows linked
|
|
1978
|
+
* recurring credits with an allocation per seat to be consumed by only one seat's
|
|
1979
|
+
* usage.
|
|
1980
|
+
*/
|
|
1981
|
+
seat_group_key: string;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1858
1984
|
}
|
|
1859
1985
|
|
|
1860
1986
|
export interface ContractWithoutAmendments {
|
|
@@ -229,7 +229,7 @@ export interface AlertCreateParams {
|
|
|
229
229
|
|
|
230
230
|
export namespace AlertCreateParams {
|
|
231
231
|
export interface CustomFieldFilter {
|
|
232
|
-
entity: 'Contract' | 'Commit' | 'ContractCredit';
|
|
232
|
+
entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
|
|
233
233
|
|
|
234
234
|
key: string;
|
|
235
235
|
|
|
@@ -58,8 +58,8 @@ export class Contracts extends APIResource {
|
|
|
58
58
|
/**
|
|
59
59
|
* Contracts define a customer's products, pricing, discounts, access duration, and
|
|
60
60
|
* billing configuration. Contracts serve as the central billing agreement for both
|
|
61
|
-
* PLG and Enterprise customers
|
|
62
|
-
* products and services directly from your product or CRM.
|
|
61
|
+
* PLG and Enterprise customers. You can automatically grant customers access to
|
|
62
|
+
* your products and services directly from your product or CRM.
|
|
63
63
|
*
|
|
64
64
|
* ### Use this endpoint to:
|
|
65
65
|
*
|
|
@@ -515,6 +515,55 @@ export class Contracts extends APIResource {
|
|
|
515
515
|
);
|
|
516
516
|
}
|
|
517
517
|
|
|
518
|
+
/**
|
|
519
|
+
* Retrieve detailed balance for seat-based credits and commits from the contract's
|
|
520
|
+
* subscriptions, broken down by individual seats.
|
|
521
|
+
*
|
|
522
|
+
* ### Use this endpoint to:
|
|
523
|
+
*
|
|
524
|
+
* - Display per-seat balance information in customer dashboards
|
|
525
|
+
* - Filter balance data by subscription or specific seats
|
|
526
|
+
*
|
|
527
|
+
* ### Key response fields:
|
|
528
|
+
*
|
|
529
|
+
* An array of seat balance objects containing:
|
|
530
|
+
*
|
|
531
|
+
* - Seat id
|
|
532
|
+
* - Balance: current total balance across all commits and credits
|
|
533
|
+
*
|
|
534
|
+
* ### Usage guidelines:
|
|
535
|
+
*
|
|
536
|
+
* - Date filtering: use `covering_date` OR `starting_at`/`ending_before` to filter
|
|
537
|
+
* balance data by time range
|
|
538
|
+
* - Set `include_credits_and_commits=true` for detailed commits and credits
|
|
539
|
+
* breakdown per seat
|
|
540
|
+
* - Set `include_ledgers=true` for detailed transaction history per commit/credit
|
|
541
|
+
* per seat
|
|
542
|
+
*
|
|
543
|
+
* @example
|
|
544
|
+
* ```ts
|
|
545
|
+
* const response = await client.v1.contracts.listSeatBalances(
|
|
546
|
+
* {
|
|
547
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
548
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
549
|
+
* covering_date: '2024-03-01T00:00:00.000Z',
|
|
550
|
+
* include_credits_and_commits: true,
|
|
551
|
+
* include_ledgers: true,
|
|
552
|
+
* limit: 25,
|
|
553
|
+
* subscription_ids: [
|
|
554
|
+
* '8deed800-1b7a-495d-a207-6c52bac54dc9',
|
|
555
|
+
* ],
|
|
556
|
+
* },
|
|
557
|
+
* );
|
|
558
|
+
* ```
|
|
559
|
+
*/
|
|
560
|
+
listSeatBalances(
|
|
561
|
+
body: ContractListSeatBalancesParams,
|
|
562
|
+
options?: RequestOptions,
|
|
563
|
+
): APIPromise<ContractListSeatBalancesResponse> {
|
|
564
|
+
return this._client.post('/v1/contracts/seatBalances/list', { body, ...options });
|
|
565
|
+
}
|
|
566
|
+
|
|
518
567
|
/**
|
|
519
568
|
* For a specific customer and contract, get the rates at a specific point in time.
|
|
520
569
|
* This endpoint takes the contract's rate card into consideration, including
|
|
@@ -726,6 +775,178 @@ export namespace ContractGetNetBalanceResponse {
|
|
|
726
775
|
|
|
727
776
|
export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
|
|
728
777
|
|
|
778
|
+
export interface ContractListSeatBalancesResponse {
|
|
779
|
+
data: Array<ContractListSeatBalancesResponse.Data>;
|
|
780
|
+
|
|
781
|
+
pagination: ContractListSeatBalancesResponse.Pagination;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
export namespace ContractListSeatBalancesResponse {
|
|
785
|
+
export interface Data {
|
|
786
|
+
balances: Array<Data.Balance>;
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* The unique identifier for the seat
|
|
790
|
+
*/
|
|
791
|
+
seat_id: string;
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Array of commits applicable to this seat with their balances
|
|
795
|
+
*/
|
|
796
|
+
commits?: Array<Data.Commit> | null;
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Array of credits applicable to this seat with their balances
|
|
800
|
+
*/
|
|
801
|
+
credits?: Array<Data.Credit>;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
export namespace Data {
|
|
805
|
+
export interface Balance {
|
|
806
|
+
/**
|
|
807
|
+
* The total balance across all commits and credits for this seat, of this credit
|
|
808
|
+
* type.
|
|
809
|
+
*/
|
|
810
|
+
balance: number;
|
|
811
|
+
|
|
812
|
+
credit_type_id: string;
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* The total initial balances of all commits and credits for this seat, of this
|
|
816
|
+
* credit type.
|
|
817
|
+
*/
|
|
818
|
+
starting_balance: number;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
export interface Commit {
|
|
822
|
+
/**
|
|
823
|
+
* The commit or credit ID
|
|
824
|
+
*/
|
|
825
|
+
id: string;
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* The current balance for this commit for this specific seat
|
|
829
|
+
*/
|
|
830
|
+
balance: number;
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* The datetime when the commit becomes active
|
|
834
|
+
*/
|
|
835
|
+
start_date: string;
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* The datetime when the commit expires
|
|
839
|
+
*/
|
|
840
|
+
end_date?: string | null;
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* Transaction history for this commit for this seat (only included if
|
|
844
|
+
* include_ledgers=true)
|
|
845
|
+
*/
|
|
846
|
+
ledger_entries?: Array<Commit.LedgerEntry>;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
export namespace Commit {
|
|
850
|
+
export interface LedgerEntry {
|
|
851
|
+
/**
|
|
852
|
+
* Amount of the ledger entry
|
|
853
|
+
*/
|
|
854
|
+
amount: number;
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* The datetime when the ledger is created
|
|
858
|
+
*/
|
|
859
|
+
timestamp: string;
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Commit ledger type
|
|
863
|
+
*/
|
|
864
|
+
type:
|
|
865
|
+
| 'PREPAID_COMMIT_SEGMENT_START'
|
|
866
|
+
| 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'
|
|
867
|
+
| 'PREPAID_COMMIT_ROLLOVER'
|
|
868
|
+
| 'PREPAID_COMMIT_EXPIRATION'
|
|
869
|
+
| 'PREPAID_COMMIT_CANCELED'
|
|
870
|
+
| 'PREPAID_COMMIT_CREDITED'
|
|
871
|
+
| 'PREPAID_COMMIT_MANUAL'
|
|
872
|
+
| 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
export interface Credit {
|
|
877
|
+
/**
|
|
878
|
+
* The credit ID
|
|
879
|
+
*/
|
|
880
|
+
id: string;
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* The current balance for this credit for this specific seat
|
|
884
|
+
*/
|
|
885
|
+
balance: number;
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* The datetime when the credit becomes active
|
|
889
|
+
*/
|
|
890
|
+
start_date: string;
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* The datetime when the credit expires
|
|
894
|
+
*/
|
|
895
|
+
end_date?: string | null;
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Transaction history for this credit for this seat (only included if
|
|
899
|
+
* include_ledgers=true)
|
|
900
|
+
*/
|
|
901
|
+
ledger_entries?: Array<Credit.LedgerEntry>;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
export namespace Credit {
|
|
905
|
+
export interface LedgerEntry {
|
|
906
|
+
/**
|
|
907
|
+
* Amount of the ledger entry
|
|
908
|
+
*/
|
|
909
|
+
amount: number;
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* The datetime when the ledger is created
|
|
913
|
+
*/
|
|
914
|
+
timestamp: string;
|
|
915
|
+
|
|
916
|
+
/**
|
|
917
|
+
* Credit ledger type
|
|
918
|
+
*/
|
|
919
|
+
type:
|
|
920
|
+
| 'CREDIT_SEGMENT_START'
|
|
921
|
+
| 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'
|
|
922
|
+
| 'CREDIT_EXPIRATION'
|
|
923
|
+
| 'CREDIT_CANCELED'
|
|
924
|
+
| 'CREDIT_CREDITED'
|
|
925
|
+
| 'CREDIT_MANUAL'
|
|
926
|
+
| 'CREDIT_SEAT_BASED_ADJUSTMENT'
|
|
927
|
+
| 'CREDIT_ROLLOVER';
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
export interface Pagination {
|
|
933
|
+
/**
|
|
934
|
+
* Number of seats available to fetch in the next page
|
|
935
|
+
*/
|
|
936
|
+
seats_available_for_next_page: number;
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* Number of seats included in this response
|
|
940
|
+
*/
|
|
941
|
+
seats_included: number;
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* Token to retrieve the next page of results. Null if no more pages available
|
|
945
|
+
*/
|
|
946
|
+
next_page?: string | null;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
729
950
|
export interface ContractRetrieveRateScheduleResponse {
|
|
730
951
|
data: Array<ContractRetrieveRateScheduleResponse.Data>;
|
|
731
952
|
|
|
@@ -872,7 +1093,7 @@ export interface ContractCreateParams {
|
|
|
872
1093
|
/**
|
|
873
1094
|
* If provided, provisions a customer on a package instead of creating a
|
|
874
1095
|
* traditional contract. When specified, only customer_id, starting_at, package_id,
|
|
875
|
-
* and
|
|
1096
|
+
* uniqueness_key, transition, and custom_fields are allowed.
|
|
876
1097
|
*/
|
|
877
1098
|
package_id?: string;
|
|
878
1099
|
|
|
@@ -1038,11 +1259,6 @@ export namespace ContractCreateParams {
|
|
|
1038
1259
|
*/
|
|
1039
1260
|
netsuite_sales_order_id?: string;
|
|
1040
1261
|
|
|
1041
|
-
/**
|
|
1042
|
-
* optionally payment gate this commit
|
|
1043
|
-
*/
|
|
1044
|
-
payment_gate_config?: Commit.PaymentGateConfig;
|
|
1045
|
-
|
|
1046
1262
|
/**
|
|
1047
1263
|
* If multiple commits are applicable, the one with the lower priority will apply
|
|
1048
1264
|
* first.
|
|
@@ -1204,83 +1420,6 @@ export namespace ContractCreateParams {
|
|
|
1204
1420
|
unit_price?: number;
|
|
1205
1421
|
}
|
|
1206
1422
|
}
|
|
1207
|
-
|
|
1208
|
-
/**
|
|
1209
|
-
* optionally payment gate this commit
|
|
1210
|
-
*/
|
|
1211
|
-
export interface PaymentGateConfig {
|
|
1212
|
-
/**
|
|
1213
|
-
* Gate access to the commit balance based on successful collection of payment.
|
|
1214
|
-
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
1215
|
-
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
1216
|
-
* wish to payment gate the commit balance.
|
|
1217
|
-
*/
|
|
1218
|
-
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
1219
|
-
|
|
1220
|
-
/**
|
|
1221
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
1222
|
-
*/
|
|
1223
|
-
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
1224
|
-
|
|
1225
|
-
/**
|
|
1226
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
1227
|
-
*/
|
|
1228
|
-
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
1229
|
-
|
|
1230
|
-
/**
|
|
1231
|
-
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
1232
|
-
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
1233
|
-
* will default to NONE.
|
|
1234
|
-
*/
|
|
1235
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
export namespace PaymentGateConfig {
|
|
1239
|
-
/**
|
|
1240
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
1241
|
-
*/
|
|
1242
|
-
export interface PrecalculatedTaxConfig {
|
|
1243
|
-
/**
|
|
1244
|
-
* Amount of tax to be applied. This should be in the same currency and
|
|
1245
|
-
* denomination as the commit's invoice schedule
|
|
1246
|
-
*/
|
|
1247
|
-
tax_amount: number;
|
|
1248
|
-
|
|
1249
|
-
/**
|
|
1250
|
-
* Name of the tax to be applied. This may be used in an invoice line item
|
|
1251
|
-
* description.
|
|
1252
|
-
*/
|
|
1253
|
-
tax_name?: string;
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
/**
|
|
1257
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
1258
|
-
*/
|
|
1259
|
-
export interface StripeConfig {
|
|
1260
|
-
/**
|
|
1261
|
-
* If left blank, will default to INVOICE
|
|
1262
|
-
*/
|
|
1263
|
-
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
1264
|
-
|
|
1265
|
-
/**
|
|
1266
|
-
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
1267
|
-
* your payment type.
|
|
1268
|
-
*/
|
|
1269
|
-
invoice_metadata?: { [key: string]: string };
|
|
1270
|
-
|
|
1271
|
-
/**
|
|
1272
|
-
* If true, the payment will be made assuming the customer is present (i.e. on
|
|
1273
|
-
* session).
|
|
1274
|
-
*
|
|
1275
|
-
* If false, the payment will be made assuming the customer is not present (i.e.
|
|
1276
|
-
* off session). For cardholders from a country with an e-mandate requirement (e.g.
|
|
1277
|
-
* India), the payment may be declined.
|
|
1278
|
-
*
|
|
1279
|
-
* If left blank, will default to false.
|
|
1280
|
-
*/
|
|
1281
|
-
on_session_payment?: boolean;
|
|
1282
|
-
}
|
|
1283
|
-
}
|
|
1284
1423
|
}
|
|
1285
1424
|
|
|
1286
1425
|
export interface Credit {
|
|
@@ -2664,11 +2803,6 @@ export namespace ContractAmendParams {
|
|
|
2664
2803
|
*/
|
|
2665
2804
|
netsuite_sales_order_id?: string;
|
|
2666
2805
|
|
|
2667
|
-
/**
|
|
2668
|
-
* optionally payment gate this commit
|
|
2669
|
-
*/
|
|
2670
|
-
payment_gate_config?: Commit.PaymentGateConfig;
|
|
2671
|
-
|
|
2672
2806
|
/**
|
|
2673
2807
|
* If multiple commits are applicable, the one with the lower priority will apply
|
|
2674
2808
|
* first.
|
|
@@ -2830,83 +2964,6 @@ export namespace ContractAmendParams {
|
|
|
2830
2964
|
unit_price?: number;
|
|
2831
2965
|
}
|
|
2832
2966
|
}
|
|
2833
|
-
|
|
2834
|
-
/**
|
|
2835
|
-
* optionally payment gate this commit
|
|
2836
|
-
*/
|
|
2837
|
-
export interface PaymentGateConfig {
|
|
2838
|
-
/**
|
|
2839
|
-
* Gate access to the commit balance based on successful collection of payment.
|
|
2840
|
-
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
2841
|
-
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
2842
|
-
* wish to payment gate the commit balance.
|
|
2843
|
-
*/
|
|
2844
|
-
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
2845
|
-
|
|
2846
|
-
/**
|
|
2847
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
2848
|
-
*/
|
|
2849
|
-
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
2850
|
-
|
|
2851
|
-
/**
|
|
2852
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
2853
|
-
*/
|
|
2854
|
-
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
2855
|
-
|
|
2856
|
-
/**
|
|
2857
|
-
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
2858
|
-
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
2859
|
-
* will default to NONE.
|
|
2860
|
-
*/
|
|
2861
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
2862
|
-
}
|
|
2863
|
-
|
|
2864
|
-
export namespace PaymentGateConfig {
|
|
2865
|
-
/**
|
|
2866
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
2867
|
-
*/
|
|
2868
|
-
export interface PrecalculatedTaxConfig {
|
|
2869
|
-
/**
|
|
2870
|
-
* Amount of tax to be applied. This should be in the same currency and
|
|
2871
|
-
* denomination as the commit's invoice schedule
|
|
2872
|
-
*/
|
|
2873
|
-
tax_amount: number;
|
|
2874
|
-
|
|
2875
|
-
/**
|
|
2876
|
-
* Name of the tax to be applied. This may be used in an invoice line item
|
|
2877
|
-
* description.
|
|
2878
|
-
*/
|
|
2879
|
-
tax_name?: string;
|
|
2880
|
-
}
|
|
2881
|
-
|
|
2882
|
-
/**
|
|
2883
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
2884
|
-
*/
|
|
2885
|
-
export interface StripeConfig {
|
|
2886
|
-
/**
|
|
2887
|
-
* If left blank, will default to INVOICE
|
|
2888
|
-
*/
|
|
2889
|
-
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
2890
|
-
|
|
2891
|
-
/**
|
|
2892
|
-
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
2893
|
-
* your payment type.
|
|
2894
|
-
*/
|
|
2895
|
-
invoice_metadata?: { [key: string]: string };
|
|
2896
|
-
|
|
2897
|
-
/**
|
|
2898
|
-
* If true, the payment will be made assuming the customer is present (i.e. on
|
|
2899
|
-
* session).
|
|
2900
|
-
*
|
|
2901
|
-
* If false, the payment will be made assuming the customer is not present (i.e.
|
|
2902
|
-
* off session). For cardholders from a country with an e-mandate requirement (e.g.
|
|
2903
|
-
* India), the payment may be declined.
|
|
2904
|
-
*
|
|
2905
|
-
* If left blank, will default to false.
|
|
2906
|
-
*/
|
|
2907
|
-
on_session_payment?: boolean;
|
|
2908
|
-
}
|
|
2909
|
-
}
|
|
2910
2967
|
}
|
|
2911
2968
|
|
|
2912
2969
|
export interface Credit {
|
|
@@ -3658,6 +3715,75 @@ export interface ContractListBalancesParams extends BodyCursorPageParams {
|
|
|
3658
3715
|
starting_at?: string;
|
|
3659
3716
|
}
|
|
3660
3717
|
|
|
3718
|
+
export interface ContractListSeatBalancesParams {
|
|
3719
|
+
/**
|
|
3720
|
+
* The contract ID to retrieve seat balances for
|
|
3721
|
+
*/
|
|
3722
|
+
contract_id: string;
|
|
3723
|
+
|
|
3724
|
+
/**
|
|
3725
|
+
* The customer ID to retrieve seat balances for
|
|
3726
|
+
*/
|
|
3727
|
+
customer_id: string;
|
|
3728
|
+
|
|
3729
|
+
/**
|
|
3730
|
+
* Include only commits or credits with access that cover this specific date
|
|
3731
|
+
* (cannot be used with starting_at or ending_before).
|
|
3732
|
+
*/
|
|
3733
|
+
covering_date?: string;
|
|
3734
|
+
|
|
3735
|
+
/**
|
|
3736
|
+
* Page token from a previous response to retrieve the next page
|
|
3737
|
+
*/
|
|
3738
|
+
cursor?: string;
|
|
3739
|
+
|
|
3740
|
+
/**
|
|
3741
|
+
* Include only commits or credits with access effective on or before this date
|
|
3742
|
+
* (cannot be used with covering_date).
|
|
3743
|
+
*/
|
|
3744
|
+
effective_before?: string;
|
|
3745
|
+
|
|
3746
|
+
/**
|
|
3747
|
+
* Include credits and commits in the response
|
|
3748
|
+
*/
|
|
3749
|
+
include_credits_and_commits?: boolean;
|
|
3750
|
+
|
|
3751
|
+
/**
|
|
3752
|
+
* Include ledger entries for each commit and commit. `include_credits_and_commits`
|
|
3753
|
+
* must be set to `true` for `include_ledgers=true` to apply.
|
|
3754
|
+
*/
|
|
3755
|
+
include_ledgers?: boolean;
|
|
3756
|
+
|
|
3757
|
+
/**
|
|
3758
|
+
* Maximum number of seats to return. Range: 1-100. Default: 25. When
|
|
3759
|
+
* `include_credits_and_commits = true`, if the total commits/credits across all
|
|
3760
|
+
* seats exceeds 100, a limit of 100 applies to the total credits and commits.
|
|
3761
|
+
* Seats are included greedily to maximize the number of seats returned. Example:
|
|
3762
|
+
* if seat 1 has 98 commits and seat 2 has 10 commits, both seats will be returned
|
|
3763
|
+
* (total: 108 commits). Each returned seat includes all of its associated credits
|
|
3764
|
+
* and commits.
|
|
3765
|
+
*/
|
|
3766
|
+
limit?: number;
|
|
3767
|
+
|
|
3768
|
+
/**
|
|
3769
|
+
* Optional filter to only include specific seats.
|
|
3770
|
+
*/
|
|
3771
|
+
seat_ids?: Array<string>;
|
|
3772
|
+
|
|
3773
|
+
/**
|
|
3774
|
+
* Include only commits or credits with access effective on or after this date
|
|
3775
|
+
* (cannot be used with covering_date).
|
|
3776
|
+
*/
|
|
3777
|
+
starting_at?: string;
|
|
3778
|
+
|
|
3779
|
+
/**
|
|
3780
|
+
* Optional filter to only include seats from specific subscriptions. If
|
|
3781
|
+
* subscriptions ids are not mapped to SEAT_BASED subscriptions, error will be
|
|
3782
|
+
* returned.
|
|
3783
|
+
*/
|
|
3784
|
+
subscription_ids?: Array<string>;
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3661
3787
|
export interface ContractRetrieveRateScheduleParams {
|
|
3662
3788
|
/**
|
|
3663
3789
|
* Body param: ID of the contract to get the rate schedule for.
|
|
@@ -3858,6 +3984,7 @@ export declare namespace Contracts {
|
|
|
3858
3984
|
type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse,
|
|
3859
3985
|
type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse,
|
|
3860
3986
|
type ContractListBalancesResponse as ContractListBalancesResponse,
|
|
3987
|
+
type ContractListSeatBalancesResponse as ContractListSeatBalancesResponse,
|
|
3861
3988
|
type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse,
|
|
3862
3989
|
type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse,
|
|
3863
3990
|
type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse,
|
|
@@ -3872,6 +3999,7 @@ export declare namespace Contracts {
|
|
|
3872
3999
|
type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams,
|
|
3873
4000
|
type ContractGetNetBalanceParams as ContractGetNetBalanceParams,
|
|
3874
4001
|
type ContractListBalancesParams as ContractListBalancesParams,
|
|
4002
|
+
type ContractListSeatBalancesParams as ContractListSeatBalancesParams,
|
|
3875
4003
|
type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams,
|
|
3876
4004
|
type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams,
|
|
3877
4005
|
type ContractScheduleProServicesInvoiceParams as ContractScheduleProServicesInvoiceParams,
|