Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Create

Create a contract
post/v1/contracts/create

Create a new contract

Body Parameters
customer_idstring
formatuuid
starting_atstring

inclusive contract start time

formatdate-time
billing_provider_configurationobject
optional

The billing provider configuration associated with a contract. Provide either an ID or the provider and delivery method.

Hide ParametersShow Parameters
billing_providerenum
optional
"aws_marketplace" OR "azure_marketplace" OR "gcp_marketplace" OR 2 more

Do not specify if using billing_provider_configuration_id.

Hide ParametersShow Parameters
"aws_marketplace"
"azure_marketplace"
"gcp_marketplace"
"stripe"
"netsuite"
billing_provider_configuration_idstring
optional

The Metronome ID of the billing provider configuration. Use when a customer has multiple configurations with the same billing provider and delivery method. Otherwise, specify the billing_provider and delivery_method.

formatuuid
delivery_methodenum
optional
"direct_to_billing_provider" OR "aws_sqs" OR "tackle" OR "aws_sns"

Do not specify if using billing_provider_configuration_id.

Hide ParametersShow Parameters
"direct_to_billing_provider"
"aws_sqs"
"tackle"
"aws_sns"
commitsarray of object
optional
Hide ParametersShow Parameters
product_idstring
formatuuid
typeenum
"PREPAID" OR "POSTPAID"
Hide ParametersShow Parameters
"PREPAID"
"POSTPAID"
access_scheduleobject
optional

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.

Hide ParametersShow Parameters
schedule_itemsarray of object
Hide ParametersShow Parameters
amountnumber
ending_beforestring

RFC 3339 timestamp (exclusive)

formatdate-time
starting_atstring

RFC 3339 timestamp (inclusive)

formatdate-time
credit_type_idstring
optional

Defaults to USD (cents) if not passed

formatuuid
amountnumber
optional

(DEPRECATED) Use access_schedule and invoice_schedule instead.

applicable_product_idsarray of string
optional

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_tagsarray of string
optional

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_fieldsmap
optional
descriptionstring
optional

Used only in UI/API. It is not exposed to end customers.

hierarchy_configurationobject
optional

Optional configuration for commit hierarchy access control

Hide ParametersShow Parameters
child_accessunion
One of the following 3 object variants:
Hide ParametersShow Parameters
CommitHierarchyChildAccessAllobject
Hide ParametersShow Parameters
typeenum
"ALL"
Hide ParametersShow Parameters
"ALL"
CommitHierarchyChildAccessNoneobject
Hide ParametersShow Parameters
typeenum
"NONE"
Hide ParametersShow Parameters
"NONE"
CommitHierarchyChildAccessContractIDsobject
Hide ParametersShow Parameters
contract_idsarray of string
typeenum
"CONTRACT_IDS"
Hide ParametersShow Parameters
"CONTRACT_IDS"
invoice_scheduleobject
optional

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.

Hide ParametersShow Parameters
credit_type_idstring
optional

Defaults to USD (cents) if not passed.

formatuuid
do_not_invoiceboolean
optional

This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice.

recurring_scheduleobject
optional

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.

Hide ParametersShow Parameters
amount_distributionenum
"DIVIDED" OR "DIVIDED_ROUNDED" OR "EACH"
Hide ParametersShow Parameters
"DIVIDED"
"DIVIDED_ROUNDED"
"EACH"
ending_beforestring

RFC 3339 timestamp (exclusive).

formatdate-time
frequencyenum
"MONTHLY" OR "QUARTERLY" OR "SEMI_ANNUAL" OR "ANNUAL"
Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"SEMI_ANNUAL"
"ANNUAL"
starting_atstring

RFC 3339 timestamp (inclusive).

formatdate-time
amountnumber
optional

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.

quantitynumber
optional

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_pricenumber
optional

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_itemsarray of object
optional

Either provide amount or provide both unit_price and quantity.

Hide ParametersShow Parameters
timestampstring

timestamp of the scheduled event

formatdate-time
amountnumber
optional

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.

quantitynumber
optional

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_pricenumber
optional

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.

namestring
optional

displayed on invoices

minLength1
netsuite_sales_order_idstring
optional

This field's availability is dependent on your client's configuration.

payment_gate_configobject
optional

optionally payment gate this commit

Hide ParametersShow Parameters
payment_gate_typeenum
"NONE" OR "STRIPE" OR "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.

Hide ParametersShow Parameters
"NONE"
"STRIPE"
"EXTERNAL"
precalculated_tax_configobject
optional

Only applicable if using PRECALCULATED as your tax type.

Hide ParametersShow Parameters
tax_amountnumber

Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule

tax_namestring
optional

Name of the tax to be applied. This may be used in an invoice line item description.

stripe_configobject
optional

Only applicable if using STRIPE as your payment gate type.

Hide ParametersShow Parameters
payment_typeenum
"INVOICE" OR "PAYMENT_INTENT"

If left blank, will default to INVOICE

Hide ParametersShow Parameters
"INVOICE"
"PAYMENT_INTENT"
invoice_metadatamap
optional

Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type.

tax_typeenum
optional
"NONE" OR "STRIPE" OR "ANROK" OR "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.

Hide ParametersShow Parameters
"NONE"
"STRIPE"
"ANROK"
"PRECALCULATED"
prioritynumber
optional

If multiple commits are applicable, the one with the lower priority will apply first.

rate_typeenum
optional
"COMMIT_RATE" OR "LIST_RATE"
Hide ParametersShow Parameters
"COMMIT_RATE"
"LIST_RATE"
rollover_fractionnumber
optional

Fraction of unused segments that will be rolled over. Must be between 0 and 1.

specifiersarray of object
optional

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.

Hide ParametersShow Parameters
presentation_group_valuesmap
optional
pricing_group_valuesmap
optional
product_idstring
optional

If provided, the specifier will only apply to the product with the specified ID.

formatuuid
product_tagsarray of string
optional

If provided, the specifier will only apply to products with all the specified tags.

temporary_idstring
optional

A temporary ID for the commit that can be used to reference the commit for commit specific overrides.

creditsarray of object
optional
Hide ParametersShow Parameters
access_scheduleobject

Schedule for distributing the credit to the customer.

Hide ParametersShow Parameters
schedule_itemsarray of object
Hide ParametersShow Parameters
amountnumber
ending_beforestring

RFC 3339 timestamp (exclusive)

formatdate-time
starting_atstring

RFC 3339 timestamp (inclusive)

formatdate-time
credit_type_idstring
optional

Defaults to USD (cents) if not passed

formatuuid
product_idstring
formatuuid
applicable_product_idsarray of string
optional

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_tagsarray of string
optional

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_fieldsmap
optional
descriptionstring
optional

Used only in UI/API. It is not exposed to end customers.

hierarchy_configurationobject
optional

Optional configuration for credit hierarchy access control

Hide ParametersShow Parameters
child_accessunion
One of the following 3 object variants:
Hide ParametersShow Parameters
CommitHierarchyChildAccessAllobject
Hide ParametersShow Parameters
typeenum
"ALL"
Hide ParametersShow Parameters
"ALL"
CommitHierarchyChildAccessNoneobject
Hide ParametersShow Parameters
typeenum
"NONE"
Hide ParametersShow Parameters
"NONE"
CommitHierarchyChildAccessContractIDsobject
Hide ParametersShow Parameters
contract_idsarray of string
typeenum
"CONTRACT_IDS"
Hide ParametersShow Parameters
"CONTRACT_IDS"
namestring
optional

displayed on invoices

minLength1
netsuite_sales_order_idstring
optional

This field's availability is dependent on your client's configuration.

prioritynumber
optional

If multiple credits are applicable, the one with the lower priority will apply first.

rate_typeenum
optional
"COMMIT_RATE" OR "LIST_RATE"
Hide ParametersShow Parameters
"COMMIT_RATE"
"LIST_RATE"
specifiersarray of object
optional

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.

Hide ParametersShow Parameters
presentation_group_valuesmap
optional
pricing_group_valuesmap
optional
product_idstring
optional

If provided, the specifier will only apply to the product with the specified ID.

formatuuid
product_tagsarray of string
optional

If provided, the specifier will only apply to products with all the specified tags.

custom_fieldsmap
optional
discountsarray of object
optional

This field's availability is dependent on your client's configuration.

Hide ParametersShow Parameters
product_idstring
formatuuid
scheduleobject

Must provide either schedule_items or recurring_schedule.

Hide ParametersShow Parameters
credit_type_idstring
optional

Defaults to USD (cents) if not passed.

formatuuid
do_not_invoiceboolean
optional

This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice.

recurring_scheduleobject
optional

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.

Hide ParametersShow Parameters
amount_distributionenum
"DIVIDED" OR "DIVIDED_ROUNDED" OR "EACH"
Hide ParametersShow Parameters
"DIVIDED"
"DIVIDED_ROUNDED"
"EACH"
ending_beforestring

RFC 3339 timestamp (exclusive).

formatdate-time
frequencyenum
"MONTHLY" OR "QUARTERLY" OR "SEMI_ANNUAL" OR "ANNUAL"
Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"SEMI_ANNUAL"
"ANNUAL"
starting_atstring

RFC 3339 timestamp (inclusive).

formatdate-time
amountnumber
optional

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.

quantitynumber
optional

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_pricenumber
optional

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_itemsarray of object
optional

Either provide amount or provide both unit_price and quantity.

Hide ParametersShow Parameters
timestampstring

timestamp of the scheduled event

formatdate-time
amountnumber
optional

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.

quantitynumber
optional

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_pricenumber
optional

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_fieldsmap
optional
namestring
optional

displayed on invoices

minLength1
netsuite_sales_order_idstring
optional

This field's availability is dependent on your client's configuration.

ending_beforestring
optional

exclusive contract end time

formatdate-time
hierarchy_configurationobject
optional
Hide ParametersShow Parameters
parentobject
Hide ParametersShow Parameters
contract_idstring
formatuuid
customer_idstring
formatuuid
multiplier_override_prioritizationenum
optional
"LOWEST_MULTIPLIER" OR "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. If tiered overrides are used, prioritization must be explicit.

Hide ParametersShow Parameters
"LOWEST_MULTIPLIER"
"EXPLICIT"
namestring
optional
net_payment_terms_daysnumber
optional
netsuite_sales_order_idstring
optional

This field's availability is dependent on your client's configuration.

overridesarray of object
optional
Hide ParametersShow Parameters
starting_atstring

RFC 3339 timestamp indicating when the override will start applying (inclusive)

formatdate-time
applicable_product_tagsarray of string
optional

tags identifying products whose rates are being overridden. Cannot be used in conjunction with override_specifiers.

ending_beforestring
optional

RFC 3339 timestamp indicating when the override will stop applying (exclusive)

formatdate-time
entitledboolean
optional
is_commit_specificboolean
optional

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. if you do not specify commit_ids, then the override will apply when consuming any prepaid or postpaid commit.

multipliernumber
optional

Required for MULTIPLIER type. Must be >=0.

override_specifiersarray of object
optional

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.

Hide ParametersShow Parameters
billing_frequencyenum
optional
"MONTHLY" OR "QUARTERLY" OR "ANNUAL" OR "WEEKLY"
Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"ANNUAL"
"WEEKLY"
commit_idsarray of string
optional

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 the specified commits. If not provided, the override will apply to all commits.

presentation_group_valuesmap
optional

A map of group names to values. The override will only apply to line items with the specified presentation group values.

pricing_group_valuesmap
optional

A map of pricing group names to values. The override will only apply to products with the specified pricing group values.

product_idstring
optional

If provided, the override will only apply to the product with the specified ID.

formatuuid
product_tagsarray of string
optional

If provided, the override will only apply to products with all the specified tags.

recurring_commit_idsarray of string
optional

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_idsarray of string
optional

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 credits created by the specified recurring credit ids.

overwrite_rateobject
optional

Required for OVERWRITE type.

Hide ParametersShow Parameters
rate_typeenum
"FLAT" OR "PERCENTAGE" OR "SUBSCRIPTION" OR 2 more
Hide ParametersShow Parameters
"FLAT"
"PERCENTAGE"
"SUBSCRIPTION"
"TIERED"
"CUSTOM"
credit_type_idstring
optional
formatuuid
custom_ratemap
optional

Only set for CUSTOM rate_type. This field is interpreted by custom rate processors.

is_proratedboolean
optional

Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true.

pricenumber
optional

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.

quantitynumber
optional

Default quantity. For SUBSCRIPTION rate_type, this must be >=0.

tiersarray of pricenumbersizenumberTier
optional

Only set for TIERED rate_type.

prioritynumber
optional

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_idstring
optional

ID of the product whose rate is being overridden. Cannot be used in conjunction with override_specifiers.

formatuuid
targetenum
optional
"COMMIT_RATE" OR "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".

Hide ParametersShow Parameters
"COMMIT_RATE"
"LIST_RATE"
tiersarray of object
optional

Required for TIERED type. Must have at least one tier.

Hide ParametersShow Parameters
multipliernumber
sizenumber
optional
typeenum
optional
"OVERWRITE" OR "MULTIPLIER" OR "TIERED"

Overwrites are prioritized over multipliers and tiered overrides.

Hide ParametersShow Parameters
"OVERWRITE"
"MULTIPLIER"
"TIERED"
prepaid_balance_threshold_configurationobject
optional
Hide ParametersShow Parameters
commitobject
Hide ParametersShow Parameters
product_idstring

The commit product that will be used to generate the line item for commit payment.

applicable_product_idsarray of string
optional

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_tagsarray of string
optional

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.

descriptionstring
optional
namestring
optional

Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name.

specifiersarray of object
optional

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.

Hide ParametersShow Parameters
presentation_group_valuesmap
optional
pricing_group_valuesmap
optional
product_idstring
optional

If provided, the specifier will only apply to the product with the specified ID.

formatuuid
product_tagsarray of string
optional

If provided, the specifier will only apply to products with all the specified tags.

is_enabledboolean

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_configobject
Hide ParametersShow Parameters
payment_gate_typeenum
"NONE" OR "STRIPE" OR "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.

Hide ParametersShow Parameters
"NONE"
"STRIPE"
"EXTERNAL"
precalculated_tax_configobject
optional

Only applicable if using PRECALCULATED as your tax type.

Hide ParametersShow Parameters
tax_amountnumber

Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule

tax_namestring
optional

Name of the tax to be applied. This may be used in an invoice line item description.

stripe_configobject
optional

Only applicable if using STRIPE as your payment gate type.

Hide ParametersShow Parameters
payment_typeenum
"INVOICE" OR "PAYMENT_INTENT"

If left blank, will default to INVOICE

Hide ParametersShow Parameters
"INVOICE"
"PAYMENT_INTENT"
invoice_metadatamap
optional

Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type.

tax_typeenum
optional
"NONE" OR "STRIPE" OR "ANROK" OR "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.

Hide ParametersShow Parameters
"NONE"
"STRIPE"
"ANROK"
"PRECALCULATED"
recharge_to_amountnumber

Specify the amount the balance should be recharged to.

threshold_amountnumber

Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.

custom_credit_type_idstring
optional

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.

formatuuid
prioritynumber
optional

Priority of the contract.

professional_servicesarray of object
optional

This field's availability is dependent on your client's configuration.

Hide ParametersShow Parameters
max_amountnumber

Maximum amount for the term.

product_idstring
formatuuid
quantitynumber

Quantity for the charge. Will be multiplied by unit_price to determine the amount.

unit_pricenumber

Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified.

custom_fieldsmap
optional
descriptionstring
optional
netsuite_sales_order_idstring
optional

This field's availability is dependent on your client's configuration.

rate_card_aliasstring
optional

Selects the rate card linked to the specified alias as of the contract's start date.

rate_card_idstring
optional
formatuuid
recurring_commitsarray of object
optional
Hide ParametersShow Parameters
access_amountobject

The amount of commit to grant.

Hide ParametersShow Parameters
credit_type_idstring
formatuuid
unit_pricenumber
quantitynumber
optional

This field is required unless a subscription is attached via subscription_config.

commit_durationobject

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.

Hide ParametersShow Parameters
valuenumber
unitenum
optional
"PERIODS"
Hide ParametersShow Parameters
"PERIODS"
prioritynumber

Will be passed down to the individual commits

product_idstring
formatuuid
starting_atstring

determines the start time for the first commit

formatdate-time
applicable_product_idsarray of string
optional

Will be passed down to the individual commits

applicable_product_tagsarray of string
optional

Will be passed down to the individual commits

descriptionstring
optional

Will be passed down to the individual commits

ending_beforestring
optional

Determines when the contract will stop creating recurring commits. optional

formatdate-time
hierarchy_configurationobject
optional

Optional configuration for recurring commit/credit hierarchy access control

Hide ParametersShow Parameters
child_accessunion
One of the following 3 object variants:
Hide ParametersShow Parameters
CommitHierarchyChildAccessAllobject
Hide ParametersShow Parameters
typeenum
"ALL"
Hide ParametersShow Parameters
"ALL"
CommitHierarchyChildAccessNoneobject
Hide ParametersShow Parameters
typeenum
"NONE"
Hide ParametersShow Parameters
"NONE"
CommitHierarchyChildAccessContractIDsobject
Hide ParametersShow Parameters
contract_idsarray of string
typeenum
"CONTRACT_IDS"
Hide ParametersShow Parameters
"CONTRACT_IDS"
invoice_amountobject
optional

The amount the customer should be billed for the commit. Not required.

Hide ParametersShow Parameters
credit_type_idstring
formatuuid
quantitynumber
unit_pricenumber
namestring
optional

displayed on invoices. will be passed through to the individual commits

minLength1
netsuite_sales_order_idstring
optional

Will be passed down to the individual commits

prorationenum
optional
"NONE" OR "FIRST" OR "LAST" OR "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).

Hide ParametersShow Parameters
"NONE"
"FIRST"
"LAST"
"FIRST_AND_LAST"
rate_typeenum
optional
"COMMIT_RATE" OR "LIST_RATE"

Whether the created commits will use the commit rate or list rate

Hide ParametersShow Parameters
"COMMIT_RATE"
"LIST_RATE"
recurrence_frequencyenum
optional
"MONTHLY" OR "QUARTERLY" OR "ANNUAL" OR "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.

Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"ANNUAL"
"WEEKLY"
rollover_fractionnumber
optional

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.

specifiersarray of object
optional

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.

Hide ParametersShow Parameters
presentation_group_valuesmap
optional
pricing_group_valuesmap
optional
product_idstring
optional

If provided, the specifier will only apply to the product with the specified ID.

formatuuid
product_tagsarray of string
optional

If provided, the specifier will only apply to products with all the specified tags.

subscription_configobject
optional

Attach a subscription to the recurring commit/credit.

Hide ParametersShow Parameters
apply_seat_increase_configobject
Hide ParametersShow Parameters
is_proratedboolean

Indicates whether a mid-period seat increase should be prorated.

subscription_idstring

ID of the subscription to configure on the recurring commit/credit.

allocationenum
optional
"POOLED"

If set to POOLED, allocation added per seat is pooled across the account.

Hide ParametersShow Parameters
"POOLED"
temporary_idstring
optional

A temporary ID that can be used to reference the recurring commit for commit specific overrides.

recurring_creditsarray of object
optional
Hide ParametersShow Parameters
access_amountobject

The amount of commit to grant.

Hide ParametersShow Parameters
credit_type_idstring
formatuuid
unit_pricenumber
quantitynumber
optional

This field is required unless a subscription is attached via subscription_config.

commit_durationobject

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.

Hide ParametersShow Parameters
valuenumber
unitenum
optional
"PERIODS"
Hide ParametersShow Parameters
"PERIODS"
prioritynumber

Will be passed down to the individual commits

product_idstring
formatuuid
starting_atstring

determines the start time for the first commit

formatdate-time
applicable_product_idsarray of string
optional

Will be passed down to the individual commits

applicable_product_tagsarray of string
optional

Will be passed down to the individual commits

descriptionstring
optional

Will be passed down to the individual commits

ending_beforestring
optional

Determines when the contract will stop creating recurring commits. optional

formatdate-time
hierarchy_configurationobject
optional

Optional configuration for recurring commit/credit hierarchy access control

Hide ParametersShow Parameters
child_accessunion
One of the following 3 object variants:
Hide ParametersShow Parameters
CommitHierarchyChildAccessAllobject
Hide ParametersShow Parameters
typeenum
"ALL"
Hide ParametersShow Parameters
"ALL"
CommitHierarchyChildAccessNoneobject
Hide ParametersShow Parameters
typeenum
"NONE"
Hide ParametersShow Parameters
"NONE"
CommitHierarchyChildAccessContractIDsobject
Hide ParametersShow Parameters
contract_idsarray of string
typeenum
"CONTRACT_IDS"
Hide ParametersShow Parameters
"CONTRACT_IDS"
namestring
optional

displayed on invoices. will be passed through to the individual commits

minLength1
netsuite_sales_order_idstring
optional

Will be passed down to the individual commits

prorationenum
optional
"NONE" OR "FIRST" OR "LAST" OR "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).

Hide ParametersShow Parameters
"NONE"
"FIRST"
"LAST"
"FIRST_AND_LAST"
rate_typeenum
optional
"COMMIT_RATE" OR "LIST_RATE"

Whether the created commits will use the commit rate or list rate

Hide ParametersShow Parameters
"COMMIT_RATE"
"LIST_RATE"
recurrence_frequencyenum
optional
"MONTHLY" OR "QUARTERLY" OR "ANNUAL" OR "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.

Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"ANNUAL"
"WEEKLY"
rollover_fractionnumber
optional

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.

specifiersarray of object
optional

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.

Hide ParametersShow Parameters
presentation_group_valuesmap
optional
pricing_group_valuesmap
optional
product_idstring
optional

If provided, the specifier will only apply to the product with the specified ID.

formatuuid
product_tagsarray of string
optional

If provided, the specifier will only apply to products with all the specified tags.

subscription_configobject
optional

Attach a subscription to the recurring commit/credit.

Hide ParametersShow Parameters
apply_seat_increase_configobject
Hide ParametersShow Parameters
is_proratedboolean

Indicates whether a mid-period seat increase should be prorated.

subscription_idstring

ID of the subscription to configure on the recurring commit/credit.

allocationenum
optional
"POOLED"

If set to POOLED, allocation added per seat is pooled across the account.

Hide ParametersShow Parameters
"POOLED"
temporary_idstring
optional

A temporary ID that can be used to reference the recurring commit for commit specific overrides.

reseller_royaltiesarray of object
optional

This field's availability is dependent on your client's configuration.

Hide ParametersShow Parameters
fractionnumber
netsuite_reseller_idstring
reseller_typeenum
"AWS" OR "AWS_PRO_SERVICE" OR "GCP" OR "GCP_PRO_SERVICE"
Hide ParametersShow Parameters
"AWS"
"AWS_PRO_SERVICE"
"GCP"
"GCP_PRO_SERVICE"
starting_atstring
formatdate-time
applicable_product_idsarray of string
optional

Must provide at least one of applicable_product_ids or applicable_product_tags.

applicable_product_tagsarray of string
optional

Must provide at least one of applicable_product_ids or applicable_product_tags.

aws_optionsobject
optional
Hide ParametersShow Parameters
aws_account_numberstring
optional
aws_offer_idstring
optional
aws_payer_reference_idstring
optional
ending_beforestring
optional
formatdate-time
gcp_optionsobject
optional
Hide ParametersShow Parameters
gcp_account_idstring
optional
gcp_offer_idstring
optional
reseller_contract_valuenumber
optional
salesforce_opportunity_idstring
optional

This field's availability is dependent on your client's configuration.

scheduled_chargesarray of object
optional
Hide ParametersShow Parameters
product_idstring
formatuuid
scheduleobject

Must provide either schedule_items or recurring_schedule.

Hide ParametersShow Parameters
credit_type_idstring
optional

Defaults to USD (cents) if not passed.

formatuuid
do_not_invoiceboolean
optional

This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice.

recurring_scheduleobject
optional

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.

Hide ParametersShow Parameters
amount_distributionenum
"DIVIDED" OR "DIVIDED_ROUNDED" OR "EACH"
Hide ParametersShow Parameters
"DIVIDED"
"DIVIDED_ROUNDED"
"EACH"
ending_beforestring

RFC 3339 timestamp (exclusive).

formatdate-time
frequencyenum
"MONTHLY" OR "QUARTERLY" OR "SEMI_ANNUAL" OR "ANNUAL"
Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"SEMI_ANNUAL"
"ANNUAL"
starting_atstring

RFC 3339 timestamp (inclusive).

formatdate-time
amountnumber
optional

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.

quantitynumber
optional

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_pricenumber
optional

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_itemsarray of object
optional

Either provide amount or provide both unit_price and quantity.

Hide ParametersShow Parameters
timestampstring

timestamp of the scheduled event

formatdate-time
amountnumber
optional

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.

quantitynumber
optional

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_pricenumber
optional

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.

namestring
optional

displayed on invoices

minLength1
netsuite_sales_order_idstring
optional

This field's availability is dependent on your client's configuration.

scheduled_charges_on_usage_invoicesenum
optional
"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.

Hide ParametersShow Parameters
"ALL"
spend_threshold_configurationobject
optional
Hide ParametersShow Parameters
commitobject
Hide ParametersShow Parameters
product_idstring

The commit product that will be used to generate the line item for commit payment.

descriptionstring
optional
namestring
optional

Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name.

is_enabledboolean

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_configobject
Hide ParametersShow Parameters
payment_gate_typeenum
"NONE" OR "STRIPE" OR "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.

Hide ParametersShow Parameters
"NONE"
"STRIPE"
"EXTERNAL"
precalculated_tax_configobject
optional

Only applicable if using PRECALCULATED as your tax type.

Hide ParametersShow Parameters
tax_amountnumber

Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule

tax_namestring
optional

Name of the tax to be applied. This may be used in an invoice line item description.

stripe_configobject
optional

Only applicable if using STRIPE as your payment gate type.

Hide ParametersShow Parameters
payment_typeenum
"INVOICE" OR "PAYMENT_INTENT"

If left blank, will default to INVOICE

Hide ParametersShow Parameters
"INVOICE"
"PAYMENT_INTENT"
invoice_metadatamap
optional

Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type.

tax_typeenum
optional
"NONE" OR "STRIPE" OR "ANROK" OR "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.

Hide ParametersShow Parameters
"NONE"
"STRIPE"
"ANROK"
"PRECALCULATED"
threshold_amountnumber

Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.

subscriptionsarray of object
optional

Optional list of subscriptions to add to the contract.

Hide ParametersShow Parameters
collection_scheduleenum
"ADVANCE" OR "ARREARS"
Hide ParametersShow Parameters
"ADVANCE"
"ARREARS"
initial_quantitynumber

The initial quantity for the subscription. It must be non-negative value.

prorationobject
Hide ParametersShow Parameters
invoice_behaviorenum
optional
"BILL_IMMEDIATELY" OR "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.

Hide ParametersShow Parameters
"BILL_IMMEDIATELY"
"BILL_ON_NEXT_COLLECTION_DATE"
is_proratedboolean
optional

Indicates if the partial period will be prorated or charged a full amount.

subscription_rateobject
Hide ParametersShow Parameters
billing_frequencyenum
"MONTHLY" OR "QUARTERLY" OR "ANNUAL" OR "WEEKLY"

Frequency to bill subscription with. Together with product_id, must match existing rate on the rate card.

Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"ANNUAL"
"WEEKLY"
product_idstring

Must be subscription type product

formatuuid
custom_fieldsmap
optional
descriptionstring
optional
ending_beforestring
optional

Exclusive end time for the subscription. If not provided, subscription inherits contract end date.

formatdate-time
namestring
optional
starting_atstring
optional

Inclusive start time for the subscription. If not provided, defaults to contract start date

formatdate-time
temporary_idstring
optional

A temporary ID used to reference the subscription in recurring commit/credit subscription configs created within the same payload.

total_contract_valuenumber
optional

This field's availability is dependent on your client's configuration.

transitionobject
optional
Hide ParametersShow Parameters
from_contract_idstring
formatuuid
typeenum
"SUPERSEDE" OR "RENEWAL"

This field's available values may vary based on your client's configuration.

Hide ParametersShow Parameters
"SUPERSEDE"
"RENEWAL"
future_invoice_behaviorobject
optional
Hide ParametersShow Parameters
trueupenum
optional
"REMOVE" OR "AS_IS"

Controls whether future trueup invoices are billed or removed. Default behavior is AS_IS if not specified.

Hide ParametersShow Parameters
"REMOVE"
"AS_IS"
uniqueness_keystring
optional

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.

minLength1
maxLength128
usage_filtergroup_keystringgroup_valuesarray of stringstarting_atstringBaseUsageFilter
optional
usage_statement_scheduleobject
optional
Hide ParametersShow Parameters
frequencyenum
"MONTHLY" OR "QUARTERLY" OR "ANNUAL" OR "WEEKLY"
Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"ANNUAL"
"WEEKLY"
billing_anchor_datestring
optional

Required when using CUSTOM_DATE. This option lets you set a historical billing anchor date, aligning future billing cycles with a chosen cadence. For example, if a contract starts on 2024-09-15 and you set the anchor date to 2024-09-10 with a MONTHLY frequency, the first usage statement will cover 09-15 to 10-10. Subsequent statements will follow the 10th of each month.

formatdate-time
dayenum
optional
"FIRST_OF_MONTH" OR "CONTRACT_START" OR "CUSTOM_DATE"

If not provided, defaults to the first day of the month.

Hide ParametersShow Parameters
"FIRST_OF_MONTH"
"CONTRACT_START"
"CUSTOM_DATE"
invoice_generation_starting_atstring
optional

The date Metronome should start generating usage invoices. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.

formatdate-time
Returns
dataidstringID
curl https://api.metronome.com/v1/contracts/create \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $METRONOME_BEARER_TOKEN" \
    -d '{
          "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d",
          "starting_at": "2020-01-01T00:00:00.000Z"
        }'
200 Example
{
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
}