## 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); ```