转单接口–转入来源受订单生成【受订退回单】SO->SR

概述

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

参数说明

1.请求方式

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

2.header参数

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

3.请求参数

请求JSON示例

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

返回结果示例

{
    "code": 0,               //为0表示执行成功,其他表示错误
    "message": "新增成功",
    "data": {
        "MF_POS": [                 //生成受订退回单表头内容
            {
                "OS_ID": "SR",
                "OS_NO": "SR2302070001",
                "OS_DD": "2023-02-07 00:00:00",
                "CUS_NO": "SY0A02",
                "SAL_NO": "001",
                "EST_DD": "2023-02-07 00:00:00",
                "CUR_ID": "",
                "TAX_ID": "2",
                "BIL_TYPE": "",
                "CAS_NO": "1964010002",
                "REM": "",
                "PAY_MTH": "1",
                "PAY_DAYS": 1,
                "CHK_DAYS": 30,
                "PAY_REM": "结帐期:2023-03-01; 票据到期日:2023-04-01",
                "SEND_MTH": "",
                "SEND_WH": "",
                "AMTN_NET": 5523.81,
                "FX_WH": "",
                "PO_DEP": "D0300",
                "PAY_DD": "2023-03-01 00:00:00",
                "CHK_DD": "2023-04-01 00:00:00",
                "INT_DAYS": 30,
                "USR": "ADMIN",
                "CLS_ID": "F",
                "LZ_CLS_ID2": "F",
                "PRT_SW": "N",
                "BIL_ID": "SO",
                "CLS_DATE": "2023-02-07 17:32:23",
                "CHK_MAN": "ADMIN",
                "EXC_RTO": 1.0,
                "SYS_DATE": "2023-02-07 17:32:23",
                "ISOVERSH": "F",
                "HS_ID": "F",
                "HIS_PRICE": "F",
                "TAX": 276.19,
                "PO_SO_NO": "SO2212200002",
                "CHK_FULL_PAID": "F",
                "TRAN_BIL_ID": "SO"
            }
        ],
        "TF_POS": [                 //生成受订退回单表身内容
            {
                "OS_ID": "SR",
                "OS_NO": "SR2302070001",
                "ITM": 1,
                "QT_NO": "SO2212200002",
                "PRD_NO": "001",
                "PRD_NAME": "哈姆卡通玩具",
                "PRD_MARK": "",
                "WH": "YH002",
                "FREE_ID_DEF": "F",
                "UNIT": "1",
                "QTY": 10.0,
                "UP": 180.0,
                "AMT": 1800.0,
                "AMTN": 1714.29,
                "TAX_RTO": 5.0,
                "TAX": 85.71,
                "PRE_ITM": 1,
                "CHK_TAX": "F",
                "EST_DD": "2022-12-20 00:00:00",
                "CST_STD": 200.0,
                "OS_DD": "2023-02-07 00:00:00",
                "REM": "",
                "EST_ITM": 1,
                "VALID_DD": "2022-12-31 00:00:00",
                "QTY1": 10.0,
                "UP_QTY1": 180.0,
                "SPC": "WQT*63WT1",
                "UP_STD": 20.0,
                "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": "件",
                "TRAN_BIL_ITM": 1,
                "PRD_NO_NO": "001",
                "TRAN_BIL_ID": "SO",
                "TRAN_BIL_NO": "SO2212200002"
            },
            {
                "OS_ID": "SR",
                "OS_NO": "SR2302070001",
                "ITM": 2,
                "QT_NO": "SO2212200003",
                "PRD_NO": "002",
                "PRD_NAME": "原料123",
                "PRD_MARK": "",
                "WH": "YH002",
                "FREE_ID_DEF": "F",
                "UNIT": "1",
                "QTY": 20.0,
                "UP": 200.0,
                "AMT": 4000.0,
                "AMTN": 3809.52,
                "TAX_RTO": 5.0,
                "TAX": 190.48,
                "PRE_ITM": 1,
                "CHK_TAX": "F",
                "EST_DD": "2022-12-20 00:00:00",
                "CST_STD": 400.0,
                "OS_DD": "2023-02-07 00:00:00",
                "REM": "",
                "EST_ITM": 2,
                "SPC": "简体車2",
                "UP_STD": 20.0,
                "TRAN_BIL_ITM": 1,
                "PRD_NO_NO": "002",
                "TRAN_BIL_ID": "SO",
                "TRAN_BIL_NO": "SO2212200003"
            }
        ],
        "TF_POS_RCV": [              //生成受订退回单收货信息
            {
                "OS_ID": "SR",
                "OS_NO": "SR2302070001",
                "CON_MAN": "博世贸易",
                "ADR": "广东珠海吉大水水水",
                "ZIP": "951010",
                "TEL_NO": "23546",
                "CELL_NO": "1350252",
                "RCV_WH_KD": "01",
                "COUN_ID": 4,
                "RCV_E_MAIL": "",
                "RCV_FAX": "",
                "CNT_MAN": "博世贸易",
                "PAY_ASS": "1",
                "REM": ""
            }
        ],
        "BILL_STATE": {
            "READONLY": false,
            "READONLY_REM": []
        }
    }
}