1.
The request must be a non-empty JSON object. body, when present, must be an object.
2.
customer_id takes precedence over identification. Valid matches are resolved exactly; inactive customers follow merge links to the final active target. Unlike the event API, an unresolved customer is optional here: the related entity is saved without a customer link and the response customer_id is empty; this request does not create a persisted customer.
3.
related_entity_setting_id, related_entity_created, and external_id are required by persistence. related_entity_changed is assigned from the request. body is validated using the selected related-entity property's definitions.
4.
Persistence is serialized by (related_entity_setting_id, external_id). The first matching record is updated regardless of the submitted customer or timestamps; otherwise a new record is created. On update, submitted body properties are processed against existing/global property rules and deep-merged with the stored body, so omitted old properties remain while accepted submitted properties replace/add values.
5.
The resulting record goes through normal save hooks and downstream Elasticsearch synchronization. The response returns entity/customer IDs, external ID, timestamps, setting ID, and normalized merged body.
1.
请求必须是非空 JSON 对象;body 如有值必须是对象。
2.
customer_id 优先于 identification。有效身份按精确值解析;停用客户会沿合并链找到最终启用目标。与事件接口不同,本接口允许未解析到客户:关联实体会在没有客户关联的情况下保存,响应中的 customer_id 为空;本次请求不会创建持久化客户。
3.
持久化要求 related_entity_setting_id、related_entity_created、external_id 必填;related_entity_changed 使用请求值。body 按选定关联实体类型的属性定义校验。
4.
保存按 (related_entity_setting_id, external_id) 加锁串行执行。找到首条匹配时直接更新,不以本次客户或时间作为去重条件;找不到则新建。更新时,本次 body 先按已有/全局属性规则处理,再与旧 body 深度合并,因此未提交的旧属性保留,通过校验的新属性覆盖或新增。
5.
最终记录执行正常保存钩子和后续 Elasticsearch 同步;响应返回实体/客户 ID、外部 ID、时间、实体类型 ID 和标准化合并后的 body。