# Price List

# Fetch Price List List

# 一、Description

​ Usage: Fetch Price List List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes uplist
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=uplist&beId=" + beId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}			

​ 4、Response Sample

{
  "stSearch": "uplist",
  "size": 11,
  "stSearchDisplay": "Price List",
  "values": [
      {
          "tDate": "2022-03-11",
          "mainup.lastModifyUid.simpleUser.desc__lang": "JLTEST",
          "code": "JLTEST20220311",
          "st_id": 84,
          "st_code": "JLTEST20220311",
          "mainup.upTypeId.pricetype.code": "",
          "st_desc": "JLTEST20220311",
          "mainup.upTypeId.pricetype.desc": "",
          "iRev": 1,
          "id": 84,
          "lastModifyDate": "2022-03-11 15:09:23"
      }
  ]
}

# Create Price List (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Price List】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/uplist
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/uplist";
		String param = "";

		HttpPost post = new HttpPost(url + "?" + param);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

Sample data:

{
  "beCode":"CAT2019",
  "upt":[{
      "proCode":"00001",
      "unitCode":"PCS",
      "qty":0,
      "up":5,
      "disc":5
  }]
}

​ 4、Response Sample

{
  "tranId": 87,
  "tranCode": "UPL220016",
  "message": "",
  "status": true
}

# Load Price List

# 一、Description

​ Usage: Load Price List Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/uplist
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes uplist
id long(Query) Yes Price List ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/uplist";
			String param = "&menuCode=uplist&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {
        "remup": [
            {
                "lTime": "",
                "tradeTerm_ccn": "",
                "tradeTerm_en": "",
                "lTime_zh-TW": "",
                "lTime_ccn": "",
                "tradeTerm_zh-CN": "",
                "lTime_haha1": "",
                "remarks_en": "",
                "payTerm_en": "",
                "iRev": 1,
                "packing_ccn": "",
                "packing": "",
                "ce01Module": "uplist",
                "tradeTerm": "",
                "payTerm_haha1": "",
                "packing_zh-TW": "",
                "payTerm_zh-TW": "",
                "packing_haha1": "",
                "remarks_haha1": "",
                "id": 85,
                "lTime_zh-CN": "",
                "remarks_zh-TW": "",
                "hId": 85,
                "packing_ctw": "",
                "payTerm": "",
                "payTerm_ccn": "",
                "remarks_ccn": "",
                "tradeTerm_ctw": "",
                "lTime_en": "",
                "packing_zh-CN": "",
                "lTime_ctw": "",
                "tradeTerm_zh-TW": "",
                "tradeTerm_haha1": "",
                "i18nField": "{\"lTime_zh-CN\": \"\", \"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "packing_en": "",
                "payTerm_zh-CN": "",
                "payTerm_ctw": "",
                "remarks": "",
                "remarks_ctw": ""
            }
        ],
        "upt": [
            {
                "sourceId": 0,
                "udftest17": "",
                "udftest16": "",
                "unit2Id": 39151,
                "udftest15": "",
                "udftest14": "",
                "udftest13": "",
                "dualQty": 0,
                "udftest12": "",
                "udftest11": "",
                "udftest10": "",
                "qty2": 0,
                "itemNo": "     1",
                "qty1": 0,
                "beId": 304,
                "bDesc": "",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 7354,
                "up": 5,
                "udftest19": "",
                "dDesc_haha1": "",
                "udftest18": "",
                "hId": 85,
                "freeQtyPer": 0,
                "dDesc": "",
                "footerKey": "",
                "i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
                "sourceType": "pro",
                "qty": 0,
                "disc": 5,
                "lotNoId": 0,
                "dDesc_ctw": "",
                "unit1Id": 39151,
                "costAmt": 0,
                "amt": 0,
                "iRev": 1,
                "dDesc_zh-CN": "",
                "bDesc_ctw": "",
                "ce01Module": "uplist",
                "lot": "A",
                "bDesc_haha1": "",
                "dDesc_zh-TW": "",
                "domAmt": 0,
                "bDesc_ccn": "",
                "unitId": 39151,
                "dDesc_ccn": "",
                "locId": 0,
                "bDesc_en": "",
                "udftest20": "",
                "udftest9": "",
                "dDesc_en": "",
                "dualUnitId": 1,
                "udftest2": "",
                "udftest1": "",
                "sourceLot": "",
                "udftest4": "",
                "udftest3": "",
                "udftest6": "",
                "udftest5": "",
                "udftest8": "",
                "proId": 4197,
                "udftest7": "",
                "udfmxtest": "",
                "bDesc_zh-CN": ""
            }
        ],
        "mainup": [
            {
                "tDate": 1646928000000,
                "lastModifyUid": 17,
                "code": "JLTEST20220311B",
                "cnDeptId": 0,
                "useAccess": false,
                "virDeptId": 0,
                "expiredDate": -2209017600000,
                "iRev": 1,
                "sysJson": "",
                "viewCode": "uplist",
                "ce01Module": "uplist",
                "beId": 304,
                "udfmxstr": "",
                "curId": 1,
                "udfmxdate": -2209017600000,
                "expired": false,
                "dDate": 253402185600000,
                "rate": 1,
                "printCount": 0,
                "useAccessBl": false,
                "udfcusaa": 0,
                "id": 85,
                "doctypeId": 0,
                "statusModifyDate": 1646983091000,
                "locked": false,
                "lastModifyDate": 1646983091000,
                "createUid": 17,
                "createDate": 1646983091000,
                "rev": "1",
                "lastApproveUid": 17,
                "upTypeId": 0,
                "expiredUid": 0,
                "useAccessWl": false,
                "freeQtyPer": 0,
                "udfmxnum": 0,
                "useAccessAutoCalc": false,
                "udfmxlookup": 0,
                "staffId": 700,
                "status": "Y"
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Price List

# 一、Description

​ Usage: Create or Update 【Price List】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/uplist
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes uplist
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/uplist";
		String param = "&menuCode=uplist";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity data as JSON format:

   {
      "mainup": {
          "values": [
              {
                  "beId": 304,
                  "code": "JLTEST20220311",
                  "tDate": "2022-3-11",
                  "curId": 1,
                  "rate": 1,
                  "staffId": 700
              }
          ]
      },
      "upt": {
          "values": [
              {
                  "sourceType": "pro",
                  "proId": 4197,
                  "unitId": 39151,
                  "qty": 0,
                  "up": 5,
                  "disc": 5
              }
          ]
      }
    }	

​ 4、Response Sample

{
	"recordId": 88,
	"messages": [],
	"status": true
}	
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Price List

# 一、Description

​ Usage: Delete Price List

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/uplist
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes uplist
id long(Query) Yes Price List ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/uplist";
		String param = "&menuCode=uplist&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Price List Report

# 一、Description

​ Usage: Run EBI[Price List Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
    "size": 1,
    "rows": [
        {
            "M_A_code": "UPL180008",
            "M_A_id": "46",
            "M_A_rate": "1.00000000",
            "M18ReservedCol_dataIndex": 1,
            "F_A_unitId_code": "克",
            "M_A_dDate": "9999.12.31",
            "M_A_curId_desc__lang": "HK$",
            "M_A_tDate": "2018.01.01",
            "PRO_A_code": "0250A",
            "PRO_A_id": "1031",
            "F_A_qty": "0.0000",
            "F_A_up": "10.0000"
        }
    ]
}

ebi4

# Sales Quotation

# Fetch Sales Quotation List

# 一、Description

​ Usage: Fetch Sales Quotation List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes oldqu
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=oldqu&beId=" + beId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}			

​ 4、Response Sample

{
    "stSearch": "oldqu",
    "size": 1,
    "stSearchDisplay": "Sales Quotation",
    "values": [
        {
            "tDate": "2022-03-11",
            "mainqu.cusId.cus.code": "000",
            "mainqu.flowTypeId.flowtype.code": "ALL",
            "code": "JLTEST20220311B",
            "st_code": "JLTEST20220311B",
            "mainqu.flowTypeId.flowtype.desc": "All",
            "mainqu.curId.cur.sym": "¥",
            "st_desc": "JLTEST20220311B",
            "iRev": 1,
            "mainqu.cusId.cus.desc__lang": "000 Sc",
            "st_id": 139,
            "mainqu.lastModifyUid.simpleUser.desc__lang": "JLTEST",
            "id": 139,
            "lastModifyDate": "2022-03-17 12:00:50"
        }
    ]
}  

# Create Sales Quotation (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Sales Quotation】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

​ ​ e. If field business process has no value specified, according to the default value set in [Business Process Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/oldqu
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/oldqu";
		String param = "";

		HttpPost post = new HttpPost(url + "?" + param);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

Sample data:

{
  "beCode":"CAT2019",
  "cusCode":"000",
  "qut":[{
      "proCode":"00001",
      "unitCode":"PCS",
      "qty":1,
      "up":5,
      "disc":5
  }]
}

​ 4、Response Sample

{
    "tranId": 141,
    "tranCode": "OLD220014",
    "message": "",
    "status": true
}

# Load Sales Quotation

# 一、Description

​ Usage: Load Sales Quotation Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/oldqu
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes oldqu
id long(Query) Yes Sales Quotation ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/oldqu";
			String param = "&menuCode=oldqu&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {
        "qut": [
            {
                "sourceId": 0,
                "unit2Id": 39151,
                "oemRate": 1,
                "dualQty": 0,
                "qty2": 0,
                "itemNo": "     1",
                "uc": 0,
                "qty1": 1,
                "beId": 304,
                "bDesc": "Skirt  SC /\\",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 225,
                "up": 5,
                "ctn": 0,
                "dDesc_haha1": "",
                "height": 0,
                "hId": 141,
                "perCtn": 0,
                "margin": 0,
                "matUc": 0,
                "markup": 0,
                "freeQtyPer": 0,
                "volume": 0,
                "dDesc": "<p>Skirt&nbsp; SC Desc<br></p>",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_zh-CN\": \"Skirt  SC /\\\\\", \"dDesc_zh-CN\": \"<p>Skirt&nbsp; SC Desc<br></p>\"}",
                "sourceType": "pro",
                "qty": 1,
                "disc": 5,
                "oemCurId": 1,
                "packingDesc": "",
                "refCode": "",
                "lotNoId": 0,
                "dDesc_ctw": "",
                "innerQty": 0,
                "unit1Id": 39151,
                "costAmt": 0,
                "amt": 4.75,
                "nw": 0,
                "iRev": 1,
                "dDesc_zh-CN": "<p>Skirt&nbsp; SC Desc<br></p>",
                "packingUnitId": 0,
                "bDesc_ctw": "",
                "ce01Module": "oldqu",
                "lot": "A",
                "bDesc_haha1": "",
                "dDesc_zh-TW": "",
                "domAmt": 4.75,
                "bDesc_ccn": "",
                "unitId": 39151,
                "innerUnitId": 0,
                "dDesc_ccn": "",
                "profit": 0,
                "locId": 0,
                "cifUp": 0,
                "bDesc_en": "",
                "length": 0,
                "gp": 0,
                "imgCode": "",
                "dDesc_en": "",
                "dualUnitId": 1,
                "gw": 0,
                "sourceLot": "",
                "pc": 0,
                "oemSourceType": "",
                "proId": 4197,
                "width": 0,
                "bDesc_zh-CN": "Skirt  SC /\\"
            }
        ],
        "mainqu": [
            {
                "insurance": 0,
                "lastModifyUid": 17,
                "useAccess": false,
                "virDeptId": 0,
                "expiredDate": -2209017600000,
                "ttlCfCifAmt": 0,
                "position_zh-CN": "",
                "sysJson": "{\"autoGenCode\":{\"snId\":982,\"code\":\"OLD220014\",\"sn\":\"14\"}}",
                "viewCode": "oldqu",
                "expDate": 253402185600000,
                "beId": 304,
                "cusId": 119,
                "useAccessBl": false,
                "id": 141,
                "doctypeId": 0,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1649154916000,
                "createUid": 17,
                "udfHtml": "",
                "rev": "1",
                "lastApproveUid": 17,
                "ttlCharge": 0,
                "expiredUid": 0,
                "freeQtyPer": 0,
                "descOrigin": "SOLAST",
                "position_en": "",
                "position_zh-TW": "",
                "i18nField": "{\"position_zh-CN\": \"\"}",
                "manId": 516,
                "ttlAmt": 4.75,
                "position": "",
                "flowTypeId": 15918,
                "status": "Y",
                "weightUnit": "kg",
                "tDate": 1649088000000,
                "code": "OLD220014",
                "cnDeptId": 0,
                "amt": 4.75,
                "iRev": 1,
                "upOrigin": "SOLAST",
                "ce01Module": "oldqu",
                "curId": 1,
                "expired": false,
                "rate": 1,
                "domAmt": 4.75,
                "measUnit": "cbm",
                "printCount": 0,
                "statusModifyDate": 1649154916000,
                "createDate": 1649154916000,
                "freightM": 0,
                "useAccessWl": false,
                "position_ccn": "",
                "ttlDisc": 0,
                "position_haha1": "",
                "freightW": 0,
                "useAccessAutoCalc": false,
                "staffId": 700,
                "domAmtDiff": 0
            }
        ],
        "remqu": [
            {
                "tradeTerm_ccn": "",
                "country": "CN",
                "heading_en": "",
                "tradeTerm_zh-CN": "",
                "lTime_haha1": "",
                "shipAd4_haha1": "",
                "remarks_en": "",
                "packing_ccn": "",
                "recipient_ccn": "",
                "tradeTerm": "",
                "heading_ccn": "",
                "shipAd2_zh-TW": "",
                "shipAd1_en": "",
                "payTerm_zh-TW": "",
                "province": "广东",
                "packing_haha1": "",
                "tel": "",
                "recipient_haha1": "",
                "id": 140,
                "fax": "",
                "remarks_zh-TW": "",
                "shipAd1_zh-CN": "送货地址 第一行 简体",
                "hId": 141,
                "payTerm": "",
                "heading_zh-TW": "",
                "payTerm_ccn": "",
                "remarks_ccn": "",
                "heading_ctw": "",
                "lTime_en": "",
                "lTime_ctw": "",
                "tradeTerm_zh-TW": "",
                "shipAd4_ccn": "",
                "zipcode": "",
                "shipAd2_en": "",
                "shipAd1_haha1": "",
                "i18nField": "{\"lTime_zh-CN\": \"\", \"heading_zh-CN\": \"\", \"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipAd1_zh-CN\": \"送货地址 第一行 简体\", \"shipAd2_zh-CN\": \"\", \"shipAd3_zh-CN\": \"\", \"shipAd4_zh-CN\": \"\", \"recipient_zh-CN\": \"Jerry.li\", \"tradeTerm_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "packing_en": "",
                "shipAd4_ctw": "",
                "gpsLat": 0,
                "payTerm_zh-CN": "",
                "shipAd3_zh-TW": "",
                "payTerm_ctw": "",
                "remarks_ctw": "",
                "lTime": "",
                "shipAd1_ccn": "",
                "tradeTerm_en": "",
                "lTime_zh-TW": "",
                "shipCodeId": 284,
                "lTime_ccn": "",
                "city": "深圳",
                "shipAd3_ctw": "",
                "recipient_zh-CN": "Jerry.li",
                "payTerm_en": "",
                "iRev": 1,
                "shipAd4_zh-TW": "",
                "packing": "",
                "heading_zh-CN": "",
                "shipAd2_ccn": "",
                "ce01Module": "oldqu",
                "payTerm_haha1": "",
                "shipAd3_en": "",
                "recipient_en": "",
                "packing_zh-TW": "",
                "shipAd3_zh-CN": "",
                "shipAd4_zh-CN": "",
                "shipAd2_ctw": "",
                "shipAd2_haha1": "",
                "remarks_haha1": "",
                "shipAd1_ctw": "",
                "lTime_zh-CN": "",
                "email": "jerry.li@mac.sz",
                "shipAd3_ccn": "",
                "recipient_zh-TW": "",
                "packing_ctw": "",
                "heading_haha1": "",
                "heading": "",
                "recipient_ctw": "",
                "tradeTerm_ctw": "",
                "packing_zh-CN": "",
                "telCountry": "",
                "tradeTerm_haha1": "",
                "shipAd1": "送货地址 第一行 简体",
                "shipAd2": "",
                "shipAd3": "",
                "shipAd4": "",
                "telArea": "",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "",
                "recipient": "Jerry.li",
                "shipAd2_zh-CN": "",
                "shipAd3_haha1": "",
                "remarks": "",
                "gpsLong": 0
            }
        ],
        "quphoto": [
            {
                "hId": 141,
                "footerKey": "     1",
                "photoId": 948,
                "iRev": 1,
                "id": 132,
                "itemNo": "     1",
                "ce01Module": "oldqu",
                "desc": ""
            },
            {
                "hId": 141,
                "footerKey": "     1",
                "photoId": 949,
                "iRev": 1,
                "id": 133,
                "itemNo": "     2",
                "ce01Module": "oldqu",
                "desc": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Sales Quotation

# 一、Description

​ Usage: Create Or Update【Sales Quotation】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/s/save/oldqu
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes oldqu
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/oldqu";
		String param = "&menuCode=oldqu";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity data as JSON format:

{
    "qut": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 4197,
                "qty": 1,
                "unitId": 39151,
                "amt": 4,
                "disc": 10,
                "up": 5
            }
        ]
    },
    "mainqu": {
        "values": [
            {
                "beId": 304,
                "tDate": "2022-03-30",
                "curId": 1,
                "cusId": 1,
                "rate": 1,
                "amt": 4,
                "flowTypeId": 15918,
                "staffId": 700
            }
        ]
    }
}

​ 4、Response Sample

{
	"recordId": 142,
	"messages": [],
	"status": true
}	
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Sales Quotation

# 一、Description

​ Usage: Delete Sales Quotation

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/delete/oldqu
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes oldqu
id long(Query) Yes Sales Quotation ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/oldqu";
		String param = "&menuCode=oldqu&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Sales Quotation Report

# 一、Description

​ Usage: Run EBI[Sales Quotation Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
    "size": 1,
    "rows": [
        {
            "M_A_code": "ITQU16120001",
            "M_A_id": "11",
            "M_A_rate": "1.00000000",
            "M18ReservedCol_dataIndex": 1,
            "M_A_curId_desc__lang": "¥",
            "M_A_tDate": "2016.12.06",
            "CUS_A_id": "1",
            "PRO_A_code": "PRO005",
            "CUS_A_code": "C0001A",
            "PRO_A_id": "10",
            "F_A_up": "17.4000",
            "F_A_qty": "10.0000"
        }
    ]
}

ebi4

# Sales Order

# Fetch Sales Order List

# 一、Description

​ Usage: Fetch Sales Order List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes oldso
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=oldso&beId=" + beId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}			

​ 4、Response Sample

{
    "stSearch": "oldso",
    "size": 1,
    "stSearchDisplay": "Sales Order",
    "values": [
        {
            "mainso.flowTypeId.flowtype.desc": "All",
            "tDate": "2022-04-02",
            "code": "SO0220887",
            "st_code": "SO0220887",
            "mainso.flowTypeId.flowtype.code": "ALL",
            "st_desc": "SO0220887",
            "iRev": 4,
            "mainso.cusId.cus.code": "000",
            "st_id": 2003,
            "mainso.cusId.cus.desc__lang": "000 Sc",
            "mainso.lastModifyUid.simpleUser.desc__lang": "JLTEST",
            "cuspono": "",
            "id": 2003,
            "mainso.curId.cur.sym": "HK$",
            "lastModifyDate": "2022-04-02 16:29:04"
        }
    ]
}

# Create Sales Order (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Sales Order】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/oldso
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/oldso";
		String param = "";

		HttpPost post = new HttpPost(url + "?" + param);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

Sample data:

{
  "beCode":"CAT2019",
  "cusCode":"000",
  "sot":[{
      "proCode":"00001",
      "unitCode":"PCS",
      "qty":1,
      "up":5,
      "disc":5
  }]
}

​ 4、Response Sample

{
	"tranId": 2004,
    "tranCode": "SO0220888",
    "message": "",
    "status": true
}

# Load Sales Order

# 一、Description

​ Usage: Load Sales Order Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/oldso
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes oldso
id long(Query) Yes Sales Order ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/oldso";
			String param = "&menuCode=oldso&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {
        "remso": [
            {
                "tradeTerm_ccn": "",
                "shipMark": "",
                "remarks_en": "",
                "tradeTerm": "",
                "premarks": "",
                "shipAd1_en": "",
                "province": "广东",
                "packing_haha1": "",
                "tel": "",
                "shipMark_en": "",
                "recipient_haha1": "",
                "id": 2000,
                "fax": "",
                "premarks_zh-CN": "",
                "shipAd1_zh-CN": "送货地址 第一行 简体",
                "payTerm": "",
                "heading_zh-TW": "",
                "payTerm_ccn": "",
                "remarks_ccn": "",
                "shipAd4_ccn": "",
                "i18nField": "{\"heading_zh-CN\": \"\", \"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipAd1_zh-CN\": \"送货地址 第一行 简体\", \"shipAd2_zh-CN\": \"\", \"shipAd3_zh-CN\": \"\", \"shipAd4_zh-CN\": \"\", \"premarks_zh-CN\": \"\", \"shipMark_zh-CN\": \"\", \"recipient_zh-CN\": \"Jerry.li\", \"tradeTerm_zh-CN\": \"\"}",
                "shipAd4_ctw": "",
                "shipAd3_zh-TW": "",
                "payTerm_ctw": "",
                "remarks_ctw": "",
                "tradeTerm_en": "",
                "city": "深圳",
                "shipMark_ctw": "",
                "payTerm_en": "",
                "iRev": 1,
                "shipAd4_zh-TW": "",
                "shipAd2_ccn": "",
                "ce01Module": "oldso",
                "shipAd3_en": "",
                "shipAd4_zh-CN": "",
                "shipAd2_ctw": "",
                "shipAd2_haha1": "",
                "email": "jerry.li@mac.sz",
                "packing_ctw": "",
                "heading_haha1": "",
                "heading": "",
                "premarks_en": "",
                "recipient_ctw": "",
                "tradeTerm_ctw": "",
                "telCountry": "",
                "tradeTerm_haha1": "",
                "shipAd1": "送货地址 第一行 简体",
                "shipAd2": "",
                "shipAd3": "",
                "premarks_zh-TW": "",
                "shipAd4": "",
                "shipMark_haha1": "",
                "shipAd3_haha1": "",
                "smthId": 0,
                "gpsLong": 0,
                "country": "CN",
                "heading_en": "",
                "shipMark_zh-CN": "",
                "tradeTerm_zh-CN": "",
                "shipAd4_haha1": "",
                "packing_ccn": "",
                "dest": "",
                "recipient_ccn": "",
                "heading_ccn": "",
                "shipAd2_zh-TW": "",
                "payTerm_zh-TW": "",
                "remarks_zh-TW": "",
                "hId": 2004,
                "heading_ctw": "",
                "tradeTerm_zh-TW": "",
                "shipMark_ccn": "",
                "zipcode": "",
                "premarks_haha1": "",
                "shipAd2_en": "",
                "shipAd1_haha1": "",
                "remarks_zh-CN": "",
                "packing_en": "",
                "gpsLat": 0,
                "payTerm_zh-CN": "",
                "shipMark_zh-TW": "",
                "shipAd1_ccn": "",
                "shipCodeId": 284,
                "shipAd3_ctw": "",
                "recipient_zh-CN": "Jerry.li",
                "packing": "",
                "heading_zh-CN": "",
                "premarks_ccn": "",
                "payTerm_haha1": "",
                "recipient_en": "",
                "packing_zh-TW": "",
                "shipAd3_zh-CN": "",
                "remarks_haha1": "",
                "shipAd1_ctw": "",
                "shipAd3_ccn": "",
                "recipient_zh-TW": "",
                "packing_zh-CN": "",
                "telArea": "",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "",
                "premarks_ctw": "",
                "recipient": "Jerry.li",
                "shipAd2_zh-CN": "",
                "remarks": ""
            }
        ],
        "sophoto": [
            {
                "hId": 2004,
                "footerKey": "     1",
                "photoId": 948,
                "iRev": 1,
                "id": 775,
                "itemNo": "     1",
                "ce01Module": "oldso",
                "desc": ""
            },
            {
                "hId": 2004,
                "footerKey": "     1",
                "photoId": 949,
                "iRev": 1,
                "id": 776,
                "itemNo": "     2",
                "ce01Module": "oldso",
                "desc": ""
            }
        ],
        "sot": [
            {
                "sourceId": 0,
                "udfPJPwidth": 0,
                "unit2Id": 39151,
                "shipMark": "",
                "udfPJPtestNum": 0,
                "oemRate": 1,
                "dualQty": 0,
                "qty2": 0,
                "itemNo": "     1",
                "uc": 0,
                "qty1": 1,
                "beId": 304,
                "dDate": 1649088000000,
                "bDesc": "Skirt  SC /\\",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "cusDDate": 1649088000000,
                "udfString": "SO0220888",
                "id": 3508,
                "up": 5,
                "ctn": 0,
                "qcRequired": false,
                "udfPJPtestBool": false,
                "dDesc_haha1": "",
                "height": 0,
                "hId": 2004,
                "perCtn": 0,
                "margin": 0,
                "matUc": 0,
                "markup": 0,
                "udfPJPtestLookup": 0,
                "completed": false,
                "freeQtyPer": 0,
                "volume": 0,
                "dDesc": "<p>Skirt&nbsp; SC Desc<br></p>",
                "footerKey": "     1",
                "udfPJPstring1": "",
                "i18nField": "{\"bDesc_zh-CN\": \"Skirt  SC /\\\\\", \"dDesc_zh-CN\": \"<p>Skirt&nbsp; SC Desc<br></p>\"}",
                "sourceType": "pro",
                "qty": 1,
                "disc": 5,
                "oemCurId": 1,
                "packingDesc": "",
                "refCode": "",
                "lotNoId": 0,
                "dDesc_ctw": "",
                "innerQty": 0,
                "unit1Id": 39151,
                "costAmt": 0,
                "amt": 4.75,
                "nw": 0,
                "iRev": 1,
                "udfTest": "",
                "dDesc_zh-CN": "<p>Skirt&nbsp; SC Desc<br></p>",
                "packingUnitId": 0,
                "bDesc_ctw": "",
                "ce01Module": "oldso",
                "lot": "A",
                "bDesc_haha1": "",
                "dDesc_zh-TW": "",
                "domAmt": 4.75,
                "udfPJPtestStr": "",
                "bDesc_ccn": "",
                "unitId": 39151,
                "innerUnitId": 0,
                "udfPJPtestDate": -2209017600000,
                "dDesc_ccn": "",
                "profit": 0,
                "locId": 0,
                "bDesc_en": "",
                "sourceCliId": 0,
                "udfPJPlength": 0,
                "length": 0,
                "gp": 0,
                "imgCode": "",
                "dDesc_en": "",
                "dualUnitId": 1,
                "gw": 0,
                "sourceLot": "",
                "pc": 0,
                "oemSourceType": "",
                "proId": 4197,
                "width": 0,
                "bDesc_zh-CN": "Skirt  SC /\\"
            }
        ],
        "mainso": [
            {
                "lastModifyUid": 17,
                "useAccess": false,
                "virDeptId": 0,
                "expiredDate": -2209017600000,
                "invShipedStatus": 2,
                "position_zh-CN": "",
                "sysJson": "{\"autoGenCode\":{\"snId\":438,\"code\":\"SO0220888\",\"sn\":\"888\"}}",
                "viewCode": "oldso",
                "beId": 304,
                "dDate": 1649088000000,
                "shipedStatus": 2,
                "cusId": 119,
                "cusDDate": -2209017600000,
                "useAccessBl": false,
                "shipedASOStatus": 0,
                "id": 2004,
                "doctypeId": 0,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1649157004000,
                "createUid": 17,
                "udfDate": -2209017600000,
                "rev": "1",
                "lastApproveUid": 0,
                "ttlCharge": 0,
                "completed": false,
                "udfAccId": 0,
                "expiredUid": 0,
                "freeQtyPer": 0,
                "descOrigin": "PRO",
                "position_en": "",
                "position_zh-TW": "",
                "i18nField": "{\"position_zh-CN\": \"\"}",
                "manId": 516,
                "deposit": 0,
                "ttlAmt": 4.75,
                "multiFlowSrcId": 0,
                "position": "",
                "flowTypeId": 15918,
                "status": "N",
                "weightUnit": "kg",
                "multiFlowFlowId": 0,
                "tDate": 1649088000000,
                "udfstr": "",
                "code": "SO0220888",
                "cnDeptId": 0,
                "multiFlowSrcModule": "",
                "amt": 4.75,
                "iRev": 1,
                "upOrigin": "SOLAST",
                "udfTESTTZ": "",
                "ce01Module": "oldso",
                "curId": 1,
                "expired": false,
                "rate": 1,
                "domAmt": 4.75,
                "measUnit": "cbm",
                "printCount": 0,
                "statusModifyDate": 1649157004000,
                "createDate": 1649157004000,
                "ttlPaidAmt": 0,
                "udfTEST": "",
                "depoRate": 0,
                "loadGpCoData": false,
                "cp": 0,
                "useAccessWl": false,
                "billingStatus": 0,
                "position_ccn": "",
                "ttlDisc": 0,
                "multiFlowSrcBeId": 0,
                "position_haha1": "",
                "cuspono": "",
                "udftest1109": "",
                "useAccessAutoCalc": false,
                "staffId": 700,
                "domAmtDiff": 0
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Sales Order

# 一、Description

​ Usage: Create Or Update 【Sales Order】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/s/save/oldso
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes oldso
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/oldso";
		String param = "&menuCode=oldso";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity data as JSON format:

{
    "sot": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 4197,
                "qty": 1,
                "unitId": 39151,
                "amt": 4,
                "disc": 10,
                "up": 5
            }
        ]
    },
    "mainso": {
        "values": [
            {
                "beId": 304,
                "tDate": "2022-03-30",
                "curId": 1,
                "cusId": 1,
                "rate": 1,
                "amt": 4,
                "flowTypeId": 15918,
                "staffId": 700
            }
        ]
    }
}	

​ 4、Response Sample

{
	"recordId": 2005,
	"messages": [],
	"status": true
}	
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Sales Order

# 一、Description

​ Usage: Delete Sales Order

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/delete/oldso
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes oldso
id long(Query) Yes Sales Order ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/oldso";
		String param = "&menuCode=oldso&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Sales Order Report

# 一、Description

​ Usage: Run EBI[Sales Order Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
    "size": 1,
    "rows": [
        {
            "SO_A_curId": "1",
            "SOT_A_qty": "10.0000",
            "M18ReservedCol_dataIndex": 1,
            "SO_A_curId_code": "R",
            "CUS_A_id": "1",
            "PRO_A_id": "8",
            "SO_A_id": "35",
            "SO_A_tDate": "2016.08.26",
            "SO_A_rate": "1.00000000",
            "SOT_A_amt": "105.00",
            "PRO_A_code": "PRO004",
            "CUS_A_code": "C0001A",
            "SOT_A_up": "10.5000",
            "SO_A_code": "ITSO16080002",
            "SOT_A_unitId_code": "PCS"
        }
    ]
}

ebi4

# Customer Shipment Note

# Fetch Customer Shipment Note List

# 一、Description

​ Usage: Fetch Customer Shipment Note List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes aso
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=aso&beId=" + beId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}			

​ 4、Response Sample

{
    "stSearch": "aso",
    "size": 1,
    "stSearchDisplay": "Customer Shipment Note",
    "values": [
        {
            "tDate": "2022-03-17",
            "code": "ASO0220883",
            "st_id": 55,
            "st_code": "ASO0220883",
            "st_desc": "ASO0220883",
            "mainaso.flowTypeId.flowtype.desc": "All",
            "iRev": 1,
            "id": 55,
            "mainaso.flowTypeId.flowtype.code": "ALL",
            "mainaso.lastModifyUid.simpleUser.desc__lang": "JLTEST",
            "lastModifyDate": "2022-03-17 21:01:48"
        }
    ] 
}

# Create Customer Shipment Note (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Customer Shipment Note】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/aso
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/aso";
		String param = "";

		HttpPost post = new HttpPost(url + "?" + param);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

Sample data:

{
    "beCode": "CAT2019",
    "asnRefCode": "000",
    "asot": [
        {
            "sourceCode": "SO0220888",
            "sourceLot": "A",
            "proCode": "00001",
            "sourceType": "oldso",
            "unitCode": "PCS",
            "qty": 1,
            "disc": 5,
            "up": 5
        }
    ]
}

​ 4、Response Sample

{
    "tranId": 57,
    "tranCode": "ASO220005",
    "message": "",
    "status": true
}

# Load Customer Shipment Note

# 一、Description

​ Usage: Load Customer Shipment Note Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/aso
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes aso
id long(Query) Yes Customer Shipment Note ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/aso";
			String param = "&menuCode=aso&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {
        "remaso": [
            {
                "tradeTerm_ccn": "",
                "shipMark": "",
                "remarks_en": "",
                "tradeTerm": "",
                "premarks": "",
                "shipAd1_en": "",
                "province": "广东",
                "packing_haha1": "",
                "tel": "",
                "shipMark_en": "",
                "recipient_haha1": "",
                "id": 39,
                "fax": "",
                "premarks_zh-CN": "",
                "shipAd1_zh-CN": "送货地址 第一行 简体",
                "payTerm": "",
                "heading_zh-TW": "",
                "payTerm_ccn": "",
                "remarks_ccn": "",
                "shipAd4_ccn": "",
                "i18nField": "{\"heading_zh-CN\": \"\", \"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipAd1_zh-CN\": \"送货地址 第一行 简体\", \"shipAd2_zh-CN\": \"\", \"shipAd3_zh-CN\": \"\", \"shipAd4_zh-CN\": \"\", \"premarks_zh-CN\": \"\", \"shipMark_zh-CN\": \"\", \"recipient_zh-CN\": \"Jerry.li\", \"tradeTerm_zh-CN\": \"\"}",
                "shipAd4_ctw": "",
                "shipAd3_zh-TW": "",
                "payTerm_ctw": "",
                "remarks_ctw": "",
                "tradeTerm_en": "",
                "city": "深圳",
                "shipMark_ctw": "",
                "payTerm_en": "",
                "iRev": 1,
                "shipAd4_zh-TW": "",
                "shipAd2_ccn": "",
                "ce01Module": "aso",
                "shipAd3_en": "",
                "shipAd4_zh-CN": "",
                "shipAd2_ctw": "",
                "shipAd2_haha1": "",
                "email": "jerry.li@mac.sz",
                "packing_ctw": "",
                "heading_haha1": "",
                "heading": "",
                "premarks_en": "",
                "recipient_ctw": "",
                "tradeTerm_ctw": "",
                "telCountry": "",
                "tradeTerm_haha1": "",
                "shipAd1": "送货地址 第一行 简体",
                "shipAd2": "",
                "shipAd3": "",
                "premarks_zh-TW": "",
                "shipAd4": "",
                "shipMark_haha1": "",
                "shipAd3_haha1": "",
                "gpsLong": 0,
                "country": "CN",
                "heading_en": "",
                "shipMark_zh-CN": "",
                "tradeTerm_zh-CN": "",
                "shipAd4_haha1": "",
                "packing_ccn": "",
                "recipient_ccn": "",
                "heading_ccn": "",
                "shipAd2_zh-TW": "",
                "payTerm_zh-TW": "",
                "remarks_zh-TW": "",
                "hId": 57,
                "heading_ctw": "",
                "tradeTerm_zh-TW": "",
                "shipMark_ccn": "",
                "zipcode": "",
                "premarks_haha1": "",
                "shipAd2_en": "",
                "shipAd1_haha1": "",
                "remarks_zh-CN": "",
                "packing_en": "",
                "gpsLat": 0,
                "payTerm_zh-CN": "",
                "shipMark_zh-TW": "",
                "shipAd1_ccn": "",
                "shipCodeId": 284,
                "shipAd3_ctw": "",
                "recipient_zh-CN": "Jerry.li",
                "packing": "",
                "heading_zh-CN": "",
                "premarks_ccn": "",
                "payTerm_haha1": "",
                "recipient_en": "",
                "packing_zh-TW": "",
                "shipAd3_zh-CN": "",
                "remarks_haha1": "",
                "shipAd1_ctw": "",
                "shipAd3_ccn": "",
                "recipient_zh-TW": "",
                "packing_zh-CN": "",
                "telArea": "",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "",
                "premarks_ctw": "",
                "recipient": "Jerry.li",
                "shipAd2_zh-CN": "",
                "remarks": ""
            }
        ],
        "asot": [
            {
                "sourceId": 2004,
                "unit2Id": 39151,
                "shipMark": "",
                "dualQty": 0,
                "qty2": 0,
                "itemNo": "     1",
                "qty1": 1,
                "beId": 304,
                "bDesc": "Skirt  SC /\\",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 97,
                "up": 5,
                "ctn": 0,
                "qcRequired": false,
                "dDesc_haha1": "",
                "height": 0,
                "hId": 57,
                "perCtn": 0,
                "soId": 2004,
                "completed": false,
                "freeQtyPer": 0,
                "volume": 0,
                "dDesc": "<p>Skirt&nbsp; SC Desc<br></p>",
                "i18nField": "{\"bDesc_zh-CN\": \"Skirt  SC /\\\\\", \"dDesc_zh-CN\": \"<p>Skirt&nbsp; SC Desc<br></p>\"}",
                "sourceType": "oldso",
                "qty": 1,
                "disc": 5,
                "packingDesc": "",
                "refCode": "",
                "lotNoId": 0,
                "dDesc_ctw": "",
                "innerQty": 0,
                "unit1Id": 39151,
                "nw": 0,
                "amt": 4.75,
                "iRev": 1,
                "dDesc_zh-CN": "<p>Skirt&nbsp; SC Desc<br></p>",
                "packingUnitId": 0,
                "bDesc_ctw": "",
                "ce01Module": "aso",
                "lot": "A",
                "bDesc_haha1": "",
                "dDesc_zh-TW": "",
                "domAmt": 4.75,
                "bDesc_ccn": "",
                "innerUnitId": 0,
                "unitId": 39151,
                "dDesc_ccn": "",
                "soLot": "A",
                "bDesc_en": "",
                "length": 0,
                "dDesc_en": "",
                "dualUnitId": 1,
                "gw": 0,
                "sourceLot": "A",
                "proId": 4197,
                "width": 0,
                "cuspono": "",
                "bDesc_zh-CN": "Skirt  SC /\\"
            }
        ],
        "mainaso": [
            {
                "lastModifyUid": 17,
                "useAccess": false,
                "virDeptId": 0,
                "expiredDate": -2209017600000,
                "invShipedStatus": 0,
                "position_zh-CN": "",
                "sysJson": "{\"autoGenCode\":{\"snId\":1041,\"code\":\"ASO220005\",\"sn\":\"5\"}}",
                "viewCode": "aso",
                "beId": 304,
                "shipedStatus": 0,
                "useAccessBl": false,
                "id": 57,
                "doctypeId": 0,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1649158641000,
                "createUid": 17,
                "rev": "1",
                "lastApproveUid": 17,
                "ttlCharge": 0,
                "completed": false,
                "expiredUid": 0,
                "freeQtyPer": 0,
                "descOrigin": "SOLAST",
                "position_en": "",
                "position_zh-TW": "",
                "i18nField": "{\"position_zh-CN\": \"\"}",
                "manId": 516,
                "ttlAmt": 4.75,
                "multiFlowSrcId": 0,
                "position": "",
                "flowTypeId": 15918,
                "status": "Y",
                "weightUnit": "kg",
                "multiFlowFlowId": 0,
                "tDate": 1649088000000,
                "code": "ASO220005",
                "cnDeptId": 0,
                "multiFlowSrcModule": "",
                "amt": 4.75,
                "iRev": 1,
                "upOrigin": "SOLAST",
                "ce01Module": "aso",
                "curId": 1,
                "expired": false,
                "asnRefId": 119,
                "rate": 1,
                "domAmt": 4.75,
                "measUnit": "cbm",
                "printCount": 0,
                "statusModifyDate": 1649158641000,
                "createDate": 1649158641000,
                "asnRefType": "cus",
                "useAccessWl": false,
                "position_ccn": "",
                "ttlDisc": 0,
                "multiFlowSrcBeId": 0,
                "position_haha1": "",
                "useAccessAutoCalc": false,
                "staffId": 700,
                "domAmtDiff": 0
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Customer Shipment Note

# 一、Description

​ Usage: Create Or Update 【Customer Shipment Note】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/s/save/aso
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes aso
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/aso";
		String param = "&menuCode=aso";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity data as JSON format:

{
    "asot": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 4197,
                "qty": 1,
                "unitId": 39151,
                "amt": 4,
                "disc": 10,
                "up": 5,
                "locId": 134
            }
        ]
    },
    "mainaso": {
        "values": [
            {
                "beId": 304,
                "tDate": "2022-04-05",
                "curId": 1,
                "asnRefId": 1,
                "rate": 1,
                "amt": 4,
                "flowTypeId": 15918,
                "staffId": 700
            }
        ]
    }
}  	

​ 4、Response Sample

{
	"recordId": 58,
	"messages": [],
	"status": true
}	
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Customer Shipment Note

# 一、Description

​ Usage: Delete Customer Shipment Note

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/delete/aso
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes aso
id long(Query) Yes Customer Shipment Note ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/aso";
		String param = "&menuCode=aso&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Customer Shipment Note Report

# 一、Description

​ Usage: Run EBI[Customer Shipment Note Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
    "size": 1,
    "rows": [
        {
            "ASO_A_id": "26",
            "ASO_A_tDate": "2019.03.25",
            "M18ReservedCol_dataIndex": 1,
            "ASOT_A_unitId_code": "个",
            "CUS_A_id": "8",
            "ASOT_A_qty": "1.0000",
            "ASO_A_curId_code": "H",
            "PRO_A_id": "6",
            "ASO_A_curId": "2",
            "ASOT_A_amt": "200.00",
            "ASO_A_code": "ASO190007",
            "ASO_A_rate": "1.00000000",
            "PRO_A_code": "COMPUTER_03",
            "CUS_A_code": "JL001",
            "ASOT_A_up": "200.0000"
        }
    ]
}

ebi4

# Delivery Note

# Fetch Delivery Note List

# 一、Description

​ Usage: Fetch Delivery Note List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes dn
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=dn&beId=" + beId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}			

​ 4、Response Sample

{
    "stSearch": "dn",
    "size": 1,
    "stSearchDisplay": "Delivery Note",
    "values": [
        {
            "tDate": "2022-04-01",
            "code": "DN0220017",
            "st_code": "DN0220017",
            "st_desc": "DN0220017",
            "iRev": 1,
            "maindn.lastModifyUid.simpleUser.desc__lang": "JLTEST",
            "maindn.curId.cur.sym": "HK$",
            "st_id": 1019,
            "maindn.cusId.cus.code": "000",
            "maindn.flowTypeId.flowtype.desc": "All",
            "id": 1019,
            "maindn.cusId.cus.desc__lang": "000 Sc",
            "lastModifyDate": "2022-04-01 19:45:06",
            "maindn.flowTypeId.flowtype.code": "ALL"
        }
    ]  
}

# Create Delivery Note (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Delivery Note】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/dn
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/dn";
		String param = "";

		HttpPost post = new HttpPost(url + "?" + param);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

Sample data:

{
    "beCode": "CAT2019",
    "cusCode": "000",
    "dnt": [
        {
            "sourceCode": "ASO220005",
            "sourceLot": "A",
            "locCode": "CK12",
            "proCode": "00001",
            "sourceType": "aso",
            "unitCode": "PCS",
            "qty": 1,
            "disc": 5,
            "up": 5
        }
    ]
}

​ 4、Response Sample

{
    "tranId": 1021,
    "tranCode": "DN0220021",
    "message": "",
    "status": true
}

# Load Delivery Note

# 一、Description

​ Usage: Load Delivery Note Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/dn
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes dn
id long(Query) Yes Delivery Note ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/dn";
			String param = "&menuCode=dn&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {},
    "messages": [],
    "status": true
}

# Create Delivery Note

# 一、Description

​ Usage: Create Or Update 【Delivery Note】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/s/save/dn
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes dn
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/dn";
		String param = "&menuCode=dn";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity data as JSON format:

{
    "maindn": {
        "values": [
            {
                "beId": 304,
                "tDate": "2022-04-05",
                "curId": 1,
                "cusId": 1,
                "rate": 1,
                "amt": 4,
                "flowTypeId": 15918,
                "staffId": 700
            }
        ]
    },
    "dnt": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 4197,
                "qty": 1,
                "unitId": 39151,
                "amt": 4,
                "disc": 10,
                "up": 5,
                "locId": 134
            }
        ]
    }
} 	

​ 4、Response Sample

{
	"recordId": 1022,
	"messages": [],
	"status": true
}	
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Delivery Note

# 一、Description

​ Usage: Delete Delivery Note

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/delete/dn
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes dn
id long(Query) Yes Price List ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/dn";
		String param = "&menuCode=dn&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Delivery Note Report

# 一、Description

​ Usage: Run EBI[Price List Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
    "size": 1,
    "rows": [
        {
            "DNT_A_amt": "52.50",
            "M18ReservedCol_dataIndex": 1,
            "DN_A_rate": "1.00000000",
            "DNT_A_up": "10.5000",
            "CUS_A_id": "27074",
            "DNT_A_unitId_code": "个",
            "DN_A_code": "ITDN17030001",
            "DN_A_curId": "1",
            "PRO_A_id": "18",
            "DN_A_tDate": "2017.03.24",
            "DNT_A_qty": "5.0000",
            "DN_A_id": "166",
            "DN_A_curId_code": "R",
            "PRO_A_code": "ITPRO001",
            "CUS_A_code": "IT002"
        }
    ]
}

ebi4

# Sales Return

# Fetch Sales Return List

# 一、Description

​ Usage: Fetch Sales Return List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes sret
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=sret&beId=" + beId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}			

​ 4、Response Sample

{
    "stSearch": "sret",
    "size": 1,
    "stSearchDisplay": "Sales Return",
    "values": [
        {
            "tDate": "2022-03-17",
            "code": "SR0220883",
            "st_code": "SR0220883",
            "st_desc": "SR0220883",
            "mainsret.cusId.cus.desc__lang": "000 Sc",
            "iRev": 1,
            "mainsret.flowTypeId.flowtype.desc": "All",
            "mainsret.flowTypeId.flowtype.code": "ALL",
            "st_id": 207,
            "mainsret.lastModifyUid.simpleUser.desc__lang": "JLTEST",
            "mainsret.cusId.cus.code": "000",
            "id": 207,
            "lastModifyDate": "2022-03-17 21:40:01",
            "mainsret.curId.cur.sym": "¥"
        }
    ]  
}

# Create Sales Return (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Sales Return】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/sret
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/sret";
		String param = "";

		HttpPost post = new HttpPost(url + "?" + param);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

Sample data:

{
    "beCode": "CAT2019",
    "cusCode": "000",
    "srett": [
        {
            "sourceCode": "DN0220021",
            "sourceLot": "A",
            "locCode": "CK12",
            "proCode": "00001",
            "sourceType": "dn",
            "unitCode": "PCS",
            "qty": 1,
            "disc": 5,
            "up": 5
        }
    ]
}

​ 4、Response Sample

{
    "tranId": 210,
    "tranCode": "SRE220010",
    "message": "",
    "status": true
}

# Load Sales Return

# 一、Description

​ Usage: Load Sales Return Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/sret
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes sret
id long(Query) Yes Sales Return ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/sret";
			String param = "&menuCode=sret&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {},
    "messages": [],
    "status": true
}

# Create Sales Return

# 一、Description

​ Usage: Create Or Update 【Sales Return】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/s/save/sret
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes sret
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/sret";
		String param = "&menuCode=sret";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity data as JSON format:

{
    "mainsret": {
        "values": [
            {
                "beId": 304,
                "tDate": "2022-04-05",
                "curId": 1,
                "cusId": 1,
                "rate": 1,
                "amt": 4,
                "flowTypeId": 15918,
                "staffId": 700
            }
        ]
    },
    "srett": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 4197,
                "qty": 1,
                "unitId": 39151,
                "amt": 4,
                "disc": 10,
                "up": 5,
                "locId": 134
            }
        ]
    }
}  

​ 4、Response Sample

{
	"recordId": 146,
	"messages": [],
	"status": true
}	
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Sales Return

# 一、Description

​ Usage: Delete Sales Return

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/delete/sret
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes sret
id long(Query) Yes Sales Return ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/sret";
		String param = "&menuCode=sret&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Sales Return Report

# 一、Description

​ Usage: Run EBI[Sales Return Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
    "size": 1,
    "rows": [
        {
            "SRET_A_rate": "1.00000000",
            "SRET_A_id": "45",
            "M18ReservedCol_dataIndex": 1,
            "SRET_A_curId": "2",
            "SRETT_A_unitId_code": "套",
            "CUS_A_id": "118",
            "SRET_A_tDate": "2017.05.09",
            "PRO_A_id": "3927",
            "SRET_A_curId_code": "H",
            "SRETT_A_qty": "1.0000",
            "SRETT_A_amt": "15,000.00",
            "SRET_A_code": "SRE170002",
            "SRETT_A_up": "15,000.0000",
            "PRO_A_code": "MXPC3",
            "CUS_A_code": ".B268560"
        }
    ]
}

ebi4

# Sales Invoice

# Fetch Sales Invoice List

# 一、Description

​ Usage: Fetch Sales Invoice List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes siso
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=siso&beId=" + beId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}			

​ 4、Response Sample

{
    "stSearch": "siso",
    "size": 1,
    "stSearchDisplay": "Sales Invoice",
    "values": [
        {
            "tDate": "2022-03-17",
            "code": "DN0220883",
            "st_code": "DN0220883",
            "st_desc": "DN0220883",
            "iRev": 1,
            "maintar.cusId.cus.desc__lang": "000 Sc",
            "maintar.cusId.cus.code": "000",
            "maintar.curId.cur.sym": "¥",
            "maintar.flowTypeId.flowtype.code": "ALL",
            "st_id": 1267,
            "maintar.flowTypeId.flowtype.desc": "All",
            "id": 1267,
            "lastModifyDate": "2022-03-17 21:33:01",
            "maintar.lastModifyUid.simpleUser.desc__lang": "JLTEST"
        }
    ]  
}

# Create Sales Invoice (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Sales Invoice】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/siso
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/siso";
		String param = "";

		HttpPost post = new HttpPost(url + "?" + param);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

Sample data:

{
    "art": [
        {
            "sourceCode": "DN0220021",
            "sourceLot": "A",
            "locCode": "CK12",
            "proCode": "00001",
            "sourceType": "dn",
            "unitCode": "PCS",
            "qty": 1,
            "disc": 5,
            "up": 5
        }
    ],
    "beCode": "CAT2019",
    "cusCode": "000"
}

​ 4、Response Sample

{
    "tranId": 1269,
    "tranCode": "SISO220706",
    "message": "",
    "status": true
}

# Load Sales Invoice

# 一、Description

​ Usage: Load Sales Invoice Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/oldqu
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes siso
id long(Query) Yes Sales Invoice ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/siso";
			String param = "&menuCode=siso&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {},
    "messages": [],
    "status": true
}

# Create Sales Invoice

# 一、Description

​ Usage: Create Or Update 【Sales Invoice】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/s/save/siso
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes siso
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/siso";
		String param = "&menuCode=siso";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity data as JSON format:

{
    "art": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 4197,
                "qty": 1,
                "unitId": 39151,
                "amt": 4,
                "disc": 10,
                "up": 5,
                "locId": 134
            }
        ]
    },
    "maintar": {
        "values": [
            {
                "beId": 304,
                "tDate": "2022-04-05",
                "curId": 1,
                "cusId": 1,
                "rate": 1,
                "amt": 4,
                "flowTypeId": 15918,
                "staffId": 700
            }
        ]
    }
} 	

​ 4、Response Sample

{
	"recordId": 208,
	"messages": [],
	"status": true
}	
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Sales Invoice

# 一、Description

​ Usage: Delete Sales Invoice

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/entity/delete/siso
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes siso
id long(Query) Yes Price List ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/siso";
		String param = "&menuCode=siso&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Sales Invoice Report

# 一、Description

​ Usage: Run EBI[Sales Invoice Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、Response Sample

{
    "size": 1,
    "rows": [
        {
            "MAINTAR_A_rate": "1.00000000",
            "M18ReservedCol_dataIndex": 1,
            "MAINTAR_A_id": "1204",
            "ART_A_amt": "0.00",
            "ART_A_unitId_code": "PCS",
            "ART_A_up": "0.0000",
            "CUS_A_id": "120",
            "MAINTAR_A_curId_code": "H",
            "PRO_A_id": "5839",
            "MAINTAR_A_code": "SISO200655",
            "ART_A_qty": "100.0000",
            "MAINTAR_A_curId": "2",
            "MAINTAR_A_tDate": "2020.11.05",
            "PRO_A_code": "EXACTLOTNO",
            "CUS_A_code": "000001"
        }
    ]
}

ebi4