Skip to main content
POST
Create a contract

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Create a new contract

customer_id
string<uuid>
required
starting_at
string<date-time>
required

inclusive contract start time

package_id
string<uuid>

If provided, provisions a customer on a package instead of creating a traditional contract. When specified, only customer_id, starting_at, package_id, uniqueness_key, transition, and custom_fields are allowed.

package_alias
string

Selects the package linked to the specified alias as of the contract's start date. Mutually exclusive with package_id.

package_customizations
object

Adjustments applied on top of the package's baseline configuration when provisioning the contract.

name
string
uniqueness_key
string

Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.

Required string length: 1 - 128
net_payment_terms_days
number
rate_card_id
string<uuid>
rate_card_alias
string

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

ending_before
string<date-time>

exclusive contract end time

commits
object[]
credits
object[]
recurring_commits
object[]
recurring_credits
object[]
multiplier_override_prioritization
enum<string>

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.

Available options:
LOWEST_MULTIPLIER,
lowest_multiplier,
EXPLICIT,
explicit
overrides
object[]
scheduled_charges
object[]
scheduled_charges_on_usage_invoices
enum<string>

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.

For recurring fixed fees, such as a monthly platform fee, use a subscription with billing_cycle_config.invoice_placement set to ON_USAGE_INVOICE instead of recurring scheduled charges with this field set to ALL. Metronome recalculates a subscription's usage invoice line items from the current contract each time it invoices, so the charges stay on the correct usage invoice after contract edits such as end date changes or transitions. Use this field for one-time scheduled charges and commit purchases, which subscriptions can't represent.

Available options:
ALL
transition
object
usage_filter
object
usage_statement_schedule
object
custom_fields
object

Custom fields to be added eg. { "key1": "value1", "key2": "value2" }

billing_provider_configuration
object

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

spend_threshold_configuration
object
prepaid_balance_threshold_configuration
object
subscriptions
object[]

Optional list of subscriptions to add to the contract.

hierarchy_configuration
object

Response

Success

data
object
required