Symptom
When we send a Lead update request using PATCH, all Lead-related contact details are getting cleared in C4C.
Environment
SAP Cloud for Customer
Reproducing the Issue
- Create a Lead in C4C using POST request via Postman.
- Verify that Lead Contact details (First Name, Last Name, Email, etc.) are correctly created.
- Update the Lead information (e.g., Last Name, Contact Type, etc.) using PATCH method.
- Send the PATCH request to C4C.
- Observe the response and the Lead record in C4C.
Cause
The issue occurs during the PATCH operation on the Lead entity when the fields ContactID and AccountPartyID are included in the payload with empty values.
Both ContactID and AccountPartyID are system-generated fields that are automatically created and assigned by SAP Sales Cloud (C4C) during Lead creation. These fields are maintained by the system and contain references to the related contact and account data generated for the Lead.
When a PATCH request contains these fields with blank values, the system interprets this as an explicit update request. As a result, the existing values are overwritten with empty values, causing the corresponding relationship data to be removed.
Resolution
To prevent this behavior, do not include ContactID and AccountPartyID in POST or PATCH requests unless there is a specific requirement to update these fields.
As these fields are system-managed, it is recommended to omit them from the payload and allow the system to handle their values automatically. This ensures that the existing references remain intact and prevents unintended clearing of related data.
Keywords
Lead PATCH operation, Lead update, ContactID, AccountPartyID, system-generated fields, SAP Sales Cloud, C4C, OData API, PATCH request, POST request, Lead entity, integration issue, blank values, empty payload fields, field overwrite, related data removal, account relationship, contact relationship, API payload, Lead creation, data inconsistency, system-managed fields, update behavior, OData service, web service integration, Lead processing, SAP Cloud for Customer, ContactID cleared, AccountPartyID cleared, Lead API, payload validation , KBA , LOD-CRM-INT-API , OData API (C4C Only) , How To
SAP Knowledge Base Article - Public