ContractCharges
This entity describes a cost associated with an Autotask Contract. A cost is a billing item for products or materials. Cost items can be billable or non-billable. Billable cost items appear in Approve and Post.
NOTE You can refer to the Online Help to find root and child access URLs of the entity you wish to query. Refer to Finding resource and child access URLs of REST API entities for more information.
Entity details
Entity Name: | ContractCharges |
Entity Path: |
/atservicesrest/v1.0/ContractCharges |
Parent Entity: |
|
Can Create: | |
Can Update: |
Only when isBilled = false |
Can Query: | |
Can Delete: |
Only when isBilled = false |
Can Have UDFs: |
Conditions and requirements
General
- Resources with security levels that specify limited or no contract visibility cannot create, update, or query this entity.
- create, update, delete, and query require Security Level permission to access the Contracts module.
- ContractCharge must have either a productID or billingCodeID.
- ContractCharge cannot be created, deleted, or queried if contractID references a Block, Retainer, or Incident type Contract unless billingCodeID references a Block Purchase, Incident Purchase, or Retainer Purchase Material Cost Code; then, only the following fields can be updated: Name, Description, costType, purchaseOrderNumber, internalPurchaseOrderNumber.
- If the Multi-currency Installed Module is enabled, the following fields will return the relevant Customer Currency values instead of the Internal Currency values: billableAmount and unitPrice.
- The following fields will return the saved Internal Currency values: internalCurrencyBillableAmount and internalCurrencyUnitPrice
Special field attributes
Field | Conditions and Requirements |
---|---|
billableAmount |
billableAmount = unitQuantity * unitPrice. If unitPrice is Null, the value will be set to the value from the Material Cost Code associated with billingCodeID. The API will round the unitQuantity, unitCost, and unitPrice values to 4 decimal places prior to any calculations for the total price or extended cost. |
billingCodeID |
billingCodeID must reference a Material Cost Code type allocation code. On create, or update when productID has changed and is not Null, if no value is supplied for the billingCodeID, unitCost, or unitPrice fields, then those fields take their values from the Product. On create or update when billingCodeID has changed and is not Null, if there is no Contract Cost Default set for the Material Cost Code associated with the billingCodeID, and if no value is supplied for the unitCost and unitPrice fields, then those fields take their values from the Material Cost Code. |
contractID |
After a ContractCharge is created, contractID cannot be updated. If contractID references a Contract that has set a Contract Cost Default for the Material Cost Code associated with the billingCodeID, and no value was supplied for unitPrice, unitCost, or isBillableToCompany, then these fields take their values from the Contract Cost Default. |
extendedCost |
extendedCost = unitQuantity * unitCost. If unitCost is Null, the value will be set to the value from the Material Cost Code associated with billingCodeID. This entity field will return no information if the user account making the query does not have sufficient privileges to view cost data in the Autotask UI. Additionally, if an update request does not have the necessary permissions, the API will ignore the call's values for the field even if they are blank or would be otherwise required. The API will round the unitQuantity, unitCost, and unitPrice values to 4 decimal places prior to any calculations for the total price or extended cost. |
isBillableToCompany |
If no value is specified for isBillableToCompany, the value is set to True |
isBilled |
When isBilled = True (cost has been approved and posted), ContractCharge is read-only. update and delete are allowed only when isBilled = False (cost has not been approved and posted). |
status |
Status is read-only. On create, when Procurement is enabled, Status is set as follows: If productID is null, then Status = Ready to Ship. If productID references a Product where doesNotRequireProcurement = True, then Status = Ready to Ship. If productID references a Product where doesNotRequireProcurement = False and the Product is not available in Inventory, then Status = Need To Order. If productID references a Product where doesNotRequireProcurement = False and the Product is available in Inventory, then Status = Ready to Ship. If Status = Need To Order and extendedCost is > the value set in the system setting "Require approval before ordering..." then Status is automatically set to Waiting Approval. When Procurement is disabled, Status = Pending |
unitCost |
This entity field will return no information if the user account making the query does not have sufficient privileges to view cost data in the Autotask UI. Additionally, if an update request does not have the necessary permissions, the API will ignore the call's values for the field even if they are blank or would be otherwise required. |
Field definitions
The following table describes the standard Autotask fields for this entity. Refer to the following articles for more information about working with these fields:
- The entityInformation REST API call
- Making basic query calls to the REST API
- Advanced query features of the REST API
To learn how to query picklist endpoints, refer to Understanding picklists.
Notes
- For string datatypes, the number in parentheses ( ) indicates the maximum number of characters allowed.
- LT indicates Local Term.
- If this entity has child collections, they will appear in a Child collection access URLs or an Entity URLs and relationships drop-down in the Entity details section of this article.
- You can call the /query/count/ endpoint of a resource to determine how many records a collection holds.
Field Name | Datatype | Read-Only | Is Required | Reference Name | Picklist |
---|---|---|---|---|---|
billableAmount | decimal | ||||
billingCodeID | long | ProjectCharges | |||
chargeType | integer | ||||
contractID | long | Contracts | |||
contractServiceBundleID | long | ContractServiceBundles | |||
contractServiceID | long | ContractServices | |||
createDate |
datetime |
|
|
|
|
creatorResourceID | long | Resources | |||
datePurchased | datetime | ||||
Description | string (2000) | ||||
extendedCost | decimal | ||||
id | long | ||||
internalCurrencyBillableAmount (Multi-currency module only) | decimal | ||||
internalCurrencyUnitPrice (Multi-currency module only) | decimal | ||||
internalPurchaseOrderNumber | string (50) | ||||
isBillableToCompany | Boolean | ||||
isBilled | Boolean | ||||
Name | string (100) | ||||
Notes | string (2000) | ||||
organizationalLevelAssociationID |
integer |
|
|
|
|
productID | long | Products | |||
purchaseOrderNumber | string (50) | ||||
Status | long | ||||
statusLastModifiedBy | long | ||||
statusLastModifiedDate | datetime | ||||
unitCost | decimal | ||||
unitPrice | decimal | ||||
unitQuantity | decimal |