PUT /api/v3/costcenter/{costCenterId}

Edits an existing cost center's code, description, or parent assignment

EditCostCenterV3 Permissions: CostCenters (Edit)
Use this endpoint to update a cost center’s properties or move it to a new parent in the hierarchy. Cannot edit the root cost center (ID 1) or the authenticated user’s own topmost cost center. Cannot set a cost center as its own parent, and cannot set a child of the cost center as the new parent. The cost center code cannot be changed to “ROOT”.

Request Headers

Header Value Required Description
ECI-ApiKey string Yes Your API key. See Authentication.
Content-Type application/json Yes All requests must specify JSON content type, including the request body.

Path Parameters

Name Description Type Required
costCenterId The unique numeric identifier of the cost center to edit integer (int32) Required

Request Body

CostCenterCreate
Property Description Type
costCenterCode The cost center code Required Must be between 0 and 32 characters string
costCenterInfo The cost center info Required Must be between 0 and 32 characters string
parentCostCenterId The identifier for the parent of the cost center. The parent is the cost center directly above the current cost center on the Accounts tree Required Topmost (CostCenter) integer (int32)
Example Request Body application/json
{  "costCenterCode": "string",  "costCenterInfo": "string",  "parentCostCenterId": 1
}

Responses

200 OK The request succeeded and the response body contains the requested data.

Response Body Parameters

CostCenterResponse
Property Description Type
accounts An array of child accounts CostCenterAccountChild[]
CostCenterAccountChild properties
Property Description Type
accountCode The account code string
accountId The account identifier integer (int32)
accountInfo The account info string
accountType AccountTypeChild
AccountTypeChild properties
Property Description Type
accountTypeCode The account type code string
accountTypeId The account type identifier integer (int32)
accountTypeInfo The account type info string
active Whether the account is active or not boolean
hasCalculatedMeter Indicates whether the Account has a child calculated meter boolean
hasSplitChildMeter Indicates whether the Account has a child split meter boolean
hasSplitParentMeter Indicates whether the Account is a recipient of a split boolean
hasSubAccount Indicates whether the Account has a sub-account boolean
isSubAccount Indicates whether the Account is a sub-account boolean
costCenterCode The cost center code string
costCenterId The cost center identifier integer (int32)
costCenterInfo The cost center info string
costCenters An array of child cost centers CostCenterChild[]
CostCenterChild properties
Property Description Type
costCenterCode The cost center code string
costCenterId The cost center identifier integer (int32)
costCenterInfo The cost center info string
parent CostCenterChild
CostCenterChild properties
Property Description Type
costCenterCode The cost center code string
costCenterId The cost center identifier integer (int32)
costCenterInfo The cost center info string
Example Response application/json
{  "accounts": [
    {    "accountCode": "string",    "accountId": 1,    "accountInfo": "string",    "accountType": {      "accountTypeCode": "string",      "accountTypeId": 1,      "accountTypeInfo": "string"
    },    "active": false,    "hasCalculatedMeter": false,    "hasSplitChildMeter": false,    "hasSplitParentMeter": false,    "hasSubAccount": false,    "isSubAccount": false
  }
  ],  "costCenterCode": "string",  "costCenterId": 1,  "costCenterInfo": "string",  "costCenters": [
    {    "costCenterCode": "string",    "costCenterId": 1,    "costCenterInfo": "string"
  }
  ],  "parent": {    "costCenterCode": "string",    "costCenterId": 1,    "costCenterInfo": "string"
  }
}
400 Bad Request The request was malformed or contains invalid parameters. Check the request body and query parameters.
404 Not Found The requested resource was not found. Verify the ID or path is correct.