菜单

保存

基本信息

  • 用途说明:产品追溯号录入单据保存接口(单据标识:wg_prd_tranceinput)
  • 请求方式:POST
  • 请求地址:https://api.kingdee.com/weigusoft/wg_cost/saveBill?access_token=?access_token=&authority_info=

headers参数

  • 所有的接口必须携带header参数
参数名称 参数示例 是否必填 参数说明
Content-Type application/json true 固定传:application/json
groupName ns-v7g6 true 分组名称,获取授权信息时返回的groupName
accountId 16xxxxxxxxxxxx true 账套ID,获取授权信息时返回的accountId
X-GW-Router-Addr https://tf.jdy.com true IDC域名,获取授权信息时返回的domain
Appuserid 10102023 true 当前登录用户id

params参数

参数名称 参数类型 是否必填 参数说明
access_token string true 金蝶云通行证token
authority_info string true 见文档authority_info参数说明

body参数

参数名称 必选 类型 说明
entityName true String 单据标识:wg_prd_tranceinput
data true Object 其他参数

data的数据结构:

参数名称 类型 必选 说明
id String true 单据id,修改时必填,新增不传该字段
billno String true 单据编号
billdate String true 单据日期
entryentity Array true 源单分录

entryentity的数据结构:

参数名称 类型 必选 说明
wg_productcode String true 加工单编号
wg_productid String true 加工单id
wg_cp_code_id String true 产品id
wg_cp_name String true 产品名称
wg_cp_model String true 规格型号
wg_cp_rowid String true 产品行id
wg_qty String true 数量
wg_qty_add String true 可追加追溯号数量
wg_unit String true 单位
sub_entryentity String true 产品追溯号子分录

sub_entryentity的数据结构:

参数名称 类型 必选 说明
wg_producttraceno String true 产品追溯号
wg_trace_remark String true 备注
wg_product_id String true 加工单ID
wg_product_rowid String true 产品行ID
wg_parent_materialid_id String true 父产品编码
wg_isadd Boolean true 是否新增
id String true 分录id,修改时必填,新增不传该字段
wg_trance_rowid String true 追溯号行ID

请求示例

{
    "entityName": "wg_prd_tranceinput",
    "data": {
        "billno": "CPZS-20260130-00000019",
        "billdate": "2026-01-30",
        "entryentity": [
            {
                "wg_productid": "2376113513790715904",
                "wg_productcode": "SCJG-20251223-00001",
                "wg_cp_rowid": "2376113513832659968",
                "wg_cp_code_id": "1834707500792855552",
                "wg_cp_name": "7-追溯成品1",
                "wg_qty": "5.0000000000",
                "wg_qty_add": 4,
                "wg_cp_model": "批次序列号辅助属性多单位",
                "wg_unit": "1",
                "sub_entryentity": [
                    {
                        "wg_producttraceno": "SN734956001",
                        "wg_trace_remark": "",
                        "wg_product_id": "2376113513790715904",
                        "wg_product_rowid": "2376113513832659968",
                        "wg_parent_materialid_id": "1834707500792855552",
                        "wg_isadd": true
                    }
                ]
            }
        ]
    }
}

响应示例

{
    "data": {
        "id": "2146139740997447680"//单据id
    },
    "errorCode": "success",
    "status": true,
    "success": true
}

curl:

curl ^"https://api.kingdee.com/weigusoft/wg_cost/saveBill?access_token=17667199780d4cbc8ca5cc39910a9df1^&authority_info=MD7Y6R6LmmbAbSDfyZnQmNWqSfaFXo8V+hjbh6AFPd09a8CtKXrcW1zMMOuDg1LZ^" ^
  -H ^"Accept: */*^" ^
  -H ^"Accept-Language: zh-CN,zh;q=0.9^" ^
  -H ^"Appuserid: 10102023^" ^
  -H ^"Connection: keep-alive^" ^
  -H ^"Content-Type: application/json;charset=UTF-8^" ^
  -H ^"Origin: http://localhost:5173^" ^
  -H ^"Referer: http://localhost:5173/^" ^
  -H ^"Sec-Fetch-Dest: empty^" ^
  -H ^"Sec-Fetch-Mode: cors^" ^
  -H ^"Sec-Fetch-Site: cross-site^" ^
  -H ^"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1^" ^
  -H ^"X-GW-Router-Addr: https://tf-ek.jdy.com^" ^
  -H ^"access_token: 17667199780d4cbc8ca5cc39910a9df1^" ^
  -H ^"accountId: 1675743896569628608^" ^
  -H ^"groupName: ns-isv5^" ^
  --data-raw ^"^{^\^"entityName^\^":^\^"wg_prd_tranceinput^\^",^\^"data^\^":^{^\^"billno^\^":^\^"CPZS-20260130-00000018^\^",^\^"billdate^\^":^\^"2026-01-30^\^",^\^"entryentity^\^":^[^{^\^"wg_productid^\^":^\^"2376113513790715904^\^",^\^"wg_productcode^\^":^\^"SCJG-20251223-00001^\^",^\^"wg_cp_rowid^\^":^\^"2376113513832659968^\^",^\^"wg_cp_code_id^\^":^\^"1834707500792855552^\^",^\^"wg_cp_name^\^":^\^"7-^追^溯^成^品1^\^",^\^"wg_qty^\^":^\^"5.0000000000^\^",^\^"wg_qty_add^\^":5,^\^"wg_cp_model^\^":^\^"^批^次^序^列^号^辅^助^属^性^多^单^位^\^",^\^"wg_unit^\^":^\^"1^\^",^\^"sub_entryentity^\^":^[^{^\^"wg_producttraceno^\^":^\^"SN734956001^\^",^\^"wg_trace_remark^\^":^\^"^\^",^\^"wg_product_id^\^":^\^"2376113513790715904^\^",^\^"wg_product_rowid^\^":^\^"2376113513832659968^\^",^\^"wg_parent_materialid_id^\^":^\^"1834707500792855552^\^",^\^"wg_isadd^\^":true^}^]^}^]^}^}^"

分享文章
上一个
产品追溯号录入
下一个
审核
最近修改: 2026-02-11