POST 销售订单更新明细行
参数位置:query:id。body:id、contractItemId、productId、skuId、skuLabel、name、spec、model、categoryId、categoryName、unitId、unitName、useUnitId、useConversionRate、primaryQty、mainUnitName、qty、unitPrice、discount、roundingDiff、originalRoundingDiff、taxRate、priceBasis、costPrice、sortOrder、remark、bundleId、bundleNo、bundleName、bundleModel、bundleSpecName、bundleCategoryName、bundleQty、bundleUnitPrice、bundleUnitName、specialPriceApplicationId、agreementId、recommendSupplierId、recommendSupplierName、supplyMode、partnerScopeId、warehouseId、warehouseName、customFieldDataList、materialImportRow、tempMaterialConfirmed、priceListVersionId、priceListMappingId、pricingMode、suggestedNetPrice、priceSourceType、pricingSnapshot、repriceRequested、repriceReason。 POST 更新。query 参数:id(明细行ID,必填);body 为 JSON 对象(订单明细行):必填 skuId(SKU ID)、name(物料名称)、spec(规格)、model(型号)、categoryId(物料分类ID,或不传 categoryId 时传 categoryName)、unitName(单位名称)、qty(数量,>0)、unitPrice(单价,>0)、taxRate(税率 %);组合物料行改为必填 bundleId、bundleName、bundleUnitName、bundleQty、bundleUnitPrice、taxRate。可选 productId、unitId、useUnitId、discount(折扣率 %)、priceBasis(taxExcluded/taxIncluded)、remark、sortOrder、contractItemId、customFieldDataList(明细自定义字段)。租户配置的必填系统字段同样校验。仅草稿/已驳回订单可改,保存后自动重算订单总额。
| 接口编码 | 所需范围 | 后端接口 |
|---|---|---|
sales.order-item.update | sales:write | POST /v1/sales-order-items/update(comap-sales) |
必填字段
| 字段 | 依据 |
|---|---|
id | 参数说明、接口规格 |
skuId | 参数说明 |
name | 参数说明 |
spec | 参数说明 |
model | 参数说明 |
categoryId | 参数说明 |
unitName | 参数说明 |
qty | 参数说明 |
unitPrice | 参数说明 |
taxRate | 参数说明、接口规格 |
bundleId | 参数说明 |
bundleName | 参数说明 |
bundleUnitName | 参数说明 |
bundleQty | 参数说明 |
bundleUnitPrice | 参数说明 |
条件必填(如「某状态时必填」)不在此表,以上方参数说明为准。 判定规则见必填字段的判定。
请求参数(query)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | integer(int64) | 是 | — |
「必填」仅反映接口规格声明的部分。服务内还有未体现在规格里的校验, 标「—」不等于可以不传;租户在主站配置的字段必填不约束本接口。 详见必填字段的判定与字段清单与自定义字段。
请求体字段(body)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | integer(int64) | — | 已有订单明细ID,编辑时保留原行需传入 |
contractItemId | integer(int64) | — | 来源销售合同明细ID,用于区分重复产品/SKU行 |
productId | integer(int64) | — | 产品ID |
skuId | integer(int64) | — | SKU id(必填) |
skuLabel | string | — | SKU 规格标签(快照,由前端从默认 SKU 或选中 SKU 带入) |
name | string | — | 产品名称 |
spec | string | — | 规格型号 |
model | string | — | 型号(手动输入) |
categoryId | integer(int64) | — | 物料分类ID(引用 comap_srm.t_product_category.id) |
categoryName | string | — | 物料分类名称(冗余快照) |
unitId | integer(int64) | — | 单位 id(可空) |
unitName | string | — | 单位名称(快照);兼容 JSON 字段 unit |
useUnitId | integer(int64) | — | 使用单位ID(NULL=主单位) |
useConversionRate | number | — | 换算比率(1 辅助单位 = N 主单位) |
primaryQty | number | — | 主单位数量 |
mainUnitName | string | — | 主单位名称 |
qty | number | — | 数量,须大于 0;组合物料行改填 bundleQty |
unitPrice | number | — | 单价,须大于 0;组合物料行改填 bundleUnitPrice |
discount | number | — | 折扣率(%):优惠百分比,10 表示优惠 10%(九折),取值 0~100,最多 6 位小数 |
roundingDiff | number | — | 报价抹零承接尾差(元),只在引入有抹零报价的最后一行有值 |
originalRoundingDiff | number | — | 原价尾差(元):按原价口径调整物料合计时承接单价反算尾差 |
taxRate | number | 是 | 税率(%) |
priceBasis | string | — | 明细计价方式:taxExcluded=不含税, taxIncluded=含税 |
costPrice | number | — | 成本价 |
sortOrder | integer(int32) | — | 排序序号 |
remark | string | — | 备注 |
bundleId | integer(int64) | — | 组合物料ID |
bundleNo | string | — | 组合物料编码快照(仅组合行有值) |
bundleName | string | — | 组合物料名称 |
bundleModel | string | — | 组合物料型号快照(仅组合行有值) |
bundleSpecName | string | — | 组合物料规格名称快照(仅组合行有值) |
bundleCategoryName | string | — | 组合物料分类名称快照(仅组合行有值) |
bundleQty | number | — | 物料组合套数(仅组合行有值) |
bundleUnitPrice | number | — | 物料组合含税单价(仅组合行有值) |
bundleUnitName | string | — | 组合物料单位名称 |
specialPriceApplicationId | integer(int64) | — | 关联特价申请ID(行级,命中特价申请时填写) |
agreementId | integer(int64) | — | 关联框架协议ID(行级,命中协议价时填写) |
recommendSupplierId | integer(int64) | — | 行级建议供应商ID(引用 srm t_supplier.id) |
recommendSupplierName | string | — | 行级建议供应商名称(冗余快照) |
supplyMode | string | — | 供货方式:STOCK 从库存发、PRODUCE 需要生产;不传 = 没指定(按物料来源类型推断:自制 → 需要生产) |
partnerScopeId | integer(int64) | — | 行适用范围ID;为空即通用 |
warehouseId | integer(int64) | — | 仓库ID:这一行计划从哪个仓发货、锁库;开启自动锁库时提交审核必填 |
warehouseName | string | — | 仓库名称(服务端按仓库ID回填) |
customFieldDataList3 | FieldDataItem[] | — | 明细行自定义字段值列表 |
materialImportRow | boolean | — | 是否为物料导入行 |
tempMaterialConfirmed | boolean | — | 是否已明确确认创建临时物料 |
priceListVersionId | integer(int64) | — | 来源客户价格表版本ID;新取价链路落库取自取价快照,旧链路按版本、物料、规格、行适用范围复核 |
priceListMappingId | integer(int64) | — | 客户编码所取的物料编码映射ID,可为空;不再参与客户价格表价格行匹配 |
pricingMode | string | — | 本任务定价模式:AUTO、MANUAL、LOCKED;空表示兼容旧行。 |
suggestedNetPrice | number | — | 系统建议不含税价,与最终成交价分开保存。 |
priceSourceType | string | — | 系统建议价真实来源,不占用原业务 sourceType。 |
pricingSnapshot | string | — | 服务端生成的价格来源 JSON 快照;客户端不可伪造。 |
repriceRequested | boolean | — | 用户显式要求重新取价。 |
repriceReason | string | — | 重新取价原因。 |
「必填」仅反映接口规格声明的部分。服务内还有未体现在规格里的校验, 标「—」不等于可以不传;租户在主站配置的字段必填不约束本接口。 详见必填字段的判定与字段清单与自定义字段。
请求示例
curl -X POST https://open.risemap.cn/v1/api/invoke \
-H "Authorization: Bearer <访问令牌>" \
-H "Content-Type: application/json" \
-d '{
"apiCode": "sales.order-item.update",
"query": {
"id": "1961000000000000001"
},
"body": {
"taxRate": 0
}
}'
错误处理
响应统一信封 { code, message, data },code == 200 为成功。以下是本接口可能返回的开放平台层错误:
| 错误码 | 说明 | 可重试 |
|---|---|---|
| 92101 | 访问凭证无效 | 否 |
| 92201 | 接口未登记或已停用 | 否 |
| 92202 | 超出凭证授权范围——本接口需 sales:write | 否 |
| 92204 | 绑定员工无此接口的功能权限 | 否 |
| 92203 | 上游服务调用失败 | 先查询处理结果,禁止盲目重试 |
| 92301 | 请求过于频繁 | 是 |
| 92205 | 写操作处理超时,结果未知(下游可能仍在执行) | 否,先查询确认结果 |
| 92302 | 有参数相同的写请求正在处理中 | 等待并确认前一次结果,勿重复提交 |
除此之外,comap-sales 自身的业务校验失败会原样透传其业务码与提示
(如字段校验、状态不允许、数据不存在),这类码不在开放平台的号段内,
以响应里的 message 为准。完整的平台层错误码见错误码说明。
← 返回order-item