How to Set Costs for Cost Codes
This guide will detail the process of setting costs for cost codes by creating adjustments in the context of HeavyJob.
Prerequisites
Before starting, ensure you have the following:
- Access to HeavyJob APIs.
- An API Client (Client ID and Secret) used to generate an authentication token for API utilization.
- API Client must possess necessary scopes:
heavyjob:readheavyjob:writeon token generation.
Refer to the Getting Started with Request Tokens guide for details on how to authenticate.
Get Business Units
Use the HeavyJob GET All Business Units endpoint to acquire the critical businessUnitid field.
Purpose: Get the list of business units within your organization. The returned id is required for pulling data.
Response: The response will provide one or more business units with an id field, this id is your businessUnitId. This businessUnitId will help filter results of the next endpoints listed in this guide.
Get Cost Categories
Use the HeavyJob GET Cost Categories to retrieve the list of cost categories
Purpose: Get a list of cost categories. The id is required for adjusting the values of Custom Cost Types.
Response: The response will return a list of one or more cost categories with an id field, this id is the costCategoryId. This costCategoryId will be used when adjusting costs that utilize custom cost types in the Setting Costs Section.
Get Cost Codes
Use the HeavyJob GET Cost Categories to retrieve cost codes, you may filter this down to the specific business unit using the
businessUnitIdthat you acquired in the Get Business Units section. You can filter this down further with this endpoints Query Parameters, such as jobId to get a list of code codes by Job.
Purpose: Get a list of cost categories.
Response: The response will return a list of one or more cost codes with an id field in results array. This id is the costCodeId. This costCodeId will be used when adjusting costs in the Setting Costs Section.
Setting Costs for a Cost Code by Creating Adjustments
Use the HeavyJob PUT Set Costs for a Cost Code by Creating Adjustments Endpoint for this section. You will need to decide on an
effectiveDateto put these adjustments into effect.
Purpose: Send the instruction to our services to perform the adjustment. You will need the costCodeId from the Get Cost Codes section. You will also need the costCategoryId from the Get Cost Categories section. Lastly, you will need to fill the effectiveDate field with a date in the YYYY-MM-DD format.
Response: The response will send an HTTP response code informing you of the result of your request. An HTTP 202 indicates a sucesssful adjustment.
Additional Info and Troubleshooting
If you'd like to check that your request has gone through and adjustments have been performed, you can call the HeavyJob GET Job Costs Endpoint.
If you encounter any issues, please refer to the Getting Started with Request Tokens guide or Contact Us for further assistance.
Updated 10 days ago