# Basic Web Services
# Get Business Rules of a Module
Get business rules' keys of a module under a specific Business Entity.
HTTP Request
GET http://[server]/jsf/rfws/erp/bsrule/getBsRules/{module}/{beId}
Parameters
Name | Type | Description |
---|---|---|
module | string (Path) | Required. Module type. Can be found in data dictionary. |
beId | int (Path) | Required. Business entity ID |
Result (In JSON Array)
Name | Type | Description |
---|---|---|
mess | string | messCode of the business rule |
key | string | Key of the business rule |
Sample request:
OkHttpClient client = new OkHttpClient();
String module = "oldso";
int beId = "1";
String url = "http://" + server + "/jsf/rfws/erp/bsrule/getBsRules/"
+ module + "/" + beId;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
[
{"mess":"ce01_core.bsrule_blcus","key":"core_blCus_0"},
{"mess":"ce01_core.bsrule_blven","key":"core_blVen_0"},
{"mess":"ce01_core.bsrule_overship(sosi)","key":"oldso_overShip(si)_0"},
{"mess":"ce01_core.bsrule_underPrice","key":"oldso_underPrice_0"},
{"mess":"ce01_core.bsrule_overship(so)","key":"oldso_overShip_0"}
]
# Check Business Rules for a Transaction
Check a transaction record for all configured business rules.
HTTP Request
GET http://[server]/jsf/rfws/erp/bsrule/chkBsRules/{module}/{id}
Parameters
Name | Type | Description |
---|---|---|
module | string (Path) | Required. Module type |
id | int (Path) | Required. ID of the record |
Result (In JSON Array)
Name | Type | Description |
---|---|---|
key | string | Key of the business rule |
canSave | boolean | true if M18 will allow saving |
status | boolean | true if business checking passed |
Sample request:
OkHttpClient client = new OkHttpClient();
String module = "oldso";
int id = "4"; // SO id , get by getIdByCode
String url = "http://" + server + "/jsf/rfws/erp/bsrule/chkBsRules/"
+ module + "/" + id;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
[
{"canSave":false,"key":"oldso_overShip(si)_0","status":false},
{"canSave":false,"key":"oldso_underPrice_0","status":false},
{"canSave":false,"key":"oldso_overShip_0","status":false}
]
# Check a Specific Business Rule for a Transaction
Check a transaction record for a specified business rule. The key of the business rule can be retrieved by the get business rules web service.
HTTP Request
GET http://[server]/jsf/rfws/erp/bsrule/chkBsRules/{module}/{id}/{key}
Parameters
Name | Type | Description |
---|---|---|
module | string (Path) | Required. Module type |
id | int (Path) | Required. ID of the record |
key | string (Path) | Required. Key of the business rule |
Result
Name | Type | Description |
---|---|---|
canSave | boolean | true if M18 will allow saving |
status | boolean | true if business checking passed |
Sample request:
OkHttpClient client = new OkHttpClient();
String module = "oldso";
int id = "4"; // SO id , get by getIdByCode
String key = "oldso_overShip(si)_0"; // key of business rule
String url = "http://" + server + "/jsf/rfws/erp/bsrule/chkBsRules/"
+ module + "/"
+ id + "/"
+ key;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{"canSave":false,"status":false}
# Get Blacklist Status of a Customer/Vendor
Determine if the customer/vendor is blacklisted.
HTTP Request
GET http://[server]/jsf/rfws/erp/query/blackstatus/{searchName}
Parameters
Name | Type | Description |
---|---|---|
searchName | string (Path) | Required. cus for customer or ven for vendor |
id | int (Query) | Required. Customer or vendor ID |
Result
Name | Type | Description |
---|---|---|
blacklisted | boolean | true if blacklisted |
Sample request:
OkHttpClient client = new OkHttpClient();
String searchName = "cus";
int id = "28"; // customer id
String url = "http://" + server + "/jsf/rfws/erp/query/blackstatus/"
+ searchName + "?id=" + id;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{blacklisted: true}
# Get Exchange Rate of a Currency
Get exchange rate of a currency, relative to entity currency, as at a given date.
HTTP Request
GET http://[server]/jsf/rfws/erp/query/getRate
Parameters
Name | Type | Description |
---|---|---|
curId | int (Header) | Required. Currency ID |
domCurId | int (Header) | Required. Entity Currency ID |
tDate | date (Header) | Required. Transaction Date |
Result (in JSON Array: "values")
Name | Type | Description |
---|---|---|
openRate | decimal | Average Exchange Rate |
closeRate | decimal | Closing Exchange Rate |
Sample request:
OkHttpClient client = new OkHttpClient();
String url = "http://" + server + "/jsf/rfws/erp/query/getRate/";
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("curId", "1")
.addHeader("domCurId", "2")
.addHeader("tDate", "2017-03-01")
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":1,
"values":[{"openRate":1.1,"closeRate":1.1}],
"name":"",
"fields":[{"fieldClassName":"Double","name":"openRate","fieldClass":"java.lang.Double","classType":10},{"fieldClassName":"Double","name":"closeRate","fieldClass":"java.lang.Double","classType":10}]
}
# Get Child Companies of a Group Customer/Vendor
Get a list of customers'/vendors' IDs of all child companies from a group company customer / vendor.
HTTP Request
GET http://[server]/jsf/rfws/erp/query/getGroupCli
Parameters
Name | Type | Description |
---|---|---|
cliType | string (Header) | Required. cus for customer or ven for vendor |
cliId | int (Header) | Required. ID of customer or vendor |
loadGpCoData | int (Header) | Required. Please always input 1 |
Result (in JSON Array: "values")
Name | Type | Description |
---|---|---|
cliId | string | , separated ID list of child companies (customer/vendor) |
Sample request:
OkHttpClient client = new OkHttpClient();
String url = "http://" + server + "/jsf/rfws/erp/query/getGroupCli/";
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("cliType", "cus")
.addHeader("cliId", "119")
.addHeader("loadGpCoData", "1")
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":1,
"values":[{"cliId":"119,120"}],
"name":"",
"fields":[{"fieldClassName":"String","name":"cliId","fieldClass":"java.lang.String","classType":0}]
}
# Update Frozen Period Date
Update frozen date for a specified frozen period type.
HTTP Request
PUT http://[server]/jsf/rfws/erp/frozen/saveDate/{beId}/{frozenTypeId}/{frozenDate}
Parameters
Name | Type | Description |
---|---|---|
beId | int (Path) | Required. Business entity ID |
frozenTypeId | int (Path) | Required. Frozen period type ID |
frozenDate | date (Path) | Required. Frozen date |
Result
Name | Type | Description |
---|---|---|
status | string | Field only exists if update failed. |
message | string | Field only exists if update failed. |
Sample request:
OkHttpClient client = new OkHttpClient();
int beId = 1;
int frozenTypeId = 18;
String frozenDate = "2017-10-23";
String url = "http://" + server + "/jsf/rfws/erp/frozen/saveDate/"
+ beId + "/"
+ frozenTypeId + "/"
+ frozenDate;
Request request = new Request.Builder()
.url(url)
.put(reqruestBody)
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":0,
"values":[],
"name":"",
"fields":[{"fieldClassName":"String","name":"status","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"message","fieldClass":"java.lang.String","classType":0}]
}
# Get Latest Frozen Period of an Editor
Get the latest frozen period and its date of an editor for a business entity.
HTTP Request
GET http://[server]/jsf/rfws/erp/frozen/getLatestFrozenPeriod/{beId}/{menuCode}
Parameters
Name | Type | Description |
---|---|---|
beId | int (Path) | Required. Business entity ID |
menuCode | string (Path) | Required. Menu code of the editor. Can be found in data dictionary. |
Result (in JSON Array: "values")
Name | Type | Description |
---|---|---|
frozenDate | date | Frozen date |
frozenTypeId | int | Frozen period type's ID |
modifyUid | int | Modify user ID |
modifyDate | date | Modified date |
Sample request:
OkHttpClient client = new OkHttpClient();
int beId = 3;
String menuCode = "k";
String url = "http://" + server + "/jsf/rfws/erp/frozen/getLatestFrozenPeriod/"
+ beId + "/"
+ menuCode;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":1,
"values":[{"beId":3,"frozenDate":"2017-06-12 00:00:00","modifyUid":8,"modifyDate":"2017-10-12 09:10:47","frozenTypeId":19,"id":40}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"beId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"frozenTypeId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Date","name":"frozenDate","fieldClass":"java.util.Date","classType":21},{"fieldClassName":"Date","name":"modifyDate","fieldClass":"java.util.Date","classType":21},{"fieldClassName":"Long","name":"modifyUid","fieldClass":"java.lang.Long","classType":10}]
}
# Search Lookup Data
Search lookup data using data filter's conditions.
HTTP Request
GET http://[server]/jsf/rfws/erp/search/searchData/{beId}/{searchName}
Parameters
Name | Type | Description |
---|---|---|
beId | int (Path) | Required. Business entity ID |
searchName | string (Path) | Required. Lookup code. Can be found in data dictionary. |
conds | string (Header) | Data filter's conditions, if not input, all data will be selected. Format please refer to the sample request |
field | string (Header) | Extra fields needed. Format please refer to the sample request |
params | string (Header) | Parameters to control the number of rows returned |
Result
Name | Type | Description |
---|---|---|
size | int | Number of records returned |
values | array | JSON Array of returned data |
fields | array | JSON Array of returned fields' detail |
Sample request:
OkHttpClient client = new OkHttpClient();
String beId = "24";
String searchName = "cusbank";
String fields = "[\"iRev\"]";
String conds = "[{\"leftField\":\"bkopAc\",\"operator\":\"=\",\"rightField\":\"135791011\"}]";
String params = "{\"startRow\":0,\"endRow\":0}";
String url = "http://" + server + "/jsf/rfws/erp/search/searchData/"
+ beId + "/"
+ searchName;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("field", fields)
.addHeader("conds", conds)
.addHeader("params", params)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":3,
"values":[{"bkopName":"Hang Seng Bank","bkopNo":"HS","iRev":92,"id":4,"bkopAc":"135791011"},{"bkopName":"Hang Seng Bank","bkopNo":"HS","iRev":1,"id":9,"bkopAc":"135791011"},{"bkopName":"Hang Seng Bank","bkopNo":"HS","iRev":4,"id":11,"bkopAc":"135791011"}],
"name":"",
"fields":[{"fieldClassName":"String","name":"bkopNo","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"bkopAc","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"bkopName","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Integer","name":"iRev","fieldClass":"java.lang.Integer","classType":10},{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10}]
}
# Search Table Data by Code
Search data in a table using code.
HTTP Request
GET http://[server]/jsf/rfws/erp/search/code/{tableName}/{code}
Parameters
Name | Type | Description |
---|---|---|
tableName | string (Path) | Required. Table name. Can be found in data dictionary |
code | string (Path) | Required. Code |
Result (in JSON Array)
Name | Type | Description |
---|---|---|
size | int | Number of records returned |
values | string | JSON Array of returned data |
fields | string | JSON Array of returned fields' detail |
Sample request:
OkHttpClient client = new OkHttpClient();
String tableName = "cus";
String code = "C0001";
String url = "http://" + server + "/jsf/rfws/erp/search/code/"
+ tableName + "/"
+ code;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":1,
"values":[{"cDate":"2016-08-05 17:10:44","lastModifyUid":4,"code":"C0001","expiredDate":"1900-01-01 00:00:00","iRev":14,"i18nField":"{\"desc_en\": \"Test Customer\"}","regionId":1,"udfPJPtestDate":"1900-01-01 00:00:00","id":1,"statusModifyDate":"2016-08-05 17:10:44","lastModifyDate":"2016-08-17 16:44:44","createUid":7,"createDate":"2016-08-05 17:10:44","status":"Y","desc":"Test Customer"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Integer","name":"iRev","fieldClass":"java.lang.Integer","classType":10},
... {"fieldClassName":"String","name":"udfPJPstring1","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"i18nField","fieldClass":"java.lang.String","classType":0}]
}
# Search Table Data By ID
Search data in a table using ID.
HTTP Request
GET http://[server]/jsf/rfws/erp/search/id/{tableName}/{id}
Parameters
Name | Type | Description |
---|---|---|
tableName | string (Path) | Required. Table name. Can be found in data dictionary |
id | int (Path) | Required. Record's ID |
Result (in JSON Array)
Name | Type | Description |
---|---|---|
size | int | Number of records returned |
values | string | JSON Array of returned data |
fields | string | JSON Array of returned fields' detail |
Sample request:
OkHttpClient client = new OkHttpClient();
String tableName = "cus";
int id = 12;
String url = "http://" + server + "/jsf/rfws/erp/search/id/"
+ tableName + "/"
+ id;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":1,
"values":[{"cDate":"2016-10-04 15:34:59","lastModifyUid":12,"code":"WL-001CUS","expiredDate":"1900-01-01 00:00:00","iRev":17,"ad2":"5678","telCountry":"852","ad1":"1234","i18nField":"{\"ad1_en\": \"1234\", \"ad2_en\": \"5678\", \"desc_en\": \"Wilson Lau\", \"country_en\": \"\"}","regionId":2,"udfPJPtestDate":"1900-01-01 00:00:00","id":12,"statusModifyDate":"2016-10-04 15:34:59","lastModifyDate":"2017-04-20 15:21:33","createUid":12,"createDate":"2016-10-04 15:34:59","status":"Y","desc":"Wilson Lau"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Integer","name":"iRev","fieldClass":"java.lang.Integer","classType":10},
... {"fieldClassName":"String","name":"udfPJPstring1","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"i18nField","fieldClass":"java.lang.String","classType":0}]
}
# Search Table Data by SQL Conditions
Search table data using SQL's WHERE conditions.
HTTP Request
GET http://[server]/jsf/rfws/erp/search/cond/{tableName}
Parameters
Name | Type | Description |
---|---|---|
tableName | string (Path) | Required. Table name. Can be found in data dictionary |
cond | string (Header) | SQL's WHERE conditions. If empty, all data will be selected. |
rowLimit | int (Header) | Row limit of returned result |
Result (in JSON Array)
Name | Type | Description |
---|---|---|
size | int | Number of records returned |
values | string | JSON Array of returned data |
fields | string | JSON Array of returned fields' detail |
Sample request:
OkHttpClient client = new OkHttpClient();
String tableName = "cus";
String cond = "iRev=14";
String url = "http://" + server + "/jsf/rfws/erp/search/cond/"
+ tableName;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("cond", cond)
.addHeader("rowLimit", "5").build();
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":3,
"values":[{"cDate":"2016-08-05 17:10:44","lastModifyUid":4,"code":"C0001","expiredDate":"1900-01-01 00:00:00","iRev":14,"i18nField":"{\"desc_en\": \"Test Customer\"}","regionId":1,"udfPJPtestDate":"1900-01-01 00:00:00","id":1,"statusModifyDate":"2016-08-05 17:10:44","lastModifyDate":"2016-08-17 16:44:44","createUid":7,"createDate":"2016-08-05 17:10:44","status":"Y","desc":"Test Customer"},{"cDate":"2016-08-05 17:30:55","lastModifyUid":20,"code":"P001-1","expiredDate":"1900-01-01 00:00:00","iRev":14,"i18nField":"{\"desc_en\": \"Doduo 1\"}","groupCoId":2,"regionId":1,"udfPJPtestDate":"1900-01-01 00:00:00","id":3,"statusModifyDate":"2016-08-05 17:30:55","lastModifyDate":"2017-07-12 18:03:37","createUid":4,"createDate":"2016-08-05 17:30:55","status":"Y","desc":"Doduo 1"},{"cDate":"2016-10-13 00:00:00","lastModifyUid":17,"code":"cus-021","expiredDate":"1900-01-01 00:00:00","iRev":14,"ad2":"地址第二行","ad1":"地址第一行","ad4":"地址第四行","webSite":"wwww.multiable.com","ad3":"地址第三行","i18nField":"{\"ad1_en\": \"地址第一行\", \"ad2_en\": \"地址第二行\", \"ad3_en\": \"地址第三行\", \"ad4_en\": \"地址第四行\", \"desc_en\": \"Phone Test Customer\", \"ad1_zh-CN\": \"地址第一行\", \"ad2_zh-CN\": \"地址第二行\", \"ad3_zh-CN\": \"地址第三行\", \"ad4_zh-CN\": \"地址第四行\", \"country_en\": \"\", \"desc_zh-CN\": \"手机测试客户\"}","regionId":10,"udfPJPtestDate":"1900-01-01 00:00:00","id":34,"statusModifyDate":"2016-10-13 10:37:23","lastModifyDate":"2017-09-13 11:17:58","createUid":12,"email":"multiable@mac.sz","createDate":"2016-10-13 11:31:29","status":"Y","desc":"Phone Test Customer"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Integer","name":"iRev","fieldClass":"java.lang.Integer","classType":10},{"fieldClassName":"Long","name":"beId","fieldClass":"java.lang.Long","classType":10},
...]
}
# Upload Product's Photo
Update a single product photo to an existing product.
HTTP Request
POST http://[server]/jsf/rfws/erp/pro/proPhoto/{id}
Parameters
Name | Type | Description |
---|---|---|
id | int (Path) | Required. Product ID |
img | file (Entity) | Required. The photo's file. Please refer to the request sample. |
photoInfo | string (Query) | Required. A JSON string of photo info. |
photoInfo (in JSON Object)
Name | Type | Description |
---|---|---|
photoCode | string | Photo's code. If empty, it implies adding new photo, otherwise it implies updating photo. |
photoDesc | string | Photo description |
int | Print. 1 implies true. 0 implies false. Default as 0 . | |
expired | int | Expired. 1 implies true. 0 implies false. Default as 0 . |
Result
Name | Type | Description |
---|---|---|
message | string | success |
Sample request:
OkHttpClient client = new OkHttpClient();
String path = "C:\\Users\\Public\\Pictures\\Sample Pictures\\Sample.jpg";
File file = new File(path);
int id = 3920; // product id
JsonObject photoInfo = new JsonObject();
photoInfo.addProperty("photoCode", "003");
photoInfo.addProperty("photoDesc", "003 photo");
photoInfo.addProperty("print", 0);
photoInfo.addProperty("expired", 0);
String url = "http://" + server + "/jsf/rfws/erp/pro/proPhoto/"
+ id + "?photoInfo="
+ URLEncoder.encode(photoInfo.toString(), "UTF-8");
RequestBody requestBody = new MultipartBody
.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("img", null,
RequestBody.create(MediaType.parse("application/jpg"), file))
.build();
Request request = new Request.Builder()
.post(requestBody)
.url(url)
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{"message":"success"}
# Close/Unclose Transactions
Transactions closed
status maintenance.
HTTP Request
GET http://[server]/jsf/rfws/erp/closedSetting/updateData
Parameters
Name | Type | Description |
---|---|---|
module | String (Query) | Required. Module type. Can be found in data dictionary. |
beCode | int (Query) | Required. Business Entity Code. |
isClosing | boolean (Query) | Required. true if the transaction need to be closed. |
tranInfo | json (Query) | Required. JSON String of transactions info. |
tranInfo (in JSON Array) (Trading App)
Name | Type | Description |
---|---|---|
tranCode | String | Required. Transaction Code |
proCode | String | Required. Product Code |
lot | string | Required. Lot |
tranInfo (in JSON Array) (Finance App)
Name | Type | Description |
---|---|---|
tranCode | String | Required. Transaction Code |
Result
Name | Type | Description |
---|---|---|
message | String | success |
Sample request:
OkHttpClient client = new OkHttpClient();
JSONArray array = new JSONArray();
JSONObject obj = new JSONObject();
obj.put("tranCode", "SO0170356");
obj.put("proCode", "NOTE1");
obj.put("lot", "A");
array.put(obj);
obj = new JSONObject();
obj.put("tranCode", "SO0170356");
obj.put("proCode", "NOTE1");
obj.put("lot", "B");
array.put(obj);
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/closedSetting/updateData");
url = url.newBuilder()
.addQueryParameter("module", "oldso")
.addQueryParameter("beCode", "SM")
.addQueryParameter("isclosing", "true")
.addQueryParameter("tranInfo", URLEncoder.encode(array.toString(), "UTF-8"));
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{"message":"success"}
# Update Module Header UDF Fields
Module Header UDF Fields maintenance.
HTTP Request
POST http://[server]/jsf/rfws/erp/dataSync/updateHeaderUdfFields/[menuCode]
Parameters
Name | Type | Description |
---|---|---|
menuCode | String (Path) | Required. Menu Code in navmenu.xml. |
tranInfo | json (Entity) | Required. JSON String of transactions info. |
tranInfo (in JSON Object)
Name | Type | Description |
---|---|---|
updateTableName | String | Required. Table name of need to update |
code | String | Required. Transaction Code |
beId | long | Required. BE (or you can input 'beCode') |
udfxxxx | Object | Update field name. (if lookup field, you also can input 'xxxxCode') |
Result
Name | Type | Description |
---|---|---|
status | Boolean | Show update success or failed |
message | String | Show update message |
Sample request:
OkHttpClient client = new OkHttpClient();
JSONObject obj = new JSONObject();
obj.put("updateTableName", "mainup");
obj.put("code", "UPL180011");
obj.put("beId", "142");// or obj.put("beCode", "MX3");
obj.put("udfmxstr", "aaaa");
obj.put("udfmxnum", "1");
obj.put("udfmxdate", "2021-07-21 00:00:00");
obj.put("udfmxlookup", "17"); // or obj.put("udfmxlookupCode", "040");
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj.toString());
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/dataSync/updateHeaderUdfFields/uplist");
url = url.newBuilder()
.addQueryParameter("tranInfo", URLEncoder.encode(array.toString(), "UTF-8"));
Request request = new Request.Builder()
.url(url)
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.post(requestBody)
.build();
Response response = client.newCall(request).execute();
Sample response:
{"message":"success"}
#
# Trading Web Services
# Get Remark Data of Transactions
Get remark data of transactions.
HTTP Request
GET http://[server]/jsf/rfws/erp/trdg/common/getRemTable/{mainTable}/{remTable}
Parameters
Name | Type | Description |
---|---|---|
mainTable | string (Path) | Required. Main table name |
remTable | string (Path) | Required. Remark table name |
tranIds | string (Header) | Required. List of transaction IDs. , separated. |
Result (in JSON Array: "values")
Name | Type | Description |
---|---|---|
serialNo | string | Transaction code |
remarks | string | Remarks |
ce01Module | string | Module type |
i18nField | string | JSON Array contains remarks in different languages |
Sample request:
OkHttpClient client = new OkHttpClient();
String mainTable = "maink";
String remTable = "remk";
String url = "http://" + server + "/jsf/rfws/erp/trdg/common/getRemTable/"
+ mainTable + "/"
+ remTable;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("tranIds", "71")
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":1,
"values":[{"hId":71,"i18nField":"{\"remarks_en\": \"\"}","iRev":1,"id":71,"serialNo":"K00160089","ce01Module":"st"}],
"name":"",
"fields":[{"fieldClassName":"String","name":"serialNo","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"hId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"remarks","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"ce01Module","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Integer","name":"iRev","fieldClass":"java.lang.Integer","classType":10},{"fieldClassName":"String","name":"i18nField","fieldClass":"java.lang.String","classType":0}]
}
# Get Product Packing Information
Get product packing information by product ID , unit ID and packing unit ID.
HTTP Request
GET http://[server]/jsf/rfws/erp/trdg/price/propack/
Parameters
Name | Type | Description |
---|---|---|
proInfo | string (Header) | Required. Product information. Format please refer to the sample request |
Result (in JSON Array: "values")
Name | Type | Description |
---|---|---|
hId | int | Product / Material ID |
innerQty | decimal | Inner Qty |
perCtn | decimal | Qty / Packing Unit |
packingUnitCode | string | Packing Unit Code |
heightCm | decimal | Height (cm) |
bmctn | decimal | CBM / CTN |
innerUnitCode | string | Inner Unit Code |
packingUnitId | int | Packing Unit ID |
nwkg | decimal | N.W. / CTN (kg) |
proId | int | Product ID |
outQty | decimal | Qty / Packing Unit |
innerUnitId | int | Inner Unit ID |
widthCm | decimal | Width (cm) |
unitId | int | Base Unit ID |
lengthCm | decimal | Length (cm) |
gwkg | decimal | G.W. / CTN (kg) |
outUnitId | int | Unit ID |
OkHttpClient client = new OkHttpClient();
String url = "http://" + server + "/jsf/rfws/erp/trdg/price/propack"
String proInfo = "(proId, unitId, packingUnitId) values (3,2,4)";
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("authorization", "Bearer " + access_token)
.addHeader("cache-control", "no-cache")
.addHeader("proInfo", proInfo)
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":2,
"values":[{"hId":3,"innerQty":3.0,"perCtn":5.0,"packingUnitCode":"BOX","heightCm":12.0,"bmctn":0.001,"iRev":22,"itemNo":" 1","innerUnitCode":"个","packingUnitId":4,"nwkg":4.0,"proId":3,"outQty":5.0,"innerUnitId":1,"widthCm":11.0,"unitId":2,"id":1,"lengthCm":10.0,"gwkg":5.0,"outUnitId":1},{"hId":3,"innerQty":6.0,"perCtn":10.0,"packingUnitCode":"BOX","heightCm":24.0,"bmctn":0.011,"iRev":22,"itemNo":" 2","innerUnitCode":"个","packingUnitId":4,"nwkg":8.0,"proId":3,"outQty":10.0,"innerUnitId":1,"widthCm":22.0,"unitId":2,"id":2,"lengthCm":20.0,"gwkg":10.0,"outUnitId":1}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Double","name":"lengthIn","fieldClass":"java.lang.Double","classType":10},
... {"fieldClassName":"String","name":"innerUnitCode","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Double","name":"perCtn","fieldClass":"java.lang.Double","classType":10}]
}
# Get Inventory Level per Product
Get the inventory level of a product in different locations in a business entity, the results can be grouped by lot number and location.
HTTP Request
GET http://[server]/jsf/rfws/erp/trdg/stock/viewLocLvl/{beId}/{proId}
Parameters
Name | Type | Description |
---|---|---|
beId | int (Path) | Required. Business entity ID |
proId | int (Path) | Required. Product ID (0 means all) |
unitId | int (Query) | Unit ID (in Product's unit table). If provided, result will return quantity in this unit. By default, result will return in base unit. |
tranId | int (Query) | Skip transaction ID. If provided, this transaction will be excluded from the calculation of the result. |
tranType | string (Query) | The transaction type of tranId . |
locTypeId | int (Query) | Location Type ID. If provided, result will be filtered by this location type. |
asAt | date (Query) | As at date. The date stock level calculated up to. |
showLoc | boolean (Query) | If true , result will be grouped by location. |
showLotno | boolean (Query) | If true , result will be grouped by Lot number. |
includeNonApv | boolean (Query) | If true , result will include non-approved records. |
excludeExpiredLoc | boolean (Query) | If true , result will be exclude expired location. |
locId | int (Query) | Location ID. If provided, result will be filtered by this location |
includeUc | boolean (Query) | If true , result will be include AVG uc (Entity Currency) |
Result (in JSON Array)
Name | Type | Description |
---|---|---|
proId | int | Product ID |
locId | int | Location ID |
locCode | string | Location code |
locType | int | Location type ID |
lotNoId | int | Lot No. ID |
lotno | string | Lot No. code |
lotnoLot | string | Lot No. lot |
qty | decimal | Quantity |
unitId | int | Unit ID (in Product's unit table) |
unitCode | string | Unit code |
basicQty | decimal | Quantity (Base Unit) |
basicUnitId | int | Base Unit ID |
basicCode | string | Base Unit code |
uc | decimal | Unit Cost (Entity Currency) |
Sample request:
OkHttpClient client = new OkHttpClient();
String beId = "14";
String proId = "3081";
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/trdg/stock/viewLocLvl/"
+ beId + "/"
+ proId);
url = url.newBuilder()
.addQueryParameter("showLoc", "true")
.addQueryParameter("showLotno", "true")
.addQueryParameter("includeNonApv", "true")
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
The response has structure like this:
[
{"basicUnitId":52,"basicQty":7000.0,"basicCode":"RTUNIT","locCode":"L0001-A","lotno":"RT01_OPENINGS-002","proId":3081,"qty":7000.0,"unitCode":"RTUNIT","unitId":3791,"lotnoLot":"A","locType":31,"locId":40.0,"lotNoId":1681.0},
{"basicUnitId":52,"basicQty":1640.0,"basicCode":"RTUNIT","locCode":"RT01_LOC","lotno":"RT01_OPENINGS-002","proId":3081,"qty":1640.0,"unitCode":"RTUNIT","unitId":3791,"lotnoLot":"A","locType":33,"locId":42.0,"lotNoId":1681.0},
{"basicUnitId":52,"basicQty":98948.0,"basicCode":"RTUNIT","locCode":"RT01_LOC","lotno":"RT01_OPENINGS-003","proId":3081,"qty":98948.0,"unitCode":"RTUNIT","unitId":3791,"lotnoLot":"A","locType":33,"locId":42.0,"lotNoId":1696.0},
{"basicUnitId":52,"basicQty":10020.0,"basicCode":"RTUNIT","locCode":"RT01_LOC_B","lotno":"RT01_OPENINGS-001","proId":3081,"qty":10020.0,"unitCode":"RTUNIT","unitId":3791,"lotnoLot":"A","locType":33,"locId":43.0,"lotNoId":1680.0},
{"basicUnitId":52,"basicQty":150.0,"basicCode":"RTUNIT","locCode":"RT01_LOC_B","lotno":"RT01_OPENINGS-002","proId":3081,"qty":150.0,"unitCode":"RTUNIT","unitId":3791,"lotnoLot":"A","locType":33,"locId":43.0,"lotNoId":1681.0}
]
# Get Available Quantities of Multiple Products
Get the quantities of different available quantity types of multiple products in multiple business entities.
HTTP Request
GET http://[server]/jsf/rfws/erp/trdg/stock/jviewLvl/{asAt}
Parameters
Name | Type | Description |
---|---|---|
asAt | date (Path) | **Required. **As At Date |
beList | string (Query) | **Required. **List of business entity's ID. , separated. |
proList | string (Query) | **Required. **List of product's ID. , separated. |
seriesList | string (Query) | List of series ID. If provided, result will be filtered by these series. |
apv | int (Query) | 1 means load all data, 2 means approved data only, 3 means non-approved data only. Default: 1 . |
Result Set 1 JSON
Name | Type | Description |
---|---|---|
beId | int | Business entity ID |
proId | int | Product ID |
locTypeId | int | Location type ID |
locId | int | Location ID |
qty | decimal | Quantity |
locCode | string | Location code |
locTypeCode | string | Location Type code |
Result Set 2 JSON
Name | Type | Description |
---|---|---|
beId | int | Business entity ID |
proId | int | Product ID |
qtyTypeId | int | Quantity Type ID |
qty | decimal | Quantity |
Result Set 3 JSON
Name | Type | Description |
---|---|---|
proId | int | Product ID |
proCode | string | Product Code |
proBDesc | string | Brief Description |
proDDesc | string | Detailed Description |
seriesId | int | Series ID |
seriesCode | string | Series Code |
seriesDesc | string | Series Description |
unitId | int | Unit ID (in Product's unit table) |
unitCode | string | Unit Code |
maxAvail | decimal | Max Available Qty |
rol | decimal | Safety Stock |
Result Set 4 JSON
Name | Type | Description |
---|---|---|
id | int | Key ID |
code | string | Code |
desc | string | Description |
qtyDeci | int | Quantity (Sales/Purchase) |
Result Set 5 JSON
Name | Type | Description |
---|---|---|
beId | int | Business entity ID |
proId | int | Product ID |
availTypeId | int | Available Type ID |
Sample request:
OkHttpClient client = new OkHttpClient();
String uId = "4";
String asAt = "2016-01-01";
String beList = "28,33";
String proList = "1,2";
String seriesList = "";
String link = "http://" + server + "/jsf/rfws/erp/trdg/stock/jviewLvl/" + asAt;
HttpUrl url = HttpUrl.parse(link).newBuilder()
.addQueryParameter("beList", beList)
.addQueryParameter("proList", proList)
.addQueryParameter("seriesList", seriesList)
.build();
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":0,
"values":[],
"name":"",
"fields":[{"fieldClassName":"Long","name":"beId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"proId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"locTypeId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"locId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Double","name":"qty","fieldClass":"java.lang.Double","classType":10},{"fieldClassName":"String","name":"locCode","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"locTypeCode","fieldClass":"java.lang.String","classType":0}]
},{
"size":0,
"values":[],
"name":"",
"fields":[{"fieldClassName":"Long","name":"beId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"proId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"qtyTypeId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Double","name":"qty","fieldClass":"java.lang.Double","classType":10}]
},{
"size":2,
"values":[{"proBDesc":"SM-BOM-PROA","proCode":"SM-BOM-PROA","seriesCode":"SM-SERIES","proId":1,"unitCode":"个","seriesDesc":"电脑","unitId":1,"seriesId":1},{"proBDesc":"SM-BOM-PROB","proCode":"SM-BOM-PROB","seriesCode":"SM-SERIES","proId":2,"unitCode":"个","seriesDesc":"电脑","unitId":2,"seriesId":1}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"proId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"proCode","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"proBDesc","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"proDDesc","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Long","name":"seriesId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"seriesCode","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"seriesDesc","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Long","name":"unitId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"unitCode","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Double","name":"maxAvail","fieldClass":"java.lang.Double","classType":10},{"fieldClassName":"Double","name":"rol","fieldClass":"java.lang.Double","classType":10}]
},{
"size":1,
"values":[{"code":"CSIL","qtyDeci":4,"id":28,"desc":"CSIL TESTING (9.49)"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"code","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"desc","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Integer","name":"qtyDeci","fieldClass":"java.lang.Integer","classType":10}]
},{
"size":0,
"values":[],
"name":"",
"fields":[{"fieldClassName":"Long","name":"beId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"proId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"availTypeId","fieldClass":"java.lang.Long","classType":10}]
}
# Get Customer/Vendor Part No. by Product Code
Get customer/vendor part no. from customer/vendor code and product code.
HTTP Request
GET http://[server]/jsf/rfws/erp/trdg/refCode/getRefCode
Parameters
Name | Type | Description |
---|---|---|
module | String (Query) | Required. Module type. Can be found in data dictionary. |
beCode | String (Query) | Required. Business entity code. |
cliCode | String (Query) | Required. Customer/Vendor code. |
proInfo | json (Query) | Required. JSON String of product info. |
proInfo (in JSON Array)
Name | Type | Description |
---|---|---|
proCode | String | Required. Product code |
unitCode | String | Required. Unit code |
qty | double | Quantity |
Result (in JSON Array)
Name | Type | Description |
---|---|---|
proId | int | Product ID |
proCode | String | Product code |
refcode | String | Customer/Vendor Part No. |
Sample request:
OkHttpClient client = new OkHttpClient();
JSONArray array = new JSONArray();
JSONObject obj = new JSONObject();
obj.put("proCode", "NOTE1");
obj.put("unitCode", "盒");
obj.put("qty", 1);
array.put(obj);
obj = new JSONObject();
obj.put("proCode", "NOTEBOOK_01");
obj.put("unitCode", "个");
obj.put("qty", 1);
array.put(obj);
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/trdg/refCode/getRefCode");
url = url.newBuilder()
.addQueryParameter("module", "oldso")
.addQueryParameter("beCode", "SM")
.addQueryParameter("cliCode", "SM-CUS")
.addQueryParameter("proInfo", URLEncoder.encode(array.toString(), "UTF-8"));
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
[{"proCode":"NOTEBOOK_01","proId":3881,"refCode":"NOTE_01_CUS"},{"proCode":"NOTE1","proId":3919,"refCode":"cusref01"}]
# Get Product Code By Customer/Vendor Part No.
Get product code from customer/vendor code and customer/vendor part no.
HTTP Request
GET http://[server]/jsf/rfws/erp/trdg/refCode/getProCode
Parameters
Name | Type | Description |
---|---|---|
module | String (Query) | Required. Module type. Can be found in data dictionary. |
beCode | String (Query) | Required. Business entity Code. |
cliCode | String (Query) | Required. Customer/Vendor Code. |
refCode | String (Query) | Required. Customer/Vendor Part No. |
Result (in JSON Array)
Name | Type | Description |
---|---|---|
proId | int | Product ID |
proCode | String | Product Code |
proDesc | String | Product Description |
Sample request:
OkHttpClient client = new OkHttpClient();
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/trdg/refCode/getProCode");
url = url.newBuilder()
.addQueryParameter("module", "oldso")
.addQueryParameter("beCode", "SM")
.addQueryParameter("cliCode", "SM-CUS")
.addQueryParameter("refCode", "cus");
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
[{"proDesc":"笔记本电脑01(Simon)SC","proCode":"NOTEBOOK_01","proId":3881},{"proDesc":"NOTE1","proCode":"NOTE1","proId":3919}]
# Get Product Price
Get product UP/desc.
HTTP Request
GET http://[server]/jsf/rfws/erp/trdg/price/multiPro
Parameters
Name | Type | Description |
---|---|---|
module | String (Query) | Required. Module type. Can be found in data dictionary. |
beCode | String (Query) | Required. Business entity code. |
cliCode | String (Query) | Required. Customer/Vendor code. |
virDeptCode | String (Query) | Required. Business unit code. |
date | String (Query) | Date(Default: current date). |
upOrigin | String (Query) | Unit price origin. Define the source where the unit price should be retrieved. Please find a list of possible values below. |
descOrigin | String (Query) | Description origin. Define the source where the description should be retrieved. Please find a list of possible values below. |
proInfo | JSON (Query) | Required. A JSON string of transactions info. |
upOrigin (Defined in origin.xml)
Name | Description |
---|---|
PRO | Product / Material File |
UPLIST | Price List |
OLDQU | Sales Quotation |
SOLAST | Latest Transaction (Sales) |
VQU | Purchase Quotation |
GRN | Goods Receipt Note |
PI | Purchase Invoice |
POLAST | Latest Transaction (Purchase) |
descOrigin (Defined in origin.xml)
Name | Description |
---|---|
PRO | Product / Material File |
UPLIST | Price List |
OLDQU | Sales Quotation |
SOLAST | Latest Transaction (Sales) |
VENREF | Vendor Part No. |
CUSREF | Customer Part No. |
VQU | Purchase Quotation |
GRN | Goods Receipt Note |
PI | Purchase Invoice |
POLAST | Latest Transaction (Purchase) |
proInfo (in JSON Array)
Name | Type | Description |
---|---|---|
proCode | String | Required. Product code |
unitCode | String | Required. Unit code |
qty | double | Quantity |
Result (in JSON Array)
Name | Type | Description |
---|---|---|
proId | int | Product ID |
proCode | String | Product code |
unitId | int | Unit ID |
unitCode | String | Unit code |
qty | double | Quantity |
upCurId | int | Unit price currency ID |
upRate | double | Unit price rate |
up | double | Unit price |
ucCurId | int | Unit cost currency ID |
ucRate | double | UC rate |
uc | double | Unit cost |
disc | double | Discount(%) |
measUnit | String | Measurement unit |
weightUnit | String | Weight unit |
lengthCm | double | Length (Measurement unit = CBM) |
widthCm | double | Width (Measurement unit = CBM) |
heightCm | double | Height (Measurement unit = CBM) |
bmctn | double | Volume (Measurement unit = CBM) |
lengthIn | double | Length (Measurement unit = CUFT) |
widthIn | double | Width (Measurement unit = CUFT) |
heightIn | double | Height (Measurement unit = CUFT) |
cuftctn | double | Volume (Measurement unit = CUFT) |
gwkg | double | G.W. (Weight Unit = KG) |
nwkg | double | N.W. (Weight Unit = KG) |
gwlb | double | G.W. (Weight Unit = LB) |
nwlb | double | N.W. (Weight Unit = LB) |
packingUnitId | int | Packing unit ID |
packingUnitCode | String | Packing Unit Code |
innerQty | int | Inner quantity |
innerUnitId | int | Inner unit ID |
perCtn | int | Quantity / Packing unit |
packingDesc | String | Packing description |
shipMark | String | Shipping marks |
bDesc | String | Brief description |
dDesc | String | Detailed description |
upOrigin | String | Price origin |
descOrigin | String | Description origin |
Sample request:
OkHttpClient client = new OkHttpClient();
JSONArray array = new JSONArray();
JSONObject obj = new JSONObject();
obj.put("proCode", "NOTE1");
obj.put("unitCode", "盒");
obj.put("qty", 1);
array.put(obj);
obj = new JSONObject();
obj.put("proCode", "NOTEBOOK_01");
obj.put("unitCode", "个");
obj.put("qty", 1);
array.put(obj);
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/trdg/price/multiPro");
url = url.newBuilder()
.addQueryParameter("module", "oldso")
.addQueryParameter("beCode", "SM")
.addQueryParameter("cliCode", "SM-CUS")
.addQueryParameter("virDeptCode", "SM_VIRDEPT")
.addQueryParameter("upOrigin", "PRO")
.addQueryParameter("descOrigin", "PRO")
.addQueryParameter("proInfo", URLEncoder.encode(array.toString(), "UTF-8"));
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
[{"lengthIn":40,"ucCurId":1,"innerQty":4,"proCode":"个","upOrigin":"PRO","nwlb":450,"ucRate":1,"uc":10,"packingUnitId":4,"nwkg":10,"gwlb":500,"bDesc":"笔记本电脑01(Simon)E","unitId":38726,"innerUnitId":17,"up":12,"lengthCm":70,"upCurId":1,"cuftctn":13.889,"widthIn":30,"perCtn":5,"upRate":1,"packingUnitCode":"BOX","heightCm":50,"bmctn":0.21,"descOrigin":"","heightIn":20,"dDesc":"haha","proId":3881,"widthCm":60,"gwkg":12,"packingDesc":"haha"},{"lengthIn":39.37,"ucCurId":1,"innerQty":0,"proCode":"盒","upOrigin":"PRO","nwlb":44,"ucRate":1,"uc":120,"packingUnitId":14,"nwkg":20,"gwlb":22,"bDesc":"NOTE1","unitId":38914,"innerUnitId":0,"up":160,"lengthCm":100,"upCurId":1,"cuftctn":211.887,"widthIn":78.74,"perCtn":2,"upRate":1,"packingUnitCode":"0.3兩","heightCm":300,"bmctn":6,"descOrigin":"","heightIn":118.11,"dDesc":"<p style=\"margin: 0px;\"><img src=\"/jsf/imageServlet?thumbnail=true&code=68O31317220596O15\" style=\"width: 255px;\"><br><\/p>","proId":3919,"widthCm":200,"gwkg":10,"packingDesc":""}]
# Get Outstanding Product Quantity
Get outstanding product quantity.
HTTP Request
GET http://[server]/jsf/rfws/erp/trdg/common/getOSTranPro
Parameters
Name | Type | Description |
---|---|---|
beId | Long (Header) | Required. Business Entity. |
tDate | String (Header) | Required. Date(Default: current date). |
sourceType | String (Header) | Required. |
tranType | String (Header) | Required. |
param | JSON (Header) | Extract source header fields.(cusId \ venId \ curId \ virDeptId) |
addFields | String (Header) | Additional returned fields.(Source module header & footer fields only) |
Result (in JSON Array)
Name | Type | Description |
---|---|---|
footerId | int | Source footer table ID |
orderId | int | Source transaction ID |
proId | int | Product ID |
unitId | int | Unit ID |
lot | string | Product Lot |
orgQty | double | Product Quantity |
outQty | double | Product Outstanding Quantity |
Sample request:
OkHttpClient client = new OkHttpClient();
JSONObject param = new JSONObject();
param.put("venId", "1");
JSONArray addFields = new JSONArray();
addFields.add("pot.bDesc");
addFields.add("mainpo.venId");
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/trdg/common/getOSTranPro");
url = url.newBuilder()
.addHeaderParameter("beId", "304")
.addHeaderParameter("tDate", "2023-12-01")
.addHeaderParameter("sourceType", "po")
.addHeaderParameter("tranType", "an")
.addHeaderParameter("param", URLEncoder.encode(param.toString(), "UTF-8"))
.addHeaderParameter("addFields", URLEncoder.encode(addFields.toString(), "UTF-8"));
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Sample response:
{"size":1,"values":[{"footerId":1096,"orderId":640,"proId":4775,"lot":"A","outQty":1.0,"orgQty":1.0,"unitId":39867,"bDesc":"Product Brief Description(EN)","venId":1}]}
# Finance Web Services
# Get Outstanding AP Invoices
Get a list of outstanding account payable invoices in a specific business entity.
HTTP Request
GET http://[server]/jsf/rfws/erp/ac/ap/getOsInvoice/{beId}/{uId}/{AIId}/{payRegId}/{multiPayId}/
Parameters
Name | Type | Description |
---|---|---|
beId | int (Path) | Required. Business entity ID |
uId | int (Path) | Required. User ID |
payRegId | int (Path) | Required. Must input 0 . |
multiPayId | int (Path) | Required. Must input 0 . |
AIId | int (Path) | Required. Creditor ID. ID of the creditor type's records, if creditor type = ven , this field represent the ID of vendor FM. |
AIType | string (Header) | Required. Type of creditor. Format please refer to request sample, built-in support these types: ven , cus , staff , cnDept , virDept |
sDate | date (Header) | Required. Transaction Date (From) |
eDate | date (Header) | **Required. **Transaction Date (To) |
sDDate | date (Header) | Required. Due Date (From) |
eDDate | date (Header) | Required. Due Date (To) |
sStaff | string (Header) | Staff Code (From) |
eStaff | string (Header) | Staff Code (To) |
sTranType | string (Header) | Invoice's transaction types. Format please refer to request sample, support types: apIni, apTran and pi. |
loadDbNote | int (Header) | Default is 0 . If 1 , result will include negative AP transactions. |
loadGroupCo | boolean (Header) | Default is false . If true , the result will consider group company data of the vendor. |
Result (in JSON Array: "values")
Name | Type | Description |
---|---|---|
id | int | Invoice ID |
code | string | Invoice No. |
tDate | date | Invoice Date |
sTranType | string | Invoice's Transaction Type |
sTranTypeMess | string | Invoice's Transaction Type Desc. |
AIType | string | Creditor Type |
AIId | int | Creditor ID |
curId | int | Currency ID |
curCode | string | Currency Code |
rate | decimal | Ex. rate |
amt | decimal | Invoice Amount |
bal | decimal | Paid Amount |
balAmt | decimal | Outstanding Amount |
cpDate | date | Due Date |
accDesc | string | Account Brief Description |
eDiscRate | decimal | Early Payment Discount |
eDiscAmt | decimal | Early Payment Discount Amount |
virDeptId | int | Business Unit ID |
virDeptCode | string | Business Unit Code |
virDeptDesc | string | Business Unit Description |
AI1 - AI30 | int | Analysis Code 1 - 30 |
invDomAmt | decimal | Invoice Amount (Entity Currency) |
usedInvDomAmt | decimal | Paid Amount (Entity Currency) |
balInvDomAmt | decimal | Outstanding Amount (Entity Currency) |
Sample request:
OkHttpClient client = new OkHttpClient();
String beId = "19";
String uId = "9";
String AIId = "6"; // AIId: vendor id in this case
String payRegId = "0";
String multiPayId = "0";
String AIType = "(aiType)values(''ven'')"; // creditor type = "ven"
String sDate = "1990-01-01";
String eDate = "2017-11-04";
String sDDate = "1990-01-01";
String eDDate = "9999-12-31";
String sStaff = "";
String eStaff = "";
String loadGroupCo = "false";
String sTranType = "(sTranType) values ('apTran')";
String url = "http://" + server + "/jsf/rfws/erp/ac/ap/getOsInvoice/"
+ beId + "/"
+ uId + "/"
+ AIId + "/"
+ payRegId + "/"
+ multiPayId;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("AIType", AIType)
.addHeader("sDate", sDate)
.addHeader("eDate", eDate)
.addHeader("sDDate", sDDate)
.addHeader("eDDate", eDDate)
.addHeader("sStaff", sStaff)
.addHeader("eStaff", eStaff)
.addHeader("loadDbNote", loadDbNote)
.addHeader("sTranType", sTranType)
.addHeader("loadGroupCo", loadGroupCo)
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":6,
"values":[{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_001","virDeptId":3,"st_desc":"KC_ART_20170901_001","amt":100.0,"balInvDomAmt":110.0,"sTranId":396,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":396,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_002","virDeptId":3,"st_desc":"KC_ART_20170901_002","amt":100.0,"balInvDomAmt":110.0,"sTranId":397,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_002","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":397,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_003","virDeptId":3,"st_desc":"KC_ART_20170901_003","amt":100.0,"balInvDomAmt":110.0,"sTranId":398,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_003","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":398,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_004","virDeptId":3,"st_desc":"KC_ART_20170901_004","amt":100.0,"balInvDomAmt":110.0,"sTranId":399,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_004","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":399,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-15 00:00:00","cpDate":"2017-09-15 00:00:00","code":"KC_ART_20170915_001","virDeptId":3,"st_desc":"KC_ART_20170915_001","amt":110.0,"balInvDomAmt":119.9,"bal":1.0,"usedInvDomAmt":1.1,"sTranId":400,"ce01Module":"arTran","sTranCode":"KC_ART_20170915_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":109.0,"id":400,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":121.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-10-25 00:00:00","cpDate":"2017-10-25 00:00:00","code":"KC_ART_20171025_001","virDeptId":3,"st_desc":"KC_ART_20171025_001","amt":12.0,"balInvDomAmt":13.2,"sTranId":405,"ce01Module":"arTran","sTranCode":"KC_ART_20171025_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":12.0,"id":405,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":13.2,"virDeptDesc":"Sales Team 1"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"code","fieldClass":"java.lang.String","classType":0},
...{"fieldClassName":"String","name":"virDeptDesc","fieldClass":"java.lang.String","classType":0}]
}
# Get Outstanding AR Invoices
Get a list of outstanding account receivable invoices in a specific business entity.
HTTP Request
GET http://[server]/jsf/rfws/erp/ac/ar/getOsInvoice/{beId}/{uId}/{AIId}/{recregId}/{multiRecId}
Parameters
Name | Type | Description |
---|---|---|
beId | int (Path) | Required. Business entity ID |
uId | int (Path) | Required. User ID |
payRegId | int (Path) | Required. Must input 0 . |
multiPayId | int (Path) | Required. Must input 0 . |
AIId | int (Path) | Required. Debtor ID. ID of the debtor type's records, if debtor type = cus , this field will represent the ID of customer FM. |
AIType | string (Header) | Required. Type of Debtor. Format please refer to request sample, built-in support these types: cus , ven , staff , cnDept , virDept . |
sDate | date (Header) | Required. Transaction Date (From) |
eDate | date (Header) | **Required. **Transaction Date (To) |
sDDate | date (Header) | Required. Due Date (From) |
eDDate | date (Header) | Required. Due Date (To) |
sStaff | string (Header) | Staff Code (From) |
eStaff | string (Header) | Staff Code (To) |
sTranType | string (Header) | Invoice's transaction types. Format please refer to request sample, support types: arIni , arTran and siso . |
loadCrNote | int (Header) | Default is 0 . If 1 , result will include negative AR transactions. |
loadGroupCo | boolean (Header) | Default is false . If true , the result will consider group company data of the customer. |
Result (in JSON Array: "values")
Name | Type | Description |
---|---|---|
id | int | Invoice ID |
code | string | Invoice No. |
tDate | date | Invoice Date |
sTranType | string | Invoice's Transaction Type |
sTranTypeMess | string | Invoice's Transaction Type Desc. |
AIType | string | Debtor Type |
AIId | int | DebtorID |
curId | int | Currency ID |
curCode | string | Currency Code |
rate | decimal | Ex. rate |
amt | decimal | Invoice Amount |
bal | decimal | Paid Amount |
balAmt | decimal | Outstanding Amount |
cpDate | date | Due Date |
accDesc | string | Account Brief Description |
eDiscRate | decimal | Early Payment Discount |
eDiscAmt | decimal | Early Payment Discount Amount |
virDeptId | int | Business Unit ID |
virDeptCode | string | Business Unit Code |
virDeptDesc | string | Business Unit Description |
AI1 - AI30 | int | Analysis Code 1 - 30 |
invDomAmt | decimal | Invoice Amount (Entity Currency) |
usedInvDomAmt | decimal | Paid Amount (Entity Currency) |
balInvDomAmt | decimal | Outstanding Amount (Entity Currency) |
Sample request:
OkHttpClient client = new OkHttpClient();
String beId = "19";
String uId = "9";
String AIId = "6"; // debtor id = customer id in this sample
String recregId = "0";
String multiRecId = "0";
String AIType = "(aiType) values (''cus'')"; // debtor type = "cus"
String sDate = "1900-01-01";
String eDate = "2017-11-04";
String sDDate = "1900-01-01";
String eDDate = "9999-12-31";
String sStaff = "";
String eStaff = "";
String loadCrNote = "1";
String sTranType = "(sTranType) values ('arTran')";
String loadGroupCo = "false";
String url = "http://" + server + "/jsf/rfws/erp/ac/ar/getOsInvoice/"
+ beId + "/"
+ uId + "/"
+ AIId + "/"
+ recregId + "/"
+ multiPayId;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("AIType", AIType)
.addHeader("sDate", sDate)
.addHeader("eDate", eDate)
.addHeader("sDDate", sDDate)
.addHeader("eDDate", eDDate)
.addHeader("sStaff", sStaff)
.addHeader("eStaff", eStaff)
.addHeader("loadCrNote", loadCrNote)
.addHeader("sTranType", sTranType)
.addHeader("loadGroupCo", loadGroupCo)
.build();
Response response = client.newCall(request).execute();
Sample response:
{
"size":6,
"values":[{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_001","virDeptId":3,"st_desc":"KC_ART_20170901_001","amt":100.0,"balInvDomAmt":110.0,"sTranId":396,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":396,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_002","virDeptId":3,"st_desc":"KC_ART_20170901_002","amt":100.0,"balInvDomAmt":110.0,"sTranId":397,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_002","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":397,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_003","virDeptId":3,"st_desc":"KC_ART_20170901_003","amt":100.0,"balInvDomAmt":110.0,"sTranId":398,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_003","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":398,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_004","virDeptId":3,"st_desc":"KC_ART_20170901_004","amt":100.0,"balInvDomAmt":110.0,"sTranId":399,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_004","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":399,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-15 00:00:00","cpDate":"2017-09-15 00:00:00","code":"KC_ART_20170915_001","virDeptId":3,"st_desc":"KC_ART_20170915_001","amt":110.0,"balInvDomAmt":119.9,"bal":1.0,"usedInvDomAmt":1.1,"sTranId":400,"ce01Module":"arTran","sTranCode":"KC_ART_20170915_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":109.0,"id":400,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":121.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-10-25 00:00:00","cpDate":"2017-10-25 00:00:00","code":"KC_ART_20171025_001","virDeptId":3,"st_desc":"KC_ART_20171025_001","amt":12.0,"balInvDomAmt":13.2,"sTranId":405,"ce01Module":"arTran","sTranCode":"KC_ART_20171025_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":12.0,"id":405,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":13.2,"virDeptDesc":"Sales Team 1"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"code","fieldClass":"java.lang.String","classType":0},
...{"fieldClassName":"String","name":"virDeptDesc","fieldClass":"java.lang.String","classType":0}]
}
# Void Transaction
Void a transaction base on given module name and transaction ID.
HTTP Request
GET http://[server]/jsf/rfws/erp/ac/voidunvoid/voidTran/
Parameters
All parameters are wrapped inside a JSON object. Please read the sample request for details.
Name | Type | Description |
---|---|---|
beId | int | Required. Business entity ID |
moduleName | int | Required. Module name of the transaction. |
tranId | int | Required. ID of the transaction |
voidDate | int | Void date. Default: transaction date |
Result
Name | Type | Description |
---|---|---|
success | boolean | Indicate if the process success. |
message | String | Message of the result |
voucherId | int | The reverse journal voucher ID if exists. |
Sample request:
JsonObject data = new JsonObject();
data.addProperty("beId", 19);
data.addProperty("moduleName", "arTran");
data.addProperty("tranId", 431);
data.addProperty("voidDate", "2017-12-14");
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), data.toString());
Request request = new Request.Builder()
.url("http://" + server + "/jsf/rfws/erp/ac/voidunvoid/voidTran/")
.addHeader("client_id", MyValue.clientID)
.addHeader("authorization", "Bearer " + access_token)
.addHeader("cache-control", "no-cache")
.post(requestBody)
.build();
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
Sample response:
{
"success": true,
"voucherId": 18595,
"message": "Void Completed"
}
# Unvoid Transaction
Unvoid a transaction base on given module name and transaction ID.
HTTP Request
GET http://[server]/jsf/rfws/erp/ac/voidunvoid/voidTran/
Parameters
All parameters are wrapped inside a JSON object. Please read the sample request for details.
Name | Type | Description |
---|---|---|
beId | int | Required. Business entity ID |
moduleName | int | Required. Module name of the transaction. |
tranId | int | Required. ID of the transaction |
Result
Name | Type | Description |
---|---|---|
success | boolean | Indicate if the process success. |
message | String | Message of the result |
Sample request:
JsonObject data = new JsonObject();
data.addProperty("beId", 19);
data.addProperty("moduleName", "arTran");
data.addProperty("tranId", 431);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), data.toString());
Request request = new Request.Builder()
.url("http://" + server + "/jsf/rfws/erp/ac/voidunvoid/unvoidTran/")
.addHeader("client_id", MyValue.clientID)
.addHeader("authorization", "Bearer " + access_token)
.addHeader("cache-control", "no-cache")
.post(requestBody)
.build();
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
Sample response:
{
"success": true,
"message": "Unvoid Completed"
}