Skip to main content
POST
/
v2
/
contracts
/
edit
Edit a contract
curl --request POST \
  --url https://api.metronome.com/v2/contracts/edit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d",
  "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
  "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
          }
        ]
      }
    }
  ]
}'
{
  "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

Contract and customer IDs and fields to update

customer_id
string<uuid>
required

ID of the customer whose contract is being edited

contract_id
string<uuid>
required

ID of the contract being edited

uniqueness_key
string

Optional uniqueness key to prevent duplicate contract edits.

Required string length: 1 - 128
add_commits
object[]
add_credits
object[]
add_recurring_commits
object[]
add_recurring_credits
object[]
add_overrides
object[]
add_scheduled_charges
object[]
add_subscriptions
object[]

Optional list of subscriptions to add to the contract.

add_spend_threshold_configuration
object
add_prepaid_balance_threshold_configuration
object
add_billing_provider_configuration_update
object

Update the billing provider configuration on the contract. Currently only supports adding a billing provider configuration to a contract that does not already have one.

update_contract_name
string | null

Value to update the contract name to. If not provided, the contract name will remain unchanged.

update_scheduled_charges
object[]
update_commits
object[]
update_credits
object[]
update_recurring_commits
object[]

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.

update_recurring_credits
object[]

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.

update_subscriptions
object[]

Optional list of subscriptions to update.

update_spend_threshold_configuration
object
update_prepaid_balance_threshold_configuration
object
update_contract_end_date
string<date-time> | null

RFC 3339 timestamp indicating when the contract will end (exclusive).

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
object[]

IDs of commits to archive

archive_credits
object[]

IDs of credits to archive

archive_scheduled_charges
object[]

IDs of scheduled charges to archive

remove_overrides
object[]

IDs of overrides to remove

Response

Success

data
object
required