All Products
Document Center

BSS OpenAPI:AllocateCostUnitResource

Last Updated:Oct 25, 2019

API Name



Resource instances are assigned from the source cost unit to the target cost unit.

Request parameters

Name Type Required Description
fromUnitUserId Long Yes Owner user ID of the source cost unit
fromUnitId Long Yes Source cost unit ID, 0 means unallocated resource first allocation, greater than 0 means allocated resource transfer or removal
toUnitUserId Long Yes Target cost unit is the primary user ID
toUnitId Long Yes Target cost unit ID, -1 indicates that the allocated resource is removed to unassigned, and greater than 0 indicates that it is assigned to the specified cost unit
resourceInstanceList List<(ResourceInstanceDto)> Yes Resource instance list


Name Type Required Description
resourceUserId Long Yes Owner ID of the resource
resourceId String Yes Instance ID of the resource
commodityCode String Yes Commodity Code of the resource

Response parameters

Name Type Description
success boolean Is success or not
code String Error code
message String Detail information
data CostUnitOperateResponse Message body


Name Type Description
ownerUid Long Owner user ID of the cost unit
unitId Long ID of the new cost unit
isSucccess Boolean Is success or not

Error codes

Error code MessageDescription
MissingParameter The specified parameter is mandatory for this request. Missing Parameter
UnitNotBelongToUser Financial unit is not belong to this user. Cost unit is not belong to this user.
MasterAndSubHasNoRelation Your accounts has no valid account relation yet. The master has no relationship.
InternalError The request processing has failed due to some unknown error, exception or failure. Internal Error.

Request sample

  2. &FromUnitId=******
  3. &FromUnitUserId=***********
  4. &RegionId=cn-hangzhou
  5. &ResourceInstanceList.1.CommodityCode=ecs
  6. &ResourceInstanceList.1.ResourceId=*************
  7. &ResourceInstanceList.1.ResourceUserId=***********
  8. &ToUnitId=******
  9. &ToUnitUserId=***********
  10. &Public parameters

Response sample