Skip to main content
POST
/
v1
/
contracts
/
create
Create a contract
curl --request POST \
  --url https://api.metronome.com/v1/contracts/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d",
  "rate_card_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
  "starting_at": "2020-01-01T00:00:00.000Z",
  "billing_provider_configuration": {
    "billing_provider": "stripe",
    "delivery_method": "direct_to_billing_provider"
  }
}'
{
  "data": {
    "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc"
  }
}

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

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.

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.

Response

Success

data
object
required