Skip to main content
PUT
/
organizations
/
{orgId}
/
contracts
/
{id}
Update Contract
curl --request PUT \
  --url https://api.m3ter.com/organizations/{orgId}/contracts/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "<string>",
  "name": "<string>",
  "startDate": "2023-12-25",
  "endDate": "2023-12-25",
  "version": 123,
  "customFields": "<unknown>",
  "code": "<string>",
  "description": "<string>",
  "purchaseOrderNumber": "<string>",
  "applyContractPeriodLimits": true,
  "usageFilters": [
    {
      "dimensionCode": "<string>",
      "value": "<string>",
      "mode": "INCLUDE"
    }
  ],
  "billGroupingKeyId": "<string>"
}
'
{
  "id": "<string>",
  "version": 123,
  "customFields": {},
  "accountId": "<string>",
  "name": "<string>",
  "code": "<string>",
  "description": "<string>",
  "purchaseOrderNumber": "<string>",
  "applyContractPeriodLimits": true,
  "usageFilters": [
    {
      "dimensionCode": "<string>",
      "value": "<string>",
      "mode": "INCLUDE"
    }
  ],
  "billGroupingKeyId": "<string>",
  "startDate": "2023-12-25",
  "endDate": "2023-12-25",
  "dtCreated": "2023-11-07T05:31:56Z",
  "dtLastModified": "2023-11-07T05:31:56Z",
  "createdBy": "<string>",
  "lastModifiedBy": "<string>"
}

Authorizations

Authorization
string
header
required

m3ter supports machine to machine authentication using the clientCredentials OAuth2 flow.

The authorizationCode flow controls access for human users via the m3ter Console application.

Path Parameters

orgId
string
required

The unique identifier (UUID) of your Organization. The Organization represents your company as a direct customer of our service.

id
string
required

The unique identifier (UUID) of the Contract to update.

Body

application/json
accountId
string
required

The unique identifier (UUID) of the Account associated with this Contract.

Minimum string length: 1
name
string
required

The name of the Contract.

Required string length: 1 - 200
startDate
string<date>
required

The start date for the Contract (in ISO-8601 format). This date is inclusive, meaning the Contract is active from this date onward.

endDate
string<date>
required

The exclusive end date of the Contract (in ISO-8601 format). This means the Contract is active until midnight on the day before this date.

version
integer<int64>

The version number of the entity:

  • Create entity: Not valid for initial insertion of new entity - do not use for Create. On initial Create, version is set at 1 and listed in the response.
  • Update Entity: On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.
customFields
any
code
string

The short code of the Contract.

Maximum string length: 80
description
string

The description of the Contract, which provides context and information.

Maximum string length: 500
purchaseOrderNumber
string

The Purchase Order Number associated with the Contract.

Maximum string length: 100
applyContractPeriodLimits
boolean

For Contract billing, a boolean setting for restricting the charges billed to the period defined for the Contract:

  • TRUE - Contract billing for the Account will be restricted to charge amounts that fall within the defined Contract period.
  • FALSE - The period for amounts billed under the Contract will be determined by the Account Plan attached to the Account and linked to the Contract.(Default)
usageFilters
object[]

Use usageFilters to control Contract billing and charge at billing only for usage where Product Meter dimensions equal specific defined values:

  • Define Usage filters to either include or exclude charges for usage associated with specific Meter dimensions.
  • The Meter dimensions must be present in the data field schema of the Meter used to submit usage data measurements.
billGroupingKeyId
string

The ID of the Bill Grouping Key assigned to the Contract.

If you are implementing Contract Billing for an Account, use billGroupingKey to control how charges linked to Contracts on the Account will be billed:

  • Independent Contract billing. Assign an exclusive Bill Grouping Key to the Contract - only charges due against the Account and linked to the single Contract will appear on a separate Bill.
  • Collective Contract billing. Assign the same non-exclusive Bill Grouping Key to multiple Contracts - all charges due against the Account and linked to the multiple Contracts will appear together on a single Bill.

Response

Returns the updated Contract

id
string
required

The UUID of the entity.

version
integer<int64>

The version number:

  • Create: On initial Create to insert a new entity, the version is set at 1 in the response.
  • Update: On successful Update, the version is incremented by 1 in the response.
customFields
object

User defined fields enabling you to attach custom data. The value for a custom field can be either a string or a number.

If customFields can also be defined for this entity at the Organizational level,customField values defined at individual level override values of customFields with the same name defined at Organization level.

See Working with Custom Fields in the m3ter documentation for more information.

accountId
string

The unique identifier (UUID) of the Account associated with this Contract.

name
string

The name of the Contract.

code
string

The short code of the Contract.

description
string

The description of the Contract, which provides context and information.

purchaseOrderNumber
string

The Purchase Order Number associated with the Contract.

applyContractPeriodLimits
boolean

For Contract billing, a boolean setting for restricting the charges billed to the period defined for the Contract:

  • TRUE - Contract billing for the Account will be restricted to charge amounts that fall within the defined Contract period.
  • FALSE - The period for amounts billed under the Contract will be determined by the Account Plan attached to the Account and linked to the Contract.(Default)
usageFilters
object[]

Used to control Contract billing and charge at billing only for usage where Product Meter dimensions equal specific defined values:

  • Usage filters are defined to either include or exclude charges for usage associated with specific Meter dimensions.
  • The Meter dimensions must be present in the data field schema of the Meter used to submit usage data measurements.
billGroupingKeyId
string

The ID of the Bill Grouping Key assigned to the Contract.

startDate
string<date>

The start date for the Contract (in ISO-8601 format). This date is inclusive, meaning the Contract is active from this date onward.

endDate
string<date>

The exclusive end date of the Contract (in ISO-8601 format). This means the Contract is active until midnight on the day before this date.

dtCreated
string<date-time>

The date and time (in ISO-8601 format) when the Contract was created.

dtLastModified
string<date-time>

The date and time (in ISO-8601 format) when the Contract was last modified.

createdBy
string

The unique identifier (UUID) of the user who created this Contract.

lastModifiedBy
string

The unique identifier (UUID) of the user who last modified this Contract.