Delete CBS Code from Cost Sheet

PUT /ws/rest/service/v2/projectcostsheet/cbs/delete

Available From: 26.10

Purpose

Use this service to delete CBS codes from CBS projects or shells with an Active status. The service helps keep CBS definitions aligned with financial policies, accounting rules, reorganizations, and regulatory updates.

Note:

  • Parent or Summary codes can only be deleted after all the codes under the hierarchy have been deleted.
  • CBS codes cannot be deleted in Company Cost Sheets and project or shell templates.

Prerequisites

Ensure the following:

  • The CBS code is no longer referenced across in any business process (BP) records in the project or shell.
  • The cost sheet is not temporarily locked by one or more transactions.
  • You have Update permission for CBS Services.
  • The project or shell status is Active. CBS Codes cannot be deleted from projects or shells with Inactive, On-Hold, or View-Only statuses.

Request Format

Send an API request as a JSON Map with the following structure:

{  
   "options":{
            "project_number": "<value>", 
           },  
   "data":["cbs_code":"<value>", " cbs_code ": "<value>"] 
}

Request Parameters - Options

In the options map, the following parameter must be included:

Parameter Required? Data Type Description
project_number Yes String A valid project/shell number.

Request Parameters - Data []

In the Data object, one or more CBS codes can be included:

Parameter Required? Data Type Description
cbs_code Yes String The full hierarchical path, where parent and child segments are separated by ~~. If the environment uses a different multi-segment separator in the data definition, that separator applies. Otherwise, the default separator is a dot (.).

Response Format

A JSON object is returned in the following format:

{
"data": [],
"message": [<list of messages>],
"status": <REST status code value>,
"rest_audit_id": <id from the audit table>
}

A successful response displays a status code 200.

A failed response displays a message with a status code.

Sample Success Request

To delete CBS codes from a cost sheet, send a request in the following format:

{ 
  "options": {     "project_number": "P-0007"   }, 
  "data": [ { "cbs_code": "16000~~16500"},     { "cbs_code": "16000~~16700"} ] 
}

Sample Success Response

A successful response with status code 200 displays in the following format:

{ 
 "data":[ 
         { 
            "record_status": "success", 
            " cbs_code": "01000~~01600" 
         } 
       ], 
 "message": ["CBS code(s) deleted successfully."], 
 "status": 200, 
 "rest_audit_id": 160 
}

Sample Failed Response

A failed response with the corresponding status code displays in the following format:

{ 
 "data":[ 
         { 
            "_record_status": 1350, 
            "cbs_code": "01000~~02320", 
            "message": "Invalid CBS Code" 
         } 
        ], 
 "message": ["Request cannot be completed - one or more CBS codes could not be deleted."], 
 "status": 3000, 
 "rest_audit_id": 159 
}

Supported Validation Messages and Status Codes

The following messages and status codes can display in the response:

Field Name Use-Case Status Message
project_number Project number tag is not provided. 3002 Invalid input.
project_number Project number is blank. 1361 Project number is required.
project_number Project is not valid. 602 Project/Shell number is not correct.
project_number Shell Template is used instead of a project or shell. 13014 CBS code deletion is not supported for shell template.
project_number Cost sheet does not exist in the project/shell. 707 Cost sheet does not exist.