A Cost Allocation Setup consists of four key components:
- Sets: The overarching name and ID of the cost allocation (CA).
- Steps: These are the definitions of steps or "questions" used in the CA.
- StepTypes: Categories or values for the steps, such as Project, Component, or Machine.
- Values: Specific values assigned to each step.
All these components work together to create a comprehensive cost allocation system.
Step 1: Create the Structure
Important Note: It is recommended to create the Sets, Steps, and StepTypes manually in the admin portal. Avoid using the API for the initial structure to reduce errors. If you've done that move on to Step 5 of this guide.
Step 2: Create a Set
The Set serves as the foundation of the cost allocation structure.
API Endpoint:POST https://api.cribwise.com/integration/v1/integrationapi/CostAllocationSets
Payload:
Step 3: Create a StepType
StepTypes define custom categories or values for your steps.
API Endpoint:POST https://api.cribwise.com/integration/v1/integrationapi/CostAllocationStepTypes
Payload:
To retrieve existing StepTypes for use in Steps:GET https://api.cribwise.com/integration/v1/integrationapi/CostAllocationStepTypes
Example Result:
Step 4: Create a Step
Steps link StepTypes to a specific Set and can include additional properties like validation and hierarchy.
API Endpoint:POST https://api.cribwise.com/integration/v1/integrationapi/CostAllocationSteps
Payload:
Step 5: Add Values
Each Step has its own values, which represent specific options within that step.
-
Retrieve Steps:
GET https://api.cribwise.com/integration/v1/integrationapi/CostAllocationSteps
Match the returned
StepID
with its correspondingStepTypeID
to verify its name:GET https://api.cribwise.com/integration/v1/integrationapi/CostAllocationStepTypes
-
Add a Value to a Step:
API Endpoint:POST https://api.cribwise.com/integration/v1/integrationapi/CostAllocationValues
Payload:
-
Repeat this process for all remaining values in the step.
Step 6: Create the Hierarchy
To establish relationships between values, you need to define a hierarchy.
-
Retrieve Existing Values:
GET https://api.cribwise.com/integration/v1/integrationapi/CostAllocationValues
Example Result:
-
Assign Values to Hierarchy:
Use the retrievedvalueId
and, if applicable, aparentId
to define the hierarchy.API Endpoint:
POST https://api.cribwise.com/integration/v1/integrationapi/CostAllocationHierarchyInstances
Payload:
-
Iterate the Hierarchy:
After adding a value, use:GET https://api.cribwise.com/integration/v1/integrationapi/CostAllocationHierarchyInstances
to retrieve the updated hierarchy and use theparentId
for subsequent additions.
Step 7: Create Hierarchy Restrictions (Relations)
To further refine your Cost Allocation setup, you can create restrictions that specify which items, users, or user groups are associated with a particular Cost Allocation path.
Assign Items to a CA Path
This step links specific items to a Cost Allocation path.
-
Find the Item ID:
Use the following API to retrieve the list of items and find the desireditemId
:Example Result:
-
Link Item to Cost Allocation Instance: Use the following API to assign an item to a specific Cost Allocation path:
Payload:
This creates a relation between the item and the specific Cost Allocation instance.
Assign Users and User Groups
Similarly, you can create restrictions for users or user groups.
-
Find User or User Group IDs:
Use APIs to retrieve user or user group IDs:-
Users:
GET https://api.cribwise.com/integration/v1/integrationapi/Users
-
User Groups:
GET https://api.cribwise.com/integration/v1/integrationapi/UserGroups
-
Users:
-
Create Relations for Users/User Groups: Use the same API endpoint:
Payload Example (User):
Payload Example (User Group):
Additional Notes
- Hierarchy Types: Ensure the StepType is of type "Hierarchy" for hierarchical relationships. If it is "List", you only need to add values without hierarchy definitions.
- Admin Portal: Use the admin portal for creating and managing Sets, Steps, and StepTypes to simplify the process and minimize API errors.
Comments
0 comments
Please sign in to leave a comment.