Master Data
# Customer
# Fetch Customer List
# 一、Description
Usage: Fetch Customer 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 aiM18 |
stSearch | String(Query) | Yes | cus |
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=cus&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": "cus",
"size": 1,
"stSearchDisplay": "Customer",
"values": [
{
"code": "5058",
"st_id": 142,
"st_code": "5058",
"desc__lang": "Wong Tin Yan",
"st_desc": "Wong Tin Yan (5058)",
"tel": "",
"iRev": 2,
"id": 142,
"cus.lastModifyUid.simpleUser.desc": "admin",
"lastModifyDate": "2021-01-27 16:02:03"
}
]
}
# Load Customer
# 一、Description
Usage: Load 【Customer】Record
# 二、API Detail
1、Request URL
URL | http://[server]/jsf/rfws/root/api/read/cus |
---|---|
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 aiM18 |
menuCode | String(Query) | Yes | cus |
id | long(Query) | Yes | Customer 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/cus";
String param = "&menuCode=cus&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": {
"cus": [
{
"useAccess": false,
"ad1_en": "Block C, 18/F., 12 Sai Ning Street",
"ad1_cth": "",
"expiredDate": -2209017600000,
"ad2_jp": "",
"sysJson": "",
"viewCode": "cus",
"taxBank": "",
"ad3_cth": "",
"ad4_en": "",
"useAccessBl": false,
"udffile": 0,
"tel": "28197865",
"id": 2,
"fax": "",
"ad2_sxg": "",
"lastModifyDate": 1599463883000,
"createUid": 1,
"ad3_zh-CN": "",
"cDate": -2209017600000,
"udfATupdateAccess": false,
"i18nField": "{\"ad1_en\": \"Block C, 18/F., 12 Sai Ning Street\", \"ad2_en\": \"Kennedy Town, Hong Kong\", \"ad3_en\": \"\", \"ad4_en\": \"\", \"desc_en\": \"Tai Hong Trading Co. Ltd. (For Training Purpose)\", \"desc_jp\": \"Tai Hong Trading Co. Ltd. (For Training Purpose)\", \"ad1_zh-CN\": \"Block C, 18/F., 12 Sai Ning Street\", \"ad2_zh-CN\": \"Kennedy Town, Hong Kong\", \"ad3_zh-CN\": \"\", \"ad4_zh-CN\": \"\", \"desc_zh-CN\": \"Tai Hong Trading Co. Ltd. (For Training Purpose)\"}",
"groupCo": false,
"ad3_zh-TW": "",
"ad4_sxg": "",
"status": "Y",
"vatReg": false,
"udfsign": "",
"ad2_zh-CN": "Kennedy Town, Hong Kong",
"iRev": 4,
"udf001": "",
"webSite": "",
"udfATAT3": 0,
"groupCoId": 0,
"udfATAT4": 0,
"udfATAT1": 0,
"udfATAT2": 0,
"udfATAT5": 0,
"taxAddress": "",
"statusModifyDate": 1582605552000,
"desc_sxg": "",
"email": "bettylau@cuscontact.com",
"createDate": 1582605552000,
"ad3_hy": "",
"taxCusName": "",
"ad2_en": "Kennedy Town, Hong Kong",
"ad3_jp": "",
"priceTypeId": 0,
"udf1": "",
"ad2_zh-TW": "",
"useAccessWl": false,
"ad2": "Kennedy Town, Hong Kong",
"telCountry": "852",
"ad1": "Block C, 18/F., 12 Sai Ning Street",
"ad4": "",
"ad3": "",
"useAccessAutoCalc": false,
"desc_jp": "Tai Hong Trading Co. Ltd. (For Training Purpose)",
"lastModifyUid": 1,
"vatRate": 0,
"ad1_zh-TW": "",
"ad2_cth": "",
"eshopcusId": 0,
"ad3_sxg": "",
"beId": 3,
"udfnumber": 0,
"ad1_sxg": "",
"udfindustry": "",
"udfCustAbbr": "",
"locked": false,
"ad1_hy": "",
"shortCode": "",
"ad4_zh-TW": "",
"ad1_zh-CN": "Block C, 18/F., 12 Sai Ning Street",
"ad4_cth": "",
"lastApproveUid": 1,
"udfATJEIEN011": 0,
"ad1_jp": "",
"expiredUid": 0,
"whatsappNo": "",
"faxArea": "",
"desc_hy": "",
"faxCountry": "",
"desc_zh-TW": "",
"ad4_zh-CN": "",
"desc": "Tai Hong Trading Co. Ltd. (For Training Purpose)",
"ad4_hy": "",
"attachmentNo": 0,
"code": "C002",
"taxCodeNo": "",
"ad3_en": "",
"desc_cth": "",
"udf210728": "",
"expired": false,
"ecomMemberId": 0,
"printCount": 0,
"desc_en": "Tai Hong Trading Co. Ltd. (For Training Purpose)",
"desc_zh-CN": "Tai Hong Trading Co. Ltd. (For Training Purpose)",
"gstRegNo": "",
"blackListed": false,
"taxTel": "",
"ad4_jp": "",
"telArea": "",
"regionId": 1,
"udfATattSetId": 0,
"staffId": 0,
"ad2_hy": ""
}
],
"cusstatement": [
{
"ending": 0,
"hId": 2,
"iRev": 4,
"id": 6,
"itemNo": " 1",
"state": "",
"starting": 0
},
{
"ending": 30,
"hId": 2,
"iRev": 4,
"id": 7,
"itemNo": " 2",
"state": "",
"starting": 0
},
{
"ending": 60,
"hId": 2,
"iRev": 4,
"id": 8,
"itemNo": " 3",
"state": "",
"starting": 31
},
{
"ending": 90,
"hId": 2,
"iRev": 4,
"id": 9,
"itemNo": " 4",
"state": "",
"starting": 61
},
{
"ending": 90,
"hId": 2,
"iRev": 4,
"id": 10,
"itemNo": " 5",
"state": "",
"starting": 90
}
],
"cusacc": [
{
"hpSetting": "dayAfterInv",
"hId": 2,
"method": "monthly",
"ePostCl": 30000,
"installNo": 0,
"slmId": 0,
"monthlyOption": 1,
"monthlyEnd": 0,
"iRev": 4,
"calcDate": 1,
"cp": 14,
"stateLevel": "",
"aInvMonth": 0,
"curId": 1,
"dayOfMonth": 0,
"iPostCl": 30000,
"id": 2,
"ptOption": 2,
"maxcp": 7,
"periodNo": 5,
"interBeId": 0
}
],
"cusship": [
{
"country": "",
"itemNo": " 1",
"shipAd2_zh-TW": "",
"shipAd1_en": "12/F., Wing On Mansion",
"province": "",
"recipient_cth": "",
"shipAd2_jp": "",
"recipient_sxg": "",
"tel": "31079253",
"id": 3,
"fax": "",
"shipAd1_zh-CN": "12/F., Wing On Mansion",
"shipAd4_hy": "",
"hId": 2,
"shipAd4_cth": "",
"recipient_hy": "",
"zipcode": "",
"shipAd2_en": "188 Hennessy Road",
"shipAd4_sxg": "",
"i18nField": "{\"shipAd1_en\": \"12/F., Wing On Mansion\", \"shipAd2_en\": \"188 Hennessy Road\", \"shipAd3_en\": \"Wanchai, Hong Kong\", \"shipAd4_en\": \"\", \"recipient_en\": \"\", \"shipAd1_zh-CN\": \"12/F., Wing On Mansion\", \"shipAd2_zh-CN\": \"188 Hennessy Road\", \"shipAd3_zh-CN\": \"Wanchai, Hong Kong\", \"shipAd4_zh-CN\": \"\", \"recipient_zh-CN\": \"\"}",
"shipAd3_jp": "",
"gpsLat": 0,
"shipAd1_hy": "",
"shipAd3_zh-TW": "",
"city": "",
"shipAd2_cth": "",
"recipient_zh-CN": "",
"iRev": 4,
"shipAd1_cth": "",
"shipAd3_sxg": "",
"shipAd4_zh-TW": "",
"shipAd3_cth": "",
"shipAd3_en": "Wanchai, Hong Kong",
"recipient_en": "",
"default": true,
"expired": false,
"shipAd3_zh-CN": "Wanchai, Hong Kong",
"shipAd4_zh-CN": "",
"shipAd1_sxg": "",
"shipAd4_jp": "",
"shipAd2_sxg": "",
"shipAd2_hy": "",
"email": "",
"recipient_zh-TW": "",
"telCountry": "852",
"shipCode": "C002A",
"shipAd1": "12/F., Wing On Mansion",
"recipient_jp": "",
"shipAd2": "188 Hennessy Road",
"shipAd3": "Wanchai, Hong Kong",
"shipAd4": "",
"telArea": "",
"shipAd1_zh-TW": "",
"shipAd4_en": "",
"shipAd1_jp": "",
"recipient": "",
"shipAd2_zh-CN": "188 Hennessy Road",
"shipAd3_hy": "",
"udfdregion": 0,
"staffId": 0,
"gpsLong": 0
},
{
"country": "",
"itemNo": " 2",
"shipAd2_zh-TW": "",
"shipAd1_en": "G/F., No. 1, Good Luk Mansion",
"province": "",
"recipient_cth": "",
"shipAd2_jp": "",
"recipient_sxg": "",
"tel": "24753411",
"id": 4,
"fax": "24756466",
"shipAd1_zh-CN": "G/F., No. 1, Good Luk Mansion",
"shipAd4_hy": "",
"hId": 2,
"shipAd4_cth": "",
"recipient_hy": "",
"zipcode": "",
"shipAd2_en": "101-121 Kau Yuk Road, Yuen Long",
"shipAd4_sxg": "",
"i18nField": "{\"shipAd1_en\": \"G/F., No. 1, Good Luk Mansion\", \"shipAd2_en\": \"101-121 Kau Yuk Road, Yuen Long\", \"shipAd3_en\": \"N.T.\", \"shipAd4_en\": \"\", \"recipient_en\": \"\", \"shipAd1_zh-CN\": \"G/F., No. 1, Good Luk Mansion\", \"shipAd2_zh-CN\": \"101-121 Kau Yuk Road, Yuen Long\", \"shipAd3_zh-CN\": \"N.T.\", \"shipAd4_zh-CN\": \"\", \"recipient_zh-CN\": \"\"}",
"shipAd3_jp": "",
"gpsLat": 0,
"shipAd1_hy": "",
"shipAd3_zh-TW": "",
"city": "",
"shipAd2_cth": "",
"recipient_zh-CN": "",
"iRev": 4,
"shipAd1_cth": "",
"shipAd3_sxg": "",
"shipAd4_zh-TW": "",
"shipAd3_cth": "",
"shipAd3_en": "N.T.",
"recipient_en": "",
"default": false,
"expired": false,
"shipAd3_zh-CN": "N.T.",
"shipAd4_zh-CN": "",
"shipAd1_sxg": "",
"shipAd4_jp": "",
"shipAd2_sxg": "",
"shipAd2_hy": "",
"email": "",
"recipient_zh-TW": "",
"telCountry": "852",
"shipCode": "C002B",
"shipAd1": "G/F., No. 1, Good Luk Mansion",
"recipient_jp": "",
"shipAd2": "101-121 Kau Yuk Road, Yuen Long",
"shipAd3": "N.T.",
"shipAd4": "",
"telArea": "",
"shipAd1_zh-TW": "",
"shipAd4_en": "",
"shipAd1_jp": "",
"recipient": "",
"shipAd2_zh-CN": "101-121 Kau Yuk Road, Yuen Long",
"shipAd3_hy": "",
"udfdregion": 0,
"staffId": 0,
"gpsLong": 0
},
{
"country": "",
"itemNo": " 3",
"shipAd2_zh-TW": "",
"shipAd1_en": "12/F., Sun Pak Ho Building",
"province": "",
"recipient_cth": "",
"shipAd2_jp": "",
"recipient_sxg": "",
"tel": "24161989",
"id": 5,
"fax": "",
"shipAd1_zh-CN": "12/F., Sun Pak Ho Building",
"shipAd4_hy": "",
"hId": 2,
"shipAd4_cth": "",
"recipient_hy": "",
"zipcode": "",
"shipAd2_en": "176-180 Apliu Street",
"shipAd4_sxg": "",
"i18nField": "{\"shipAd1_en\": \"12/F., Sun Pak Ho Building\", \"shipAd2_en\": \"176-180 Apliu Street\", \"shipAd3_en\": \"Sham Shui Po, Kowloon\", \"shipAd4_en\": \"\", \"recipient_en\": \"\", \"shipAd1_zh-CN\": \"12/F., Sun Pak Ho Building\", \"shipAd2_zh-CN\": \"176-180 Apliu Street\", \"shipAd3_zh-CN\": \"Sham Shui Po, Kowloon\", \"shipAd4_zh-CN\": \"\", \"recipient_zh-CN\": \"\"}",
"shipAd3_jp": "",
"gpsLat": 0,
"shipAd1_hy": "",
"shipAd3_zh-TW": "",
"city": "",
"shipAd2_cth": "",
"recipient_zh-CN": "",
"iRev": 4,
"shipAd1_cth": "",
"shipAd3_sxg": "",
"shipAd4_zh-TW": "",
"shipAd3_cth": "",
"shipAd3_en": "Sham Shui Po, Kowloon",
"recipient_en": "",
"default": false,
"expired": false,
"shipAd3_zh-CN": "Sham Shui Po, Kowloon",
"shipAd4_zh-CN": "",
"shipAd1_sxg": "",
"shipAd4_jp": "",
"shipAd2_sxg": "",
"shipAd2_hy": "",
"email": "",
"recipient_zh-TW": "",
"telCountry": "852",
"shipCode": "C002C",
"shipAd1": "12/F., Sun Pak Ho Building",
"recipient_jp": "",
"shipAd2": "176-180 Apliu Street",
"shipAd3": "Sham Shui Po, Kowloon",
"shipAd4": "",
"telArea": "",
"shipAd1_zh-TW": "",
"shipAd4_en": "",
"shipAd1_jp": "",
"recipient": "",
"shipAd2_zh-CN": "176-180 Apliu Street",
"shipAd3_hy": "",
"udfdregion": 0,
"staffId": 0,
"gpsLong": 0
}
],
"remcus": [
{
"shipMark_hy": "",
"tradeTerm_en": "",
"shipMark": "",
"shipMark_zh-CN": "",
"tradeTerm_zh-CN": "",
"payTerm_en": "14 Days",
"iRev": 4,
"packing": "",
"tradeTerm": "",
"packing_zh-TW": "",
"payTerm_zh-TW": "",
"shipMark_cth": "",
"packing_jp": "",
"shipMark_en": "",
"shipMark_sxg": "",
"tradeTerm_hy": "",
"id": 2,
"payTerm_hy": "",
"hId": 2,
"bNature": "",
"payTerm": "14 Days",
"packing_zh-CN": "",
"payTerm_cth": "",
"tradeTerm_sxg": "",
"payTerm_jp": "",
"tradeTerm_zh-TW": "",
"packing_hy": "",
"tradeTerm_jp": "",
"packing_cth": "",
"i18nField": "{\"packing_en\": \"\", \"payTerm_en\": \"14 Days\", \"shipMark_en\": \"\", \"tradeTerm_en\": \"\", \"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"14 Days\", \"shipMark_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\"}",
"packing_en": "",
"tradeTerm_cth": "",
"shipMark_jp": "",
"smthId": 0,
"payTerm_zh-CN": "14 Days",
"shipMark_zh-TW": "",
"packing_sxg": "",
"payTerm_sxg": ""
}
],
"cust": [
{
"position_sxg": "",
"man_jp": "",
"code": "001",
"iRev": 4,
"position_zh-CN": "Manager",
"itemNo": " 1",
"position_cth": "",
"ce01Module": "cus",
"default": true,
"position_jp": "",
"expired": false,
"cordchat": "",
"tel": "28197865",
"id": 3,
"man": "Benny Lau",
"fax": "",
"man_hy": "",
"email": "bettylau@cuscontact.com",
"hId": 2,
"man_zh-CN": "Benny Lau",
"man_en": "Benny Lau",
"position_hy": "",
"whatsappNo": "",
"telCountry": "852",
"faxArea": "",
"position_en": "Manager",
"position_zh-TW": "",
"i18nField": "{\"man_en\": \"Benny Lau\", \"man_zh-CN\": \"Benny Lau\", \"position_en\": \"Manager\", \"position_zh-CN\": \"Manager\"}",
"telArea": "",
"man_sxg": "",
"faxCountry": "",
"man_cth": "",
"position": "Manager",
"man_zh-TW": ""
},
{
"position_sxg": "",
"man_jp": "",
"code": "002",
"iRev": 4,
"position_zh-CN": "Assistant",
"itemNo": " 2",
"position_cth": "",
"ce01Module": "cus",
"default": false,
"position_jp": "",
"expired": false,
"cordchat": "",
"tel": "28197868",
"id": 4,
"man": "Jade Wong",
"fax": "",
"man_hy": "",
"email": "jadewong@cuscontact.com",
"hId": 2,
"man_zh-CN": "Jade Wong",
"man_en": "Jade Wong",
"position_hy": "",
"whatsappNo": "",
"telCountry": "852",
"faxArea": "",
"position_en": "Assistant",
"position_zh-TW": "",
"i18nField": "{\"man_en\": \"Jade Wong\", \"man_zh-CN\": \"Jade Wong\", \"position_en\": \"Assistant\", \"position_zh-CN\": \"Assistant\"}",
"telArea": "",
"man_sxg": "",
"faxCountry": "",
"man_cth": "",
"position": "Assistant",
"man_zh-TW": ""
}
]
},
"messages": [],
"status": true
}
# Create Customer
# 一、Description
Usage: create or update 【Customer】
# 二、API Detail
1、Request URL
URL | http://[server]/jsf/rfws/root/api/save/cus |
---|---|
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 aiM18 |
menuCode | String(Query) | Yes | cus |
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/cus";
String param = "&menuCode=cus";
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:
{
"cus": {
"values": [
{
"beId": 80,
"cDate": "20220401",
"regionId": 79,
"desc": "20220401"
}
]
},
"cusacc": {
"values": [
{
"curId": 1
}
]
}
}
4、Response Sample
{
"recordId": 1784,
"messages": [],
"status": true
}
{
"recordId": 0,
"messages": [
{
"msgDetail": "Required field is empty",
"msgCode": "core_101905"
}
],
"status": false
}
# Delete Customer
# 一、Description
Usage: Delete Customer
# 二、API Detail
1、Request URL
URL | http://[server]/jsf/rfws/root/api/delete/cus |
---|---|
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 aiM18 |
menuCode | String(Query) | Yes | cus |
id | long(Query) | Yes | Customer 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:Customer List
# 一、Description
Usage: Run EBI[Customer 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 aiM18 |
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_code": "CUS",
"MAIN_A_id": "278",
"M18ReservedCol_dataIndex": 1,
"MAIN_A_email": "",
"MAIN_A_tel": "",
"MAIN_A_fax": "",
"MAIN_A_ad1": "",
"MAIN_A_webSite": "",
"MAIN_A_desc__lang": "",
"MAIN_A_ad2": "",
"MAIN_A_ad3": "",
"MAIN_A_ad4": ""
}
]
}
# Vendor
# Fetch Vendor List
# 一、Description
Usage: Fetch Vendor 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 aiM18 |
stSearch | String(Query) | Yes | ven |
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=ven&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": "ven",
"size": 1,
"stSearchDisplay": "Vendor",
"values": [
{
"code": "EMM",
"st_id": 93,
"st_code": "EMM",
"desc__lang": "Eternity Music Ministry",
"st_desc": "Eternity Music Ministry (EMM)",
"tel": "",
"iRev": 1,
"ven.lastModifyUid.simpleUser.desc": "admin",
"id": 93,
"lastModifyDate": "2020-09-29 13:28:53"
}
]
}
# Load Vendor
# 一、Description
Usage: Load 【Vendor】Record
# 二、API Detail
1、Request URL
URL | http://[server]/jsf/rfws/root/api/read/ven |
---|---|
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 aiM18 |
menuCode | String(Query) | Yes | ven |
id | long(Query) | Yes | Vendor 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/ven";
String param = "&menuCode=ven&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": {
"venacc": [
{
"hpSetting": "dayAfterInv",
"hId": 93,
"method": "cod",
"ePostCl": 0,
"installNo": 0,
"slmId": 0,
"monthlyOption": 1,
"monthlyEnd": 0,
"iRev": 1,
"maxPOAmt": 0,
"cp": 0,
"stateLevel": "",
"aInvMonth": 0,
"curId": 1,
"dayOfMonth": 1,
"iPostCl": 0,
"id": 93,
"maxcp": 0,
"periodNo": 5,
"interBeId": 0
}
],
"ven": [
{
"defVatPer": 0,
"lastModifyUid": 1,
"useAccess": false,
"ad1_en": "",
"ad1_cth": "",
"expiredDate": -2209017600000,
"ad1_zh-TW": "",
"ad2_jp": "",
"ad2_cth": "",
"sysJson": "",
"udfDefaultAP": 0,
"viewCode": "ven",
"ad3_sxg": "",
"beId": 80,
"ad1_sxg": "",
"ad3_cth": "",
"ad4_en": "",
"useAccessBl": false,
"tel": "",
"id": 93,
"locked": false,
"fax": "",
"ad1_hy": "",
"ad2_sxg": "",
"lastModifyDate": 1601357333000,
"createUid": 1,
"ad3_zh-CN": "",
"ad4_zh-TW": "",
"ad1_zh-CN": "",
"cDate": 1577808000000,
"ad4_cth": "",
"lastApproveUid": 1,
"udfATJEIEN011": 0,
"udfATupdateAccess": false,
"ad1_jp": "",
"expiredUid": 0,
"whatsappNo": "",
"faxArea": "",
"i18nField": "{\"ad1_en\": \"\", \"ad2_en\": \"\", \"ad3_en\": \"\", \"ad4_en\": \"\", \"desc_en\": \"Eternity Music Ministry\", \"desc_jp\": \"\", \"desc_zh-CN\": \"\"}",
"desc_hy": "",
"groupCo": false,
"faxCountry": "",
"desc_zh-TW": "",
"ad3_zh-TW": "",
"ad4_zh-CN": "",
"ad4_sxg": "",
"status": "Y",
"desc": "Eternity Music Ministry",
"ad4_hy": "",
"attachmentNo": 0,
"code": "EMM",
"vatReg": false,
"ad2_zh-CN": "",
"ad3_en": "",
"iRev": 1,
"desc_cth": "",
"webSite": "",
"udfATVENGP1": 0,
"expired": false,
"groupCoId": 0,
"printCount": 0,
"statusModifyDate": 1601357333000,
"desc_en": "Eternity Music Ministry",
"desc_sxg": "",
"email": "",
"createDate": 1601357333000,
"desc_zh-CN": "",
"ad3_hy": "",
"ad2_en": "",
"ad3_jp": "",
"udf1": "",
"ad2_zh-TW": "",
"useAccessWl": false,
"ad2": "",
"telCountry": "",
"blackListed": false,
"ad1": "",
"ad4": "",
"ad3": "",
"ad4_jp": "",
"telArea": "",
"regionId": 79,
"useAccessAutoCalc": false,
"udfATattSetId": 0,
"staffId": 0,
"ad2_hy": "",
"desc_jp": ""
}
],
"remven": [
{
"tradeTerm_en": "",
"shipMark_hy": "",
"shipMark": "",
"shipMark_zh-CN": "",
"tradeTerm_zh-CN": "",
"payTerm_en": "",
"iRev": 1,
"packing": "",
"tradeTerm": "",
"packing_zh-TW": "",
"payTerm_zh-TW": "",
"shipMark_cth": "",
"packing_jp": "",
"tradeTerm_hy": "",
"shipMark_en": "",
"shipMark_sxg": "",
"id": 93,
"payTerm_hy": "",
"hId": 93,
"bNature": "",
"payTerm": "",
"venScore": 0,
"packing_zh-CN": "",
"payTerm_cth": "",
"tradeTerm_sxg": "",
"payTerm_jp": "",
"tradeTerm_zh-TW": "",
"packing_hy": "",
"tradeTerm_jp": "",
"packing_cth": "",
"i18nField": "{\"packing_en\": \"\", \"payTerm_en\": \"\", \"shipMark_en\": \"\", \"tradeTerm_en\": \"\"}",
"packing_en": "",
"tradeTerm_cth": "",
"shipMark_jp": "",
"smthId": 0,
"payTerm_zh-CN": "",
"shipMark_zh-TW": "",
"packing_sxg": "",
"payTerm_sxg": ""
}
]
},
"messages": [],
"status": true
}
# Create Vendor
# 一、Description
Usage: create or update 【Vendor】
# 二、API Detail
1、Request URL
URL | http://[server]/jsf/rfws/root/api/save/ven |
---|---|
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 aiM18 |
menuCode | String(Query) | Yes | ven |
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/ven";
String param = "&menuCode=ven";
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:
{
"venacc": {
"values": [
{
"curId": 1
}
]
},
"ven": {
"values": [
{
"beId": 80,
"regionId": 79,
"desc": "20220401"
}
]
}
}
4、Response Sample
{
"recordId": 1698,
"messages": [],
"status": true
}
{
"recordId": 0,
"messages": [
{
"msgDetail": "Required field is empty",
"msgCode": "core_101905"
}
],
"status": false
}
# Delete Vendor
# 一、Description
Usage: Delete Vendor
# 二、API Detail
1、Request URL
URL | http://[server]/jsf/rfws/root/api/delete/ven |
---|---|
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 aiM18 |
menuCode | String(Query) | Yes | ven |
id | long(Query) | Yes | Vendor 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/ven";
String param = "&menuCode=ven&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:Vendor List
# 一、Description
Usage: Run EBI[Vendor 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 aiM18 |
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": [
{
"VEN_A_ad2": "",
"VEN_A_ad1": "",
"VEN_A_ad4": "",
"VEN_A_email": "",
"VEN_A_ad3": "",
"M18ReservedCol_dataIndex": 1,
"VEN_A_code": "PB",
"VEN_C_bNature": "",
"VEN_A_tel": "",
"VEN_A_webSite": "",
"VEN_A_fax": "",
"VEN_A_id": "96"
}
]
}
# Product
# Fetch Product List
# 一、Description
Usage: Fetch Product 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 aiM18 |
stSearch | String(Query) | Yes | pro |
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=pro&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": "pro",
"size": 1,
"stSearchDisplay": "Product / Material",
"values": [
{
"code": "A",
"st_id": 5024,
"st_code": "A",
"desc__lang": "",
"st_desc": "A ()",
"pro.lastModifyUid.simpleUser.desc": "admin",
"iRev": 1,
"id": 5024,
"lastModifyDate": "2021-08-17 17:23:07"
}
]
}
# Load Product
# 一、Description
Usage: Load 【Product】Record
# 二、API Detail
1、Request URL
URL | http://[server]/jsf/rfws/root/api/read/pro |
---|---|
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 aiM18 |
menuCode | String(Query) | Yes | pro |
id | long(Query) | Yes | Product 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/pro";
String param = "&menuCode=pro&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": {
"produalunit": [
{
"hId": 5024,
"default": true,
"expired": false,
"ratioN": 1,
"unitId": 287,
"iRev": 1,
"id": 4965,
"itemNo": " 1",
"showRatioD": 1,
"basicUnit": true,
"ratioD": 1,
"showRatioN": 1
}
],
"proco": [
{
"inventoryItem": true,
"maxUcCurId": 1,
"suManHour": 0,
"dualRefRatio": 1,
"minBQty": 0,
"maxAvailDef": "avail_1",
"maxSubFee": 99999999.99999999,
"beId": 80,
"hourSalaryCurId": 0,
"maxUcUnitId": 287,
"sscoRemarks_zh-CN": "",
"autoAssign": false,
"expDay": 0,
"useLotno": false,
"batchQty": 0,
"catchWeightNeed": false,
"maxSubFeeCurId": 1,
"id": 5024,
"unitSalaryUnitId": 0,
"stkMth2": "avg",
"minUpUnitId": 287,
"sscoRemarks": "",
"mpqUnitId": 287,
"kcId": 0,
"hId": 5024,
"setMenu": false,
"mpq": 0,
"subUpCurId": 1,
"venId": 0,
"i18nField": "{\"sscoRemarks_zh-CN\": \"\"}",
"minUp": 0,
"jobLeadTime": 0,
"unitSalary": 0,
"maxUc": 99999999.99999999,
"soleLotno": false,
"skipJob": false,
"maxSubFeeUnitId": 287,
"stkMth": "avg",
"maxAvail": 999999999999.99,
"showInCo": "no",
"suMcHour": 0,
"iRev": 1,
"leadTime": 0,
"rol": 0,
"unitSalaryCurId": 0,
"poqUnitId": 287,
"subUpUnitId": 287,
"poq": 0,
"hourSalary": 0,
"packDeci": 0,
"dualUnitNeed": false,
"showInSsco": "no",
"attrib": "prod",
"sscoRemarks_hy": "",
"sscoRemarks_sxg": "",
"roundType": "notRound",
"locId": 0,
"sscoRemarks_jp": "",
"minUpCurId": 1,
"minBQtyUnitId": 287,
"batchQtyUnitId": 287,
"catchWeightUnit": "dualUnit",
"rolUnitId": 287,
"cateringQuickCode": "",
"sscoRemarks_zh-TW": "",
"sscoRemarks_cth": "",
"subUp": 0,
"maxAvailUnitId": 287,
"expDayUnit": "month",
"priceRefRatio": 1,
"sscoRemarks_en": ""
}
],
"price": [
{
"ctiUc15": 0,
"ctiUc16": 0,
"ucCurId": 1,
"ctiUc13": 0,
"ctiUc14": 0,
"ctiUc19": 0,
"endDate": 253402271999000,
"ctiUc17": 0,
"ctiUc18": 0,
"itemNo": " 1",
"ratioD": 1,
"ctiUc11": 0,
"saleUnit": true,
"ctiUc12": 0,
"uc": 5,
"ctiUc10": 0,
"effDate": -2209017600000,
"id": 5523,
"up": 7,
"showRatioD": 1,
"upCurId": 1,
"hId": 5024,
"stkUnit": true,
"pickUnit": true,
"ctiUc1": 5,
"ctiUc5": 0,
"ctiUc4": 0,
"ctiUc3": 0,
"ctiUc2": 0,
"ctiUc9": 0,
"ctiUc8": 0,
"ctiUc7": 0,
"ctiUc6": 0,
"ratioN": 1,
"udfbarcode": "",
"ctiUc30": 0,
"iRev": 1,
"expired": false,
"unitId": 287,
"ctiUc26": 0,
"ctiUc27": 0,
"ctiUc24": 0,
"ctiUc25": 0,
"ctiUc28": 0,
"retailUnit": true,
"ctiUc29": 0,
"basicUnit": true,
"ctiUc22": 0,
"showRatioN": 1,
"ctiUc23": 0,
"ctiUc20": 0,
"ctiUc21": 0,
"purUnit": true
}
],
"pro": [
{
"expiredDate": -2209017600000,
"tpAttr5Id": 0,
"udffktest31": 0,
"udffktest32": 0,
"udfATPROATTRB": 0,
"udffktest33": 0,
"udfATPROATTRA": 0,
"udffktest34": 0,
"udffktest30": 0,
"syncEnabled": false,
"udfAT1": 0,
"udffktest39": 0,
"udffktest35": 0,
"udfATSUB": 0,
"udffktest36": 0,
"udffktest37": 0,
"udffktest38": 0,
"udfATATT0002": 0,
"lastModifyDate": 1629192187000,
"createUid": 1,
"poscoreDesc_sxg": "",
"taxFree": false,
"udfATupdateAccess": false,
"udffktest20": 0,
"udfATOCOLOR": 0,
"udffktest21": 0,
"udffktest22": 0,
"udffktest23": 0,
"udffktest28": 0,
"udffktest29": 0,
"proName_cth": "",
"afterTaxRetUp": 0,
"udffktest24": 0,
"udfATRWIDTH": 0,
"udffktest25": 0,
"udffktest26": 0,
"udffktest27": 0,
"udffktest6": 0,
"udffktest7": 0,
"udffktest8": 0,
"udffktest9": 0,
"udfATMAIN": 0,
"tpAttr4Id": 0,
"udffktest53": 0,
"udffktest54": 0,
"udffktest55": 0,
"udffktest1": 0,
"udffktest56": 0,
"poscoreExcPromo": false,
"udffktest2": 0,
"cateringDesc_en": "",
"udffktest3": 0,
"udffktest50": 0,
"udffktest4": 0,
"udffktest51": 0,
"udffktest5": 0,
"udffktest52": 0,
"udffktest57": 0,
"udffktest58": 0,
"udffktest59": 0,
"poscoreExcMU": false,
"unitId": 287,
"udfATATTTP1": 0,
"proShortDesc_sxg": "",
"poscoreExcPreOrder": false,
"udffktest42": 0,
"proName_en": "",
"udffktest43": 0,
"imgCode": "",
"udffktest44": 0,
"poscoreExcAllCalc": false,
"udffktest45": 0,
"useAccessWl": false,
"udfATPLUMWINE": 0,
"udffktest40": 0,
"udffktest41": 0,
"udffktest46": 0,
"udffktest47": 0,
"udffktest48": 0,
"udffktest49": 0,
"tpAttr7Id": 0,
"proTpId": 0,
"lastModifyUid": 1,
"proDesc_zh-CN": "",
"purUnitId": 287,
"pickUnitId": 287,
"seriesId": 113,
"qcRequiredProd": false,
"beId": 80,
"qcRequired": false,
"posmultibcBarCodeList": "",
"udfATTESTINGL1": 0,
"udfATJEIEN011": 0,
"udffktest64": 0,
"udffktest60": 0,
"proDesc_zh-TW": "",
"expiredUid": 0,
"udffktest61": 0,
"udffktest62": 0,
"barCode": "",
"udffktest63": 0,
"dDesc": "",
"cateringDesc_cth": "",
"proName_sxg": "",
"eshopProType": "simple",
"desc": "",
"proTpiRev": 0,
"tpAttr6Id": 0,
"udfjessetest": "",
"udfPJPlookup1": 0,
"proName_hy": "",
"attachmentNo": 0,
"magentoProId": "",
"stkUnitId": 287,
"udfATTYPE": 0,
"dDesc_cth": "",
"expired": false,
"cateringDesc_hy": "",
"printCount": 0,
"udfATBASE93": 0,
"udfATQUALITY": 0,
"proShortDesc_cth": "",
"cateringDesc_jp": "",
"udfATBRAND": 0,
"poscoreDesc_en": "",
"proDesc_en": "",
"saleUnitId": 287,
"proShortDesc": "",
"retailUnitId": 287,
"procmPurCateId": 0,
"udfATSWEETNESS": 0,
"udfATCOLOR": 0,
"tpAttr9Id": 0,
"poscoreDesc_jp": "",
"useAccess": false,
"proDesc_jp": "",
"sysJson": "",
"magentoSku": "A",
"viewCode": "pro",
"udfchanpinguige": "",
"udfATTESTMY": 0,
"proName_jp": "",
"useAccessBl": false,
"id": 5024,
"cateringDesc_sxg": "",
"poscoreRetailType": "na",
"proDesc_sxg": "",
"i18nField": "{\"desc_jp\": \"\", \"dDesc_jp\": \"\", \"desc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\", \"proDesc_zh-CN\": \"\", \"proName_zh-CN\": \"\", \"poscoreDesc_jp\": \"\", \"poscoreDesc_zh-CN\": \"\", \"cateringDesc_zh-CN\": \"\", \"proShortDesc_zh-CN\": \"\"}",
"udfATQRCODE": "",
"proShortDesc_en": "",
"status": "Y",
"udfaccount": 0,
"tpAttr8Id": 0,
"dDesc_sxg": "",
"dDesc_jp": "",
"iRev": 1,
"poscoreDesc_zh-CN": "",
"poscoreDesc_hy": "",
"udfATPLUMTYPE": 0,
"proDesc_hy": "",
"udfATJESSEPRO": 0,
"proName": "",
"statusModifyDate": 1629192187000,
"desc_sxg": "",
"proShortDesc_zh-CN": "",
"createDate": 1629192187000,
"udfATLEVEL": 0,
"poscoreDesc_zh-TW": "",
"cateringExcServCharge": false,
"poscoreDesc_cth": "",
"qcRequiredSales": false,
"useAccessAutoCalc": false,
"udfSPECUDF": "",
"desc_jp": "",
"udfATSIZE": 0,
"dDesc_hy": "",
"tpAttr3Id": 0,
"udfATPACKAGING": 0,
"udfATREGION": 0,
"udfATVEIN": 0,
"proShortDesc_jp": "",
"cateringDesc_zh-CN": "",
"locked": false,
"matcatId": 0,
"proDesc": "",
"tpAttr10Id": 0,
"lastApproveUid": 1,
"udfATSUGAR": 0,
"qcRequiredPurchase": false,
"preTaxRetUnitId": 0,
"preTaxRetUp": 0,
"udfATSECONDARY": 0,
"seedtime": 0,
"cateringDesc_zh-TW": "",
"udfPJPstring1": "",
"desc_hy": "",
"proShortDesc_zh-TW": "",
"qcRequiredConsign": false,
"desc_zh-TW": "",
"udfATPART": 0,
"udfATP1C1": 0,
"proShortDesc_hy": "",
"code": "A",
"tpAttr2Id": 0,
"udfATTEXTURE": 0,
"proName_zh-TW": "",
"proDesc_cth": "",
"udffktest10": 0,
"udffktest11": 0,
"udffktest12": 0,
"dDesc_zh-CN": "",
"desc_cth": "",
"udffktest17": 0,
"afterTaxRetUnitId": 0,
"udffktest18": 0,
"udffktest19": 0,
"dDesc_zh-TW": "",
"udffktest13": 0,
"udffktest14": 0,
"udffktest15": 0,
"udffktest16": 0,
"qcRequiredSubc": false,
"desc_en": "",
"proName_zh-CN": "",
"desc_zh-CN": "",
"poscoreDesc": "",
"cateringDesc": "",
"dDesc_en": "",
"poscoreExcDisc": false,
"tpAttr1Id": 0,
"udfATattSetId": 0,
"udfATSAKI": 0
}
]
},
"messages": [],
"status": true
}
# Create Product
# 一、Description
Usage: create or update 【Product】
# 二、API Detail
1、Request URL
URL | http://[server]/jsf/rfws/root/api/save/pro |
---|---|
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 aiM18 |
menuCode | String(Query) | Yes | pro |
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/pro";
String param = "&menuCode=pro";
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:
{
"price": {
"values": [
{
"ucCurId": 1,
"unitId": 287,
"showRatioD": 1,
"showRatioN": 1,
"upCurId": 1
}
]
},
"proco": {
"values": [
{
"ucCurId": 1,
"unitId": 287,
"showRatioD": 1,
"showRatioN": 1,
"upCurId": 1
}
]
},
"pro": {
"values": [
{
"beId": 80,
"seriesId": 113,
"desc": "20220401"
}
]
}
}
4、Response Sample
{
"recordId": 6607,
"messages": [],
"status": true
}
{
"recordId": 0,
"messages": [
{
"msgDetail": "Required field is empty",
"msgCode": "core_101905"
}
],
"status": false
}
# Delete Product
# 一、Description
Usage: Delete Product
# 二、API Detail
1、Request URL
URL | http://[server]/jsf/rfws/root/api/delete/pro |
---|---|
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 aiM18 |
menuCode | String(Query) | Yes | pro |
id | long(Query) | Yes | Product 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/pro";
String param = "&menuCode=pro&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:Product List
# 一、Description
Usage: Run EBI[Product 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 aiM18 |
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": [
{
"PRICE_A_up": "6.00000000",
"M18ReservedCol_dataIndex": 1,
"PROCO_A_stkMth": "Monthly Weighted Average",
"PRICE_A_ucCurId_desc__lang": "HK$",
"PRICE_A_uc": "4.00000000",
"PRO_A_code": "A1",
"PRICE_A_upCurId_desc__lang": "HK$",
"PRO_A_id": "5025",
"PRO_A_desc__lang": ""
}
]
}