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

Edit Commit

Edit a commit
v2.contracts.edit_commit(ContractEditCommitParams**kwargs) -> dataIDContractEditCommitResponse
post/v2/contracts/commits/edit

Edit a customer or contract commit. Contract commits can only be edited using this endpoint if contract editing is enabled.

Parameters
commit_idstr

ID of the commit to edit

formatuuid
customer_idstr

ID of the customer whose commit is being edited

formatuuid
access_scheduleadd_schedule_itemsiterableremove_schedule_itemsiterableupdate_schedule_itemsiterableAccessSchedule
optional
Hide ParametersShow Parameters
add_schedule_itemsiterable
optional
amountfloatending_beforeunionstarting_atunionIterable[AccessScheduleAddScheduleItem]
Hide ParametersShow Parameters
amountfloat
ending_beforeunion
Union[str, datetime]
formatdate-time
starting_atunion
Union[str, datetime]
formatdate-time
remove_schedule_itemsiterable
optional
Hide ParametersShow Parameters
idstr
formatuuid
update_schedule_itemsiterable
optional
idstramountfloatending_beforeunionstarting_atunionIterable[AccessScheduleUpdateScheduleItem]
Hide ParametersShow Parameters
idstr
formatuuid
amountfloat
optional
ending_beforeunion
optional
Union[str, datetime]
formatdate-time
starting_atunion
optional
Union[str, datetime]
formatdate-time
applicable_product_idslist
optional
Optional[List[str]]

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_tagslist
optional
Optional[List[str]]

Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products.

invoice_contract_idstr
optional

ID of contract to use for invoicing

formatuuid
invoice_scheduleadd_schedule_itemsiterableremove_schedule_itemsiterableupdate_schedule_itemsiterableInvoiceSchedule
optional
Hide ParametersShow Parameters
add_schedule_itemsiterable
optional
timestampunionamountfloatquantityfloatunit_pricefloatIterable[InvoiceScheduleAddScheduleItem]
Hide ParametersShow Parameters
timestampunion
Union[str, datetime]
formatdate-time
amountfloat
optional
quantityfloat
optional
unit_pricefloat
optional
remove_schedule_itemsiterable
optional
Hide ParametersShow Parameters
idstr
formatuuid
update_schedule_itemsiterable
optional
idstramountfloatquantityfloattimestampunionunit_pricefloatIterable[InvoiceScheduleUpdateScheduleItem]
Hide ParametersShow Parameters
idstr
formatuuid
amountfloat
optional
quantityfloat
optional
timestampunion
optional
Union[str, datetime]
formatdate-time
unit_pricefloat
optional
priorityfloat
optional

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

product_idstr
optional
formatuuid
specifiersiterable
optional
Optional[Iterable[Specifier]]

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.

Hide ParametersShow Parameters
presentation_group_valuesDict[str, str]
optional
Dict[str, str]
pricing_group_valuesDict[str, str]
optional
Dict[str, str]
product_idstr
optional

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

formatuuid
product_tagslist
optional
List[str]

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

Returns
ContractEditCommitResponseclass
Hide ParametersShow Parameters
dataidstrID
from datetime import datetime
from metronome import Metronome

client = Metronome(
    bearer_token="My Bearer Token",
)
response = client.v2.contracts.edit_commit(
    commit_id="5e7e82cf-ccb7-428c-a96f-a8e4f67af822",
    customer_id="4c91c473-fc12-445a-9c38-40421d47023f",
    access_schedule={
        "update_schedule_items": [{
            "id": "d5edbd32-c744-48cb-9475-a9bca0e6fa39",
            "ending_before": datetime.fromisoformat("2025-03-12T00:00:00"),
        }]
    },
)
print(response.data)
200 Example
{
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
}