转单接口–转入来源采购单生成【进货送检单】PO->TI

概述

该接口主要用于第三方平台或自主研发者,通过调用【进货送检单】的转单接口,将第三方系统的采购入库送检的货品信息推送到Sunlike ERP或Online ERP系统中,从而生成Sunlike ERP或Online ERP系统的【进货送检单】。

参数说明

1.请求方式

请求方式 POST
接口地址 http://ERPAPI站点/DRPTI/TRANDATA
格式 JSON
编码类型 UTF-8

2.header参数

Content-Type application/json
Authorization token 获取每次登录的值

3.请求参数

请求JSON示例

{
  "REF_NO": "HYPTI2212220001",        //第三方单号,必填
  "PGM": "DRPTIWIN",            //程序代号,必填
  "MF_TI": [          //请求生成单据的表头参数信息
    {
      "TI_ID": "TI",       //生成单据别,必填
      "TI_NO": "",         //ERP为自动编号,则取ERP系统编码;为手工编码,则与REF_NO必须相同
      "TRAN_BIL_ID":"PO",       //来源单据别,必填
      "USR":"ADMIN"         //制单人,必填
    }
  ],
  "TF_TI": [            //请求生成单据的表身参数信息,变更表身资料
    {
      "TI_ID": "TI",
      "TI_NO": "",
      "ITM": 1,           //表身项次,必填
       "TRAN_BIL_ID":"PO",             //来源单据别,必填
      "TRAN_BIL_NO":"PO2212220001",      //来源单号,必填
      "TRAN_BIL_ITM":1,      //转单项次,可通过查询接口查来源单表身TRAN_BIL_ITM的值,必填
      "QTY":10          //数量,必填
    },
    {
      "TI_ID": "TI",
      "TI_NO": "",
      "ITM": 2,
       "TRAN_BIL_ID":"PO",
      "TRAN_BIL_NO":"PO2212220002",
      "TRAN_BIL_ITM":1,
      "QTY":20
    }
  ]
}

返回结果示例

{
    "code": 0,             //为0表示执行成功,其他表示错误
    "message": "新增成功",
    "data": {
        "MF_TI": [            //生成进货送检单表头内容
            {
                "TI_ID": "TI",
                "TI_NO": "TI2302070001",
                "TI_DD": "2023-02-07 00:00:00",
                "SAL_NO": "001",
                "CUS_NO": "CU0301",
                "DEP": "D0300",
                "BIL_ID": "PO",
                "BIL_NO": "PO2212220001-2",
                "BIL_TYPE": "",
                "REM": "",
                "USR": "ADMIN",
                "CHK_MAN": "ADMIN",
                "CLS_DATE": "2023-02-07 19:14:36",
                "PRT_SW": "N",
                "CLOSE_ID": "F",
                "SYS_DATE": "2023-02-07 19:14:36",
                "OS_ID": "PO",
                "OS_NO": "PO2212220001-2",
                "TRAN_BIL_ID": "PO"
            }
        ],
        "TF_TI": [                //生成进货送检单表身内容
            {
                "TI_ID": "TI",
                "TI_NO": "TI2302070001",
                "ITM": 1,
                "PRD_NO": "001",
                "PRD_NAME": "哈姆卡通玩具",
                "PRD_MARK": "",
                "WH": "YH002",
                "UNIT": "1",
                "QTY": 10.0,
                "REM": "",
                "BIL_ID": "PO",
                "SUP_PRD_MARK": "",
                "BIL_NO": "PO2212220001",
                "SUP_PRD_NO": "1070300082",
                "EST_ITM": 1,
                "PRE_ITM": 1,
                "CK_ITM": 1,
                "CUS_OS_NO": "",
                "VALID_DD": "2023-02-18 00:00:00",
                "CHKTY_ID": "T",
                "QTY1": 10.0,
                "QTY_RK": 10.0,
                "CNT_NEED": "F",
                "TRAN_BIL_ITM": 1,
                "TRAN_BIL_ID": "PO",
                "TRAN_BIL_NO": "PO2212220001"
            },
            {
                "TI_ID": "TI",
                "TI_NO": "TI2302070001",
                "ITM": 2,
                "PRD_NO": "002",
                "PRD_NAME": "原料123",
                "PRD_MARK": "",
                "WH": "YH002",
                "UNIT": "1",
                "QTY": 20.0,
                "REM": "",
                "BIL_ID": "PO",
                "BIL_NO": "PO2212220002",
                "EST_ITM": 1,
                "PRE_ITM": 2,
                "CK_ITM": 2,
                "CUS_OS_NO": "",
                "CHKTY_ID": "T",
                "QTY_RK": 20.0,
                "CNT_NEED": "F",
                "TRAN_BIL_ITM": 1,
                "TRAN_BIL_ID": "PO",
                "TRAN_BIL_NO": "PO2212220002"
            }
        ],
        "BILL_STATE": {
            "READONLY": false,
            "READONLY_REM": []
        }
    }
}