# Member

# Fetch Member List

# 一、Description

​ Usage: Fetch Member 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 poscoreMember
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=poscoreMember&beId=1";

		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": "poscoreMember",
    "size": 1,
    "stSearchDisplay": "Member",
    "values": [
        {
            "code": "20200520",
            "st_id": 16,
            "st_code": "20200520",
            "st_desc": "Mr. Chan Sing (20200520)",
            "poscoreMember.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "iRev": 3,
            "id": 16,
            "lastModifyDate": "2020-08-11 11:17:23",
            "displayName__lang": "Mr. Chan Sing"
        }
    ]
}

# Load Member

# 一、Description

​ Usage: Load 【Member】Record

# 二、API Detail

​ 1、Request URL

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

​ 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 poscoreMember
id long(Query) Yes Member 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/poscoreMember";
			String param = "&menuCode=poscoreMember&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": {
        "poscorememberaddress": [
            {
                "country": "",
                "itemNo": "     1",
                "beId": 1,
                "shipAd2_zh-TW": "",
                "shipAd1_en": "",
                "province": "",
                "mobileCountry": "",
                "shipAd2_jp": "",
                "tel": "",
                "id": 18,
                "shipAd1_zh-CN": "",
                "shipAd4_hy": "",
                "hId": 16,
                "shipAd4_cth": "",
                "zipcode": "",
                "shipAd2_en": "",
                "shipAd4_sxg": "",
                "i18nField": "{\"shipAd1_en\": \"\", \"shipAd2_en\": \"\", \"shipAd3_en\": \"\", \"shipAd4_en\": \"\"}",
                "shipAd3_jp": "",
                "gpsLat": 0,
                "shipAd1_hy": "",
                "shipAd3_zh-TW": "",
                "city": "",
                "shipAd2_cth": "",
                "iRev": 2,
                "shipAd1_cth": "",
                "shipAd3_sxg": "",
                "shipAd4_zh-TW": "",
                "ce01Module": "poscoreMember",
                "shipAd3_cth": "",
                "shipAd3_en": "",
                "defaultVal": true,
                "expired": false,
                "shipAd3_zh-CN": "",
                "shipAd4_zh-CN": "",
                "shipAd1_sxg": "",
                "shipAd4_jp": "",
                "shipAd2_sxg": "",
                "shipAd2_hy": "",
                "man": "",
                "mobile": "",
                "telCountry": "",
                "shipCode": "001",
                "shipAd1": "",
                "shipAd2": "",
                "shipAd3": "",
                "shipAd4": "",
                "telArea": "",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "",
                "shipAd1_jp": "",
                "shipAd2_zh-CN": "",
                "shipAd3_hy": "",
                "gpsLong": 0
            }
        ],
        "poscoreremmember": [
            {
                "shipRemarks_cth": "",
                "pickRemarks_zh-CN": "",
                "pickRemarks_sxg": "",
                "remarks_en": "",
                "pickRemarks_jp": "",
                "iRev": 2,
                "pickRemarks_hy": "",
                "ce01Module": "poscoreMember",
                "shipRemarks_sxg": "",
                "pickRemarks": "",
                "shipRemarks_en": "",
                "pickRemarks_cth": "",
                "id": 16,
                "remarks_zh-TW": "",
                "remarks_jp": "",
                "hId": 16,
                "pickRemarks_en": "",
                "shipRemarks_zh-CN": "",
                "shipRemarks_jp": "",
                "pickRemarks_zh-TW": "",
                "remarks_cth": "",
                "remarks_hy": "",
                "remarks_sxg": "",
                "shipRemarks_hy": "",
                "i18nField": "{\"remarks_en\": \"\", \"pickRemarks_en\": \"\", \"shipRemarks_en\": \"\"}",
                "remarks_zh-CN": "",
                "shipRemarks": "",
                "shipRemarks_zh-TW": "",
                "remarks": ""
            }
        ],
        "poscoremaincardt": [
            {
                "reason": "na",
                "lastName_sxg": "",
                "itemNo": "     1",
                "idNo": "",
                "expDate": 1621353600000,
                "beId": 1,
                "effDate": 1589904000000,
                "mobileCountry": "",
                "lastName_en": "Sing",
                "tel": "",
                "id": 13,
                "cardNameId": 1,
                "firstName_hy": "",
                "memTypeId": 1,
                "hId": 16,
                "lastName_zh-TW": "",
                "firstName_zh-TW": "",
                "displayName_sxg": "",
                "firstName": "Chan",
                "i18nField": "{\"lastName_en\": \"Sing\", \"firstName_en\": \"Chan\", \"displayName_en\": \"Mr. Chan Sing\"}",
                "firstName_zh-CN": "",
                "lastName_cth": "",
                "displayName_jp": "",
                "invalid": false,
                "displayName_cth": "",
                "isAutoGraded": false,
                "lastName_hy": "",
                "lastName_zh-CN": "",
                "lastName": "Sing",
                "firstName_jp": "",
                "code": "GE900001",
                "firstName_sxg": "",
                "displayName": "Mr. Chan Sing",
                "iRev": 2,
                "displayName_hy": "",
                "titleCode": "mr",
                "firstName_cth": "",
                "displayName_zh-TW": "",
                "ce01Module": "poscoreMember",
                "displayName_en": "Mr. Chan Sing",
                "issueDate": 1589904000000,
                "firstName_en": "Chan",
                "displayName_zh-CN": "",
                "cardType": 1,
                "mobile": "",
                "invalidDate": -2209017600000,
                "telCountry": "",
                "lastName_jp": "",
                "telArea": ""
            }
        ],
        "poscoremember": [
            {
                "useAccess": false,
                "expiredDate": -2209017600000,
                "sysJson": "",
                "viewCode": "",
                "idNo": "",
                "shipAd1_en": "",
                "mobileCountry": "",
                "dayOfBirth": 1,
                "shipAd2_jp": "",
                "useAccessBl": false,
                "tel": "",
                "id": 16,
                "lastModifyDate": 1597115843000,
                "shipAd1_zh-CN": "",
                "createUid": 23,
                "yearOfBirth": 1962,
                "cDate": 1589904000000,
                "shipAd4_cth": "",
                "udfATupdateAccess": false,
                "printed": false,
                "i18nField": "{\"shipAd1_en\": \"\", \"shipAd2_en\": \"\", \"shipAd3_en\": \"\", \"shipAd4_en\": \"\", \"lastName_en\": \"Sing\", \"firstName_en\": \"Chan\", \"displayName_en\": \"Mr. Chan Sing\", \"displayName_jp\": \"\", \"displayName_zh-CN\": \"\", \"pmpcoreMemJoinBy_en\": \"\", \"pmpcoreMemReferBy_en\": \"\"}",
                "lastName_cth": "",
                "displayName_jp": "",
                "displayName_cth": "",
                "shipAd3_zh-TW": "",
                "status": "N",
                "lastName_hy": "",
                "lastName_zh-CN": "",
                "lastName": "Sing",
                "firstName_jp": "",
                "gender": "male",
                "shipAd2_cth": "",
                "displayName": "Mr. Chan Sing",
                "iRev": 3,
                "shipAd3_sxg": "",
                "shipAd4_zh-TW": "",
                "displayName_hy": "",
                "monthOfBirth": 1,
                "firstName_cth": "",
                "displayName_zh-TW": "",
                "shipAd3_en": "",
                "shipAd4_zh-CN": "",
                "shipAd1_sxg": "",
                "shipAd4_jp": "",
                "shipAd2_hy": "",
                "man": "",
                "statusModifyDate": 1589943397000,
                "email": "",
                "createDate": 1589943397000,
                "displayName_zh-CN": "",
                "udf1": "",
                "useAccessWl": false,
                "telCountry": "",
                "shipAd1": "",
                "shipAd2": "",
                "shipAd3": "",
                "shipAd4": "",
                "shipAd1_jp": "",
                "useAccessAutoCalc": false,
                "lastModifyUid": 5,
                "lastName_sxg": "",
                "beId": 1,
                "shipAd2_zh-TW": "",
                "receivePM": false,
                "udfATREGION": 0,
                "lastName_en": "Sing",
                "shopId": 1,
                "locked": false,
                "firstName_hy": "",
                "shipAd4_hy": "",
                "lastApproveUid": 0,
                "udfATJEIEN011": 0,
                "lastName_zh-TW": "",
                "firstName_zh-TW": "",
                "expiredUid": 0,
                "displayName_sxg": "",
                "firstName": "Chan",
                "shipAd2_en": "",
                "shipAd4_sxg": "",
                "firstName_zh-CN": "",
                "shipAd3_jp": "",
                "shipAd1_hy": "",
                "attachmentNo": 0,
                "code": "20200520",
                "firstName_sxg": "",
                "memberTypeId": 1,
                "shipAd1_cth": "",
                "titleCode": "mr",
                "shipAd3_cth": "",
                "expired": false,
                "shipAd3_zh-CN": "",
                "displayName_en": "Mr. Chan Sing",
                "cordchat": "",
                "printCount": 0,
                "shipAd2_sxg": "",
                "firstName_en": "Chan",
                "mobile": "",
                "lastName_jp": "",
                "telArea": "",
                "regionId": 8,
                "shipAd1_zh-TW": "",
                "shipAd4_en": "",
                "shipAd2_zh-CN": "",
                "shipAd3_hy": "",
                "udfATattSetId": 0
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Member

# 一、Description

​ Usage: create or update 【Member】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/poscoreMember
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 poscoreMember
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/poscoreMember";
		String param = "&menuCode=poscoreMember";

		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:

{
    "poscoremaincardt": {
        "values": [
            {
                "effDate": "20220401",
                "expDate": "20230330",
                "memTypeId": 50
            }
        ]
    },
    "poscoremember": {
        "values": [
            {
                "beId": 1,
                "cDate": "20220401",
                "regionId": 91,
                "desc": "20220401"
            }
        ]
    }
}

​ 4、Response Sample

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

# Delete Member

# 一、Description

​ Usage: Delete Member

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/poscoreMember
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 poscoreMember
id long(Query) Yes Member 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/cus";
		String param = "&menuCode=cus&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:Member List

# 一、Description

​ Usage: Run EBI[Member List],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": [
        {
            "MAIN_A_monthOfBirth": "April",
            "MAIN_A_mobile": "92890973",
            "MAIN_A_code": "LH2201",
            "MAIN_A_id": "194",
            "M18ReservedCol_dataIndex": 1,
            "MAIN_A_tel": "",
            "MAIN_A_dayOfBirth": "5",
            "MAIN_A_titleCode": "Miss",
            "MAIN_A_receivePM": "No",
            "MAIN_A_shipAd2": "荃灣永順街49號",
            "MAIN_A_shipAd1": "香港新界",
            "MAIN_A_lastName": "Lee",
            "MAIN_A_shipAd4": "10樓",
            "MAIN_A_shipAd3": "環宇海灣3座",
            "MAIN_A_cDate": "2021 Dec 14",
            "MAIN_A_idNo": "2362817823",
            "MAIN_A_email": "lpy0821C@hotmail.com",
            "MAIN_A_firstName": "Pui Ying"
        }
    ]
}

ebi1

# Shop Stock Request

# Fetch Shop Stock Request List

# 一、Description

​ Usage: Fetch Shop Stock Request 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 poscoreTransRequest
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=poscoreTransRequest&beId=11";

		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": "poscoreTransRequest",
    "size": 1,
    "stSearchDisplay": "Shop Stock Request",
    "values": [
        {
            "tDate": "2022-03-31",
            "code": "220270SSREQ",
            "st_id": 39,
            "st_code": "220270SSREQ",
            "poscoreTransRequest.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "st_desc": "220270SSREQ",
            "iRev": 3,
            "id": 39,
            "lastModifyDate": "2022-03-31 16:17:55"
        }
    ]
}

# Load Shop Stock Request

# 一、Description

​ Usage: Load 【Shop Stock Request】Record

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/poscoreTransRequest
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 poscoreTransRequest
id long(Query) Yes Shop Stock Request 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/poscoreTransRequest";
			String param = "&menuCode=poscoreTransRequest&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": {
        "poscoretransrequestt": [
            {
                "sourceId": 0,
                "dDesc_hy": "",
                "bDesc_sxg": "",
                "poscoreDesc_jp": "",
                "dualQty": 10,
                "bDesc_jp": "",
                "dDesc_sxg": "",
                "costAmt": 0,
                "dDesc_jp": "",
                "iRev": 3,
                "bDesc_hy": "",
                "itemNo": "     1",
                "dDesc_zh-CN": "",
                "poscoreDesc_zh-CN": "",
                "poscoreDesc_hy": "",
                "ce01Module": "poscoreTransRequest",
                "beId": 1,
                "lot": "A",
                "dDesc_cth": "",
                "dDesc_zh-TW": "",
                "bDesc": "P20220324 Brief Description",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "unitId": 7034,
                "id": 87,
                "locId": 16,
                "bDesc_cth": "",
                "poscoreDesc_sxg": "",
                "poscoreDesc": "",
                "hId": 39,
                "bDesc_en": "P20220324 Brief Description",
                "poscoreDesc_en": "",
                "poscoreDesc_zh-TW": "",
                "dDesc_en": "<p>P20220324 Detailed Description<br></p>",
                "completed": false,
                "poscoreDesc_cth": "",
                "dualUnitId": 6280,
                "sourceLot": "",
                "dDesc": "<p>P20220324 Detailed Description<br></p>",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_en\": \"P20220324 Brief Description\", \"dDesc_en\": \"<p>P20220324 Detailed Description<br></p>\", \"poscoreDesc_en\": \"\"}",
                "sourceType": "pro",
                "proId": 6334,
                "qty": 10,
                "lotNoId": 0,
                "bDesc_zh-CN": ""
            }
        ],
        "poscoretransrequest": [
            {
                "tDate": 1648656000000,
                "attachmentNo": 0,
                "lastModifyUid": 5,
                "code": "220270SSREQ",
                "cnDeptId": 204,
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "iRev": 3,
                "sysJson": "{}",
                "upOrigin": "PRO",
                "viewCode": "poscoreTransRequest",
                "ce01Module": "poscoreTransRequest",
                "beId": 1,
                "expired": false,
                "printCount": 0,
                "useAccessBl": false,
                "id": 39,
                "doctypeId": 1,
                "shopId": 1,
                "statusModifyDate": 1648714495000,
                "locked": false,
                "lastModifyDate": 1648714675000,
                "createUid": 5,
                "createDate": 1648714495000,
                "rev": "3",
                "lastApproveUid": 5,
                "completed": false,
                "expiredUid": 0,
                "useAccessWl": false,
                "descOrigin": "PRO",
                "flowTypeId": 86,
                "useAccessAutoCalc": false,
                "staffId": 4,
                "status": "Y"
            }
        ],
        "poscoreremtransrequest": [
            {
                "remarks_jp": "",
                "hId": 39,
                "remarks_en": "",
                "iRev": 3,
                "ce01Module": "poscoreTransRequest",
                "remarks_cth": "",
                "remarks_hy": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\"}",
                "remarks_zh-CN": "",
                "id": 39,
                "remarks_zh-TW": "",
                "remarks": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Shop Stock Request

# 一、Description

​ Usage: create or update 【Shop Stock Request】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/poscoreTransRequest
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 poscoreTransRequest
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/poscoreTransRequest";
		String param = "&menuCode=poscoreTransRequest";

		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:

{
    "poscoretransrequestt": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 84,
                "qty": 1,
                "unitId": 120
            }
        ]
    },
    "poscoretransrequest": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "virDeptId": 17,
                "shopId": 1,
                "flowTypeId": 54,
                "staffId": 823
            }
        ]
    }
}

​ 4、Response Sample

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

# Create Shop Stock Request (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Shop Stock Request】

​ 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/poscoreTransRequest
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/poscoreTransRequest";

		HttpPost post = new HttpPost(url);
		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

{
    "shopCode": "KL01",
    "poscoretransrequestt": [
        {
            "proCode": "0037",
            "sourceType": "pro",
            "unitCode": "PCS",
            "qty": 1
        }
    ],
    "staffCode": "0001",
    "flowTypeCode": "ALL",
    "beCode": "JC-AA",
    "virDeptCode": "1010"
}

​ 4、Response Sample

{
    "tranId": 40,
    "tranCode": "TR22040002",
    "message": "",
    "status": true
}

# Delete Shop Stock Request

# 一、Description

​ Usage: Delete Shop Stock Request

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/poscoreTransRequest
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 poscoreTransRequest
id long(Query) Yes Shop Stock Request 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/poscoreTransRequest";
		String param = "&menuCode=poscoreTransRequest&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
}

# Shop Stock Receipt

# Fetch Shop Stock Receipt List

# 一、Description

​ Usage: Fetch Shop Stock Receipt 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 poscoreShopStkRec
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=poscoreTransRequest&beId=11";

		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": "poscoreShopStkRec",
    "size": 1,
    "stSearchDisplay": "Shop Stock Receipt",
    "values": [
        {
            "tDate": "2022-03-31",
            "code": "220270SSREC",
            "st_id": 47,
            "st_code": "220270SSREC",
            "st_desc": "220270SSREC",
            "iRev": 1,
            "id": 47,
            "poscoreShopStkRec.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "lastModifyDate": "2022-03-31 16:30:18"
        }
    ]
}

# Load Shop Stock Receipt

# 一、Description

​ Usage: Load 【Shop Stock Receipt】Record

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/poscoreShopStkRec
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 poscoreShopStkRec
id long(Query) Yes Shop Stock Receipt 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/poscoreShopStkRec";
			String param = "&menuCode=poscoreShopStkRec&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": {
        "poscoremainshopstkrec": [
            {
                "tDate": 1648656000000,
                "attachmentNo": 0,
                "lastModifyUid": 5,
                "code": "220270SSREC",
                "cnDeptId": 204,
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "iRev": 1,
                "sysJson": "",
                "upOrigin": "PRO",
                "viewCode": "poscoreShopStkRec",
                "ce01Module": "poscoreShopStkRec",
                "beId": 1,
                "expired": false,
                "stkjlId": 0,
                "printCount": 0,
                "useAccessBl": false,
                "id": 47,
                "doctypeId": 1,
                "shopId": 1,
                "statusModifyDate": 1648715418000,
                "locked": false,
                "lastModifyDate": 1648715418000,
                "createUid": 5,
                "createDate": 1648715418000,
                "rev": "1",
                "lastApproveUid": 5,
                "expiredUid": 0,
                "useAccessWl": false,
                "accdfsId": 0,
                "descOrigin": "PRO",
                "flowTypeId": 86,
                "useAccessAutoCalc": false,
                "staffId": 4,
                "status": "Y"
            }
        ],
        "poscoreremshopstkrec": [
            {
                "remarks_jp": "",
                "hId": 47,
                "remarks_en": "",
                "iRev": 1,
                "ce01Module": "poscoreShopStkRec",
                "remarks_cth": "",
                "remarks_hy": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\"}",
                "remarks_zh-CN": "",
                "id": 47,
                "remarks_zh-TW": "",
                "remarks": ""
            }
        ],
        "poscoreshopstkrect": [
            {
                "sourceId": 47,
                "dDesc_hy": "",
                "poscoreDesc_jp": "",
                "dualQty": 0,
                "bDesc_hy": "",
                "itemNo": "     1",
                "beId": 1,
                "alocId": 16,
                "bDesc": "P20220324 Brief Description",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 127,
                "shopId": 0,
                "poscoreDesc_sxg": "",
                "hId": 47,
                "dDesc": "<p>P20220324 Detailed Description<br></p>",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_en\": \"P20220324 Brief Description\", \"dDesc_en\": \"<p>P20220324 Detailed Description<br></p>\", \"poscoreDesc_en\": \"\"}",
                "sourceType": "poscoreShopTransNote",
                "transQty": 10,
                "qty": 10,
                "lotNoId": 0,
                "bDesc_sxg": "",
                "bDesc_jp": "",
                "dDesc_sxg": "",
                "costAmt": 100,
                "dDesc_jp": "",
                "iRev": 1,
                "dDesc_zh-CN": "",
                "poscoreDesc_zh-CN": "",
                "poscoreDesc_hy": "",
                "ce01Module": "poscoreShopStkRec",
                "lot": "A",
                "dDesc_cth": "",
                "dDesc_zh-TW": "",
                "unitId": 7034,
                "locId": 61,
                "bDesc_cth": "",
                "poscoreDesc": "",
                "bDesc_en": "P20220324 Brief Description",
                "poscoreDesc_en": "",
                "poscoreDesc_zh-TW": "",
                "dDesc_en": "<p>P20220324 Detailed Description<br></p>",
                "poscoreDesc_cth": "",
                "dualUnitId": 6280,
                "confirm": false,
                "sourceLot": "A",
                "proId": 6334,
                "bDesc_zh-CN": ""
            }
        ],
        "poscoreshopstkrectlot": [
            {
                "lotnoNumAttr17": 0,
                "lotnoNumAttr16": 0,
                "lotnoNumAttr15": 0,
                "lotnoNumAttr14": 0,
                "lotnoNumAttr19": 0,
                "lotnoNumAttr18": 0,
                "lotnoLookupAttr20": 0,
                "lotnoNumAttr13": 0,
                "lotnoNumAttr12": 0,
                "lotnoNumAttr11": 0,
                "lotnoNumAttr10": 0,
                "lotnoLookupAttr16": 0,
                "alocId": 16,
                "lotnoLookupAttr17": 0,
                "lotnoLookupAttr14": 0,
                "lotnoLookupAttr15": 0,
                "lotnoLookupAttr18": 0,
                "lotnoLookupAttr19": 0,
                "newLotno": 0,
                "lotnoLot": "A",
                "id": 146,
                "lotnoNumAttr20": 0,
                "lotnoLookupAttr12": 0,
                "lotnoLookupAttr13": 0,
                "lotnoLookupAttr10": 0,
                "lotnoLookupAttr11": 0,
                "iRev": 1,
                "ce01Module": "poscoreShopStkRec",
                "lotnoDateAttr3": -2209017600000,
                "lotnoDateAttr4": -2209017600000,
                "lotnoDateAttr1": 1645977600000,
                "lotnoDateAttr2": -2209017600000,
                "lotnoDateAttr7": -2209017600000,
                "lotnoDateAttr8": -2209017600000,
                "lotnoDateAttr5": -2209017600000,
                "lotnoDateAttr6": -2209017600000,
                "unitId": 7034,
                "lotnoDateAttr9": -2209017600000,
                "locId": 61,
                "lotnoTextAttr1": "G01",
                "lotnoTextAttr2": "",
                "lotnoTextAttr3": "",
                "lotnoTextAttr4": "",
                "lotnoTextAttr5": "",
                "lotnoTextAttr6": "",
                "lotnoTextAttr7": "",
                "lotnoTextAttr8": "",
                "lotnoTextAttr9": "",
                "dualQty": 0,
                "itemNo": "     1",
                "hId": 47,
                "lotnoNumAttr1": 10,
                "lotnoNumAttr2": 0,
                "lotnoNumAttr3": 0,
                "lotnoNumAttr4": 0,
                "lotnoExpDate": 1738512000000,
                "footerKey": "     1",
                "qty": 10,
                "lotnoNumAttr5": 0,
                "lotnoNumAttr6": 0,
                "lotnoNumAttr7": 0,
                "lotnoNumAttr8": 0,
                "lotnoNumAttr9": 0,
                "lotNoId": 8845,
                "lotnoTextAttr16": "",
                "lotnoTextAttr15": "",
                "lotnoTextAttr18": "",
                "lotnoTextAttr17": "",
                "lotnoTextAttr12": "",
                "lotnoTextAttr11": "",
                "lotnoDateAttr20": -2209017600000,
                "lotnoTextAttr14": "",
                "lotnoTextAttr13": "",
                "lotnoTextAttr19": "",
                "lotnoTextAttr10": "",
                "dualUnitId": 6280,
                "lotnoLookupAttr5": 0,
                "lotnoLookupAttr6": 0,
                "lotnoLookupAttr7": 0,
                "lotnoDateAttr18": -2209017600000,
                "lotnoLookupAttr8": 0,
                "lotnoDateAttr19": -2209017600000,
                "lotno": "L12",
                "lotnoLookupAttr9": 0,
                "proId": 6334,
                "lotnoDateAttr12": -2209017600000,
                "lotnoDateAttr13": -2209017600000,
                "lotnoDateAttr10": -2209017600000,
                "lotnoDateAttr11": -2209017600000,
                "lotnoTextAttr20": "",
                "lotnoLookupAttr1": 0,
                "lotnoDateAttr16": -2209017600000,
                "lotnoLookupAttr2": 0,
                "lotnoDateAttr17": -2209017600000,
                "lotnoLookupAttr3": 0,
                "lotnoDateAttr14": -2209017600000,
                "lotnoLookupAttr4": 0,
                "lotnoDateAttr15": -2209017600000
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Shop Stock Receipt

# 一、Description

​ Usage: Create 【Shop Stock Receipt】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/poscoreShopStkRec
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 poscoreShopStkRec
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/poscoreShopStkRec";
		String param = "&menuCode=poscoreShopStkRec";

		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:

{
    "poscoremainshopstkrec": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "virDeptId": 17,
                "shopId": 1,
                "flowTypeId": 54,
                "staffId": 823
            }
        ]
    },
    "poscoreshopstkrect": {
        "values": [
            {
                "alocId": 16,
                "sourceType": "pro",
                "proId": 84,
                "qty": 1,
                "unitId": 120,
                "locId": 76
            }
        ]
    }
}

​ 4、Response Sample

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

# Create Shop Stock Receipt (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Shop Stock Receipt】

​ 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/poscoreShopStkRec
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/poscoreTransRequest";

		HttpPost post = new HttpPost(url);
		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

{
    "shopCode": "KL01",
    "staffCode": "0001",
    "flowTypeCode": "ALL",
    "beCode": "JC-AA",
    "virDeptCode": "1010",
    "poscoreshopstkrect": [
        {
            "locCode": "01",
            "proCode": "0037",
            "sourceType": "pro",
            "unitCode": "PCS",
            "qty": 1,
            "alocCode": "KLSW01"
        }
    ]
}

​ 4、Response Sample

{
    "tranId": 50,
    "tranCode": "TR22040002",
    "message": "",
    "status": true
}

# Delete Shop Stock Receipt

# 一、Description

​ Usage: Delete Shop Stock Receipt

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/poscoreShopStkRec
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 poscoreShopStkRec
id long(Query) Yes Shop Stock Receipt 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/poscoreTransRequest";
		String param = "&menuCode=poscoreTransRequest&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
}

# Shop Return Request

# Fetch Shop Return Request List

# 一、Description

​ Usage: Fetch Shop Return Request 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 poscoreReturnRequest
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=poscoreReturnRequest&beId=11";

		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": "poscoreReturnRequest",
    "size": 1,
    "stSearchDisplay": "Shop Return Request",
    "values": [
        {
            "tDate": "2022-03-31",
            "poscoreReturnRequest.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "code": "220270SRETR",
            "st_id": 11,
            "st_code": "220270SRETR",
            "st_desc": "220270SRETR",
            "iRev": 1,
            "id": 11,
            "lastModifyDate": "2022-03-31 16:36:19"
        }
    ]
}

# Load Shop Return Request

# 一、Description

​ Usage: Load 【Shop Return Request】Record

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/poscoreReturnRequest
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 poscoreReturnRequest
id long(Query) Yes Shop Return Request 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/poscoreReturnRequest";
			String param = "&menuCode=poscoreReturnRequest&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": {
        "poscorereturnrequestt": [
            {
                "sourceId": 0,
                "dDesc_hy": "",
                "bDesc_sxg": "",
                "poscoreDesc_jp": "",
                "dualQty": 5,
                "bDesc_jp": "",
                "dDesc_sxg": "",
                "costAmt": 0,
                "dDesc_jp": "",
                "iRev": 1,
                "bDesc_hy": "",
                "itemNo": "     1",
                "dDesc_zh-CN": "",
                "poscoreDesc_zh-CN": "",
                "poscoreDesc_hy": "",
                "ce01Module": "poscoreReturnRequest",
                "beId": 1,
                "lot": "A",
                "dDesc_cth": "",
                "dDesc_zh-TW": "",
                "bDesc": "P20220324 Brief Description",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "unitId": 7034,
                "id": 13,
                "locId": 16,
                "bDesc_cth": "",
                "poscoreDesc_sxg": "",
                "poscoreDesc": "",
                "hId": 11,
                "bDesc_en": "P20220324 Brief Description",
                "poscoreDesc_en": "",
                "poscoreDesc_zh-TW": "",
                "dDesc_en": "<p>P20220324 Detailed Description<br></p>",
                "completed": false,
                "poscoreDesc_cth": "",
                "dualUnitId": 6280,
                "sourceLot": "",
                "dDesc": "<p>P20220324 Detailed Description<br></p>",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_en\": \"P20220324 Brief Description\", \"dDesc_en\": \"<p>P20220324 Detailed Description<br></p>\", \"poscoreDesc_en\": \"\"}",
                "sourceType": "pro",
                "proId": 6334,
                "qty": 5,
                "lotNoId": 0,
                "bDesc_zh-CN": ""
            }
        ],
        "poscorereturnrequest": [
            {
                "tDate": 1648656000000,
                "attachmentNo": 0,
                "lastModifyUid": 5,
                "code": "220270SRETR",
                "cnDeptId": 0,
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "iRev": 1,
                "sysJson": "",
                "upOrigin": "PRO",
                "viewCode": "poscoreReturnRequest",
                "ce01Module": "poscoreReturnRequest",
                "beId": 1,
                "expired": false,
                "printCount": 0,
                "useAccessBl": false,
                "id": 11,
                "doctypeId": 0,
                "shopId": 1,
                "statusModifyDate": 1648715779000,
                "locked": false,
                "lastModifyDate": 1648715779000,
                "createUid": 5,
                "createDate": 1648715779000,
                "rev": "1",
                "lastApproveUid": 5,
                "completed": false,
                "expiredUid": 0,
                "useAccessWl": false,
                "descOrigin": "PRO",
                "flowTypeId": 86,
                "useAccessAutoCalc": false,
                "staffId": 4,
                "status": "Y"
            }
        ],
        "poscoreremreturnrequest": [
            {
                "remarks_jp": "",
                "hId": 11,
                "remarks_en": "",
                "iRev": 1,
                "ce01Module": "poscoreReturnRequest",
                "remarks_cth": "",
                "remarks_hy": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\"}",
                "remarks_zh-CN": "",
                "id": 11,
                "remarks_zh-TW": "",
                "remarks": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Shop Return Request

# 一、Description

​ Usage: create or update 【Shop Return Request】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/poscoreReturnRequest
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 poscoreReturnRequest
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/poscoreReturnRequest";
		String param = "&menuCode=poscoreReturnRequest";

		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:

{
    "poscorereturnrequestt": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 84,
                "qty": 1,
                "unitId": 120
            }
        ]
    },
    "poscorereturnrequest": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "virDeptId": 17,
                "shopId": 1,
                "flowTypeId": 54,
                "staffId": 823
            }
        ]
    }
}

​ 4、Response Sample

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

# Create Shop Return Request (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Shop Return Request】

​ 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/poscoreReturnRequest
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/poscoreReturnRequest";

		HttpPost post = new HttpPost(url);
		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

{
    "shopCode": "KL01",
    "staffCode": "0001",
    "poscorereturnrequestt": [
        {
            "proCode": "0037",
            "sourceType": "pro",
            "unitCode": "PCS",
            "qty": 1
        }
    ],
    "flowTypeCode": "ALL",
    "beCode": "JC-AA",
    "virDeptCode": "1010"
}

​ 4、Response Sample

{
    "tranId": 13,
    "tranCode": "RR22040001",
    "message": "",
    "status": true
}

# Delete Shop Return Request

# 一、Description

​ Usage: Delete Shop Return Request

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/poscoreReturnRequest
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 poscoreReturnRequest
id long(Query) Yes Shop Return Request 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/poscoreReturnRequest";
		String param = "&menuCode=poscoreReturnRequest&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
}

# Shop Stock Return

# Fetch Shop Stock Return List

# 一、Description

​ Usage: Fetch Shop Stock 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 poscoreShopStkReturn
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=poscoreShopStkReturn&beId=11";

		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": "poscoreShopStkReturn",
    "size": 1,
    "stSearchDisplay": "Shop Stock Return",
    "values": [
        {
            "tDate": "2022-03-31",
            "code": "220270SSRET",
            "st_id": 7,
            "st_code": "220270SSRET",
            "st_desc": "220270SSRET",
            "poscoreShopStkReturn.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "iRev": 1,
            "id": 7,
            "lastModifyDate": "2022-03-31 16:37:18"
        }
    ]
}

# Load Shop Stock Return

# 一、Description

​ Usage: Load 【Shop Stock Return】Record

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/poscoreShopStkReturn
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 poscoreShopStkReturn
id long(Query) Yes Shop Stock 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/poscoreShopStkReturn";
			String param = "&menuCode=poscoreShopStkReturn&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": {
        "poscoremainshopstkreturn": [
            {
                "tDate": 1648656000000,
                "attachmentNo": 0,
                "lastModifyUid": 5,
                "code": "220270SSRET",
                "cnDeptId": 0,
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "iRev": 1,
                "sysJson": "",
                "upOrigin": "PRO",
                "viewCode": "poscoreShopStkReturn",
                "ce01Module": "poscoreShopStkReturn",
                "beId": 1,
                "expired": false,
                "stkjlId": 0,
                "printCount": 0,
                "useAccessBl": false,
                "id": 7,
                "doctypeId": 0,
                "shopId": 1,
                "statusModifyDate": 1648715838000,
                "locked": false,
                "lastModifyDate": 1648715838000,
                "createUid": 5,
                "createDate": 1648715838000,
                "rev": "1",
                "lastApproveUid": 5,
                "completed": false,
                "expiredUid": 0,
                "useAccessWl": false,
                "accdfsId": 0,
                "descOrigin": "PRO",
                "flowTypeId": 86,
                "useAccessAutoCalc": false,
                "staffId": 4,
                "status": "Y"
            }
        ],
        "poscoreremshopstkreturn": [
            {
                "remarks_jp": "",
                "hId": 7,
                "remarks_en": "",
                "iRev": 1,
                "ce01Module": "poscoreShopStkReturn",
                "remarks_cth": "",
                "remarks_hy": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\"}",
                "remarks_zh-CN": "",
                "id": 7,
                "remarks_zh-TW": "",
                "remarks": ""
            }
        ],
        "poscoreshopstkreturnt": [
            {
                "sourceId": 0,
                "dDesc_hy": "",
                "bDesc_sxg": "",
                "poscoreDesc_jp": "",
                "dualQty": 1,
                "bDesc_jp": "",
                "dDesc_sxg": "",
                "costAmt": 10,
                "dDesc_jp": "",
                "iRev": 1,
                "bDesc_hy": "",
                "itemNo": "     1",
                "dDesc_zh-CN": "",
                "poscoreDesc_zh-CN": "",
                "poscoreDesc_hy": "",
                "ce01Module": "poscoreShopStkReturn",
                "beId": 1,
                "lot": "A",
                "dDesc_cth": "",
                "alocId": 61,
                "dDesc_zh-TW": "",
                "bDesc": "P20220324 Brief Description",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "unitId": 7034,
                "id": 8,
                "locId": 16,
                "bDesc_cth": "",
                "poscoreDesc_sxg": "",
                "poscoreDesc": "",
                "hId": 7,
                "bDesc_en": "P20220324 Brief Description",
                "poscoreDesc_en": "",
                "poscoreDesc_zh-TW": "",
                "dDesc_en": "<p>P20220324 Detailed Description<br></p>",
                "completed": false,
                "poscoreDesc_cth": "",
                "dualUnitId": 6280,
                "sourceLot": "",
                "dDesc": "<p>P20220324 Detailed Description<br></p>",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_en\": \"P20220324 Brief Description\", \"dDesc_en\": \"<p>P20220324 Detailed Description<br></p>\", \"poscoreDesc_en\": \"\"}",
                "sourceType": "pro",
                "proId": 6334,
                "qty": 1,
                "lotNoId": 0,
                "bDesc_zh-CN": ""
            }
        ],
        "poscoreshopstkreturntlot": [
            {
                "lotnoNumAttr17": 0,
                "lotnoNumAttr16": 0,
                "lotnoNumAttr15": 0,
                "lotnoNumAttr14": 0,
                "lotnoNumAttr19": 0,
                "lotnoNumAttr18": 0,
                "lotnoLookupAttr20": 0,
                "lotnoNumAttr13": 0,
                "lotnoNumAttr12": 0,
                "lotnoNumAttr11": 0,
                "lotnoNumAttr10": 0,
                "lotnoLookupAttr16": 0,
                "alocId": 61,
                "lotnoLookupAttr17": 0,
                "lotnoLookupAttr14": 0,
                "lotnoLookupAttr15": 0,
                "lotnoLookupAttr18": 0,
                "lotnoLookupAttr19": 0,
                "newLotno": 0,
                "lotnoLot": "A",
                "id": 7,
                "lotnoNumAttr20": 0,
                "lotnoLookupAttr12": 0,
                "lotnoLookupAttr13": 0,
                "lotnoLookupAttr10": 0,
                "lotnoLookupAttr11": 0,
                "iRev": 1,
                "ce01Module": "poscoreShopStkReturn",
                "lotnoDateAttr3": -2209017600000,
                "lotnoDateAttr4": -2209017600000,
                "lotnoDateAttr1": 1645977600000,
                "lotnoDateAttr2": -2209017600000,
                "lotnoDateAttr7": -2209017600000,
                "lotnoDateAttr8": -2209017600000,
                "lotnoDateAttr5": -2209017600000,
                "lotnoDateAttr6": -2209017600000,
                "unitId": 7034,
                "lotnoDateAttr9": -2209017600000,
                "locId": 16,
                "lotnoTextAttr1": "G01",
                "lotnoTextAttr2": "",
                "lotnoTextAttr3": "",
                "lotnoTextAttr4": "",
                "lotnoTextAttr5": "",
                "lotnoTextAttr6": "",
                "lotnoTextAttr7": "",
                "lotnoTextAttr8": "",
                "lotnoTextAttr9": "",
                "dualQty": 1,
                "itemNo": "     1",
                "hId": 7,
                "lotnoNumAttr1": 10,
                "lotnoNumAttr2": 0,
                "lotnoNumAttr3": 0,
                "lotnoNumAttr4": 0,
                "lotnoExpDate": 1738512000000,
                "footerKey": "     1",
                "qty": 1,
                "lotnoNumAttr5": 0,
                "lotnoNumAttr6": 0,
                "lotnoNumAttr7": 0,
                "lotnoNumAttr8": 0,
                "lotnoNumAttr9": 0,
                "lotNoId": 8845,
                "lotnoTextAttr16": "",
                "lotnoTextAttr15": "",
                "lotnoTextAttr18": "",
                "lotnoTextAttr17": "",
                "lotnoTextAttr12": "",
                "lotnoTextAttr11": "",
                "lotnoDateAttr20": -2209017600000,
                "lotnoTextAttr14": "",
                "lotnoTextAttr13": "",
                "lotnoTextAttr19": "",
                "lotnoTextAttr10": "",
                "dualUnitId": 6280,
                "lotnoLookupAttr5": 0,
                "lotnoLookupAttr6": 0,
                "lotnoLookupAttr7": 0,
                "lotnoDateAttr18": -2209017600000,
                "lotnoLookupAttr8": 0,
                "lotnoDateAttr19": -2209017600000,
                "lotno": "L12",
                "lotnoLookupAttr9": 0,
                "proId": 6334,
                "lotnoDateAttr12": -2209017600000,
                "lotnoDateAttr13": -2209017600000,
                "lotnoDateAttr10": -2209017600000,
                "lotnoDateAttr11": -2209017600000,
                "lotnoTextAttr20": "",
                "lotnoLookupAttr1": 0,
                "lotnoDateAttr16": -2209017600000,
                "lotnoLookupAttr2": 0,
                "lotnoDateAttr17": -2209017600000,
                "lotnoLookupAttr3": 0,
                "lotnoDateAttr14": -2209017600000,
                "lotnoLookupAttr4": 0,
                "lotnoDateAttr15": -2209017600000
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Shop Stock Return

# 一、Description

​ Usage: create or update 【Shop Stock Return】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/poscoreShopStkReturn
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 poscoreShopStkReturn
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/poscoreShopStkReturn";
		String param = "&menuCode=poscoreShopStkReturn";

		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:

{
    "poscoremainshopstkreturn": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "virDeptId": 17,
                "shopId": 1,
                "flowTypeId": 54,
                "staffId": 823
            }
        ]
    },
    "poscoreshopstkreturnt": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 84,
                "qty": 1,
                "unitId": 120,
                "locId": 16
            }
        ]
    }
}

​ 4、Response Sample

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

# Create Shop Stock Return (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Shop Stock 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)]

​ ​ 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/poscoreShopStkReturn
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/poscoreShopStkReturn";

		HttpPost post = new HttpPost(url);
		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

{
    "shopCode": "KL01",
    "poscoreshopstkreturnt": [
        {
            "proCode": "0037",
            "sourceType": "pro",
            "unitCode": "PCS",
            "qty": 1
        }
    ],
    "staffCode": "0001",
    "flowTypeCode": "ALL",
    "beCode": "JC-AA",
    "virDeptCode": "1010"
}

​ 4、Response Sample

{
    "tranId": 50,
    "tranCode": "TR22040002",
    "message": "",
    "status": true
}

# Delete Shop Stock Return

# 一、Description

​ Usage: Delete Shop Stock Return

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/poscoreShopStkReturn
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 poscoreShopStkReturn
id long(Query) Yes Shop Stock 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/poscoreShopStkReturn";
		String param = "&menuCode=poscoreShopStkReturn&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
}

# Stock Return from Shop

# Fetch Stock Return from Shop List

# 一、Description

​ Usage: Fetch Stock Return from Shop 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 poscoreShopReturnNote
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=poscoreShopReturnNote&beId=11";

		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": "poscoreShopReturnNote",
    "size": 1,
    "stSearchDisplay": "Stock Return Receipt",
    "values": [
        {
            "tDate": "2022-03-31",
            "code": "220270SRETRE",
            "st_id": 22,
            "st_code": "220270SRETRE",
            "st_desc": "220270SRETRE",
            "poscoreShopReturnNote.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "iRev": 1,
            "id": 22,
            "lastModifyDate": "2022-03-31 16:38:35"
        }
    ]
}

# Load Stock Return from Shop

# 一、Description

​ Usage: Load 【Stock Return from Shop】Record

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/poscoreShopReturnNote
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 poscoreShopReturnNote
id long(Query) Yes Stock Return from Shop 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/poscoreShopReturnNote";
			String param = "&menuCode=poscoreShopReturnNote&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": {
        "poscoreshopreturnnote": [
            {
                "tDate": 1648656000000,
                "attachmentNo": 0,
                "lastModifyUid": 5,
                "code": "220270SRETRE",
                "cnDeptId": 0,
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "iRev": 1,
                "sysJson": "",
                "upOrigin": "PRO",
                "viewCode": "poscoreShopReturnNote",
                "ce01Module": "poscoreShopReturnNote",
                "beId": 1,
                "alocId": 66,
                "expired": false,
                "stkjlId": 0,
                "printCount": 0,
                "useAccessBl": false,
                "id": 22,
                "doctypeId": 0,
                "statusModifyDate": 1648715915000,
                "locked": false,
                "lastModifyDate": 1648715915000,
                "createUid": 5,
                "createDate": 1648715915000,
                "rev": "1",
                "lastApproveUid": 5,
                "expiredUid": 0,
                "useAccessWl": false,
                "accdfsId": 0,
                "descOrigin": "PRO",
                "flowTypeId": 86,
                "useAccessAutoCalc": false,
                "staffId": 4,
                "status": "Y"
            }
        ],
        "poscoreshopreturnnotet": [
            {
                "sourceId": 11,
                "dDesc_hy": "",
                "poscoreDesc_jp": "",
                "dualQty": 5,
                "bDesc_hy": "",
                "itemNo": "     1",
                "beId": 1,
                "alocId": 66,
                "bDesc": "P20220324 Brief Description",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 32,
                "shopId": 1,
                "poscoreDesc_sxg": "",
                "hId": 22,
                "dDesc": "<p>P20220324 Detailed Description<br></p>",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_en\": \"P20220324 Brief Description\", \"dDesc_en\": \"<p>P20220324 Detailed Description<br></p>\", \"poscoreDesc_en\": \"\"}",
                "sourceType": "poscoreReturnRequest",
                "qty": 5,
                "lotNoId": 0,
                "bDesc_sxg": "",
                "bDesc_jp": "",
                "dDesc_sxg": "",
                "costAmt": 50,
                "dDesc_jp": "",
                "iRev": 1,
                "dDesc_zh-CN": "",
                "poscoreDesc_zh-CN": "",
                "poscoreDesc_hy": "",
                "ce01Module": "poscoreShopReturnNote",
                "lot": "A",
                "dDesc_cth": "",
                "dDesc_zh-TW": "",
                "unitId": 7034,
                "locId": 16,
                "bDesc_cth": "",
                "poscoreDesc": "",
                "bDesc_en": "P20220324 Brief Description",
                "poscoreDesc_en": "",
                "poscoreDesc_zh-TW": "",
                "dDesc_en": "<p>P20220324 Detailed Description<br></p>",
                "poscoreDesc_cth": "",
                "dualUnitId": 6280,
                "confirm": true,
                "sourceLot": "A",
                "reqQty": 5,
                "proId": 6334,
                "bDesc_zh-CN": ""
            },
            {
                "sourceId": 7,
                "dDesc_hy": "",
                "poscoreDesc_jp": "",
                "dualQty": 1,
                "bDesc_hy": "",
                "itemNo": "     2",
                "beId": 1,
                "alocId": 66,
                "bDesc": "P20220324 Brief Description",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 33,
                "shopId": 1,
                "poscoreDesc_sxg": "",
                "hId": 22,
                "dDesc": "<p>P20220324 Detailed Description<br></p>",
                "footerKey": "     2",
                "i18nField": "{\"bDesc_en\": \"P20220324 Brief Description\", \"dDesc_en\": \"<p>P20220324 Detailed Description<br></p>\", \"poscoreDesc_en\": \"\"}",
                "sourceType": "poscoreShopStkReturn",
                "qty": 1,
                "lotNoId": 0,
                "bDesc_sxg": "",
                "bDesc_jp": "",
                "dDesc_sxg": "",
                "costAmt": 10,
                "dDesc_jp": "",
                "iRev": 1,
                "dDesc_zh-CN": "",
                "poscoreDesc_zh-CN": "",
                "poscoreDesc_hy": "",
                "ce01Module": "poscoreShopReturnNote",
                "lot": "B",
                "dDesc_cth": "",
                "dDesc_zh-TW": "",
                "unitId": 7034,
                "locId": 61,
                "bDesc_cth": "",
                "poscoreDesc": "",
                "bDesc_en": "P20220324 Brief Description",
                "poscoreDesc_en": "",
                "poscoreDesc_zh-TW": "",
                "dDesc_en": "<p>P20220324 Detailed Description<br></p>",
                "poscoreDesc_cth": "",
                "dualUnitId": 6280,
                "confirm": true,
                "sourceLot": "A",
                "reqQty": 1,
                "proId": 6334,
                "bDesc_zh-CN": ""
            }
        ],
        "poscoreshopreturnnotetlot": [
            {
                "lotnoNumAttr17": 0,
                "lotnoNumAttr16": 0,
                "lotnoNumAttr15": 0,
                "lotnoNumAttr14": 0,
                "lotnoNumAttr19": 0,
                "lotnoNumAttr18": 0,
                "lotnoLookupAttr20": 0,
                "lotnoNumAttr13": 0,
                "lotnoNumAttr12": 0,
                "lotnoNumAttr11": 0,
                "lotnoNumAttr10": 0,
                "lotnoLookupAttr16": 0,
                "alocId": 66,
                "lotnoLookupAttr17": 0,
                "lotnoLookupAttr14": 0,
                "lotnoLookupAttr15": 0,
                "lotnoLookupAttr18": 0,
                "lotnoLookupAttr19": 0,
                "newLotno": 0,
                "lotnoLot": "A",
                "id": 15,
                "lotnoNumAttr20": 0,
                "lotnoLookupAttr12": 0,
                "lotnoLookupAttr13": 0,
                "lotnoLookupAttr10": 0,
                "lotnoLookupAttr11": 0,
                "iRev": 1,
                "ce01Module": "poscoreShopReturnNote",
                "lotnoDateAttr3": -2209017600000,
                "lotnoDateAttr4": -2209017600000,
                "lotnoDateAttr1": 1645977600000,
                "lotnoDateAttr2": -2209017600000,
                "lotnoDateAttr7": -2209017600000,
                "lotnoDateAttr8": -2209017600000,
                "lotnoDateAttr5": -2209017600000,
                "lotnoDateAttr6": -2209017600000,
                "unitId": 7034,
                "lotnoDateAttr9": -2209017600000,
                "locId": 61,
                "lotnoTextAttr1": "G01",
                "lotnoTextAttr2": "",
                "lotnoTextAttr3": "",
                "lotnoTextAttr4": "",
                "lotnoTextAttr5": "",
                "lotnoTextAttr6": "",
                "lotnoTextAttr7": "",
                "lotnoTextAttr8": "",
                "lotnoTextAttr9": "",
                "dualQty": 0,
                "itemNo": "     1",
                "hId": 22,
                "lotnoNumAttr1": 10,
                "lotnoNumAttr2": 0,
                "lotnoNumAttr3": 0,
                "lotnoNumAttr4": 0,
                "lotnoExpDate": 1738512000000,
                "footerKey": "     2",
                "qty": 1,
                "lotnoNumAttr5": 0,
                "lotnoNumAttr6": 0,
                "lotnoNumAttr7": 0,
                "lotnoNumAttr8": 0,
                "lotnoNumAttr9": 0,
                "lotNoId": 8845,
                "lotnoTextAttr16": "",
                "lotnoTextAttr15": "",
                "lotnoTextAttr18": "",
                "lotnoTextAttr17": "",
                "lotnoTextAttr12": "",
                "lotnoTextAttr11": "",
                "lotnoDateAttr20": -2209017600000,
                "lotnoTextAttr14": "",
                "lotnoTextAttr13": "",
                "lotnoTextAttr19": "",
                "lotnoTextAttr10": "",
                "dualUnitId": 6280,
                "lotnoLookupAttr5": 0,
                "lotnoLookupAttr6": 0,
                "lotnoLookupAttr7": 0,
                "lotnoDateAttr18": -2209017600000,
                "lotnoLookupAttr8": 0,
                "lotnoDateAttr19": -2209017600000,
                "lotno": "L12",
                "lotnoLookupAttr9": 0,
                "proId": 6334,
                "lotnoDateAttr12": -2209017600000,
                "lotnoDateAttr13": -2209017600000,
                "lotnoDateAttr10": -2209017600000,
                "lotnoDateAttr11": -2209017600000,
                "lotnoTextAttr20": "",
                "lotnoLookupAttr1": 0,
                "lotnoDateAttr16": -2209017600000,
                "lotnoLookupAttr2": 0,
                "lotnoDateAttr17": -2209017600000,
                "lotnoLookupAttr3": 0,
                "lotnoDateAttr14": -2209017600000,
                "lotnoLookupAttr4": 0,
                "lotnoDateAttr15": -2209017600000
            },
            {
                "lotnoNumAttr17": 0,
                "lotnoNumAttr16": 0,
                "lotnoNumAttr15": 0,
                "lotnoNumAttr14": 0,
                "lotnoNumAttr19": 0,
                "lotnoNumAttr18": 0,
                "lotnoLookupAttr20": 0,
                "lotnoNumAttr13": 0,
                "lotnoNumAttr12": 0,
                "lotnoNumAttr11": 0,
                "lotnoNumAttr10": 0,
                "lotnoLookupAttr16": 0,
                "alocId": 66,
                "lotnoLookupAttr17": 0,
                "lotnoLookupAttr14": 0,
                "lotnoLookupAttr15": 0,
                "lotnoLookupAttr18": 0,
                "lotnoLookupAttr19": 0,
                "newLotno": 0,
                "lotnoLot": "A",
                "id": 16,
                "lotnoNumAttr20": 0,
                "lotnoLookupAttr12": 0,
                "lotnoLookupAttr13": 0,
                "lotnoLookupAttr10": 0,
                "lotnoLookupAttr11": 0,
                "iRev": 1,
                "ce01Module": "poscoreShopReturnNote",
                "lotnoDateAttr3": -2209017600000,
                "lotnoDateAttr4": -2209017600000,
                "lotnoDateAttr1": 1645977600000,
                "lotnoDateAttr2": -2209017600000,
                "lotnoDateAttr7": -2209017600000,
                "lotnoDateAttr8": -2209017600000,
                "lotnoDateAttr5": -2209017600000,
                "lotnoDateAttr6": -2209017600000,
                "unitId": 7034,
                "lotnoDateAttr9": -2209017600000,
                "locId": 16,
                "lotnoTextAttr1": "G01",
                "lotnoTextAttr2": "",
                "lotnoTextAttr3": "",
                "lotnoTextAttr4": "",
                "lotnoTextAttr5": "",
                "lotnoTextAttr6": "",
                "lotnoTextAttr7": "",
                "lotnoTextAttr8": "",
                "lotnoTextAttr9": "",
                "dualQty": 5,
                "itemNo": "     2",
                "hId": 22,
                "lotnoNumAttr1": 10,
                "lotnoNumAttr2": 0,
                "lotnoNumAttr3": 0,
                "lotnoNumAttr4": 0,
                "lotnoExpDate": 1738512000000,
                "footerKey": "     1",
                "qty": 5,
                "lotnoNumAttr5": 0,
                "lotnoNumAttr6": 0,
                "lotnoNumAttr7": 0,
                "lotnoNumAttr8": 0,
                "lotnoNumAttr9": 0,
                "lotNoId": 8845,
                "lotnoTextAttr16": "",
                "lotnoTextAttr15": "",
                "lotnoTextAttr18": "",
                "lotnoTextAttr17": "",
                "lotnoTextAttr12": "",
                "lotnoTextAttr11": "",
                "lotnoDateAttr20": -2209017600000,
                "lotnoTextAttr14": "",
                "lotnoTextAttr13": "",
                "lotnoTextAttr19": "",
                "lotnoTextAttr10": "",
                "dualUnitId": 6280,
                "lotnoLookupAttr5": 0,
                "lotnoLookupAttr6": 0,
                "lotnoLookupAttr7": 0,
                "lotnoDateAttr18": -2209017600000,
                "lotnoLookupAttr8": 0,
                "lotnoDateAttr19": -2209017600000,
                "lotno": "L12",
                "lotnoLookupAttr9": 0,
                "proId": 6334,
                "lotnoDateAttr12": -2209017600000,
                "lotnoDateAttr13": -2209017600000,
                "lotnoDateAttr10": -2209017600000,
                "lotnoDateAttr11": -2209017600000,
                "lotnoTextAttr20": "",
                "lotnoLookupAttr1": 0,
                "lotnoDateAttr16": -2209017600000,
                "lotnoLookupAttr2": 0,
                "lotnoDateAttr17": -2209017600000,
                "lotnoLookupAttr3": 0,
                "lotnoDateAttr14": -2209017600000,
                "lotnoLookupAttr4": 0,
                "lotnoDateAttr15": -2209017600000
            }
        ],
        "poscoreremshopreturnnote": [
            {
                "remarks_jp": "",
                "hId": 22,
                "remarks_en": "",
                "iRev": 1,
                "ce01Module": "poscoreShopReturnNote",
                "remarks_cth": "",
                "remarks_hy": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\"}",
                "remarks_zh-CN": "",
                "id": 22,
                "remarks_zh-TW": "",
                "remarks": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Stock Return from Shop

# 一、Description

​ Usage: create or update 【Stock Return from Shop】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/poscoreShopReturnNote
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 poscoreShopReturnNote
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/poscoreShopReturnNote";
		String param = "&menuCode=poscoreShopReturnNote";

		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:

{
    "poscoreshopreturnnote": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "virDeptId": 17,
                "shopId": 1,
                "flowTypeId": 54,
                "staffId": 823
            }
        ]
    },
    "poscoreshopreturnnotet": {
        "values": [
            {
                "alocId": 66,
                "sourceType": "pro",
                "proId": 84,
                "qty": 1,
                "unitId": 120,
                "locId": 16
            }
        ]
    }
}

​ 4、Response Sample

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

# Create Stock Return from Shop (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Stock Return from Shop】

​ 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/poscoreShopReturnNote
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/poscoreShopReturnNote";

		HttpPost post = new HttpPost(url);
		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

{
    "shopCode": "KL01",
    "poscoreshopstkreturnt": [
        {
            "locCode": "KLSW01",
            "proCode": "0037",
            "sourceType": "pro",
            "unitCode": "PCS",
            "qty": 1,
            "alocCode": "01"
        }
    ],
    "staffCode": "0001",
    "flowTypeCode": "ALL",
    "beCode": "JC-AA",
    "virDeptCode": "1010"
}

​ 4、Response Sample

{
    "tranId": 10,
    "tranCode": "SSR22040002",
    "message": "",
    "status": true
}

# Delete Stock Return from Shop

# 一、Description

​ Usage: Delete Stock Return from Shop

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/poscoreShopReturnNote
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 poscoreShopReturnNote
id long(Query) Yes Stock Return from Shop 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/poscoreShopReturnNote";
		String param = "&menuCode=poscoreShopReturnNote&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
}

# Shop to Shop Transfer

# Fetch Shop to Shop Transfer List

# 一、Description

​ Usage: Fetch Shop to Shop Transfer 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 poscoreShopToShop
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=poscoreShopToShop&beId=11";

		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": "poscoreShopToShop",
    "size": 1,
    "stSearchDisplay": "Shop to Shop Transfer",
    "values": [
        {
            "tDate": "2022-03-31",
            "poscoreShopToShop.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "code": "220270SST",
            "st_id": 18,
            "st_code": "220270SST",
            "st_desc": "220270SST",
            "iRev": 2,
            "id": 18,
            "lastModifyDate": "2022-03-31 16:34:11"
        }
    ]
}

# Load Shop to Shop Transfer

# 一、Description

​ Usage: Load 【Shop to Shop Transfer】Record

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/poscoreShopToShop
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 poscoreShopToShop
id long(Query) Yes Shop to Shop Transfer 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/poscoreShopToShop";
			String param = "&menuCode=poscoreShopToShop&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": {
        "poscoreshoptoshoptlot": [
            {
                "lotnoNumAttr17": 0,
                "lotnoNumAttr16": 0,
                "lotnoNumAttr15": 0,
                "lotnoNumAttr14": 0,
                "lotnoNumAttr19": 0,
                "lotnoNumAttr18": 0,
                "lotnoLookupAttr20": 0,
                "lotnoNumAttr13": 0,
                "lotnoNumAttr12": 0,
                "lotnoNumAttr11": 0,
                "lotnoNumAttr10": 0,
                "lotnoLookupAttr16": 0,
                "alocId": 61,
                "lotnoLookupAttr17": 0,
                "lotnoLookupAttr14": 0,
                "lotnoLookupAttr15": 0,
                "lotnoLookupAttr18": 0,
                "lotnoLookupAttr19": 0,
                "newLotno": 0,
                "lotnoLot": "A",
                "id": 8,
                "lotnoNumAttr20": 0,
                "lotnoLookupAttr12": 0,
                "lotnoLookupAttr13": 0,
                "lotnoLookupAttr10": 0,
                "lotnoLookupAttr11": 0,
                "iRev": 2,
                "ce01Module": "poscoreShopToShop",
                "lotnoDateAttr3": -2209017600000,
                "lotnoDateAttr4": -2209017600000,
                "lotnoDateAttr1": 1643817600000,
                "lotnoDateAttr2": -2209017600000,
                "lotnoDateAttr7": -2209017600000,
                "lotnoDateAttr8": -2209017600000,
                "lotnoDateAttr5": -2209017600000,
                "lotnoDateAttr6": -2209017600000,
                "unitId": 7034,
                "lotnoDateAttr9": -2209017600000,
                "locId": 16,
                "lotnoTextAttr1": "H02",
                "lotnoTextAttr2": "",
                "lotnoTextAttr3": "",
                "lotnoTextAttr4": "",
                "lotnoTextAttr5": "",
                "lotnoTextAttr6": "",
                "lotnoTextAttr7": "",
                "lotnoTextAttr8": "",
                "lotnoTextAttr9": "",
                "dualQty": 10,
                "itemNo": "     1",
                "hId": 18,
                "lotnoNumAttr1": 12,
                "lotnoNumAttr2": 0,
                "lotnoNumAttr3": 0,
                "lotnoNumAttr4": 0,
                "lotnoExpDate": 1744041600000,
                "footerKey": "     1",
                "qty": 10,
                "lotnoNumAttr5": 0,
                "lotnoNumAttr6": 0,
                "lotnoNumAttr7": 0,
                "lotnoNumAttr8": 0,
                "lotnoNumAttr9": 0,
                "lotNoId": 8861,
                "lotnoTextAttr16": "",
                "lotnoTextAttr15": "",
                "lotnoTextAttr18": "",
                "lotnoTextAttr17": "",
                "lotnoTextAttr12": "",
                "lotnoTextAttr11": "",
                "lotnoDateAttr20": -2209017600000,
                "lotnoTextAttr14": "",
                "lotnoTextAttr13": "",
                "lotnoTextAttr19": "",
                "lotnoTextAttr10": "",
                "dualUnitId": 6280,
                "lotnoLookupAttr5": 0,
                "lotnoLookupAttr6": 0,
                "lotnoLookupAttr7": 0,
                "lotnoDateAttr18": -2209017600000,
                "lotnoLookupAttr8": 0,
                "lotnoDateAttr19": -2209017600000,
                "lotno": "L13",
                "lotnoLookupAttr9": 0,
                "proId": 6334,
                "lotnoDateAttr12": -2209017600000,
                "lotnoDateAttr13": -2209017600000,
                "lotnoDateAttr10": -2209017600000,
                "lotnoDateAttr11": -2209017600000,
                "lotnoTextAttr20": "",
                "lotnoLookupAttr1": 0,
                "lotnoDateAttr16": -2209017600000,
                "lotnoLookupAttr2": 0,
                "lotnoDateAttr17": -2209017600000,
                "lotnoLookupAttr3": 0,
                "lotnoDateAttr14": -2209017600000,
                "lotnoLookupAttr4": 0,
                "lotnoDateAttr15": -2209017600000
            }
        ],
        "poscoreshoptoshopt": [
            {
                "sourceId": 0,
                "dDesc_hy": "",
                "bDesc_sxg": "",
                "poscoreDesc_jp": "",
                "dualQty": 10,
                "bDesc_jp": "",
                "dDesc_sxg": "",
                "costAmt": 100,
                "dDesc_jp": "",
                "iRev": 2,
                "bDesc_hy": "",
                "itemNo": "     1",
                "dDesc_zh-CN": "",
                "poscoreDesc_zh-CN": "",
                "poscoreDesc_hy": "",
                "ce01Module": "poscoreShopToShop",
                "beId": 1,
                "lot": "A",
                "dDesc_cth": "",
                "alocId": 61,
                "dDesc_zh-TW": "",
                "bDesc": "P20220324 Brief Description",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "unitId": 7034,
                "id": 21,
                "shopId": 2,
                "locId": 16,
                "bDesc_cth": "",
                "poscoreDesc_sxg": "",
                "poscoreDesc": "",
                "hId": 18,
                "bDesc_en": "P20220324 Brief Description",
                "poscoreDesc_en": "",
                "poscoreDesc_zh-TW": "",
                "dDesc_en": "<p>P20220324 Detailed Description<br></p>",
                "completed": false,
                "poscoreDesc_cth": "",
                "dualUnitId": 6280,
                "sourceLot": "",
                "dDesc": "<p>P20220324 Detailed Description<br></p>",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_en\": \"P20220324 Brief Description\", \"dDesc_en\": \"<p>P20220324 Detailed Description<br></p>\", \"poscoreDesc_en\": \"\"}",
                "sourceType": "pro",
                "proId": 6334,
                "qty": 10,
                "lotNoId": 0,
                "bDesc_zh-CN": ""
            }
        ],
        "poscoremainshoptoshop": [
            {
                "tDate": 1648656000000,
                "attachmentNo": 0,
                "lastModifyUid": 5,
                "code": "220270SST",
                "cnDeptId": 0,
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "iRev": 2,
                "sysJson": "",
                "upOrigin": "PRO",
                "viewCode": "poscoreShopToShop",
                "ce01Module": "poscoreShopToShop",
                "beId": 1,
                "alocId": 61,
                "expired": false,
                "stkjlId": 0,
                "printCount": 0,
                "useAccessBl": false,
                "id": 18,
                "doctypeId": 1,
                "shopId": 1,
                "statusModifyDate": 1648715349000,
                "locked": false,
                "lastModifyDate": 1648715651000,
                "createUid": 5,
                "createDate": 1648715349000,
                "rev": "2",
                "lastApproveUid": 5,
                "shopToId": 0,
                "completed": false,
                "expiredUid": 0,
                "useAccessWl": false,
                "accdfsId": 0,
                "descOrigin": "PRO",
                "flowTypeId": 86,
                "useAccessAutoCalc": false,
                "staffId": 4,
                "status": "Y"
            }
        ],
        "poscoreremshoptoshop": [
            {
                "remarks_jp": "",
                "hId": 18,
                "remarks_en": "",
                "iRev": 2,
                "ce01Module": "poscoreShopToShop",
                "remarks_cth": "",
                "remarks_hy": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\"}",
                "remarks_zh-CN": "",
                "id": 18,
                "remarks_zh-TW": "",
                "remarks": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Shop to Shop Transfer

# 一、Description

​ Usage: create or update 【Shop to Shop Transfer】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/poscoreShopToShop
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 poscoreShopToShop
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/poscoreShopToShop";
		String param = "&menuCode=poscoreShopToShop";

		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:

{
    "poscoreshoptoshopt": {
        "values": [
            {
                "alocId": 16,
                "sourceType": "pro",
                "proId": 84,
                "qty": 1,
                "unitId": 120,
                "shopId": 1,
                "locId": 76
            }
        ]
    },
    "poscoremainshoptoshop": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "alocId": 16,
                "virDeptId": 17,
                "shopId": 2,
                "flowTypeId": 54,
                "staffId": 823,
                "locId": 76
            }
        ]
    }
}

​ 4、Response Sample

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

# Create Shop to Shop Transfer (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Shop to Shop Transfer】

​ 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/poscoreShopToShop
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/poscoreShopToShop";

		HttpPost post = new HttpPost(url);
		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

{
    "shopCode": "KL02",
    "poscoreshoptoshopt": [
        {
            "shopCode": "KL01",
            "locCode": "KLSW01",
            "proCode": "P20220324",
            "sourceType": "pro",
            "unitCode": "PCS",
            "qty": 1
        }
    ],
    "staffCode": "0001",
    "flowTypeCode": "ALL",
    "beCode": "JC-AA",
    "virDeptCode": "1010",
    "alocCode": "01"
}

​ 4、Response Sample

{
    "tranId": 50,
    "tranCode": "TR22040002",
    "message": "",
    "status": true
}

# Delete Shop to Shop Transfer

# 一、Description

​ Usage: Delete Shop to Shop Transfer

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/poscoreShopToShop
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 poscoreShopToShop
id long(Query) Yes Shop to Shop Transfer 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/poscoreShopToShop";
		String param = "&menuCode=poscoreShopToShop&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
}

# HQ to Shop Transfer

# Fetch HQ to Shop Transfer List

# 一、Description

​ Usage: Fetch HQ to Shop Transfer 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 poscoreShopTransNote
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=poscoreShopTransNote&beId=11";

		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": "poscoreShopTransNote",
    "size": 1,
    "stSearchDisplay": "HQ to Shop Transfer",
    "values": [
        {
            "tDate": "2022-03-31",
            "code": "220270HQST",
            "st_id": 47,
            "st_code": "220270HQST",
            "st_desc": "220270HQST",
            "poscoreShopTransNote.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "iRev": 1,
            "id": 47,
            "lastModifyDate": "2022-03-31 16:18:41"
        }
    ]
}

# Load HQ to Shop Transfer

# 一、Description

​ Usage: Load 【HQ to Shop Transfer】Record

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/poscoreShopTransNote
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 poscoreShopTransNote
id long(Query) Yes HQ to Shop Transfer 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/poscoreShopTransNote";
			String param = "&menuCode=poscoreShopTransNote&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": {
        "poscoreshoptransnote": [
            {
                "tDate": 1648656000000,
                "attachmentNo": 0,
                "lastModifyUid": 5,
                "code": "220270HQST",
                "cnDeptId": 204,
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "iRev": 1,
                "sysJson": "",
                "upOrigin": "PRO",
                "viewCode": "poscoreShopTransNote",
                "ce01Module": "poscoreShopTransNote",
                "beId": 1,
                "alocId": 61,
                "expired": false,
                "stkjlId": 0,
                "printCount": 0,
                "useAccessBl": false,
                "id": 47,
                "doctypeId": 0,
                "isSpecificShop": false,
                "statusModifyDate": 1648714721000,
                "locked": false,
                "lastModifyDate": 1648714721000,
                "createUid": 5,
                "locId": 0,
                "createDate": 1648714721000,
                "reqCondFormula": "",
                "rev": "1",
                "lastApproveUid": 5,
                "shopToId": 0,
                "completed": false,
                "expiredUid": 0,
                "useAccessWl": false,
                "accdfsId": 0,
                "descOrigin": "PRO",
                "flowTypeId": 86,
                "useAccessAutoCalc": false,
                "staffId": 4,
                "status": "Y"
            }
        ],
        "poscoreremshoptransnote": [
            {
                "remarks_jp": "",
                "hId": 47,
                "remarks_en": "",
                "iRev": 1,
                "ce01Module": "poscoreShopTransNote",
                "remarks_cth": "",
                "remarks_hy": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\"}",
                "remarks_zh-CN": "",
                "id": 47,
                "remarks_zh-TW": "",
                "remarks": ""
            }
        ],
        "poscoreshoptransnotetlot": [
            {
                "lotnoNumAttr17": 0,
                "lotnoNumAttr16": 0,
                "lotnoNumAttr15": 0,
                "lotnoNumAttr14": 0,
                "lotnoNumAttr19": 0,
                "lotnoNumAttr18": 0,
                "lotnoLookupAttr20": 0,
                "lotnoNumAttr13": 0,
                "lotnoNumAttr12": 0,
                "lotnoNumAttr11": 0,
                "lotnoNumAttr10": 0,
                "lotnoLookupAttr16": 0,
                "alocId": 61,
                "lotnoLookupAttr17": 0,
                "lotnoLookupAttr14": 0,
                "lotnoLookupAttr15": 0,
                "lotnoLookupAttr18": 0,
                "lotnoLookupAttr19": 0,
                "newLotno": 0,
                "lotnoLot": "A",
                "id": 79,
                "lotnoNumAttr20": 0,
                "lotnoLookupAttr12": 0,
                "lotnoLookupAttr13": 0,
                "lotnoLookupAttr10": 0,
                "lotnoLookupAttr11": 0,
                "iRev": 1,
                "ce01Module": "poscoreShopTransNote",
                "lotnoDateAttr3": -2209017600000,
                "lotnoDateAttr4": -2209017600000,
                "lotnoDateAttr1": 1645977600000,
                "lotnoDateAttr2": -2209017600000,
                "lotnoDateAttr7": -2209017600000,
                "lotnoDateAttr8": -2209017600000,
                "lotnoDateAttr5": -2209017600000,
                "lotnoDateAttr6": -2209017600000,
                "unitId": 7034,
                "lotnoDateAttr9": -2209017600000,
                "locId": 66,
                "lotnoTextAttr1": "G01",
                "lotnoTextAttr2": "",
                "lotnoTextAttr3": "",
                "lotnoTextAttr4": "",
                "lotnoTextAttr5": "",
                "lotnoTextAttr6": "",
                "lotnoTextAttr7": "",
                "lotnoTextAttr8": "",
                "lotnoTextAttr9": "",
                "dualQty": 10,
                "itemNo": "     1",
                "hId": 47,
                "lotnoNumAttr1": 10,
                "lotnoNumAttr2": 0,
                "lotnoNumAttr3": 0,
                "lotnoNumAttr4": 0,
                "lotnoExpDate": 1738512000000,
                "footerKey": "     1",
                "qty": 10,
                "lotnoNumAttr5": 0,
                "lotnoNumAttr6": 0,
                "lotnoNumAttr7": 0,
                "lotnoNumAttr8": 0,
                "lotnoNumAttr9": 0,
                "lotNoId": 8845,
                "lotnoTextAttr16": "",
                "lotnoTextAttr15": "",
                "lotnoTextAttr18": "",
                "lotnoTextAttr17": "",
                "lotnoTextAttr12": "",
                "lotnoTextAttr11": "",
                "lotnoDateAttr20": -2209017600000,
                "lotnoTextAttr14": "",
                "lotnoTextAttr13": "",
                "lotnoTextAttr19": "",
                "lotnoTextAttr10": "",
                "dualUnitId": 6280,
                "lotnoLookupAttr5": 0,
                "lotnoLookupAttr6": 0,
                "lotnoLookupAttr7": 0,
                "lotnoDateAttr18": -2209017600000,
                "lotnoLookupAttr8": 0,
                "lotnoDateAttr19": -2209017600000,
                "lotno": "L12",
                "lotnoLookupAttr9": 0,
                "proId": 6334,
                "lotnoDateAttr12": -2209017600000,
                "lotnoDateAttr13": -2209017600000,
                "lotnoDateAttr10": -2209017600000,
                "lotnoDateAttr11": -2209017600000,
                "lotnoTextAttr20": "",
                "lotnoLookupAttr1": 0,
                "lotnoDateAttr16": -2209017600000,
                "lotnoLookupAttr2": 0,
                "lotnoDateAttr17": -2209017600000,
                "lotnoLookupAttr3": 0,
                "lotnoDateAttr14": -2209017600000,
                "lotnoLookupAttr4": 0,
                "lotnoDateAttr15": -2209017600000
            }
        ],
        "poscoreshoptransnotet": [
            {
                "sourceId": 39,
                "dDesc_hy": "",
                "poscoreDesc_jp": "",
                "dualQty": 10,
                "bDesc_hy": "",
                "itemNo": "     1",
                "beId": 1,
                "alocId": 61,
                "bDesc": "P20220324 Brief Description",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 100,
                "shopId": 1,
                "poscoreDesc_sxg": "",
                "hId": 47,
                "completed": false,
                "dDesc": "<p>P20220324 Detailed Description<br></p>",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_en\": \"P20220324 Brief Description\", \"dDesc_en\": \"<p>P20220324 Detailed Description<br></p>\", \"poscoreDesc_en\": \"\"}",
                "sourceType": "poscoreTransRequest",
                "qty": 10,
                "lotNoId": 0,
                "bDesc_sxg": "",
                "bDesc_jp": "",
                "dDesc_sxg": "",
                "costAmt": 100,
                "dDesc_jp": "",
                "iRev": 1,
                "dDesc_zh-CN": "",
                "poscoreDesc_zh-CN": "",
                "poscoreDesc_hy": "",
                "ce01Module": "poscoreShopTransNote",
                "lot": "A",
                "dDesc_cth": "",
                "dDesc_zh-TW": "",
                "unitId": 7034,
                "locId": 66,
                "bDesc_cth": "",
                "poscoreDesc": "",
                "bDesc_en": "P20220324 Brief Description",
                "poscoreDesc_en": "",
                "poscoreDesc_zh-TW": "",
                "dDesc_en": "<p>P20220324 Detailed Description<br></p>",
                "poscoreDesc_cth": "",
                "dualUnitId": 6280,
                "sourceLot": "A",
                "reqQty": 10,
                "proId": 6334,
                "bDesc_zh-CN": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create HQ to Shop Transfer

# 一、Description

​ Usage: create or update 【HQ to Shop Transfer】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/poscoreShopTransNote
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 poscoreShopTransNote
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/poscoreShopTransNote";
		String param = "&menuCode=poscoreShopTransNote";

		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:

{
    "poscoreshoptransnote": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "alocId": 16,
                "virDeptId": 17,
                "shopId": 2,
                "flowTypeId": 54,
                "staffId": 823,
                "locId": 76
            }
        ]
    },
    "poscoreshoptransnotet": {
        "values": [
            {
                "alocId": 16,
                "sourceType": "pro",
                "proId": 84,
                "qty": 1,
                "unitId": 120,
                "shopId": 1,
                "locId": 76
            }
        ]
    }
}

​ 4、Response Sample

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

# Create HQ to Shop Transfer (Auto Completion)

# 一、Description

​ 1. Usage: Create 【HQ to Shop Transfer】

​ 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/poscoreShopTransNote
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/poscoreShopTransNote";

		HttpPost post = new HttpPost(url);
		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

{
    "shopCode": "KL02",
    "staffCode": "0001",
    "locCode": "KLSW01",
    "flowTypeCode": "ALL",
    "beCode": "JC-AA",
    "poscoreshoptransnotet": [
        {
            "shopCode": "KL01",
            "locCode": "01",
            "proCode": "P20220324",
            "sourceType": "pro",
            "unitCode": "PCS",
            "qty": 1
        }
    ],
    "virDeptCode": "1010"
}

​ 4、Response Sample

{
    "tranId": 50,
    "tranCode": "TR22040002",
    "message": "",
    "status": true
}

# Delete HQ to Shop Transfer

# 一、Description

​ Usage: Delete HQ to Shop Transfer

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/poscoreShopTransNote
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 poscoreShopTransNote
id long(Query) Yes HQ to Shop Transfer 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/poscoreShopTransNote";
		String param = "&menuCode=poscoreShopTransNote&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:Outstanding Shop Stock Request Report

# 一、Description

​ Usage: Run EBI[Outstanding Shop Stock Request 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": [
        {
            "REQ_A_shopId_code": "KL01",
            "MAIN_outQty": "35.00",
            "MAIN_returnedQty": "15.00",
            "REQ_A_shopId": "1",
            "M18ReservedCol_dataIndex": 1,
            "REQT_A_proId_desc__lang": "維他命B",
            "REQT_A_locId_code": "KLSW01",
            "REQT_A_qty": "50.0000",
            "REQ_A_tDate": "2020 Aug 26",
            "MAIN_reqQty": "50.00",
            "REQ_A_code": "211424SRREQ",
            "REQT_A_locId": "16",
            "REQ_A_id": "1",
            "REQT_A_proId_code": "0101",
            "REQT_A_proId": "72"
        }
    ]
}

ebi1

# Load EBI data:Outstanding Shop Return Request Report

# 一、Description

​ Usage: Run EBI[Outstanding Shop Return Request 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": [
        {
            "REQ_A_shopId_code": "KL01",
            "MAIN_outQty": "20.00",
            "REQ_A_shopId": "1",
            "M18ReservedCol_dataIndex": 1,
            "REQT_A_locId_code": "KLSW01",
            "REQT_A_qty": "100.0000",
            "REQ_A_tDate": "2020 Jul 03",
            "MAIN_reqQty": "100.00",
            "REQ_A_code": "202352SSR",
            "REQT_A_locId": "16",
            "REQ_A_id": "6",
            "REQT_A_proId_code": "0101",
            "REQT_A_proId": "72",
            "MAIN_sentQty": "80.00"
        }
    ]
}

ebi1

# Load EBI data:POS Stock Transfer Difference Report

# 一、Description

​ Usage: Run EBI[POS Stock Transfer Difference 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": [
        {
            "MAIN_tranType": "poscoreShopStkReturn",
            "GITS_A_id": "61",
            "MAIN_orderId": "3",
            "M18ReservedCol_dataIndex": 1,
            "MAIN_diffQty": "2.0000",
            "LOC_A_id": "16",
            "MAIN_tDate": "2020 Jan 06",
            "PRO_A_id": "71",
            "HT1_A_beId": "0",
            "DLOC_A_code": "",
            "GITS_A_code": "GITS",
            "MAIN_aQty": "3.0000",
            "LOC_A_code": "KLSW01",
            "MAIN_dQty": "5.0000",
            "HT1_A_beId_code": "",
            "MAIN_tranTypeMess": "Shop Stock Return",
            "PRO_A_code": "0100",
            "DLOC_A_id": "0",
            "MAIN_code": "231122SSRET"
        }
    ]
}

ebi1

# POS Delivery Note

# Fetch POS Delivery Note List

# 一、Description

​ Usage: Fetch POS 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 poscoreDeliveryNote
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=poscoreDeliveryNote&beId=11";

		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": "poscoreDeliveryNote",
    "size": 1,
    "stSearchDisplay": "POS Delivery Note",
    "values": [
        {
            "poscoreDeliveryNote.memId.poscoreMember.displayName__lang": "Default Member",
            "poscoreDeliveryNote.lastModifyUid.simpleUser.desc": "admin",
            "tDate": "2022-04-07",
            "code": "POSDN22040001",
            "st_id": 317,
            "st_code": "POSDN22040001",
            "poscoreDeliveryNote.memId.poscoreMember.code": "DEFMEMBER",
            "st_desc": "POSDN22040001",
            "poscoreDeliveryNote.curId.cur.sym": "HK$",
            "iRev": 1,
            "id": 317,
            "lastModifyDate": "2022-04-13 17:31:52"
        }
    ]
}

# Load POS Delivery Note

# 一、Description

​ Usage: Load 【POS Delivery Note】Record

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/poscoreDeliveryNote
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 poscoreDeliveryNote
id long(Query) Yes POS 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/poscoreDeliveryNote";
			String param = "&menuCode=poscoreDeliveryNote&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": {
        "poscoredntlot": [
            {
                "lotnoNumAttr17": 0,
                "lotnoNumAttr16": 0,
                "lotnoNumAttr15": 0,
                "lotnoNumAttr14": 0,
                "lotnoNumAttr19": 0,
                "lotnoNumAttr18": 0,
                "lotnoLookupAttr20": 0,
                "lotnoNumAttr13": 0,
                "lotnoNumAttr12": 0,
                "lotnoNumAttr11": 0,
                "lotnoNumAttr10": 0,
                "lotnoLookupAttr16": 0,
                "lotnoLookupAttr17": 0,
                "lotnoLookupAttr14": 0,
                "lotnoLookupAttr15": 0,
                "lotnoLookupAttr18": 0,
                "lotnoLookupAttr19": 0,
                "newLotno": 0,
                "lotnoLot": "A",
                "id": 346,
                "lotnoNumAttr20": 0,
                "lotnoLookupAttr12": 0,
                "lotnoLookupAttr13": 0,
                "lotnoLookupAttr10": 0,
                "lotnoLookupAttr11": 0,
                "iRev": 1,
                "ce01Module": "poscoreDeliveryNote",
                "lotnoDateAttr3": -2209017600000,
                "lotnoDateAttr4": -2209017600000,
                "lotnoDateAttr1": -2209017600000,
                "lotnoDateAttr2": -2209017600000,
                "lotnoDateAttr7": -2209017600000,
                "lotnoDateAttr8": -2209017600000,
                "lotnoDateAttr5": -2209017600000,
                "lotnoDateAttr6": -2209017600000,
                "unitId": 102,
                "lotnoDateAttr9": -2209017600000,
                "locId": 16,
                "lotnoTextAttr1": "",
                "lotnoTextAttr2": "",
                "lotnoTextAttr3": "",
                "lotnoTextAttr4": "",
                "lotnoTextAttr5": "",
                "lotnoTextAttr6": "",
                "lotnoTextAttr7": "",
                "lotnoTextAttr8": "",
                "lotnoTextAttr9": "",
                "dualQty": 0,
                "itemNo": "",
                "hId": 317,
                "lotnoNumAttr1": 0,
                "lotnoNumAttr2": 0,
                "lotnoNumAttr3": 0,
                "lotnoNumAttr4": 0,
                "lotnoExpDate": 1640966400000,
                "footerKey": "     2",
                "qty": 1,
                "lotnoNumAttr5": 0,
                "lotnoNumAttr6": 0,
                "lotnoNumAttr7": 0,
                "lotnoNumAttr8": 0,
                "lotnoNumAttr9": 0,
                "lotNoId": 39,
                "lotnoTextAttr16": "",
                "lotnoTextAttr15": "",
                "lotnoTextAttr18": "",
                "lotnoTextAttr17": "",
                "lotnoTextAttr12": "",
                "lotnoTextAttr11": "",
                "lotnoDateAttr20": -2209017600000,
                "lotnoTextAttr14": "",
                "lotnoTextAttr13": "",
                "lotnoTextAttr19": "",
                "lotnoTextAttr10": "",
                "dualUnitId": 71,
                "lotnoLookupAttr5": 0,
                "lotnoLookupAttr6": 0,
                "lotnoLookupAttr7": 0,
                "lotnoDateAttr18": -2209017600000,
                "lotnoLookupAttr8": 0,
                "lotnoDateAttr19": -2209017600000,
                "lotno": "JCAAOS200102",
                "lotnoLookupAttr9": 0,
                "proId": 71,
                "lotnoDateAttr12": -2209017600000,
                "lotnoDateAttr13": -2209017600000,
                "lotnoDateAttr10": -2209017600000,
                "lotnoDateAttr11": -2209017600000,
                "lotnoTextAttr20": "",
                "lotnoLookupAttr1": 0,
                "lotnoDateAttr16": -2209017600000,
                "lotnoLookupAttr2": 0,
                "lotnoDateAttr17": -2209017600000,
                "lotnoLookupAttr3": 0,
                "lotnoDateAttr14": -2209017600000,
                "lotnoLookupAttr4": 0,
                "lotnoDateAttr15": -2209017600000
            }
        ],
        "poscoredndepo": [
            {
                "curDomDepoAmt": 200,
                "AI1": 0,
                "AI2": 0,
                "itemNo": "     1",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "AI9": 0,
                "id": 223,
                "depositRate": 1,
                "AI30": 0,
                "hId": 317,
                "depositKey": "_0_",
                "srcAIId": 2,
                "refType": "",
                "iRev": 1,
                "AI19": 0,
                "sTranId": 3851,
                "depoAmt": 200,
                "lot": "",
                "AI17": 0,
                "AI18": 0,
                "curId": 1,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "rate": 1,
                "AI14": 0,
                "AI11": 0,
                "AI12": 0,
                "sorId": 0,
                "AI10": 0,
                "domDepoAmt": 200,
                "apply": true,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "sTranType": "pos",
                "domAmtDiff": 0
            }
        ],
        "poscoremaindn": [
            {
                "cpDate": 1649323224000,
                "lastModifyUid": 1,
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "AI1": 0,
                "AI2": 0,
                "sysJson": "{\"autoGenCode\":{\"snId\":684,\"code\":\"POSDN22040001\",\"sn\":\"1\"}}",
                "AI3": 0,
                "AI4": 0,
                "viewCode": "poscoreDeliveryNote",
                "AI5": 0,
                "accDesc": "",
                "accDesc_cth": "",
                "AI6": 0,
                "AI7": 0,
                "eDiscRate": 0,
                "beId": 1,
                "AI8": 0,
                "accDesc_jp": "",
                "AI9": 0,
                "useAccessBl": false,
                "id": 317,
                "AI30": 0,
                "locked": false,
                "lastModifyDate": 1649842312000,
                "accDesc_sxg": "",
                "createUid": 1,
                "rev": "1",
                "lastApproveUid": 1,
                "ttlCharge": 0,
                "expiredUid": 0,
                "accjlId": 44064,
                "accdfsId": 0,
                "i18nField": "{\"accDesc_en\": \"\"}",
                "accDesc_en": "",
                "ttlAmt": 200,
                "status": "Y",
                "tDate": 1649260800000,
                "attachmentNo": 0,
                "code": "POSDN22040001",
                "cnDeptId": 6,
                "jlTypeId": 0,
                "amt": 0,
                "iRev": 1,
                "accDesc_zh-TW": "",
                "AI19": 0,
                "depoAmt": 200,
                "ce01Module": "poscoreDeliveryNote",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "curId": 1,
                "expired": false,
                "AI16": 0,
                "stkjlId": 0,
                "AI13": 0,
                "AI14": 0,
                "rate": 1,
                "domAmt": 0,
                "AI11": 0,
                "AI12": 0,
                "printCount": 0,
                "AI10": 0,
                "statusModifyDate": 1649842312000,
                "domDepoAmt": 200,
                "accDesc_hy": "",
                "locId": 16,
                "createDate": 1649842312000,
                "accDesc_zh-CN": "",
                "ttlPaidAmt": 0,
                "loadGpCoData": false,
                "useAccessWl": false,
                "isEShop": false,
                "AI28": 0,
                "accdfId": 255,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "ttlDisc": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "useAccessAutoCalc": false,
                "staffId": 1029,
                "memId": 2,
                "domAmtDiff": 0
            }
        ],
        "poscorednt": [
            {
                "sourceId": 3851,
                "refTranType": "",
                "dDesc_hy": "",
                "poscoreDesc_jp": "",
                "dualQty": 0,
                "AI1": 0,
                "AI2": 0,
                "bDesc_hy": "",
                "itemNo": "     1",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "AI9": 0,
                "bDesc": "Vitamin A (BD)",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 445,
                "AI30": 0,
                "shopId": 1,
                "up": 200,
                "poscoreDesc_sxg": "",
                "hId": 317,
                "dDesc": "",
                "footerKey": "     2",
                "i18nField": "{\"bDesc_en\": \"Vitamin A (BD)\", \"dDesc_en\": \"\", \"remarks_en\": \"\", \"discDesc_en\": \"\", \"posProDesc_en\": \"維他命A\", \"poscoreDesc_en\": \"\"}",
                "sourceType": "pos",
                "qty": 1,
                "disc": 0,
                "lotNoId": 0,
                "bDesc_sxg": "",
                "bDesc_jp": "",
                "dDesc_sxg": "",
                "costAmt": 58.56154166,
                "amt": 200,
                "dDesc_jp": "",
                "iRev": 1,
                "dDesc_zh-CN": "",
                "AI19": 0,
                "refTranId": 0,
                "poscoreDesc_zh-CN": "",
                "poscoreDesc_hy": "",
                "ce01Module": "poscoreDeliveryNote",
                "lot": "A",
                "AI17": 0,
                "dDesc_cth": "",
                "AI18": 0,
                "AI15": 0,
                "AI16": 0,
                "dDesc_zh-TW": "",
                "AI13": 0,
                "domAmt": 200,
                "AI14": 0,
                "AI11": 0,
                "AI12": 0,
                "unitId": 102,
                "AI10": 0,
                "locId": 16,
                "bDesc_cth": "",
                "poscoreDesc": "",
                "bDesc_en": "Vitamin A (BD)",
                "poscoreDesc_en": "",
                "poscoreDesc_zh-TW": "",
                "dDesc_en": "",
                "poscoreDesc_cth": "",
                "discAmt": 0,
                "dualUnitId": 71,
                "AI28": 0,
                "AI29": 0,
                "sourceLot": "A",
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "proId": 71,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "bDesc_zh-CN": ""
            }
        ],
        "poscoreremdn": [
            {
                "shipTime": "00:00",
                "remarks_en": "<div><font color=\"#434a54\"><span style=\"font-size: 13px;\">1. COZLHP00013 : do not user red rose, use pink one</span></font></div><div><font color=\"#434a54\"><span style=\"font-size: 13px;\">2. osjhudoi'jsodf&nbsp;</span></font></div><div><font color=\"#434a54\"><span style=\"font-size: 13px;\">3. 0u9psjiohud9f<span style=\"white-space:pre\">\t</span></span></font></div>",
                "shipAd2_zh-TW": "",
                "shipAd1_en": "Mong Kok",
                "mobileCountry": "852",
                "shipAd2_jp": "",
                "shipGpsLat": 0,
                "tel": "",
                "id": 317,
                "remarks_zh-TW": "",
                "shipAd1_zh-CN": "",
                "shipMan": "Mr. Wong",
                "shipAd4_hy": "",
                "hId": 317,
                "shipAd4_cth": "",
                "shipMan_zh-CN": "",
                "shipDate": 1651248000000,
                "shipZipcode": "",
                "remarks_cth": "",
                "remarks_hy": "",
                "shipAd2_en": "",
                "shipAd4_sxg": "",
                "remarks_sxg": "",
                "i18nField": "{\"pickMan_en\": \"\", \"remarks_en\": \"<div><font color=\\\"#434a54\\\"><span style=\\\"font-size: 13px;\\\">1. COZLHP00013 : do not user red rose, use pink one</span></font></div><div><font color=\\\"#434a54\\\"><span style=\\\"font-size: 13px;\\\">2. osjhudoi'jsodf&nbsp;</span></font></div><div><font color=\\\"#434a54\\\"><span style=\\\"font-size: 13px;\\\">3. 0u9psjiohud9f<span style=\\\"white-space:pre\\\">\\t</span></span></font></div>\", \"shipAd1_en\": \"Mong Kok\", \"shipAd2_en\": \"\", \"shipAd3_en\": \"\", \"shipAd4_en\": \"\", \"shipMan_en\": \"Mr. Wong\", \"pickRemarks_en\": \"\", \"shipRemarks_en\": \"<div><font color=\\\"#434a54\\\"><span style=\\\"font-size: 13px;\\\">1. COZLHP00013 : do not user red rose, use pink one</span></font></div><div><font color=\\\"#434a54\\\"><span style=\\\"font-size: 13px;\\\">2. osjhudoi'jsodf&nbsp;</span></font></div><div><font color=\\\"#434a54\\\"><span style=\\\"font-size: 13px;\\\">3. 0u9psjiohud9f<span style=\\\"white-space:pre\\\">\\t</span></span></font></div>\", \"extendReason_en\": \"\"}",
                "shipAd3_jp": "",
                "remarks_zh-CN": "",
                "shipAd1_hy": "",
                "shipAd3_zh-TW": "",
                "shipMan_hy": "",
                "shipAd2_cth": "",
                "shipMan_en": "Mr. Wong",
                "shipProvince": "",
                "shipMan_sxg": "",
                "iRev": 1,
                "shipAd1_cth": "",
                "shipAd3_sxg": "",
                "shipAd4_zh-TW": "",
                "shipCountry": "",
                "ce01Module": "poscoreDeliveryNote",
                "shipMan_zh-TW": "",
                "shipAd3_cth": "",
                "shipAd3_en": "",
                "shipAd3_zh-CN": "",
                "shipAd4_zh-CN": "",
                "shipAd1_sxg": "",
                "shipAd4_jp": "",
                "shipAd2_sxg": "",
                "shipAd2_hy": "",
                "shipId": 0,
                "remarks_jp": "",
                "shipCity": "",
                "mobile": "97452614",
                "shipMan_jp": "",
                "telCountry": "",
                "shipAd1": "Mong Kok",
                "shipAd2": "",
                "shipGpsLong": 0,
                "shipAd3": "",
                "shipAd4": "",
                "telArea": "",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "",
                "shipAd1_jp": "",
                "shipAd2_zh-CN": "",
                "shipAd3_hy": "",
                "remarks": "<div><font color=\"#434a54\"><span style=\"font-size: 13px;\">1. COZLHP00013 : do not user red rose, use pink one</span></font></div><div><font color=\"#434a54\"><span style=\"font-size: 13px;\">2. osjhudoi'jsodf&nbsp;</span></font></div><div><font color=\"#434a54\"><span style=\"font-size: 13px;\">3. 0u9psjiohud9f<span style=\"white-space:pre\">\t</span></span></font></div>",
                "shipMan_cth": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create POS Delivery Note

# 一、Description

​ Usage: create or update 【POS Delivery Note】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/poscoreDeliveryNote
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 poscoreDeliveryNote
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/poscoreDeliveryNote";
		String param = "&menuCode=poscoreDeliveryNote";

		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:

{
    "poscoremaindn": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "curId": 1,
                "virDeptId": 17,
                "rate": 1,
                "amt": 20,
                "shopId": 2,
                "staffId": 823,
                "locId": 16,
                "memId": 3
            }
        ]
    },
    "poscorednt": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 6334,
                "qty": 1,
                "unitId": 7034,
                "amt": 20,
                "up": 20,
                "locId": 16
            }
        ]
    }
}

​ 4、Response Sample

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

# Create POS Delivery Note (Auto Completion)

# 一、Description

​ 1. Usage: Create 【POS 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)]

​ ​ 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/poscoreDeliveryNote
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/poscoreDeliveryNote";

		HttpPost post = new HttpPost(url);
		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

{
    "memCode": "LH0001",
    "staffCode": "0001",
    "locCode": "KLSW01",
    "rate": 1,
    "amt": 20,
    "beCode": "JC-AA",
    "poscorednt": [
        {
            "locCode": "KLSW01",
            "proCode": "P20220324",
            "sourceType": "pro",
            "unitCode": "PCS",
            "qty": 1,
            "amt": 20,
            "up": 20
        }
    ],
    "virDeptCode": "1010",
    "curCode": "HKD"
}

​ 4、Response Sample

{
    "tranId": 10,
    "tranCode": "SSR22040002",
    "message": "",
    "status": true
}

# Delete POS Delivery Note

# 一、Description

​ Usage: Delete POS Delivery Note

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/poscoreDeliveryNote
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 poscoreDeliveryNote
id long(Query) Yes POS 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/delete/poscoreDeliveryNote";
		String param = "&menuCode=poscoreDeliveryNote&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:POS Delivery Note List

# 一、Description

​ Usage: Run EBI[POS Delivery Note List],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": [
        {
            "DN_A_depoAmt": "0.00",
            "MEM_A_id": "3",
            "M18ReservedCol_dataIndex": 1,
            "DN_A_rate": "1.00000000",
            "DN_A_ttlAmt": "2,500.00",
            "DN_A_amt": "2,500.00",
            "DN_A_ttlPaidAmt": "0.00",
            "DN_A_beId_code": "JC-AA",
            "STAFF_A_id": "1",
            "DN_A_curId_desc__lang": "HK$",
            "DN_A_code": "232036POSDN",
            "DN_A_tDate": "2020 Jan 26",
            "MEM_A_code": "LH0001",
            "DN_A_id": "143",
            "STAFF_A_code": "A-02",
            "DN_A_beId": "1"
        }
    ]
}

ebi1

# Load EBI data:POS Delivery Note Report

# 一、Description

​ Usage: Run EBI[POS Delivery 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": [
        {
            "POS_A_shopId_code": "",
            "MEM_A_id": "3",
            "DNT_A_amt": "2,500.00",
            "M18ReservedCol_dataIndex": 1,
            "DNT_A_up": "2,500.0000",
            "DN_A_beId_code": "JC-AA",
            "POS_A_shopId": "0",
            "DN_A_code": "232036POSDN",
            "PRO_A_id": "5395",
            "DN_A_tDate": "2020 Jan 26",
            "MEM_A_code": "LH0001",
            "DNT_A_qty": "1.0000",
            "DN_A_id": "143",
            "DN_A_beId": "1",
            "PRO_A_code": "P20210827"
        }
    ]
}

ebi1