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

Update End Date

Update the contract end date
v1.contracts.update_end_date(ContractUpdateEndDateParams**kwargs) -> dataIDContractUpdateEndDateResponse
post/v1/contracts/updateEndDate

Update the end date of a contract

Parameters
contract_idstr

ID of the contract to update

formatuuid
customer_idstr

ID of the customer whose contract is to be updated

formatuuid
allow_ending_before_finalized_invoicebool
optional

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.

ending_beforeunion
optional
Union[str, datetime]

RFC 3339 timestamp indicating when the contract will end (exclusive). If not provided, the contract will be updated to be open-ended.

formatdate-time
Returns
ContractUpdateEndDateResponseclass
Hide ParametersShow Parameters
dataidstrID
from datetime import datetime
from metronome import Metronome

client = Metronome(
    bearer_token="My Bearer Token",
)
response = client.v1.contracts.update_end_date(
    contract_id="d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
    customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
    ending_before=datetime.fromisoformat("2020-01-01T00:00:00.000"),
)
print(response.data)
200 Example
{
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
}