Delete

[POST] .../v1/dealtype/delete

Soft-deletes a CRM deal type. Deletion is rejected when the type is used by active deals. Use this destructive method to logically remove a CRM deal type from normal lists after confirming that active deals no longer use it. The method rejects deletion when non-deleted deals reference the type, otherwise marks the type as deleted and inactive, renames it with a deleted suffix to free the unique name, writes an action log record, invalidates the CRM deal type cache and returns row_affected with changed ids. The request body is required and id must be positive; typical workflow is DealType/Get, review dependent deals if needed, then DealType/Delete. The caller must have CRM deal type delete permission; missing body, invalid id, denied access, missing deal type, related deals, database failures, transaction failures and action-log errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
id Int64 Required Deal type ID.

Request Example

{
  "id": 2
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Update Update operation result.

Response Example

{
  "ok": true,
  "result": {
    "row_affected": 1,
    "ids": [
      2
    ]
  }
}