ContractBlocks

The ContractBlocks entity describes an Autotask Contract Block. The Contract Block represents a block of hours purchased for a Block Hours type Contract. With a Block Hours Contract, the customer pre-pays for a block of hours and then the pre-paid hours are reduced as billable work is performed. The contract maintains the balance of hours. You can create a Block Hours type Contract without creating an associated ContractBlocks entity, but time cannot be charged against the contract.

NOTE  A Contract Block specifies a single per hour rate. Autotask Block Hour Factors accommodate work performed against the contract by resources with different role rates. The ContractBlockHourFactors entity describes a block hour factor.

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: ContractBlocks

Entity Path:

/atservicesrest/v1.0/ContractBlocks

Parent Entity:

Contracts

Can Create:
Can Update:
Can Query:
Can Delete:  
Can Have UDFs:  

Fields that cannot be queried

The following fields from this entity will return an error when queried:

  • hoursApproved

Conditions and requirements

General

  • Resources with security levels that specify limited or no contract visibility cannot create, update, or query this entity.
  • If the multi-currency Installed Module is enabled, the following field will return the relevant Customer Currency values instead of the Internal Currency values: hourlyRate

NOTE   The API does not currently support automatic cost creation when creating a contract block. To create contract costs automatically the contract blocks must be added through the User Interface.

Special field attributes

Field Conditions and Requirements

contractID

contractID must reference a Contract where ContractType is Blocks Hour type.

hourlyRate

HourlyRate cannot be changed via the API when the block has been billed, but the other editable fields can be updated.

hours

On update, ContractBlock.Hours must be >= ContractBlock.hoursApproved.

ContractBlock.Hours and ContractBlock.hourlyRate must be >= 0.

Hours cannot be changed via the API when the block has been billed, but the other editable fields can be updated.

isPaid

isPaid is not required. It is Read-Only; on creation, isPaid will automatically be set to 0 and then updated by triggers.

startDate, endDate

ContractBlock.startDate must be < ContractBlock.endDate.

ContractBlock.startDate and ContractBlock.endDate must be within the startDate and endDate of the Contract referenced by ContractBlock.contractID; that is, you cannot create a ContractBlock outside of the Contract dates.

startDate and endDate only support date values. The API will not store non-date values (such as time) in these fields.

Field definitions

Field Name Datatype Read-Only Is Required Reference Name Picklist
contractID integer   Contracts  
datePurchased datetime      
endDate datetime      
hourlyRate decimal      
hours decimal      
hoursApproved decimal      
id long    
invoiceNumber string (50)        
isPaid boolean      
paymentNumber string (50)        
paymentType integer      
startDate datetime      
status integer      

Additional resources