# Contracts ## Retrieve `client.v2.contracts.retrieve(ContractRetrieveParamsbody, RequestOptionsoptions?): ContractRetrieveResponse` **post** `/v2/contracts/get` Get a specific contract. New clients should use this endpoint rather than the v1 endpoint. ### Parameters - **body:** `ContractRetrieveParams` - **contract\_id:** `string` - **customer\_id:** `string` - **as\_of\_date:** `string` Optional RFC 3339 timestamp. Return the contract as of this date. Cannot be used with include_ledgers parameter. - **include\_balance:** `boolean` Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower. - **include\_ledgers:** `boolean` Include commit/credit ledgers in the response. Setting this flag may cause the query to be slower. Cannot be used with as_of_date parameter. ### Returns - `ContractRetrieveResponse` - **data:** `Data` - **id:** `string` - **commits:** `Array` - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **type:** `"PREPAID" | "POSTPAID"` - `"PREPAID"` - `"POSTPAID"` - **access\_schedule:** `ScheduleDuration` The schedule that the customer will gain access to the credits purposed with this commit. - **applicable\_contract\_ids:** `Array` - **applicable\_product\_ids:** `Array` - **applicable\_product\_tags:** `Array` - **archived\_at:** `string` - **balance:** `number` The current balance of the credit or commit. This balance reflects the amount of credit or commit that the customer has access to use at this moment - thus, expired and upcoming credit or commit segments contribute 0 to the balance. The balance will match the sum of all ledger entries with the exception of the case where the sum of negative manual ledger entries exceeds the positive amount remaining on the credit or commit - in that case, the balance will be 0. All manual ledger entries associated with active credit or commit segments are included in the balance, including future-dated manual ledger entries. - **contract:** `Contract` - **id:** `string` - **custom\_fields:** `Record` - **description:** `string` - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for commit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **invoice\_contract:** `InvoiceContract` The contract that this commit will be billed on. - **id:** `string` - **invoice\_schedule:** `SchedulePointInTime` The schedule that the customer will be invoiced for this commit. - **ledger:** `Array` A list of ordered events that impact the balance of a commit. For example, an invoice deduction or a rollover. - `PrepaidCommitSegmentStartLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_SEGMENT_START"` - `"PREPAID_COMMIT_SEGMENT_START"` - `PrepaidCommitAutomatedInvoiceDeductionLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION"` - `"PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION"` - **contract\_id:** `string` - `PrepaidCommitRolloverLedgerEntry` - **amount:** `number` - **new\_contract\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_ROLLOVER"` - `"PREPAID_COMMIT_ROLLOVER"` - `PrepaidCommitExpirationLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_EXPIRATION"` - `"PREPAID_COMMIT_EXPIRATION"` - `PrepaidCommitCanceledLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_CANCELED"` - `"PREPAID_COMMIT_CANCELED"` - **contract\_id:** `string` - `PrepaidCommitCreditedLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_CREDITED"` - `"PREPAID_COMMIT_CREDITED"` - **contract\_id:** `string` - `PrepaidCommitSeatBasedAdjustmentLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT"` - `"PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT"` - `PostpaidCommitInitialBalanceLedgerEntry` - **amount:** `number` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_INITIAL_BALANCE"` - `"POSTPAID_COMMIT_INITIAL_BALANCE"` - `PostpaidCommitAutomatedInvoiceDeductionLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION"` - `"POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION"` - **contract\_id:** `string` - `PostpaidCommitRolloverLedgerEntry` - **amount:** `number` - **new\_contract\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_ROLLOVER"` - `"POSTPAID_COMMIT_ROLLOVER"` - `PostpaidCommitTrueupLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_TRUEUP"` - `"POSTPAID_COMMIT_TRUEUP"` - **contract\_id:** `string` - `PrepaidCommitManualLedgerEntry` - **amount:** `number` - **reason:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_MANUAL"` - `"PREPAID_COMMIT_MANUAL"` - `PostpaidCommitManualLedgerEntry` - **amount:** `number` - **reason:** `string` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_MANUAL"` - `"POSTPAID_COMMIT_MANUAL"` - `PostpaidCommitExpirationLedgerEntry` - **amount:** `number` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_EXPIRATION"` - `"POSTPAID_COMMIT_EXPIRATION"` - **name:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **priority:** `number` If multiple credits or commits are applicable, the one with the lower priority will apply first. - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` - `"COMMIT_RATE"` - `"LIST_RATE"` - **rolled\_over\_from:** `RolledOverFrom` - **commit\_id:** `string` - **contract\_id:** `string` - **rollover\_fraction:** `number` - **salesforce\_opportunity\_id:** `string` This field's availability is dependent on your client's configuration. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **created\_at:** `string` - **created\_by:** `string` - **customer\_id:** `string` - **overrides:** `Array` - **id:** `string` - **starting\_at:** `string` - **applicable\_product\_tags:** `Array` - **ending\_before:** `string` - **entitled:** `boolean` - **is\_commit\_specific:** `boolean` - **multiplier:** `number` - **override\_specifiers:** `Array` - **billing\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **commit\_ids:** `Array` - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` - **product\_tags:** `Array` - **recurring\_commit\_ids:** `Array` - **recurring\_credit\_ids:** `Array` - **override\_tiers:** `Array` - **multiplier:** `number` - **size:** `number` - **overwrite\_rate:** `OverwriteRate` - **rate\_type:** `"FLAT" | "PERCENTAGE" | "SUBSCRIPTION" | 2 more` - `"FLAT"` - `"PERCENTAGE"` - `"SUBSCRIPTION"` - `"TIERED"` - `"CUSTOM"` - **credit\_type:** `CreditTypeData` - **custom\_rate:** `Record` Only set for CUSTOM rate_type. This field is interpreted by custom rate processors. - **is\_prorated:** `boolean` Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true. - **price:** `number` Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1. - **quantity:** `number` Default quantity. For SUBSCRIPTION rate_type, this must be >=0. - **tiers:** `Array` Only set for TIERED rate_type. - **price:** `number` - **size:** `number` - **priority:** `number` - **product:** `Product` - **id:** `string` - **name:** `string` - **target:** `"COMMIT_RATE" | "LIST_RATE"` - `"COMMIT_RATE"` - `"LIST_RATE"` - **type:** `"OVERWRITE" | "MULTIPLIER" | "TIERED"` - `"OVERWRITE"` - `"MULTIPLIER"` - `"TIERED"` - **scheduled\_charges:** `Array` - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **schedule:** `SchedulePointInTime` - **archived\_at:** `string` - **custom\_fields:** `Record` - **name:** `string` displayed on invoices - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **starting\_at:** `string` - **transitions:** `Array` - **from\_contract\_id:** `string` - **to\_contract\_id:** `string` - **type:** `"SUPERSEDE" | "RENEWAL"` - `"SUPERSEDE"` - `"RENEWAL"` - **usage\_filter:** `Array` - **group\_key:** `string` - **group\_values:** `Array` - **starting\_at:** `string` This will match contract starting_at value if usage filter is active from the beginning of the contract. - **ending\_before:** `string` This will match contract ending_before value if usage filter is active until the end of the contract. It will be undefined if the contract is open-ended. - **usage\_statement\_schedule:** `UsageStatementSchedule` - **billing\_anchor\_date:** `string` Contract usage statements follow a selected cadence based on this date. - **frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **archived\_at:** `string` - **credits:** `Array` - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **type:** `"CREDIT"` - `"CREDIT"` - **access\_schedule:** `ScheduleDuration` The schedule that the customer will gain access to the credits. - **applicable\_contract\_ids:** `Array` - **applicable\_product\_ids:** `Array` - **applicable\_product\_tags:** `Array` - **balance:** `number` The current balance of the credit or commit. This balance reflects the amount of credit or commit that the customer has access to use at this moment - thus, expired and upcoming credit or commit segments contribute 0 to the balance. The balance will match the sum of all ledger entries with the exception of the case where the sum of negative manual ledger entries exceeds the positive amount remaining on the credit or commit - in that case, the balance will be 0. All manual ledger entries associated with active credit or commit segments are included in the balance, including future-dated manual ledger entries. - **contract:** `Contract` - **id:** `string` - **custom\_fields:** `Record` - **description:** `string` - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **ledger:** `Array` A list of ordered events that impact the balance of a credit. For example, an invoice deduction or an expiration. - `CreditSegmentStartLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_SEGMENT_START"` - `"CREDIT_SEGMENT_START"` - `CreditAutomatedInvoiceDeductionLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_AUTOMATED_INVOICE_DEDUCTION"` - `"CREDIT_AUTOMATED_INVOICE_DEDUCTION"` - **contract\_id:** `string` - `CreditExpirationLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_EXPIRATION"` - `"CREDIT_EXPIRATION"` - `CreditCanceledLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_CANCELED"` - `"CREDIT_CANCELED"` - **contract\_id:** `string` - `CreditCreditedLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_CREDITED"` - `"CREDIT_CREDITED"` - **contract\_id:** `string` - `CreditManualLedgerEntry` - **amount:** `number` - **reason:** `string` - **timestamp:** `string` - **type:** `"CREDIT_MANUAL"` - `"CREDIT_MANUAL"` - `CreditSeatBasedAdjustmentLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_SEAT_BASED_ADJUSTMENT"` - `"CREDIT_SEAT_BASED_ADJUSTMENT"` - **name:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **priority:** `number` If multiple credits or commits are applicable, the one with the lower priority will apply first. - **salesforce\_opportunity\_id:** `string` This field's availability is dependent on your client's configuration. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **custom\_fields:** `Record` - **customer\_billing\_provider\_configuration:** `CustomerBillingProviderConfiguration` This field's availability is dependent on your client's configuration. - **id:** `string` ID of Customer's billing provider configuration. - **billing\_provider:** `"aws_marketplace" | "stripe" | "netsuite" | 5 more` - `"aws_marketplace"` - `"stripe"` - `"netsuite"` - `"custom"` - `"azure_marketplace"` - `"quickbooks_online"` - `"workday"` - `"gcp_marketplace"` - **delivery\_method:** `"direct_to_billing_provider" | "aws_sqs" | "tackle" | "aws_sns"` - `"direct_to_billing_provider"` - `"aws_sqs"` - `"tackle"` - `"aws_sns"` - **discounts:** `Array` This field's availability is dependent on your client's configuration. - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **schedule:** `SchedulePointInTime` - **custom\_fields:** `Record` - **name:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **ending\_before:** `string` - **has\_more:** `HasMore` Indicates whether there are more items than the limit for this endpoint. Use the respective list endpoints to get the full lists. - **commits:** `boolean` Whether there are more commits on this contract than the limit for this endpoint. Use the /contracts/customerCommits/list endpoint to get the full list of commits. - **credits:** `boolean` Whether there are more credits on this contract than the limit for this endpoint. Use the /contracts/customerCredits/list endpoint to get the full list of credits. - **hierarchy\_configuration:** `ParentHierarchyConfiguration | ChildHierarchyConfiguration` Either a **parent** configuration with a list of children or a **child** configuration with a single parent. - `ParentHierarchyConfiguration` - **children:** `Array` List of contracts that belong to this parent. - **contract\_id:** `string` - **customer\_id:** `string` - `ChildHierarchyConfiguration` - **parent:** `Parent` The single parent contract/customer for this child. - **contract\_id:** `string` - **customer\_id:** `string` - **multiplier\_override\_prioritization:** `"LOWEST_MULTIPLIER" | "EXPLICIT"` Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. - `"LOWEST_MULTIPLIER"` - `"EXPLICIT"` - **name:** `string` - **net\_payment\_terms\_days:** `number` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **prepaid\_balance\_threshold\_configuration:** `PrepaidBalanceThresholdConfiguration` - **commit:** `Commit` - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **applicable\_product\_ids:** `Array` Which products the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array` Which tags the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **recharge\_to\_amount:** `number` Specify the amount the balance should be recharged to. - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated. - **custom\_credit\_type\_id:** `string` If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency. - **priority:** `number` Priority of the contract. - **professional\_services:** `Array` This field's availability is dependent on your client's configuration. - **id:** `string` - **max\_amount:** `number` Maximum amount for the term. - **product\_id:** `string` - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified. - **custom\_fields:** `Record` - **description:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **rate\_card\_id:** `string` - **recurring\_commits:** `Array` - **id:** `string` - **access\_amount:** `AccessAmount` The amount of commit to grant. - **credit\_type\_id:** `string` - **unit\_price:** `number` - **quantity:** `number` - **commit\_duration:** `CommitDuration` The amount of time the created commits will be valid for - **value:** `number` - **unit:** `"PERIODS"` - `"PERIODS"` - **priority:** `number` Will be passed down to the individual commits - **product:** `Product` - **id:** `string` - **name:** `string` - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` Whether the created commits will use the commit rate or list rate - `"COMMIT_RATE"` - `"LIST_RATE"` - **starting\_at:** `string` Determines the start time for the first commit - **applicable\_product\_ids:** `Array` Will be passed down to the individual commits - **applicable\_product\_tags:** `Array` Will be passed down to the individual commits - **contract:** `Contract` - **id:** `string` - **description:** `string` Will be passed down to the individual commits - **ending\_before:** `string` Determines when the contract will stop creating recurring commits. Optional - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for recurring credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **invoice\_amount:** `InvoiceAmount` The amount the customer should be billed for the commit. Not required. - **credit\_type\_id:** `string` - **quantity:** `number` - **unit\_price:** `number` - **name:** `string` Displayed on invoices. Will be passed through to the individual commits - **netsuite\_sales\_order\_id:** `string` Will be passed down to the individual commits - **proration:** `"NONE" | "FIRST" | "LAST" | "FIRST_AND_LAST"` Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits). - `"NONE"` - `"FIRST"` - `"LAST"` - `"FIRST_AND_LAST"` - **recurrence\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates. - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **rollover\_fraction:** `number` Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **subscription\_config:** `SubscriptionConfig` Attach a subscription to the recurring commit/credit. - **allocation:** `"INDIVIDUAL" | "POOLED"` - `"INDIVIDUAL"` - `"POOLED"` - **apply\_seat\_increase\_config:** `ApplySeatIncreaseConfig` - **is\_prorated:** `boolean` Indicates whether a mid-period seat increase should be prorated. - **subscription\_id:** `string` - **recurring\_credits:** `Array` - **id:** `string` - **access\_amount:** `AccessAmount` The amount of commit to grant. - **credit\_type\_id:** `string` - **unit\_price:** `number` - **quantity:** `number` - **commit\_duration:** `CommitDuration` The amount of time the created commits will be valid for - **value:** `number` - **unit:** `"PERIODS"` - `"PERIODS"` - **priority:** `number` Will be passed down to the individual commits - **product:** `Product` - **id:** `string` - **name:** `string` - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` Whether the created commits will use the commit rate or list rate - `"COMMIT_RATE"` - `"LIST_RATE"` - **starting\_at:** `string` Determines the start time for the first commit - **applicable\_product\_ids:** `Array` Will be passed down to the individual commits - **applicable\_product\_tags:** `Array` Will be passed down to the individual commits - **contract:** `Contract` - **id:** `string` - **description:** `string` Will be passed down to the individual commits - **ending\_before:** `string` Determines when the contract will stop creating recurring commits. Optional - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for recurring credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **name:** `string` Displayed on invoices. Will be passed through to the individual commits - **netsuite\_sales\_order\_id:** `string` Will be passed down to the individual commits - **proration:** `"NONE" | "FIRST" | "LAST" | "FIRST_AND_LAST"` Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits). - `"NONE"` - `"FIRST"` - `"LAST"` - `"FIRST_AND_LAST"` - **recurrence\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates. - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **rollover\_fraction:** `number` Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **subscription\_config:** `SubscriptionConfig` Attach a subscription to the recurring commit/credit. - **allocation:** `"INDIVIDUAL" | "POOLED"` - `"INDIVIDUAL"` - `"POOLED"` - **apply\_seat\_increase\_config:** `ApplySeatIncreaseConfig` - **is\_prorated:** `boolean` Indicates whether a mid-period seat increase should be prorated. - **subscription\_id:** `string` - **reseller\_royalties:** `Array` This field's availability is dependent on your client's configuration. - **reseller\_type:** `"AWS" | "AWS_PRO_SERVICE" | "GCP" | "GCP_PRO_SERVICE"` - `"AWS"` - `"AWS_PRO_SERVICE"` - `"GCP"` - `"GCP_PRO_SERVICE"` - **segments:** `Array` - **fraction:** `number` - **netsuite\_reseller\_id:** `string` - **reseller\_type:** `"AWS" | "AWS_PRO_SERVICE" | "GCP" | "GCP_PRO_SERVICE"` - `"AWS"` - `"AWS_PRO_SERVICE"` - `"GCP"` - `"GCP_PRO_SERVICE"` - **starting\_at:** `string` - **applicable\_product\_ids:** `Array` - **applicable\_product\_tags:** `Array` - **aws\_account\_number:** `string` - **aws\_offer\_id:** `string` - **aws\_payer\_reference\_id:** `string` - **ending\_before:** `string` - **gcp\_account\_id:** `string` - **gcp\_offer\_id:** `string` - **reseller\_contract\_value:** `number` - **salesforce\_opportunity\_id:** `string` This field's availability is dependent on your client's configuration. - **scheduled\_charges\_on\_usage\_invoices:** `"ALL"` Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges. - `"ALL"` - **spend\_threshold\_configuration:** `SpendThresholdConfiguration` - **commit:** `Commit` - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated. - **subscriptions:** `Array` List of subscriptions on the contract. - **collection\_schedule:** `"ADVANCE" | "ARREARS"` - `"ADVANCE"` - `"ARREARS"` - **proration:** `Proration` - **invoice\_behavior:** `"BILL_IMMEDIATELY" | "BILL_ON_NEXT_COLLECTION_DATE"` - `"BILL_IMMEDIATELY"` - `"BILL_ON_NEXT_COLLECTION_DATE"` - **is\_prorated:** `boolean` - **quantity\_schedule:** `Array` List of quantity schedule items for the subscription. Only includes the current quantity and future quantity changes. - **quantity:** `number` - **starting\_at:** `string` - **ending\_before:** `string` - **starting\_at:** `string` - **subscription\_rate:** `SubscriptionRate` - **billing\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **product:** `Product` - **id:** `string` - **name:** `string` - **id:** `string` - **custom\_fields:** `Record` - **description:** `string` - **ending\_before:** `string` - **fiat\_credit\_type\_id:** `string` - **name:** `string` - **total\_contract\_value:** `number` - **uniqueness\_key:** `string` Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error. ### Example ```node import Metronome from '@metronome/sdk'; const client = new Metronome({ bearerToken: 'My Bearer Token', }); const contract = await client.v2.contracts.retrieve({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', }); console.log(contract.data); ``` ## List `client.v2.contracts.list(ContractListParamsbody, RequestOptionsoptions?): ContractListResponse` **post** `/v2/contracts/list` List all contracts for a customer in chronological order. New clients should use this endpoint rather than the v1 endpoint. ### Parameters - **body:** `ContractListParams` - **customer\_id:** `string` - **covering\_date:** `string` Optional RFC 3339 timestamp. Only include contracts active on the provided date. This cannot be provided if starting_at filter is provided. - **include\_archived:** `boolean` Include archived contracts in the response. - **include\_balance:** `boolean` Include the balance of credits and commits in the response. Setting this flag may cause the response to be slower. - **include\_ledgers:** `boolean` Include commit/credit ledgers in the response. Setting this flag may cause the response to be slower. - **starting\_at:** `string` Optional RFC 3339 timestamp. Only include contracts that started on or after this date. This cannot be provided if covering_date filter is provided. ### Returns - `ContractListResponse` - **data:** `Array` - **id:** `string` - **commits:** `Array` - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **type:** `"PREPAID" | "POSTPAID"` - `"PREPAID"` - `"POSTPAID"` - **access\_schedule:** `ScheduleDuration` The schedule that the customer will gain access to the credits purposed with this commit. - **applicable\_contract\_ids:** `Array` - **applicable\_product\_ids:** `Array` - **applicable\_product\_tags:** `Array` - **archived\_at:** `string` - **balance:** `number` The current balance of the credit or commit. This balance reflects the amount of credit or commit that the customer has access to use at this moment - thus, expired and upcoming credit or commit segments contribute 0 to the balance. The balance will match the sum of all ledger entries with the exception of the case where the sum of negative manual ledger entries exceeds the positive amount remaining on the credit or commit - in that case, the balance will be 0. All manual ledger entries associated with active credit or commit segments are included in the balance, including future-dated manual ledger entries. - **contract:** `Contract` - **id:** `string` - **custom\_fields:** `Record` - **description:** `string` - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for commit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **invoice\_contract:** `InvoiceContract` The contract that this commit will be billed on. - **id:** `string` - **invoice\_schedule:** `SchedulePointInTime` The schedule that the customer will be invoiced for this commit. - **ledger:** `Array` A list of ordered events that impact the balance of a commit. For example, an invoice deduction or a rollover. - `PrepaidCommitSegmentStartLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_SEGMENT_START"` - `"PREPAID_COMMIT_SEGMENT_START"` - `PrepaidCommitAutomatedInvoiceDeductionLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION"` - `"PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION"` - **contract\_id:** `string` - `PrepaidCommitRolloverLedgerEntry` - **amount:** `number` - **new\_contract\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_ROLLOVER"` - `"PREPAID_COMMIT_ROLLOVER"` - `PrepaidCommitExpirationLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_EXPIRATION"` - `"PREPAID_COMMIT_EXPIRATION"` - `PrepaidCommitCanceledLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_CANCELED"` - `"PREPAID_COMMIT_CANCELED"` - **contract\_id:** `string` - `PrepaidCommitCreditedLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_CREDITED"` - `"PREPAID_COMMIT_CREDITED"` - **contract\_id:** `string` - `PrepaidCommitSeatBasedAdjustmentLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT"` - `"PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT"` - `PostpaidCommitInitialBalanceLedgerEntry` - **amount:** `number` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_INITIAL_BALANCE"` - `"POSTPAID_COMMIT_INITIAL_BALANCE"` - `PostpaidCommitAutomatedInvoiceDeductionLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION"` - `"POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION"` - **contract\_id:** `string` - `PostpaidCommitRolloverLedgerEntry` - **amount:** `number` - **new\_contract\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_ROLLOVER"` - `"POSTPAID_COMMIT_ROLLOVER"` - `PostpaidCommitTrueupLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_TRUEUP"` - `"POSTPAID_COMMIT_TRUEUP"` - **contract\_id:** `string` - `PrepaidCommitManualLedgerEntry` - **amount:** `number` - **reason:** `string` - **timestamp:** `string` - **type:** `"PREPAID_COMMIT_MANUAL"` - `"PREPAID_COMMIT_MANUAL"` - `PostpaidCommitManualLedgerEntry` - **amount:** `number` - **reason:** `string` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_MANUAL"` - `"POSTPAID_COMMIT_MANUAL"` - `PostpaidCommitExpirationLedgerEntry` - **amount:** `number` - **timestamp:** `string` - **type:** `"POSTPAID_COMMIT_EXPIRATION"` - `"POSTPAID_COMMIT_EXPIRATION"` - **name:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **priority:** `number` If multiple credits or commits are applicable, the one with the lower priority will apply first. - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` - `"COMMIT_RATE"` - `"LIST_RATE"` - **rolled\_over\_from:** `RolledOverFrom` - **commit\_id:** `string` - **contract\_id:** `string` - **rollover\_fraction:** `number` - **salesforce\_opportunity\_id:** `string` This field's availability is dependent on your client's configuration. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **created\_at:** `string` - **created\_by:** `string` - **customer\_id:** `string` - **overrides:** `Array` - **id:** `string` - **starting\_at:** `string` - **applicable\_product\_tags:** `Array` - **ending\_before:** `string` - **entitled:** `boolean` - **is\_commit\_specific:** `boolean` - **multiplier:** `number` - **override\_specifiers:** `Array` - **billing\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **commit\_ids:** `Array` - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` - **product\_tags:** `Array` - **recurring\_commit\_ids:** `Array` - **recurring\_credit\_ids:** `Array` - **override\_tiers:** `Array` - **multiplier:** `number` - **size:** `number` - **overwrite\_rate:** `OverwriteRate` - **rate\_type:** `"FLAT" | "PERCENTAGE" | "SUBSCRIPTION" | 2 more` - `"FLAT"` - `"PERCENTAGE"` - `"SUBSCRIPTION"` - `"TIERED"` - `"CUSTOM"` - **credit\_type:** `CreditTypeData` - **custom\_rate:** `Record` Only set for CUSTOM rate_type. This field is interpreted by custom rate processors. - **is\_prorated:** `boolean` Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true. - **price:** `number` Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1. - **quantity:** `number` Default quantity. For SUBSCRIPTION rate_type, this must be >=0. - **tiers:** `Array` Only set for TIERED rate_type. - **price:** `number` - **size:** `number` - **priority:** `number` - **product:** `Product` - **id:** `string` - **name:** `string` - **target:** `"COMMIT_RATE" | "LIST_RATE"` - `"COMMIT_RATE"` - `"LIST_RATE"` - **type:** `"OVERWRITE" | "MULTIPLIER" | "TIERED"` - `"OVERWRITE"` - `"MULTIPLIER"` - `"TIERED"` - **scheduled\_charges:** `Array` - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **schedule:** `SchedulePointInTime` - **archived\_at:** `string` - **custom\_fields:** `Record` - **name:** `string` displayed on invoices - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **starting\_at:** `string` - **transitions:** `Array` - **from\_contract\_id:** `string` - **to\_contract\_id:** `string` - **type:** `"SUPERSEDE" | "RENEWAL"` - `"SUPERSEDE"` - `"RENEWAL"` - **usage\_filter:** `Array` - **group\_key:** `string` - **group\_values:** `Array` - **starting\_at:** `string` This will match contract starting_at value if usage filter is active from the beginning of the contract. - **ending\_before:** `string` This will match contract ending_before value if usage filter is active until the end of the contract. It will be undefined if the contract is open-ended. - **usage\_statement\_schedule:** `UsageStatementSchedule` - **billing\_anchor\_date:** `string` Contract usage statements follow a selected cadence based on this date. - **frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **archived\_at:** `string` - **credits:** `Array` - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **type:** `"CREDIT"` - `"CREDIT"` - **access\_schedule:** `ScheduleDuration` The schedule that the customer will gain access to the credits. - **applicable\_contract\_ids:** `Array` - **applicable\_product\_ids:** `Array` - **applicable\_product\_tags:** `Array` - **balance:** `number` The current balance of the credit or commit. This balance reflects the amount of credit or commit that the customer has access to use at this moment - thus, expired and upcoming credit or commit segments contribute 0 to the balance. The balance will match the sum of all ledger entries with the exception of the case where the sum of negative manual ledger entries exceeds the positive amount remaining on the credit or commit - in that case, the balance will be 0. All manual ledger entries associated with active credit or commit segments are included in the balance, including future-dated manual ledger entries. - **contract:** `Contract` - **id:** `string` - **custom\_fields:** `Record` - **description:** `string` - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **ledger:** `Array` A list of ordered events that impact the balance of a credit. For example, an invoice deduction or an expiration. - `CreditSegmentStartLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_SEGMENT_START"` - `"CREDIT_SEGMENT_START"` - `CreditAutomatedInvoiceDeductionLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_AUTOMATED_INVOICE_DEDUCTION"` - `"CREDIT_AUTOMATED_INVOICE_DEDUCTION"` - **contract\_id:** `string` - `CreditExpirationLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_EXPIRATION"` - `"CREDIT_EXPIRATION"` - `CreditCanceledLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_CANCELED"` - `"CREDIT_CANCELED"` - **contract\_id:** `string` - `CreditCreditedLedgerEntry` - **amount:** `number` - **invoice\_id:** `string` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_CREDITED"` - `"CREDIT_CREDITED"` - **contract\_id:** `string` - `CreditManualLedgerEntry` - **amount:** `number` - **reason:** `string` - **timestamp:** `string` - **type:** `"CREDIT_MANUAL"` - `"CREDIT_MANUAL"` - `CreditSeatBasedAdjustmentLedgerEntry` - **amount:** `number` - **segment\_id:** `string` - **timestamp:** `string` - **type:** `"CREDIT_SEAT_BASED_ADJUSTMENT"` - `"CREDIT_SEAT_BASED_ADJUSTMENT"` - **name:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **priority:** `number` If multiple credits or commits are applicable, the one with the lower priority will apply first. - **salesforce\_opportunity\_id:** `string` This field's availability is dependent on your client's configuration. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **custom\_fields:** `Record` - **customer\_billing\_provider\_configuration:** `CustomerBillingProviderConfiguration` This field's availability is dependent on your client's configuration. - **id:** `string` ID of Customer's billing provider configuration. - **billing\_provider:** `"aws_marketplace" | "stripe" | "netsuite" | 5 more` - `"aws_marketplace"` - `"stripe"` - `"netsuite"` - `"custom"` - `"azure_marketplace"` - `"quickbooks_online"` - `"workday"` - `"gcp_marketplace"` - **delivery\_method:** `"direct_to_billing_provider" | "aws_sqs" | "tackle" | "aws_sns"` - `"direct_to_billing_provider"` - `"aws_sqs"` - `"tackle"` - `"aws_sns"` - **discounts:** `Array` This field's availability is dependent on your client's configuration. - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **schedule:** `SchedulePointInTime` - **custom\_fields:** `Record` - **name:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **ending\_before:** `string` - **has\_more:** `HasMore` Indicates whether there are more items than the limit for this endpoint. Use the respective list endpoints to get the full lists. - **commits:** `boolean` Whether there are more commits on this contract than the limit for this endpoint. Use the /contracts/customerCommits/list endpoint to get the full list of commits. - **credits:** `boolean` Whether there are more credits on this contract than the limit for this endpoint. Use the /contracts/customerCredits/list endpoint to get the full list of credits. - **hierarchy\_configuration:** `ParentHierarchyConfiguration | ChildHierarchyConfiguration` Either a **parent** configuration with a list of children or a **child** configuration with a single parent. - `ParentHierarchyConfiguration` - **children:** `Array` List of contracts that belong to this parent. - **contract\_id:** `string` - **customer\_id:** `string` - `ChildHierarchyConfiguration` - **parent:** `Parent` The single parent contract/customer for this child. - **contract\_id:** `string` - **customer\_id:** `string` - **multiplier\_override\_prioritization:** `"LOWEST_MULTIPLIER" | "EXPLICIT"` Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. - `"LOWEST_MULTIPLIER"` - `"EXPLICIT"` - **name:** `string` - **net\_payment\_terms\_days:** `number` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **prepaid\_balance\_threshold\_configuration:** `PrepaidBalanceThresholdConfiguration` - **commit:** `Commit` - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **applicable\_product\_ids:** `Array` Which products the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array` Which tags the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **recharge\_to\_amount:** `number` Specify the amount the balance should be recharged to. - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated. - **custom\_credit\_type\_id:** `string` If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency. - **priority:** `number` Priority of the contract. - **professional\_services:** `Array` This field's availability is dependent on your client's configuration. - **id:** `string` - **max\_amount:** `number` Maximum amount for the term. - **product\_id:** `string` - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified. - **custom\_fields:** `Record` - **description:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **rate\_card\_id:** `string` - **recurring\_commits:** `Array` - **id:** `string` - **access\_amount:** `AccessAmount` The amount of commit to grant. - **credit\_type\_id:** `string` - **unit\_price:** `number` - **quantity:** `number` - **commit\_duration:** `CommitDuration` The amount of time the created commits will be valid for - **value:** `number` - **unit:** `"PERIODS"` - `"PERIODS"` - **priority:** `number` Will be passed down to the individual commits - **product:** `Product` - **id:** `string` - **name:** `string` - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` Whether the created commits will use the commit rate or list rate - `"COMMIT_RATE"` - `"LIST_RATE"` - **starting\_at:** `string` Determines the start time for the first commit - **applicable\_product\_ids:** `Array` Will be passed down to the individual commits - **applicable\_product\_tags:** `Array` Will be passed down to the individual commits - **contract:** `Contract` - **id:** `string` - **description:** `string` Will be passed down to the individual commits - **ending\_before:** `string` Determines when the contract will stop creating recurring commits. Optional - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for recurring credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **invoice\_amount:** `InvoiceAmount` The amount the customer should be billed for the commit. Not required. - **credit\_type\_id:** `string` - **quantity:** `number` - **unit\_price:** `number` - **name:** `string` Displayed on invoices. Will be passed through to the individual commits - **netsuite\_sales\_order\_id:** `string` Will be passed down to the individual commits - **proration:** `"NONE" | "FIRST" | "LAST" | "FIRST_AND_LAST"` Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits). - `"NONE"` - `"FIRST"` - `"LAST"` - `"FIRST_AND_LAST"` - **recurrence\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates. - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **rollover\_fraction:** `number` Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **subscription\_config:** `SubscriptionConfig` Attach a subscription to the recurring commit/credit. - **allocation:** `"INDIVIDUAL" | "POOLED"` - `"INDIVIDUAL"` - `"POOLED"` - **apply\_seat\_increase\_config:** `ApplySeatIncreaseConfig` - **is\_prorated:** `boolean` Indicates whether a mid-period seat increase should be prorated. - **subscription\_id:** `string` - **recurring\_credits:** `Array` - **id:** `string` - **access\_amount:** `AccessAmount` The amount of commit to grant. - **credit\_type\_id:** `string` - **unit\_price:** `number` - **quantity:** `number` - **commit\_duration:** `CommitDuration` The amount of time the created commits will be valid for - **value:** `number` - **unit:** `"PERIODS"` - `"PERIODS"` - **priority:** `number` Will be passed down to the individual commits - **product:** `Product` - **id:** `string` - **name:** `string` - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` Whether the created commits will use the commit rate or list rate - `"COMMIT_RATE"` - `"LIST_RATE"` - **starting\_at:** `string` Determines the start time for the first commit - **applicable\_product\_ids:** `Array` Will be passed down to the individual commits - **applicable\_product\_tags:** `Array` Will be passed down to the individual commits - **contract:** `Contract` - **id:** `string` - **description:** `string` Will be passed down to the individual commits - **ending\_before:** `string` Determines when the contract will stop creating recurring commits. Optional - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for recurring credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **name:** `string` Displayed on invoices. Will be passed through to the individual commits - **netsuite\_sales\_order\_id:** `string` Will be passed down to the individual commits - **proration:** `"NONE" | "FIRST" | "LAST" | "FIRST_AND_LAST"` Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits). - `"NONE"` - `"FIRST"` - `"LAST"` - `"FIRST_AND_LAST"` - **recurrence\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates. - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **rollover\_fraction:** `number` Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **subscription\_config:** `SubscriptionConfig` Attach a subscription to the recurring commit/credit. - **allocation:** `"INDIVIDUAL" | "POOLED"` - `"INDIVIDUAL"` - `"POOLED"` - **apply\_seat\_increase\_config:** `ApplySeatIncreaseConfig` - **is\_prorated:** `boolean` Indicates whether a mid-period seat increase should be prorated. - **subscription\_id:** `string` - **reseller\_royalties:** `Array` This field's availability is dependent on your client's configuration. - **reseller\_type:** `"AWS" | "AWS_PRO_SERVICE" | "GCP" | "GCP_PRO_SERVICE"` - `"AWS"` - `"AWS_PRO_SERVICE"` - `"GCP"` - `"GCP_PRO_SERVICE"` - **segments:** `Array` - **fraction:** `number` - **netsuite\_reseller\_id:** `string` - **reseller\_type:** `"AWS" | "AWS_PRO_SERVICE" | "GCP" | "GCP_PRO_SERVICE"` - `"AWS"` - `"AWS_PRO_SERVICE"` - `"GCP"` - `"GCP_PRO_SERVICE"` - **starting\_at:** `string` - **applicable\_product\_ids:** `Array` - **applicable\_product\_tags:** `Array` - **aws\_account\_number:** `string` - **aws\_offer\_id:** `string` - **aws\_payer\_reference\_id:** `string` - **ending\_before:** `string` - **gcp\_account\_id:** `string` - **gcp\_offer\_id:** `string` - **reseller\_contract\_value:** `number` - **salesforce\_opportunity\_id:** `string` This field's availability is dependent on your client's configuration. - **scheduled\_charges\_on\_usage\_invoices:** `"ALL"` Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges. - `"ALL"` - **spend\_threshold\_configuration:** `SpendThresholdConfiguration` - **commit:** `Commit` - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated. - **subscriptions:** `Array` List of subscriptions on the contract. - **collection\_schedule:** `"ADVANCE" | "ARREARS"` - `"ADVANCE"` - `"ARREARS"` - **proration:** `Proration` - **invoice\_behavior:** `"BILL_IMMEDIATELY" | "BILL_ON_NEXT_COLLECTION_DATE"` - `"BILL_IMMEDIATELY"` - `"BILL_ON_NEXT_COLLECTION_DATE"` - **is\_prorated:** `boolean` - **quantity\_schedule:** `Array` List of quantity schedule items for the subscription. Only includes the current quantity and future quantity changes. - **quantity:** `number` - **starting\_at:** `string` - **ending\_before:** `string` - **starting\_at:** `string` - **subscription\_rate:** `SubscriptionRate` - **billing\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **product:** `Product` - **id:** `string` - **name:** `string` - **id:** `string` - **custom\_fields:** `Record` - **description:** `string` - **ending\_before:** `string` - **fiat\_credit\_type\_id:** `string` - **name:** `string` - **total\_contract\_value:** `number` - **uniqueness\_key:** `string` Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error. ### Example ```node import Metronome from '@metronome/sdk'; const client = new Metronome({ bearerToken: 'My Bearer Token', }); const contracts = await client.v2.contracts.list({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' }); console.log(contracts.data); ``` ## Edit `client.v2.contracts.edit(ContractEditParamsbody, RequestOptionsoptions?): ContractEditResponse` **post** `/v2/contracts/edit` Edit a contract. Contract editing must be enabled to use this endpoint. ### Parameters - **body:** `ContractEditParams` - **contract\_id:** `string` ID of the contract being edited - **customer\_id:** `string` ID of the customer whose contract is being edited - **add\_commits:** `Array` - **product\_id:** `string` - **type:** `"PREPAID" | "POSTPAID"` - `"PREPAID"` - `"POSTPAID"` - **access\_schedule:** `AccessSchedule` Required: Schedule for distributing the commit to the customer. For "POSTPAID" commits only one schedule item is allowed and amount must match invoice_schedule total. - **schedule\_items:** `Array` - **amount:** `number` - **ending\_before:** `string` RFC 3339 timestamp (exclusive) - **starting\_at:** `string` RFC 3339 timestamp (inclusive) - **credit\_type\_id:** `string` - **amount:** `number` (DEPRECATED) Use access_schedule and invoice_schedule instead. - **applicable\_product\_ids:** `Array` Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array` Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **custom\_fields:** `Record` - **description:** `string` Used only in UI/API. It is not exposed to end customers. - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for commit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **invoice\_schedule:** `InvoiceSchedule` Required for "POSTPAID" commits: the true up invoice will be generated at this time and only one schedule item is allowed; the total must match access_schedule amount. Optional for "PREPAID" commits: if not provided, this will be a "complimentary" commit with no invoice. - **credit\_type\_id:** `string` Defaults to USD (cents) if not passed. - **do\_not\_invoice:** `boolean` This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice. - **recurring\_schedule:** `RecurringSchedule` Enter the unit price and quantity for the charge or instead only send the amount. If amount is sent, the unit price is assumed to be the amount and quantity is inferred to be 1. - **amount\_distribution:** `"DIVIDED" | "DIVIDED_ROUNDED" | "EACH"` - `"DIVIDED"` - `"DIVIDED_ROUNDED"` - `"EACH"` - **ending\_before:** `string` RFC 3339 timestamp (exclusive). - **frequency:** `"MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | 2 more` - `"MONTHLY"` - `"QUARTERLY"` - `"SEMI_ANNUAL"` - `"ANNUAL"` - `"WEEKLY"` - **starting\_at:** `string` RFC 3339 timestamp (inclusive). - **amount:** `number` Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1. - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided. - **schedule\_items:** `Array` Either provide amount or provide both unit_price and quantity. - **timestamp:** `string` timestamp of the scheduled event - **amount:** `number` Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1. - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided. - **name:** `string` displayed on invoices - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **payment\_gate\_config:** `PaymentGateConfig` optionally payment gate this commit - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **priority:** `number` If multiple commits are applicable, the one with the lower priority will apply first. - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` - `"COMMIT_RATE"` - `"LIST_RATE"` - **rollover\_fraction:** `number` Fraction of unused segments that will be rolled over. Must be between 0 and 1. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **temporary\_id:** `string` A temporary ID for the commit that can be used to reference the commit for commit specific overrides. - **add\_credits:** `Array` - **access\_schedule:** `AccessSchedule` Schedule for distributing the credit to the customer. - **schedule\_items:** `Array` - **amount:** `number` - **ending\_before:** `string` RFC 3339 timestamp (exclusive) - **starting\_at:** `string` RFC 3339 timestamp (inclusive) - **credit\_type\_id:** `string` - **product\_id:** `string` - **applicable\_product\_ids:** `Array` Which products the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products. - **applicable\_product\_tags:** `Array` Which tags the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products. - **custom\_fields:** `Record` - **description:** `string` Used only in UI/API. It is not exposed to end customers. - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **name:** `string` displayed on invoices - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **priority:** `number` If multiple credits are applicable, the one with the lower priority will apply first. - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` - `"COMMIT_RATE"` - `"LIST_RATE"` - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **add\_discounts:** `Array` - **product\_id:** `string` - **schedule:** `Schedule` Must provide either schedule_items or recurring_schedule. - **credit\_type\_id:** `string` Defaults to USD (cents) if not passed. - **do\_not\_invoice:** `boolean` This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice. - **recurring\_schedule:** `RecurringSchedule` Enter the unit price and quantity for the charge or instead only send the amount. If amount is sent, the unit price is assumed to be the amount and quantity is inferred to be 1. - **amount\_distribution:** `"DIVIDED" | "DIVIDED_ROUNDED" | "EACH"` - `"DIVIDED"` - `"DIVIDED_ROUNDED"` - `"EACH"` - **ending\_before:** `string` RFC 3339 timestamp (exclusive). - **frequency:** `"MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | 2 more` - `"MONTHLY"` - `"QUARTERLY"` - `"SEMI_ANNUAL"` - `"ANNUAL"` - `"WEEKLY"` - **starting\_at:** `string` RFC 3339 timestamp (inclusive). - **amount:** `number` Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1. - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided. - **schedule\_items:** `Array` Either provide amount or provide both unit_price and quantity. - **timestamp:** `string` timestamp of the scheduled event - **amount:** `number` Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1. - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided. - **custom\_fields:** `Record` - **name:** `string` displayed on invoices - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **add\_overrides:** `Array` - **starting\_at:** `string` RFC 3339 timestamp indicating when the override will start applying (inclusive) - **applicable\_product\_tags:** `Array` tags identifying products whose rates are being overridden - **ending\_before:** `string` RFC 3339 timestamp indicating when the override will stop applying (exclusive) - **entitled:** `boolean` - **is\_commit\_specific:** `boolean` Indicates whether the override should only apply to commits. Defaults to `false`. If `true`, you can specify relevant commits in `override_specifiers` by passing `commit_ids`. - **multiplier:** `number` Required for MULTIPLIER type. Must be >=0. - **override\_specifiers:** `Array` Cannot be used in conjunction with product_id or applicable_product_tags. If provided, the override will apply to all products with the specified specifiers. - **billing\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **commit\_ids:** `Array` If provided, the override will only apply to the specified commits. Can only be used for commit specific overrides. If not provided, the override will apply to all commits. - **presentation\_group\_values:** `Record` A map of group names to values. The override will only apply to line items with the specified presentation group values. Can only be used for multiplier overrides. - **pricing\_group\_values:** `Record` A map of pricing group names to values. The override will only apply to products with the specified pricing group values. - **product\_id:** `string` If provided, the override will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the override will only apply to products with all the specified tags. - **recurring\_commit\_ids:** `Array` Can only be used for commit specific overrides. Must be used in conjunction with one of product_id, product_tags, pricing_group_values, or presentation_group_values. If provided, the override will only apply to commits created by the specified recurring commit ids. - **recurring\_credit\_ids:** `Array` Can only be used for commit specific overrides. Must be used in conjunction with one of product_id, product_tags, pricing_group_values, or presentation_group_values. If provided, the override will only apply to commits created by the specified recurring credit ids. - **overwrite\_rate:** `OverwriteRate` Required for OVERWRITE type. - **rate\_type:** `"FLAT" | "PERCENTAGE" | "SUBSCRIPTION" | 2 more` - `"FLAT"` - `"PERCENTAGE"` - `"SUBSCRIPTION"` - `"TIERED"` - `"CUSTOM"` - **credit\_type\_id:** `string` - **custom\_rate:** `Record` Only set for CUSTOM rate_type. This field is interpreted by custom rate processors. - **is\_prorated:** `boolean` Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true. - **price:** `number` Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1. - **quantity:** `number` Default quantity. For SUBSCRIPTION rate_type, this must be >=0. - **tiers:** `Array` Only set for TIERED rate_type. - **price:** `number` - **size:** `number` - **priority:** `number` Required for EXPLICIT multiplier prioritization scheme and all TIERED overrides. Under EXPLICIT prioritization, overwrites are prioritized first, and then tiered and multiplier overrides are prioritized by their priority value (lowest first). Must be > 0. - **product\_id:** `string` ID of the product whose rate is being overridden - **target:** `"COMMIT_RATE" | "LIST_RATE"` Indicates whether the override applies to commit rates or list rates. Can only be used for overrides that have `is_commit_specific` set to `true`. Defaults to `"LIST_RATE"`. - `"COMMIT_RATE"` - `"LIST_RATE"` - **tiers:** `Array` Required for TIERED type. Must have at least one tier. - **multiplier:** `number` - **size:** `number` - **type:** `"OVERWRITE" | "MULTIPLIER" | "TIERED"` Overwrites are prioritized over multipliers and tiered overrides. - `"OVERWRITE"` - `"MULTIPLIER"` - `"TIERED"` - **add\_prepaid\_balance\_threshold\_configuration:** `AddPrepaidBalanceThresholdConfiguration` - **commit:** `Commit` - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **applicable\_product\_ids:** `Array` Which products the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array` Which tags the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **recharge\_to\_amount:** `number` Specify the amount the balance should be recharged to. - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated. - **custom\_credit\_type\_id:** `string` If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency. - **add\_professional\_services:** `Array` This field's availability is dependent on your client's configuration. - **max\_amount:** `number` Maximum amount for the term. - **product\_id:** `string` - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified. - **custom\_fields:** `Record` - **description:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **add\_recurring\_commits:** `Array` - **access\_amount:** `AccessAmount` The amount of commit to grant. - **credit\_type\_id:** `string` - **unit\_price:** `number` - **quantity:** `number` This field is required unless a subscription is attached via `subscription_config`. - **commit\_duration:** `CommitDuration` Defines the length of the access schedule for each created commit/credit. The value represents the number of units. Unit defaults to "PERIODS", where the length of a period is determined by the recurrence_frequency. - **value:** `number` - **unit:** `"PERIODS"` - `"PERIODS"` - **priority:** `number` Will be passed down to the individual commits - **product\_id:** `string` - **starting\_at:** `string` determines the start time for the first commit - **applicable\_product\_ids:** `Array` Will be passed down to the individual commits - **applicable\_product\_tags:** `Array` Will be passed down to the individual commits - **description:** `string` Will be passed down to the individual commits - **ending\_before:** `string` Determines when the contract will stop creating recurring commits. optional - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for recurring credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **invoice\_amount:** `InvoiceAmount` The amount the customer should be billed for the commit. Not required. - **credit\_type\_id:** `string` - **quantity:** `number` - **unit\_price:** `number` - **name:** `string` displayed on invoices. will be passed through to the individual commits - **netsuite\_sales\_order\_id:** `string` Will be passed down to the individual commits - **proration:** `"NONE" | "FIRST" | "LAST" | "FIRST_AND_LAST"` Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits). - `"NONE"` - `"FIRST"` - `"LAST"` - `"FIRST_AND_LAST"` - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` Whether the created commits will use the commit rate or list rate - `"COMMIT_RATE"` - `"LIST_RATE"` - **recurrence\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates. - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **rollover\_fraction:** `number` Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **subscription\_config:** `SubscriptionConfig` Attach a subscription to the recurring commit/credit. - **apply\_seat\_increase\_config:** `ApplySeatIncreaseConfig` - **is\_prorated:** `boolean` Indicates whether a mid-period seat increase should be prorated. - **subscription\_id:** `string` ID of the subscription to configure on the recurring commit/credit. - **allocation:** `"POOLED"` If set to POOLED, allocation added per seat is pooled across the account. - `"POOLED"` - **temporary\_id:** `string` A temporary ID that can be used to reference the recurring commit for commit specific overrides. - **add\_recurring\_credits:** `Array` - **access\_amount:** `AccessAmount` The amount of commit to grant. - **credit\_type\_id:** `string` - **unit\_price:** `number` - **quantity:** `number` This field is required unless a subscription is attached via `subscription_config`. - **commit\_duration:** `CommitDuration` Defines the length of the access schedule for each created commit/credit. The value represents the number of units. Unit defaults to "PERIODS", where the length of a period is determined by the recurrence_frequency. - **value:** `number` - **unit:** `"PERIODS"` - `"PERIODS"` - **priority:** `number` Will be passed down to the individual commits - **product\_id:** `string` - **starting\_at:** `string` determines the start time for the first commit - **applicable\_product\_ids:** `Array` Will be passed down to the individual commits - **applicable\_product\_tags:** `Array` Will be passed down to the individual commits - **description:** `string` Will be passed down to the individual commits - **ending\_before:** `string` Determines when the contract will stop creating recurring commits. optional - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for recurring credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **name:** `string` displayed on invoices. will be passed through to the individual commits - **netsuite\_sales\_order\_id:** `string` Will be passed down to the individual commits - **proration:** `"NONE" | "FIRST" | "LAST" | "FIRST_AND_LAST"` Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits). - `"NONE"` - `"FIRST"` - `"LAST"` - `"FIRST_AND_LAST"` - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` Whether the created commits will use the commit rate or list rate - `"COMMIT_RATE"` - `"LIST_RATE"` - **recurrence\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates. - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **rollover\_fraction:** `number` Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **subscription\_config:** `SubscriptionConfig` Attach a subscription to the recurring commit/credit. - **apply\_seat\_increase\_config:** `ApplySeatIncreaseConfig` - **is\_prorated:** `boolean` Indicates whether a mid-period seat increase should be prorated. - **subscription\_id:** `string` ID of the subscription to configure on the recurring commit/credit. - **allocation:** `"POOLED"` If set to POOLED, allocation added per seat is pooled across the account. - `"POOLED"` - **temporary\_id:** `string` A temporary ID that can be used to reference the recurring commit for commit specific overrides. - **add\_reseller\_royalties:** `Array` - **reseller\_type:** `"AWS" | "AWS_PRO_SERVICE" | "GCP" | "GCP_PRO_SERVICE"` - `"AWS"` - `"AWS_PRO_SERVICE"` - `"GCP"` - `"GCP_PRO_SERVICE"` - **applicable\_product\_ids:** `Array` Must provide at least one of applicable_product_ids or applicable_product_tags. - **applicable\_product\_tags:** `Array` Must provide at least one of applicable_product_ids or applicable_product_tags. - **aws\_options:** `AwsOptions` - **aws\_account\_number:** `string` - **aws\_offer\_id:** `string` - **aws\_payer\_reference\_id:** `string` - **ending\_before:** `string | null` Use null to indicate that the existing end timestamp should be removed. - **fraction:** `number` - **gcp\_options:** `GcpOptions` - **gcp\_account\_id:** `string` - **gcp\_offer\_id:** `string` - **netsuite\_reseller\_id:** `string` - **reseller\_contract\_value:** `number` - **starting\_at:** `string` - **add\_scheduled\_charges:** `Array` - **product\_id:** `string` - **schedule:** `Schedule` Must provide either schedule_items or recurring_schedule. - **credit\_type\_id:** `string` Defaults to USD (cents) if not passed. - **do\_not\_invoice:** `boolean` This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice. - **recurring\_schedule:** `RecurringSchedule` Enter the unit price and quantity for the charge or instead only send the amount. If amount is sent, the unit price is assumed to be the amount and quantity is inferred to be 1. - **amount\_distribution:** `"DIVIDED" | "DIVIDED_ROUNDED" | "EACH"` - `"DIVIDED"` - `"DIVIDED_ROUNDED"` - `"EACH"` - **ending\_before:** `string` RFC 3339 timestamp (exclusive). - **frequency:** `"MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | 2 more` - `"MONTHLY"` - `"QUARTERLY"` - `"SEMI_ANNUAL"` - `"ANNUAL"` - `"WEEKLY"` - **starting\_at:** `string` RFC 3339 timestamp (inclusive). - **amount:** `number` Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1. - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided. - **schedule\_items:** `Array` Either provide amount or provide both unit_price and quantity. - **timestamp:** `string` timestamp of the scheduled event - **amount:** `number` Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1. - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided. - **name:** `string` displayed on invoices - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **add\_spend\_threshold\_configuration:** `AddSpendThresholdConfiguration` - **commit:** `Commit` - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated. - **add\_subscriptions:** `Array` Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract. - **collection\_schedule:** `"ADVANCE" | "ARREARS"` - `"ADVANCE"` - `"ARREARS"` - **initial\_quantity:** `number` - **proration:** `Proration` - **invoice\_behavior:** `"BILL_IMMEDIATELY" | "BILL_ON_NEXT_COLLECTION_DATE"` Indicates how mid-period quantity adjustments are invoiced. **BILL\_IMMEDIATELY**: Only available when collection schedule is `ADVANCE`. The quantity increase will be billed immediately on the scheduled date. **BILL\_ON\_NEXT\_COLLECTION\_DATE**: The quantity increase will be billed for in-arrears at the end of the period. - `"BILL_IMMEDIATELY"` - `"BILL_ON_NEXT_COLLECTION_DATE"` - **is\_prorated:** `boolean` Indicates if the partial period will be prorated or charged a full amount. - **subscription\_rate:** `SubscriptionRate` - **billing\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` Frequency to bill subscription with. Together with product_id, must match existing rate on the rate card. - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **product\_id:** `string` Must be subscription type product - **custom\_fields:** `Record` - **description:** `string` - **ending\_before:** `string` Exclusive end time for the subscription. If not provided, subscription inherits contract end date. - **name:** `string` - **starting\_at:** `string` Inclusive start time for the subscription. If not provided, defaults to contract start date - **temporary\_id:** `string` A temporary ID used to reference the subscription in recurring commit/credit subscription configs created within the same payload. - **allow\_contract\_ending\_before\_finalized\_invoice:** `boolean` If true, allows setting the contract end date earlier than the end_timestamp of existing finalized invoices. Finalized invoices will be unchanged; if you want to incorporate the new end date, you can void and regenerate finalized usage invoices. Defaults to true. - **archive\_commits:** `Array` IDs of commits to archive - **id:** `string` - **archive\_credits:** `Array` IDs of credits to archive - **id:** `string` - **archive\_scheduled\_charges:** `Array` IDs of scheduled charges to archive - **id:** `string` - **remove\_overrides:** `Array` IDs of overrides to remove - **id:** `string` - **update\_commits:** `Array` - **commit\_id:** `string` - **access\_schedule:** `AccessSchedule` - **add\_schedule\_items:** `Array` - **amount:** `number` - **ending\_before:** `string` - **starting\_at:** `string` - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **ending\_before:** `string` - **starting\_at:** `string` - **applicable\_product\_ids:** `Array | null` Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array | null` Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for commit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **invoice\_schedule:** `InvoiceSchedule` - **add\_schedule\_items:** `Array` - **timestamp:** `string` - **amount:** `number` - **quantity:** `number` - **unit\_price:** `number` - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **quantity:** `number` - **timestamp:** `string` - **unit\_price:** `number` - **netsuite\_sales\_order\_id:** `string | null` - **priority:** `number | null` - **product\_id:** `string` - **rollover\_fraction:** `number | null` - **update\_contract\_end\_date:** `string | null` RFC 3339 timestamp indicating when the contract will end (exclusive). - **update\_contract\_name:** `string | null` Value to update the contract name to. If not provided, the contract name will remain unchanged. - **update\_credits:** `Array` - **credit\_id:** `string` - **access\_schedule:** `AccessSchedule` - **add\_schedule\_items:** `Array` - **amount:** `number` - **ending\_before:** `string` - **starting\_at:** `string` - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **ending\_before:** `string` - **starting\_at:** `string` - **applicable\_product\_ids:** `Array | null` Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array | null` Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for commit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **netsuite\_sales\_order\_id:** `string | null` - **priority:** `number | null` - **product\_id:** `string` - **update\_prepaid\_balance\_threshold\_configuration:** `UpdatePrepaidBalanceThresholdConfiguration` - **commit:** `Commit` - **applicable\_product\_ids:** `Array | null` Which products the threshold commit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array | null` Which tags the threshold commit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the commit applies to all products. - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **specifiers:** `Array | null` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **custom\_credit\_type\_id:** `string | null` If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **recharge\_to\_amount:** `number` Specify the amount the balance should be recharged to. - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated. - **update\_recurring\_commits:** `Array` Edits to these recurring commits will only affect commits whose access schedules has not started. Expired commits, and commits with an active access schedule will remain unchanged. - **recurring\_commit\_id:** `string` - **access\_amount:** `AccessAmount` - **quantity:** `number` - **unit\_price:** `number` - **ending\_before:** `string | null` - **invoice\_amount:** `InvoiceAmount` - **quantity:** `number` - **unit\_price:** `number` - **update\_recurring\_credits:** `Array` Edits to these recurring credits will only affect credits whose access schedules has not started. Expired credits, and credits with an active access schedule will remain unchanged. - **recurring\_credit\_id:** `string` - **access\_amount:** `AccessAmount` - **quantity:** `number` - **unit\_price:** `number` - **ending\_before:** `string | null` - **update\_scheduled\_charges:** `Array` - **scheduled\_charge\_id:** `string` - **invoice\_schedule:** `InvoiceSchedule` - **add\_schedule\_items:** `Array` - **timestamp:** `string` - **amount:** `number` - **quantity:** `number` - **unit\_price:** `number` - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **quantity:** `number` - **timestamp:** `string` - **unit\_price:** `number` - **netsuite\_sales\_order\_id:** `string | null` - **update\_spend\_threshold\_configuration:** `UpdateSpendThresholdConfiguration` - **commit:** `Commit` - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated. - **update\_subscriptions:** `Array` Optional list of subscriptions to update. - **subscription\_id:** `string` - **ending\_before:** `string | null` - **quantity\_updates:** `Array` Quantity changes are applied on the effective date based on the order which they are sent. For example, if I scheduled the quantity to be 12 on May 21 and then scheduled a quantity delta change of -1, the result from that day would be 11. - **starting\_at:** `string` - **quantity:** `number` The new quantity for the subscription. Must be provided if quantity_delta is not provided. Must be non-negative. - **quantity\_delta:** `number` The delta to add to the subscription's quantity. Must be provided if quantity is not provided. Can't be zero. It also can't result in a negative quantity on the subscription. ### Returns - `ContractEditResponse` - **data:** `ID` ### Example ```node import Metronome from '@metronome/sdk'; const client = new Metronome({ bearerToken: 'My Bearer Token', }); const response = await client.v2.contracts.edit({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', add_overrides: [ { type: 'MULTIPLIER', starting_at: '2024-11-02T00:00:00Z', product_id: 'd4fc086c-d8e5-4091-a235-fbba5da4ec14', multiplier: 2, priority: 100, }, ], add_scheduled_charges: [ { product_id: '2e30f074-d04c-412e-a134-851ebfa5ceb2', schedule: { schedule_items: [{ timestamp: '2020-02-15T00:00:00.000Z', unit_price: 1000000, quantity: 1 }], }, }, ], }); console.log(response.data); ``` ## Edit Commit `client.v2.contracts.editCommit(ContractEditCommitParamsbody, RequestOptionsoptions?): ContractEditCommitResponse` **post** `/v2/contracts/commits/edit` Edit a customer or contract commit. Contract commits can only be edited using this endpoint if contract editing is enabled. ### Parameters - **body:** `ContractEditCommitParams` - **commit\_id:** `string` ID of the commit to edit - **customer\_id:** `string` ID of the customer whose commit is being edited - **access\_schedule:** `AccessSchedule` - **add\_schedule\_items:** `Array` - **amount:** `number` - **ending\_before:** `string` - **starting\_at:** `string` - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **ending\_before:** `string` - **starting\_at:** `string` - **applicable\_product\_ids:** `Array | null` Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array | null` Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **invoice\_contract\_id:** `string` ID of contract to use for invoicing - **invoice\_schedule:** `InvoiceSchedule` - **add\_schedule\_items:** `Array` - **timestamp:** `string` - **amount:** `number` - **quantity:** `number` - **unit\_price:** `number` - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **quantity:** `number` - **timestamp:** `string` - **unit\_price:** `number` - **priority:** `number | null` If multiple commits are applicable, the one with the lower priority will apply first. - **product\_id:** `string` - **specifiers:** `Array | null` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. ### Returns - `ContractEditCommitResponse` - **data:** `ID` ### Example ```node import Metronome from '@metronome/sdk'; const client = new Metronome({ bearerToken: 'My Bearer Token', }); const response = await client.v2.contracts.editCommit({ commit_id: '5e7e82cf-ccb7-428c-a96f-a8e4f67af822', customer_id: '4c91c473-fc12-445a-9c38-40421d47023f', access_schedule: { update_schedule_items: [ { id: 'd5edbd32-c744-48cb-9475-a9bca0e6fa39', ending_before: '2025-03-12T00:00:00Z' }, ], }, }); console.log(response.data); ``` ## Edit Credit `client.v2.contracts.editCredit(ContractEditCreditParamsbody, RequestOptionsoptions?): ContractEditCreditResponse` **post** `/v2/contracts/credits/edit` Edit a customer or contract credit. Contract credits can only be edited using this endpoint if contract editing is enabled. ### Parameters - **body:** `ContractEditCreditParams` - **credit\_id:** `string` ID of the credit to edit - **customer\_id:** `string` ID of the customer whose credit is being edited - **access\_schedule:** `AccessSchedule` - **add\_schedule\_items:** `Array` - **amount:** `number` - **ending\_before:** `string` - **starting\_at:** `string` - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **ending\_before:** `string` - **starting\_at:** `string` - **applicable\_product\_ids:** `Array | null` Which products the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products. - **applicable\_product\_tags:** `Array | null` Which tags the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products. - **priority:** `number | null` If multiple commits are applicable, the one with the lower priority will apply first. - **product\_id:** `string` - **specifiers:** `Array | null` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. ### Returns - `ContractEditCreditResponse` - **data:** `ID` ### Example ```node import Metronome from '@metronome/sdk'; const client = new Metronome({ bearerToken: 'My Bearer Token', }); const response = await client.v2.contracts.editCredit({ credit_id: '5e7e82cf-ccb7-428c-a96f-a8e4f67af822', customer_id: '4c91c473-fc12-445a-9c38-40421d47023f', access_schedule: { update_schedule_items: [ { id: 'd5edbd32-c744-48cb-9475-a9bca0e6fa39', ending_before: '2025-03-12T00:00:00Z' }, ], }, }); console.log(response.data); ``` ## Get Edit History `client.v2.contracts.getEditHistory(ContractGetEditHistoryParamsbody, RequestOptionsoptions?): ContractGetEditHistoryResponse` **post** `/v2/contracts/getEditHistory` Get the edit history of a specific contract. Contract editing must be enabled to use this endpoint. ### Parameters - **body:** `ContractGetEditHistoryParams` - **contract\_id:** `string` - **customer\_id:** `string` ### Returns - `ContractGetEditHistoryResponse` - **data:** `Array` - **id:** `string` - **add\_commits:** `Array` - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **type:** `"PREPAID" | "POSTPAID"` - `"PREPAID"` - `"POSTPAID"` - **access\_schedule:** `ScheduleDuration` The schedule that the customer will gain access to the credits purposed with this commit. - **applicable\_product\_ids:** `Array` - **applicable\_product\_tags:** `Array` - **description:** `string` - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for commit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **invoice\_schedule:** `SchedulePointInTime` The schedule that the customer will be invoiced for this commit. - **name:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **priority:** `number` If multiple credits or commits are applicable, the one with the lower priority will apply first. - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` - `"COMMIT_RATE"` - `"LIST_RATE"` - **rollover\_fraction:** `number` - **salesforce\_opportunity\_id:** `string` This field's availability is dependent on your client's configuration. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **add\_credits:** `Array` - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **type:** `"CREDIT"` - `"CREDIT"` - **access\_schedule:** `ScheduleDuration` The schedule that the customer will gain access to the credits. - **applicable\_product\_ids:** `Array` - **applicable\_product\_tags:** `Array` - **description:** `string` - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for recurring credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **name:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **priority:** `number` If multiple credits or commits are applicable, the one with the lower priority will apply first. - **salesforce\_opportunity\_id:** `string` This field's availability is dependent on your client's configuration. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **add\_discounts:** `Array` - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **schedule:** `SchedulePointInTime` - **custom\_fields:** `Record` - **name:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **add\_overrides:** `Array` - **id:** `string` - **starting\_at:** `string` - **applicable\_product\_tags:** `Array` - **ending\_before:** `string` - **entitled:** `boolean` - **is\_commit\_specific:** `boolean` - **multiplier:** `number` - **override\_specifiers:** `Array` - **billing\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **commit\_ids:** `Array` - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` - **product\_tags:** `Array` - **recurring\_commit\_ids:** `Array` - **recurring\_credit\_ids:** `Array` - **override\_tiers:** `Array` - **multiplier:** `number` - **size:** `number` - **overwrite\_rate:** `OverwriteRate` - **rate\_type:** `"FLAT" | "PERCENTAGE" | "SUBSCRIPTION" | 2 more` - `"FLAT"` - `"PERCENTAGE"` - `"SUBSCRIPTION"` - `"TIERED"` - `"CUSTOM"` - **credit\_type:** `CreditTypeData` - **custom\_rate:** `Record` Only set for CUSTOM rate_type. This field is interpreted by custom rate processors. - **is\_prorated:** `boolean` Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true. - **price:** `number` Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1. - **quantity:** `number` Default quantity. For SUBSCRIPTION rate_type, this must be >=0. - **tiers:** `Array` Only set for TIERED rate_type. - **price:** `number` - **size:** `number` - **priority:** `number` - **product:** `Product` - **id:** `string` - **name:** `string` - **target:** `"COMMIT_RATE" | "LIST_RATE"` - `"COMMIT_RATE"` - `"LIST_RATE"` - **type:** `"OVERWRITE" | "MULTIPLIER" | "TIERED"` - `"OVERWRITE"` - `"MULTIPLIER"` - `"TIERED"` - **add\_prepaid\_balance\_threshold\_configuration:** `AddPrepaidBalanceThresholdConfiguration` - **commit:** `Commit` - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **applicable\_product\_ids:** `Array` Which products the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array` Which tags the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **recharge\_to\_amount:** `number` Specify the amount the balance should be recharged to. - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated. - **custom\_credit\_type\_id:** `string` If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency. - **add\_pro\_services:** `Array` - **id:** `string` - **max\_amount:** `number` Maximum amount for the term. - **product\_id:** `string` - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified. - **custom\_fields:** `Record` - **description:** `string` - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **add\_recurring\_commits:** `Array` - **id:** `string` - **access\_amount:** `AccessAmount` The amount of commit to grant. - **credit\_type\_id:** `string` - **unit\_price:** `number` - **quantity:** `number` - **commit\_duration:** `CommitDuration` The amount of time the created commits will be valid for - **value:** `number` - **unit:** `"PERIODS"` - `"PERIODS"` - **priority:** `number` Will be passed down to the individual commits - **product:** `Product` - **id:** `string` - **name:** `string` - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` Whether the created commits will use the commit rate or list rate - `"COMMIT_RATE"` - `"LIST_RATE"` - **starting\_at:** `string` Determines the start time for the first commit - **applicable\_product\_ids:** `Array` Will be passed down to the individual commits - **applicable\_product\_tags:** `Array` Will be passed down to the individual commits - **contract:** `Contract` - **id:** `string` - **description:** `string` Will be passed down to the individual commits - **ending\_before:** `string` Determines when the contract will stop creating recurring commits. Optional - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for recurring credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **invoice\_amount:** `InvoiceAmount` The amount the customer should be billed for the commit. Not required. - **credit\_type\_id:** `string` - **quantity:** `number` - **unit\_price:** `number` - **name:** `string` Displayed on invoices. Will be passed through to the individual commits - **netsuite\_sales\_order\_id:** `string` Will be passed down to the individual commits - **proration:** `"NONE" | "FIRST" | "LAST" | "FIRST_AND_LAST"` Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits). - `"NONE"` - `"FIRST"` - `"LAST"` - `"FIRST_AND_LAST"` - **recurrence\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates. - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **rollover\_fraction:** `number` Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **subscription\_config:** `SubscriptionConfig` Attach a subscription to the recurring commit/credit. - **allocation:** `"INDIVIDUAL" | "POOLED"` - `"INDIVIDUAL"` - `"POOLED"` - **apply\_seat\_increase\_config:** `ApplySeatIncreaseConfig` - **is\_prorated:** `boolean` Indicates whether a mid-period seat increase should be prorated. - **subscription\_id:** `string` - **add\_recurring\_credits:** `Array` - **id:** `string` - **access\_amount:** `AccessAmount` The amount of commit to grant. - **credit\_type\_id:** `string` - **unit\_price:** `number` - **quantity:** `number` - **commit\_duration:** `CommitDuration` The amount of time the created commits will be valid for - **value:** `number` - **unit:** `"PERIODS"` - `"PERIODS"` - **priority:** `number` Will be passed down to the individual commits - **product:** `Product` - **id:** `string` - **name:** `string` - **rate\_type:** `"COMMIT_RATE" | "LIST_RATE"` Whether the created commits will use the commit rate or list rate - `"COMMIT_RATE"` - `"LIST_RATE"` - **starting\_at:** `string` Determines the start time for the first commit - **applicable\_product\_ids:** `Array` Will be passed down to the individual commits - **applicable\_product\_tags:** `Array` Will be passed down to the individual commits - **contract:** `Contract` - **id:** `string` - **description:** `string` Will be passed down to the individual commits - **ending\_before:** `string` Determines when the contract will stop creating recurring commits. Optional - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for recurring credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **name:** `string` Displayed on invoices. Will be passed through to the individual commits - **netsuite\_sales\_order\_id:** `string` Will be passed down to the individual commits - **proration:** `"NONE" | "FIRST" | "LAST" | "FIRST_AND_LAST"` Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits). - `"NONE"` - `"FIRST"` - `"LAST"` - `"FIRST_AND_LAST"` - **recurrence\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates. - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **rollover\_fraction:** `number` Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1. - **specifiers:** `Array` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **subscription\_config:** `SubscriptionConfig` Attach a subscription to the recurring commit/credit. - **allocation:** `"INDIVIDUAL" | "POOLED"` - `"INDIVIDUAL"` - `"POOLED"` - **apply\_seat\_increase\_config:** `ApplySeatIncreaseConfig` - **is\_prorated:** `boolean` Indicates whether a mid-period seat increase should be prorated. - **subscription\_id:** `string` - **add\_reseller\_royalties:** `Array` - **reseller\_type:** `"AWS" | "AWS_PRO_SERVICE" | "GCP" | "GCP_PRO_SERVICE"` - `"AWS"` - `"AWS_PRO_SERVICE"` - `"GCP"` - `"GCP_PRO_SERVICE"` - **applicable\_product\_ids:** `Array` - **applicable\_product\_tags:** `Array` - **aws\_account\_number:** `string` - **aws\_offer\_id:** `string` - **aws\_payer\_reference\_id:** `string` - **ending\_before:** `string | null` - **fraction:** `number` - **gcp\_account\_id:** `string` - **gcp\_offer\_id:** `string` - **netsuite\_reseller\_id:** `string` - **reseller\_contract\_value:** `number` - **starting\_at:** `string` - **add\_scheduled\_charges:** `Array` - **id:** `string` - **product:** `Product` - **id:** `string` - **name:** `string` - **schedule:** `SchedulePointInTime` - **name:** `string` displayed on invoices - **netsuite\_sales\_order\_id:** `string` This field's availability is dependent on your client's configuration. - **add\_spend\_threshold\_configuration:** `AddSpendThresholdConfiguration` - **commit:** `Commit` - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated. - **add\_subscriptions:** `Array` List of subscriptions on the contract. - **collection\_schedule:** `"ADVANCE" | "ARREARS"` - `"ADVANCE"` - `"ARREARS"` - **proration:** `Proration` - **invoice\_behavior:** `"BILL_IMMEDIATELY" | "BILL_ON_NEXT_COLLECTION_DATE"` - `"BILL_IMMEDIATELY"` - `"BILL_ON_NEXT_COLLECTION_DATE"` - **is\_prorated:** `boolean` - **quantity\_schedule:** `Array` List of quantity schedule items for the subscription. Only includes the current quantity and future quantity changes. - **quantity:** `number` - **starting\_at:** `string` - **ending\_before:** `string` - **starting\_at:** `string` - **subscription\_rate:** `SubscriptionRate` - **billing\_frequency:** `"MONTHLY" | "QUARTERLY" | "ANNUAL" | "WEEKLY"` - `"MONTHLY"` - `"QUARTERLY"` - `"ANNUAL"` - `"WEEKLY"` - **product:** `Product` - **id:** `string` - **name:** `string` - **id:** `string` - **custom\_fields:** `Record` - **description:** `string` - **ending\_before:** `string` - **fiat\_credit\_type\_id:** `string` - **name:** `string` - **add\_usage\_filters:** `Array` - **group\_key:** `string` - **group\_values:** `Array` - **starting\_at:** `string` This will match contract starting_at value if usage filter is active from the beginning of the contract. - **ending\_before:** `string` This will match contract ending_before value if usage filter is active until the end of the contract. It will be undefined if the contract is open-ended. - **archive\_commits:** `Array` - **id:** `string` - **archive\_credits:** `Array` - **id:** `string` - **archive\_scheduled\_charges:** `Array` - **id:** `string` - **remove\_overrides:** `Array` - **id:** `string` - **timestamp:** `string` - **update\_commits:** `Array` - **id:** `string` - **access\_schedule:** `AccessSchedule` - **add\_schedule\_items:** `Array` - **amount:** `number` - **ending\_before:** `string` RFC 3339 timestamp (exclusive) - **starting\_at:** `string` RFC 3339 timestamp (inclusive) - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **ending\_before:** `string` RFC 3339 timestamp (exclusive) - **starting\_at:** `string` RFC 3339 timestamp (inclusive) - **applicable\_product\_ids:** `Array | null` Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array | null` Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products. - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for commit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **invoice\_schedule:** `InvoiceSchedule` - **add\_schedule\_items:** `Array` - **timestamp:** `string` - **amount:** `number` - **quantity:** `number` - **unit\_price:** `number` - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **quantity:** `number` - **timestamp:** `string` - **unit\_price:** `number` - **name:** `string` - **netsuite\_sales\_order\_id:** `string | null` - **priority:** `number | null` If multiple commits are applicable, the one with the lower priority will apply first. - **product\_id:** `string` - **rollover\_fraction:** `number | null` - **specifiers:** `Array | null` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **update\_contract\_end\_date:** `string` - **update\_contract\_name:** `string | null` Value to update the contract name to. If not provided, the contract name will remain unchanged. - **update\_credits:** `Array` - **id:** `string` - **access\_schedule:** `AccessSchedule` - **add\_schedule\_items:** `Array` - **amount:** `number` - **ending\_before:** `string` RFC 3339 timestamp (exclusive) - **starting\_at:** `string` RFC 3339 timestamp (inclusive) - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **ending\_before:** `string` RFC 3339 timestamp (exclusive) - **starting\_at:** `string` RFC 3339 timestamp (inclusive) - **hierarchy\_configuration:** `HierarchyConfiguration` Optional configuration for credit hierarchy access control - **child\_access:** `CommitHierarchyChildAccessAll | CommitHierarchyChildAccessNone | CommitHierarchyChildAccessContractIDs` - `CommitHierarchyChildAccessAll` - **type:** `"ALL"` - `"ALL"` - `CommitHierarchyChildAccessNone` - **type:** `"NONE"` - `"NONE"` - `CommitHierarchyChildAccessContractIDs` - **contract\_ids:** `Array` - **type:** `"CONTRACT_IDS"` - `"CONTRACT_IDS"` - **name:** `string` - **netsuite\_sales\_order\_id:** `string | null` - **priority:** `number | null` If multiple credits are applicable, the one with the lower priority will apply first. - **rollover\_fraction:** `number | null` - **update\_discounts:** `Array` - **id:** `string` - **custom\_fields:** `Record` - **name:** `string` - **netsuite\_sales\_order\_id:** `string` - **schedule:** `Schedule` Must provide either schedule_items or recurring_schedule. - **credit\_type\_id:** `string` Defaults to USD (cents) if not passed. - **do\_not\_invoice:** `boolean` This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice. - **recurring\_schedule:** `RecurringSchedule` Enter the unit price and quantity for the charge or instead only send the amount. If amount is sent, the unit price is assumed to be the amount and quantity is inferred to be 1. - **amount\_distribution:** `"DIVIDED" | "DIVIDED_ROUNDED" | "EACH"` - `"DIVIDED"` - `"DIVIDED_ROUNDED"` - `"EACH"` - **ending\_before:** `string` RFC 3339 timestamp (exclusive). - **frequency:** `"MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | 2 more` - `"MONTHLY"` - `"QUARTERLY"` - `"SEMI_ANNUAL"` - `"ANNUAL"` - `"WEEKLY"` - **starting\_at:** `string` RFC 3339 timestamp (inclusive). - **amount:** `number` Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1. - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided. - **schedule\_items:** `Array` Either provide amount or provide both unit_price and quantity. - **timestamp:** `string` timestamp of the scheduled event - **amount:** `number` Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1. - **quantity:** `number` Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided. - **unit\_price:** `number` Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided. - **update\_prepaid\_balance\_threshold\_configuration:** `UpdatePrepaidBalanceThresholdConfiguration` - **commit:** `Commit` - **applicable\_product\_ids:** `Array | null` Which products the threshold commit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the commit applies to all products. - **applicable\_product\_tags:** `Array | null` Which tags the threshold commit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the commit applies to all products. - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **specifiers:** `Array | null` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Record` - **pricing\_group\_values:** `Record` - **product\_id:** `string` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array` If provided, the specifier will only apply to products with all the specified tags. - **custom\_credit\_type\_id:** `string | null` If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **recharge\_to\_amount:** `number` Specify the amount the balance should be recharged to. - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated. - **update\_recurring\_commits:** `Array` - **id:** `string` - **access\_amount:** `AccessAmount` - **quantity:** `number` - **unit\_price:** `number` - **ending\_before:** `string` - **invoice\_amount:** `InvoiceAmount` - **quantity:** `number` - **unit\_price:** `number` - **update\_recurring\_credits:** `Array` - **id:** `string` - **access\_amount:** `AccessAmount` - **quantity:** `number` - **unit\_price:** `number` - **ending\_before:** `string` - **update\_refund\_invoices:** `Array` - **date:** `string` - **invoice\_id:** `string` - **update\_scheduled\_charges:** `Array` - **id:** `string` - **invoice\_schedule:** `InvoiceSchedule` - **add\_schedule\_items:** `Array` - **timestamp:** `string` - **amount:** `number` - **quantity:** `number` - **unit\_price:** `number` - **remove\_schedule\_items:** `Array` - **id:** `string` - **update\_schedule\_items:** `Array` - **id:** `string` - **amount:** `number` - **quantity:** `number` - **timestamp:** `string` - **unit\_price:** `number` - **name:** `string` - **netsuite\_sales\_order\_id:** `string | null` - **update\_spend\_threshold\_configuration:** `UpdateSpendThresholdConfiguration` - **commit:** `Commit` - **description:** `string` - **name:** `string` Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name. - **product\_id:** `string` The commit product that will be used to generate the line item for commit payment. - **is\_enabled:** `boolean` When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state. - **payment\_gate\_config:** `PaymentGateConfig` - **payment\_gate\_type:** `"NONE" | "STRIPE" | "EXTERNAL"` Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance. - `"NONE"` - `"STRIPE"` - `"EXTERNAL"` - **precalculated\_tax\_config:** `PrecalculatedTaxConfig` Only applicable if using PRECALCULATED as your tax type. - **tax\_amount:** `number` Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule - **tax\_name:** `string` Name of the tax to be applied. This may be used in an invoice line item description. - **stripe\_config:** `StripeConfig` Only applicable if using STRIPE as your payment gateway type. - **payment\_type:** `"INVOICE" | "PAYMENT_INTENT"` If left blank, will default to INVOICE - `"INVOICE"` - `"PAYMENT_INTENT"` - **invoice\_metadata:** `Record` Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type. - **tax\_type:** `"NONE" | "STRIPE" | "ANROK" | "PRECALCULATED"` Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE. - `"NONE"` - `"STRIPE"` - `"ANROK"` - `"PRECALCULATED"` - **threshold\_amount:** `number` Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated. - **update\_subscriptions:** `Array` Optional list of subscriptions to update. - **id:** `string` - **ending\_before:** `string` - **quantity\_updates:** `Array` - **starting\_at:** `string` - **quantity:** `number` - **quantity\_delta:** `number` ### Example ```node import Metronome from '@metronome/sdk'; const client = new Metronome({ bearerToken: 'My Bearer Token', }); const response = await client.v2.contracts.getEditHistory({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', }); console.log(response.data); ```