转单接口–转入来源出库单生成【销货单】CK->SA

概述

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

参数说明

1.请求方式

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

2.header参数

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

3.请求参数

请求JSON示例

{
  "REF_NO": "HYPSA2212190002",        //第三方单号,必填
  "PGM": "DRPSA",            //程序代号,必填
  "MF_PSS": [          //请求生成单据的表头参数信息
    {
      "PS_ID":"SA",       //生成单据别,必填
      "PS_NO":"",        //ERP为自动编号,则取ERP系统编码;为手工编码,则与REF_NO必须相同
      "TRAN_BIL_ID":"CK",      //来源单据别,必填
      "ZHANG_ID":"1",    //立帐方式:1.单张立帐;2.不立帐;3.开出发票才立帐,必填
      "USR":"ADMIN"        //制单人,必填
    }
  ],
  "TF_PSS": [            //请求生成单据的表身参数信息,变更表身资料
    {
       "PS_ID":"SA",
       "PS_NO":"",
       "ITM":1,           //表身项次,必填
       "TRAN_BIL_ID":"CK",            //来源单据别,必填
       "TRAN_BIL_NO":"CK2212190001",      //来源单号,必填
       "TRAN_BIL_ITM":1,     //转单项次,可通过查询接口查来源单表身TRAN_BIL_ITM的值,必填
       "QTY":10          //数量,必填
    },
    {
       "PS_ID":"SA",
       "PS_NO":"",
       "ITM":2,
       "TRAN_BIL_ID":"CK",
       "TRAN_BIL_NO":"CK2212190002",
       "TRAN_BIL_ITM":1,
       "QTY":20
    }
  ]
}

返回结果示例

{
    "code": 0,          //为0表示执行成功,其他表示错误
    "message": "新增成功",
    "data": {
        "MF_PSS": [                //生成销货单表头内容
            {
                "PS_ID": "SA",
                "PS_NO": "SA2302070002",
                "PS_DD": "2023-02-07 00:00:00",
                "PAY_DD": "2023-01-01 00:00:00",
                "CHK_DD": "2023-02-01 00:00:00",
                "CUS_NO": "SY0A02",
                "DEP": "D0300",
                "TAX_ID": "2",
                "SEND_MTH": "1",
                "SEND_WH": "01",
                "ZHANG_ID": "1",
                "CUR_ID": "",
                "EXC_RTO": 1.0,
                "SAL_NO": "001",
                "ARP_NO": "AR2302070002",
                "ARP_DD": "2023-02-07 00:00:00",
                "PAY_MTH": "1",
                "PAY_DAYS": 1,
                "CHK_DAYS": 30,
                "INT_DAYS": 30,
                "PAY_REM": "结帐期:2023-01-01;票据到期日:2023-02-01",
                "USR": "ADMIN",
                "CHK_MAN": "ADMIN",
                "PRT_SW": "N",
                "CLS_DATE": "2023-02-07 16:50:04",
                "CK_CLS_ID": "F",
                "LZ_CLS_ID": "F",
                "YD_ID": "T",
                "BIL_TYPE": "",
                "OS_ID": "CK",
                "SYS_DATE": "2022-12-19 16:39:36",
                "REM": "",
                "TOT_QTY": 30.0,
                "OS_NO": "CK2212190001",
                "KP_ID": "F",
                "CAS_NO": "1964010002",
                "TRAD_MTH": "TD2212190001",
                "AMTN_TRANS": 0.0,
                "BIL_FILE_COUNT": 1,
                "AMT_DIS_CNT": 0.0,
                "TRAN_BIL_ID": "CK"
            }
        ],
        "TF_PSS": [              //生成销货单表身内容
            {
                "PS_ID": "SA",
                "PS_NO": "SA2302070002",
                "ITM": 1,
                "PS_DD": "2023-02-07 00:00:00",
                "WH": "YH002",
                "FREE_ID_DEF": "F",
                "PRD_NO": "001",
                "PRD_NAME": "哈姆卡通玩具",
                "PRD_MARK": "",
                "SPC": "WQT*63WT1",
                "BAR_CODE": "A01",
                "UNIT": "1",
                "QTY_PS": 10.0,
                "PRM_NO": "",
                "QTY": 10.0,
                "QTY1": 10.0,
                "UP": 100.0,
                "UP_QTY1": 100.0,
                "AMTN_NET": 952.38,
                "AMT": 1000.0,
                "UP_SALE": 100.0,
                "AMTN_SALE": 1000.0,
                "PRE_ITM": 1,
                "OS_NO": "SO2212190003",
                "OS_ID": "SO",
                "CSTN_SAL": 615.1,
                "TAX": 47.62,
                "OTH_ITM": 1,
                "VALID_DD": "2022-12-30 00:00:00",
                "CST_STD": 200.0,
                "UP_STD": 20.0,
                "TAX_RTO": 5.0,
                "EST_ITM": 1,
                "REM": "",
                "PAK_UNIT": "2箱",
                "PAK_EXC": 5.0,
                "PAK_NW": 2.0,
                "PAK_WEIGHT_UNIT": "个",
                "PAK_GW": 4.0,
                "PAK_MEAST": 6.0,
                "PAK_MEAST_UNIT": "件",
                "CK_NO": "CK2212190001",
                "SUP_PRD_NO": "AA001",
                "SUP_PRD_MARK": "",
                "EST_DD": "2022-12-19 00:00:00",
                "CHUW": "",
                "TRAN_BIL_ITM": 1,
                "CHK_XZL": "T",
                "QTY_SO_ORG": -9.0,
                "SUP_PRD_NAME": "AA001博世",
                "UP_DIS_CNT": 100.0,
                "PRD_NO_NO": "001",
                "UNIT_DP": "",
                "WLGL_UP": "100.00000000",
                "TRAN_BIL_ID": "CK",
                "TRAN_BIL_NO": "CK2212190001"
            },
            {
                "PS_ID": "SA",
                "PS_NO": "SA2302070002",
                "ITM": 2,
                "PS_DD": "2023-02-07 00:00:00",
                "WH": "YH002",
                "PRD_NO": "002",
                "PRD_NAME": "原料123",
                "PRD_MARK": "",
                "SPC": "简体車2",
                "BAR_CODE": "A02",
                "UNIT": "1",
                "QTY_PS": 20.0,
                "PRM_NO": "",
                "QTY": 20.0,
                "QTY1": 0.0,
                "UP": 200.0,
                "DIS_CNT": 0.0,
                "AMTN_NET": 3809.52,
                "AMT": 4000.0,
                "UP_SALE": 200.0,
                "AMTN_SALE": 4000.0,
                "PRE_ITM": 2,
                "OS_NO": "CK2212190002",
                "OS_ID": "CK",
                "CSTN_SAL": 13803.0,
                "TAX": 190.48,
                "OTH_ITM": 1,
                "CST_STD": 400.0,
                "UP_STD": 20.0,
                "TAX_RTO": 5.0,
                "REM": "",
                "CK_NO": "CK2212190002",
                "CHUW": "",
                "TRAN_BIL_ITM": 1,
                "CHK_XZL": "T",
                "CHK_TAX": "F",
                "UP_DIS_CNT": 0.0,
                "PRD_NO_NO": "002",
                "UNIT_DP": "",
                "WLGL_UP": "200.00000000",
                "TRAN_BIL_ID": "CK",
                "TRAN_BIL_NO": "CK2212190002"
            }
        ],
        "TF_PSS_RCV": [            //生成销货单收货信息
            {
                "PS_ID": "SA",
                "PS_NO": "SA2302070002",
                "CON_MAN": "博世贸易",
                "ADR": "广东珠海吉大水水水",
                "ZIP": "951010",
                "TEL_NO": "23546",
                "CELL_NO": "1350252",
                "RCV_WH_KD": "01",
                "COUN_ID": 4,
                "RCV_E_MAIL": "",
                "RCV_FAX": "",
                "AMT_EXPR": 0.0,
                "CNT_MAN": "博世贸易",
                "REM": "",
                "PAY_ASS": "1"
            }
        ],
        "BILL_STATE": {
            "READONLY": false,
            "READONLY_REM": []
        }
    }
}