# Journal Voucher

# Fetch Journal Voucher List

# 一、Description

​ Usage: Fetch Journal Voucher List

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes jl
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=jl&beId=11";

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

​ 4、Response Sample

{
    "stSearch": "jl",
    "size": 1,
    "stSearchDisplay": "Journal Voucher",
    "values": [
        {
            "tDate": "2022-04-06",
            "batchNo": "",
            "maint.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "code": "JCAAJV220401",
            "st_id": 43925,
            "st_code": "JCAAJV220401",
            "st_desc": "JCAAJV220401",
            "iRev": 4,
            "id": 43925,
            "lastModifyDate": "2022-04-06 16:10:59"
        }
    ]
}

# Load Journal Voucher

# 一、Description

​ Usage: Load【Journal Voucher】Record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes jl
id long(Query) Yes Journal Voucher 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/jl";
			String param = "&menuCode=jl&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": {
        "t": [
            {
                "virDeptId": 4,
                "AI1": 0,
                "c_d": -1,
                "AI2": 0,
                "itemNo": "     1",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "accDesc": "Account Receivable",
                "payer": "",
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "payee": "",
                "AI9": 0,
                "iafSrcDocId": "",
                "cusId": 0,
                "id": 169398,
                "AI30": 0,
                "taxAmt": 0,
                "debtorType": "cus",
                "hId": 43925,
                "reconciled": false,
                "chequeNo": "",
                "crBkopAc": "",
                "taxDomAmt": 0,
                "particular": "",
                "importPermitAmt": 0,
                "taxCodeId": 0,
                "creditorType": "ven",
                "printed": false,
                "bankSlipNo": "",
                "venId": 0,
                "crBkopNoId": 0,
                "importPermitTaxAmt": 0,
                "sourceTableKey": "",
                "adjustment": false,
                "toAccId": 0,
                "monthlyPeriodId": 28,
                "tDate": 1649174400000,
                "refNo": "",
                "cnDeptId": 0,
                "jlTypeId": 0,
                "postStatus": "U",
                "amt": 1000,
                "iRev": 4,
                "ipTaxCodeId": 0,
                "reconDate": -2209017600000,
                "udf001": "",
                "AI19": 0,
                "sTranId": 0,
                "ce01Module": "jl",
                "AI17": 0,
                "poscoreShopId": 0,
                "AI18": 0,
                "preTaxAmt": 0,
                "AI15": 0,
                "curId": 1,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "rate": 1,
                "domAmt": 1000,
                "AI11": 0,
                "sourceMappingKey": "",
                "AI12": 0,
                "AI10": 0,
                "preTaxDomAmt": 0,
                "vatPer": 0,
                "multiFlowId": 0,
                "weeklyPeriodId": 0,
                "drBkopNoId": 0,
                "isAdj": false,
                "faFooterId": 0,
                "isMainAccPrdExtra": false,
                "slmId": 53,
                "drBkopAc": "",
                "ipTaxRate": 0,
                "reverse": false,
                "chequeDate": -2209017600000,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "proId": 0,
                "AI20": 0,
                "AI21": 0,
                "accId": 27,
                "faFooterType": "",
                "staffId": 4
            },
            {
                "virDeptId": 4,
                "AI1": 0,
                "c_d": 1,
                "AI2": 0,
                "itemNo": "     2",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "accDesc": "Cash",
                "payer": "",
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "payee": "",
                "AI9": 0,
                "iafSrcDocId": "",
                "cusId": 0,
                "id": 169399,
                "AI30": 0,
                "taxAmt": 0,
                "debtorType": "cus",
                "hId": 43925,
                "reconciled": false,
                "chequeNo": "",
                "crBkopAc": "",
                "taxDomAmt": 0,
                "particular": "",
                "importPermitAmt": 0,
                "taxCodeId": 0,
                "creditorType": "ven",
                "printed": false,
                "bankSlipNo": "",
                "venId": 0,
                "crBkopNoId": 0,
                "importPermitTaxAmt": 0,
                "sourceTableKey": "",
                "adjustment": false,
                "toAccId": 0,
                "monthlyPeriodId": 28,
                "tDate": 1649174400000,
                "refNo": "",
                "cnDeptId": 0,
                "jlTypeId": 0,
                "postStatus": "U",
                "amt": 1000,
                "iRev": 4,
                "ipTaxCodeId": 0,
                "reconDate": -2209017600000,
                "udf001": "",
                "AI19": 0,
                "sTranId": 0,
                "ce01Module": "jl",
                "AI17": 0,
                "poscoreShopId": 0,
                "AI18": 0,
                "preTaxAmt": 0,
                "AI15": 0,
                "curId": 1,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "rate": 1,
                "domAmt": 1000,
                "AI11": 0,
                "sourceMappingKey": "",
                "AI12": 0,
                "AI10": 0,
                "preTaxDomAmt": 0,
                "vatPer": 0,
                "multiFlowId": 0,
                "weeklyPeriodId": 0,
                "drBkopNoId": 0,
                "isAdj": false,
                "faFooterId": 0,
                "isMainAccPrdExtra": false,
                "slmId": 53,
                "drBkopAc": "",
                "ipTaxRate": 0,
                "reverse": false,
                "chequeDate": -2209017600000,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "proId": 0,
                "AI20": 0,
                "AI21": 0,
                "accId": 57,
                "faFooterType": "",
                "staffId": 4
            }
        ],
        "maint": [
            {
                "udfint": 0,
                "lastModifyUid": 5,
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "pzzId": 0,
                "sysJson": "",
                "viewCode": "jl",
                "fromInterCoId": 0,
                "beId": 1,
                "hcJlId": 0,
                "useAccessBl": false,
                "cashierId": 0,
                "id": 43925,
                "doctypeId": 0,
                "locked": false,
                "srcHcJlId": 0,
                "lastModifyDate": 1649232659000,
                "createUid": 5,
                "pZH": 0,
                "rev": "4",
                "batchNo": "",
                "lastApproveUid": 5,
                "iafTrxDesc": "Account Receivable,Cash",
                "udfattach": 0,
                "expiredUid": 0,
                "permitNo": "",
                "ttlImportPermitAmt": 0,
                "bankSlipNo": "",
                "batchGen": false,
                "interVoucherType": "normal",
                "taxOrigin": "ACC",
                "toInterCoId": 0,
                "postUid": 0,
                "status": "Y",
                "monthlyPeriodId": 28,
                "tDate": 1649174400000,
                "attachmentNo": 0,
                "code": "JCAAJV220401",
                "cnDeptId": 0,
                "yearEndVoucher": false,
                "postStatus": "U",
                "iRev": 4,
                "sTranId": 0,
                "ce01Module": "jl",
                "curId": 0,
                "expired": false,
                "rate": 1,
                "sourceMappingKey": "",
                "printCount": 0,
                "ttlImportPermitTaxAmt": 0,
                "statusModifyDate": 1649232281000,
                "multiFlowId": 0,
                "createDate": 1649232281000,
                "weeklyPeriodId": 0,
                "faFooterId": 0,
                "voucherType": "normal",
                "toDate": -2209017600000,
                "slmId": 0,
                "udfadatest": "",
                "reverse": false,
                "useAccessWl": false,
                "accdfId": 0,
                "toBeId": 0,
                "yearEndVoucherToPeriod": 0,
                "yearEndVoucherFromPeriod": 0,
                "postDate": -2209017600000,
                "attachmentCount": 1,
                "faFooterType": "",
                "useAccessAutoCalc": false,
                "staffId": 4,
                "sumJLId": 0,
                "isStock": false
            }
        ],
        "remt": [
            {
                "remarks_jp": "",
                "hId": 43925,
                "remarks_en": "",
                "iRev": 4,
                "ce01Module": "jl",
                "remarks_cth": "",
                "remarks_hy": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\"}",
                "remarks_zh-CN": "",
                "id": 6565,
                "remarks_zh-TW": "",
                "remarks": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Journal Voucher

# 一、Description

​ Usage: create or update【Journal Voucher】 record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes jl
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/jl";
		String param = "&menuCode=jl";

		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:

{
    "t": {
        "values": [
            {
                "tDate": "2022-04-15",
                "curId": 1,
                "virDeptId": 4,
                "rate": 1,
                "domAmt": 100,
                "accId": 27,
                "c_d": 1,
                "amt": 100,
                "monthlyPeriodId": 28
            },
            {
                "tDate": "2022-04-15",
                "curId": 1,
                "virDeptId": 4,
                "rate": 1,
                "domAmt": 100,
                "accId": 57,
                "c_d": -1,
                "amt": 100,
                "monthlyPeriodId": 28
            }
        ]
    },
    "maint": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "staffId": 4
            }
        ]
    }
}

​ 4、Response Sample

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

# Delete Journal Voucher

# 一、Description

​ Usage: Delete Journal Voucher Record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes jl
id long(Query) Yes Journal Voucher 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/jl";
		String param = "&menuCode=jl&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
}

# AR Initial Balance

# Fetch AR Initial Balance List

# 一、Description

​ Usage: Fetch AR Initial Balance List

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes arIni
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=arIni&beId=11";

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

​ 4、Response Sample

{
    "stSearch": "arIni",
    "size": 1,
    "stSearchDisplay": "AR Initial Balance",
    "values": [
        {
            "tDate": "2021-09-16",
            "batchNo": "",
            "code": "232516ARIB-1",
            "st_code": "232516ARIB-1",
            "arIni.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "st_desc": "232516ARIB-1",
            "iRev": 10,
            "arIni.AIId.dAICode.desc": "224300BU (SC)",
            "st_id": 94,
            "AIType": "virDept",
            "arIni.AIId.dAICode.code": "224300BU",
            "id": 94,
            "lastModifyDate": "2021-09-16 12:12:50"
        }
    ]
}

# Load AR Initial Balance

# 一、Description

​ Usage: Load 【AR Initial Balance】 Record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes arIni
id long(Query) Yes AR Initial Balance 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/arIni";
			String param = "&menuCode=arIni&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": {
        "remartran": [
            {
                "statement_cth": "",
                "remarks_en": "",
                "particular_jp": "",
                "shipAd2_zh-TW": "",
                "statement_sxg": "",
                "shipAd1_en": "",
                "payTerm_zh-TW": "",
                "noteDesc": "",
                "shipAd2_jp": "",
                "noteDesc_jp": "",
                "id": 483,
                "remarks_zh-TW": "",
                "shipAd1_zh-CN": "",
                "shipAd4_hy": "",
                "payTerm_hy": "",
                "statement_hy": "",
                "hId": 94,
                "payTerm": "",
                "particular_en": "",
                "shipAd4_cth": "",
                "particular_zh-TW": "",
                "particular_cth": "",
                "particular": "",
                "payTerm_cth": "",
                "remarks_cth": "",
                "remarks_hy": "",
                "particular_zh-CN": "",
                "shipAd2_en": "",
                "shipAd4_sxg": "",
                "remarks_sxg": "",
                "noteDesc_cth": "",
                "i18nField": "{\"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipAd1_zh-CN\": \"\", \"shipAd2_zh-CN\": \"\", \"shipAd3_zh-CN\": \"\", \"shipAd4_zh-CN\": \"\", \"noteDesc_zh-CN\": \"\", \"statement_zh-CN\": \"\", \"particular_zh-CN\": \"\"}",
                "shipAd3_jp": "",
                "remarks_zh-CN": "",
                "statement_en": "",
                "shipAd1_hy": "",
                "shipAd3_zh-TW": "",
                "payTerm_zh-CN": "",
                "particular_sxg": "",
                "payTerm_sxg": "",
                "noteDesc_en": "",
                "shipCodeId": 0,
                "shipAd2_cth": "",
                "noteDesc_zh-CN": "",
                "payTerm_en": "",
                "iRev": 1,
                "shipAd1_cth": "",
                "shipAd3_sxg": "",
                "shipAd4_zh-TW": "",
                "particular_hy": "",
                "noteDesc_sxg": "",
                "ce01Module": "arIni",
                "shipAd3_cth": "",
                "shipAd3_en": "",
                "statement_zh-CN": "",
                "shipAd3_zh-CN": "",
                "shipAd4_zh-CN": "",
                "shipAd1_sxg": "",
                "shipAd4_jp": "",
                "statement_jp": "",
                "noteDesc_hy": "",
                "statement": "",
                "shipAd2_sxg": "",
                "shipAd2_hy": "",
                "remarks_jp": "",
                "payTerm_jp": "",
                "noteDesc_zh-TW": "",
                "shipAd1": "",
                "shipAd2": "",
                "shipAd3": "",
                "shipAd4": "",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "",
                "shipAd1_jp": "",
                "shipAd2_zh-CN": "",
                "shipAd3_hy": "",
                "statement_zh-TW": "",
                "remarks": ""
            }
        ],
        "mainarini": [
            {
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "installNo": 1,
                "AI1": 0,
                "AI2": 0,
                "sysJson": "",
                "AI3": 0,
                "AI4": 0,
                "viewCode": "arIni",
                "AI5": 0,
                "accDesc": "",
                "position_cth": "",
                "accDesc_cth": "",
                "AI6": 0,
                "AI7": 0,
                "AI8": 0,
                "AI9": 0,
                "alAmt": 0,
                "useAccessBl": false,
                "id": 94,
                "lastModifyDate": 1631765570000,
                "createUid": 5,
                "position_hy": "",
                "completed": true,
                "iniAmt": 100,
                "accjlId": 41664,
                "i18nField": "{\"accDesc_zh-CN\": \"\", \"position_zh-CN\": \"\"}",
                "dayOfMonth": 0,
                "accDesc_en": "",
                "manId": 0,
                "status": "Y",
                "cnDeptId": 0,
                "jlTypeId": 0,
                "iRev": 10,
                "AI19": 0,
                "aInvMonth": 0,
                "ce01Module": "arIni",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "statusModifyDate": 1631765570000,
                "aiCnDeptId": 0,
                "aiMemId": 0,
                "createDate": 1631765570000,
                "cp": 0,
                "useAccessWl": false,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "AIId": 26,
                "useAccessAutoCalc": false,
                "position_sxg": "",
                "cpDate": 1631721600000,
                "lastModifyUid": 5,
                "aiVirDeptId": 26,
                "aiVenId": 0,
                "position_zh-CN": "",
                "eDiscRate": 0,
                "beId": 1,
                "accDesc_jp": "",
                "AIType": "virDept",
                "comRate": 0,
                "AI30": 0,
                "locked": false,
                "accDesc_sxg": "",
                "showEarlyPayDisc": false,
                "rev": "1",
                "batchNo": "",
                "lastApproveUid": 5,
                "aiCusId": 0,
                "iafTrxDesc": "AR Initial Balance of 224300BU (EN)",
                "expiredUid": 0,
                "completedDate": 1631721600000,
                "position_en": "",
                "position_zh-TW": "",
                "aiStaffId": 0,
                "monthEndDate": "0",
                "iniDate": 1631721600000,
                "position": "",
                "tDate": 1631721600000,
                "attachmentNo": 0,
                "code": "232516ARIB-1",
                "amt": 100,
                "accDesc_zh-TW": "",
                "curId": 1,
                "position_jp": "",
                "expired": false,
                "rate": 1,
                "domAmt": 100,
                "printCount": 0,
                "accDesc_hy": "",
                "accDesc_zh-CN": "",
                "accdfId": 41,
                "attachmentCount": 0,
                "staffId": 4
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create AR Initial Balance

# 一、Description

​ Usage: create or update 【AR Initial Balance】

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes arIni
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/arIni";
		String param = "&menuCode=arIni";

		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:

{
    "mainarini": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "curId": 1,
                "AIType": "cus",
                "rate": 1,
                "virDeptId": 4,
                "domAmt": 400,
                "iniDate": "2022-04-15",
                "amt": 400,
                "AIId": 12,
                "staffId": 4,
                "iniAmt": 400
            }
        ]
    }
}

​ 4、Response Sample

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

# Delete AR Initial Balance

# 一、Description

​ Usage: Delete AR Initial Balance

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes arIni
id long(Query) Yes AR Initial Balance 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/arIni";
		String param = "&menuCode=arIni&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
}

# Deposit Receipt Initial Balance

# Fetch Deposit Receipt Initial Balance List

# 一、Description

​ Usage: Fetch Deposit Receipt Initial Balance List.

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes drIni
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=drIni&beId=11";

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

​ 4、Response Sample

{
    "stSearch": "drIni",
    "size": 1,
    "stSearchDisplay": "Deposit Receipt Initial Balance",
    "values": [
        {
            "tDate": "2021-09-16",
            "batchNo": "",
            "code": "232516ARIB-1",
            "st_code": "232516ARIB-1",
            "drIni.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "st_desc": "232516ARIB-1",
            "iRev": 10,
            "drIni.AIId.dAICode.desc": "224300BU (SC)",
            "st_id": 94,
            "AIType": "virDept",
            "drIni.AIId.dAICode.code": "224300BU",
            "id": 94,
            "lastModifyDate": "2021-09-16 12:12:50"
        }
    ]
}

# Load Deposit Receipt Initial Balance

# 一、Description

​ Usage: Load 【Deposit Receipt Initial Balance】Record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes drIni
id long(Query) Yes Deposit Receipt Initial Balance 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/drIni";
			String param = "&menuCode=drIni&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": {
        "maindrini": [
            {
                "lastModifyUid": 5,
                "aiVirDeptId": 0,
                "useAccess": false,
                "virDeptId": 4,
                "aiVenId": 0,
                "expiredDate": -2209017600000,
                "AI1": 0,
                "AI2": 0,
                "sysJson": "",
                "AI3": 0,
                "AI4": 0,
                "viewCode": "drIni",
                "AI5": 0,
                "accDesc": "",
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "AI9": 0,
                "alAmt": 0,
                "AIType": "cus",
                "useAccessBl": false,
                "id": 49,
                "AI30": 0,
                "locked": false,
                "lastModifyDate": 1647224729000,
                "createUid": 5,
                "rev": "2",
                "batchNo": "",
                "depositKey": "consignCo_0_",
                "lastApproveUid": 5,
                "aiCusId": 12,
                "iafTrxDesc": "AP Initial Balance of JCB (HK) Trading Limited (AAC)",
                "retAmt": 0,
                "expiredUid": 0,
                "multiRecId": 0,
                "iniAmt": 1000,
                "accjlId": 43542,
                "aiStaffId": 0,
                "manId": 0,
                "iniDate": 1647187200000,
                "position": "",
                "status": "Y",
                "tDate": 1647187200000,
                "attachmentNo": 0,
                "code": "155313DRIB",
                "cnDeptId": 94,
                "jlTypeId": 0,
                "amt": 1000,
                "iRev": 6,
                "AI19": 0,
                "sTranId": 0,
                "ce01Module": "drIni",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "curId": 1,
                "AI16": 0,
                "expired": false,
                "AI13": 0,
                "AI14": 0,
                "rate": 1,
                "domAmt": 1000,
                "AI11": 0,
                "AI12": 0,
                "printCount": 0,
                "AI10": 0,
                "sorId": 0,
                "statusModifyDate": 1647224614000,
                "aiCnDeptId": 0,
                "aiMemId": 0,
                "createDate": 1647224608000,
                "useAccessWl": false,
                "AI28": 0,
                "accdfId": 43,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "attachmentCount": 0,
                "sTranType": "consignCo",
                "AIId": 12,
                "useAccessAutoCalc": false,
                "staffId": 1
            }
        ],
        "remrecreg": [
            {
                "statement_cth": "",
                "remarks_en": "",
                "particular_jp": "",
                "shipAd2_zh-TW": "",
                "statement_sxg": "",
                "shipAd1_en": "Rm 1403 Wset Tower Shun Tak Centre 168",
                "shipAd2_jp": "",
                "id": 738,
                "remarks_zh-TW": "",
                "shipAd1_zh-CN": "",
                "shipAd4_hy": "",
                "statement_hy": "",
                "hId": 49,
                "particular_en": "",
                "shipAd4_cth": "",
                "particular_zh-TW": "",
                "particular_cth": "",
                "particular": "",
                "remarks_cth": "",
                "remarks_hy": "",
                "particular_zh-CN": "",
                "shipAd2_en": "Connaught Road Central",
                "shipAd4_sxg": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\", \"shipAd1_en\": \"Rm 1403 Wset Tower Shun Tak Centre 168\", \"shipAd2_en\": \"Connaught Road Central\", \"shipAd3_en\": \"Central and Western District\", \"shipAd4_en\": \"Hong Kong\", \"statement_en\": \"\", \"particular_en\": \"\"}",
                "shipAd3_jp": "",
                "remarks_zh-CN": "",
                "statement_en": "",
                "shipAd1_hy": "",
                "shipAd3_zh-TW": "",
                "particular_sxg": "",
                "shipCodeId": 31,
                "shipAd2_cth": "",
                "iRev": 6,
                "shipAd1_cth": "",
                "shipAd3_sxg": "",
                "shipAd4_zh-TW": "",
                "particular_hy": "",
                "ce01Module": "drIni",
                "shipAd3_cth": "",
                "shipAd3_en": "Central and Western District",
                "statement_zh-CN": "",
                "shipAd3_zh-CN": "",
                "shipAd4_zh-CN": "",
                "shipAd1_sxg": "",
                "shipAd4_jp": "",
                "statement_jp": "",
                "statement": "",
                "shipAd2_sxg": "",
                "shipAd2_hy": "",
                "remarks_jp": "",
                "shipAd1": "Rm 1403 Wset Tower Shun Tak Centre 168",
                "shipAd2": "Connaught Road Central",
                "shipAd3": "Central and Western District",
                "shipAd4": "Hong Kong",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "Hong Kong",
                "shipAd1_jp": "",
                "shipAd2_zh-CN": "",
                "shipAd3_hy": "",
                "statement_zh-TW": "",
                "remarks": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Deposit Receipt Initial Balance

# 一、Description

​ Usage: create or update 【Deposit Receipt Initial Balance】

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes drIni
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/drIni";
		String param = "&menuCode=drIni";

		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:

{
    "maindrini": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "curId": 1,
                "AIType": "cus",
                "rate": 1,
                "virDeptId": 4,
                "domAmt": 400,
                "iniDate": "2022-04-15",
                "amt": 400,
                "AIId": 12,
                "staffId": 4,
                "iniAmt": 400
            }
        ]
    }
}

​ 4、Response Sample

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

# Delete Deposit Receipt Initial Balance

# 一、Description

​ Usage: Delete Deposit Receipt Initial Balance

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes drIni
id long(Query) Yes Deposit Receipt Initial Balance 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/drIni";
		String param = "&menuCode=drIni&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
}

# AR Transaction

# Fetch AR Transaction List

# 一、Description

​ Usage: Fetch AR Transaction List.

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes arTran
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=arTran&beId=11";

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

​ 4、Response Sample

{
    "stSearch": "arTran",
    "size": 1,
    "stSearchDisplay": "AR Transaction",
    "values": [
        {
            "tDate": "2023-01-01",
            "batchNo": "",
            "code": "JCAAART230102",
            "st_code": "JCAAART230102",
            "arTran.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "st_desc": "JCAAART230102",
            "arTran.AIId.dAICode.desc": "JCB (HK) Trading Limited",
            "amt": 200,
            "iRev": 3,
            "arTran.curId.cur.sym": "HK$",
            "arTran.AIId.dAICode.code": "AAC",
            "st_id": 420,
            "AIType": "cus",
            "id": 420,
            "lastModifyDate": "2022-01-04 15:31:34"
        }
    ]
}

# Load AR Transaction

# 一、Description

​ Usage: Load 【AR Transaction】Record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes arTran
id long(Query) Yes AR Transaction 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/arTran";
			String param = "&menuCode=arTran&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": {
        "artrant": [
            {
                "AI1": 0,
                "c_d": "discount",
                "AI2": 0,
                "itemNo": "     1",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "accDesc": "Account Receivable 1",
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "AI9": 0,
                "cusId": 0,
                "id": 516,
                "AI30": 0,
                "taxAmt": 0,
                "debtorType": "cus",
                "oiId": 0,
                "hId": 420,
                "taxDomAmt": 0,
                "particular": "",
                "taxCodeId": 0,
                "creditorType": "ven",
                "venId": 0,
                "cnDeptId": 0,
                "amt": 100,
                "iRev": 3,
                "AI19": 0,
                "ce01Module": "arTran",
                "AI17": 0,
                "AI18": 0,
                "preTaxAmt": 100,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "domAmt": 100,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "preTaxDomAmt": 100,
                "vatPer": 0,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "proId": 0,
                "AI20": 0,
                "AI21": 0,
                "accId": 58,
                "staffId": 0
            },
            {
                "AI1": 0,
                "c_d": "discount",
                "AI2": 0,
                "itemNo": "     2",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "accDesc": "Account Receivable 2",
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "AI9": 0,
                "cusId": 0,
                "id": 517,
                "AI30": 0,
                "taxAmt": 0,
                "debtorType": "cus",
                "oiId": 0,
                "hId": 420,
                "taxDomAmt": 0,
                "particular": "",
                "taxCodeId": 0,
                "creditorType": "ven",
                "venId": 0,
                "cnDeptId": 0,
                "amt": 200,
                "iRev": 3,
                "AI19": 0,
                "ce01Module": "arTran",
                "AI17": 0,
                "AI18": 0,
                "preTaxAmt": 200,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "domAmt": 200,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "preTaxDomAmt": 200,
                "vatPer": 0,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "proId": 0,
                "AI20": 0,
                "AI21": 0,
                "accId": 59,
                "staffId": 0
            },
            {
                "AI1": 0,
                "c_d": "charge",
                "AI2": 0,
                "itemNo": "     3",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "accDesc": "Account Receivable 3",
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "AI9": 0,
                "cusId": 0,
                "id": 518,
                "AI30": 0,
                "taxAmt": 0,
                "debtorType": "cus",
                "oiId": 0,
                "hId": 420,
                "taxDomAmt": 0,
                "particular": "",
                "taxCodeId": 0,
                "creditorType": "ven",
                "venId": 0,
                "cnDeptId": 0,
                "amt": 500,
                "iRev": 3,
                "AI19": 0,
                "ce01Module": "arTran",
                "AI17": 0,
                "AI18": 0,
                "preTaxAmt": 500,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "domAmt": 500,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "preTaxDomAmt": 500,
                "vatPer": 0,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "proId": 0,
                "AI20": 0,
                "AI21": 0,
                "accId": 60,
                "staffId": 0
            }
        ],
        "mainartran": [
            {
                "useAccess": false,
                "virDeptId": 4,
                "sggstOvrr": false,
                "expiredDate": -2209017600000,
                "installNo": 0,
                "AI1": 0,
                "AI2": 0,
                "sysJson": "",
                "AI3": 0,
                "AI4": 0,
                "viewCode": "arTran",
                "AI5": 0,
                "accDesc": "",
                "position_cth": "",
                "accDesc_cth": "",
                "AI6": 0,
                "AI7": 0,
                "AI8": 0,
                "AI9": 0,
                "useAccessBl": false,
                "id": 420,
                "lastModifyDate": 1641281494000,
                "createUid": 5,
                "method": "cod",
                "taxDomAmt": 0,
                "position_hy": "",
                "udfaracc": 0,
                "completed": false,
                "accjlId": 42551,
                "i18nField": "{\"accDesc_en\": \"\", \"position_en\": \"Sales Staff\"}",
                "dayOfMonth": 1,
                "accDesc_en": "",
                "taxOrigin": "",
                "manId": 36,
                "multiFlowSrcId": 0,
                "status": "Y",
                "multiFlowFlowId": 0,
                "cnDeptId": 94,
                "jlTypeId": 0,
                "iRev": 3,
                "AI19": 0,
                "aInvMonth": 0,
                "ce01Module": "arTran",
                "AI17": 0,
                "AI18": 0,
                "preTaxAmt": 200,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "statusModifyDate": 1641281417000,
                "aiCnDeptId": 0,
                "aiMemId": 0,
                "createDate": 1641281417000,
                "needOi": true,
                "cp": 0,
                "useAccessWl": false,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "multiFlowSrcBeId": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "prtFpsQrCode": false,
                "AIId": 12,
                "useAccessAutoCalc": false,
                "udfamount": "",
                "domAmtDiff": 0,
                "position_sxg": "",
                "cpDate": 1672502400000,
                "lastModifyUid": 5,
                "aiVirDeptId": 0,
                "aiVenId": 0,
                "position_zh-CN": "",
                "eDiscRate": 0,
                "beId": 1,
                "accDesc_jp": "",
                "AIType": "cus",
                "comRate": 0,
                "AI30": 0,
                "locked": false,
                "taxAmt": 0,
                "accDesc_sxg": "",
                "showEarlyPayDisc": false,
                "oiId": 0,
                "rev": "3",
                "batchNo": "",
                "lastApproveUid": 5,
                "aiCusId": 12,
                "ttlCharge": 500,
                "iafTrxDesc": "",
                "expiredUid": 0,
                "completedDate": -2209017600000,
                "position_en": "Sales Staff",
                "position_zh-TW": "",
                "aiStaffId": 0,
                "monthEndDate": "0",
                "position": "Sales Staff",
                "hpSetting": "dayAfterInv",
                "tDate": 1672502400000,
                "attachmentNo": 0,
                "code": "JCAAART230102",
                "multiFlowSrcModule": "",
                "amt": 200,
                "accDesc_zh-TW": "",
                "depoAmt": 0,
                "curId": 1,
                "position_jp": "",
                "expired": false,
                "rate": 1,
                "domAmt": 200,
                "printCount": 0,
                "preTaxDomAmt": 200,
                "vatPer": 0,
                "domDepoAmt": 0,
                "accDesc_hy": "",
                "accDesc_zh-CN": "",
                "loadGpCoData": false,
                "accdfId": 409,
                "fpsOffSetId": 0,
                "ttlDisc": 300,
                "attachmentCount": 0,
                "staffId": 1
            }
        ],
        "remartran": [
            {
                "statement_cth": "",
                "remarks_en": "",
                "particular_jp": "",
                "shipAd2_zh-TW": "",
                "statement_sxg": "",
                "shipAd1_en": "Rm 1403 Wset Tower Shun Tak Centre 168",
                "payTerm_zh-TW": "",
                "noteDesc": "",
                "shipAd2_jp": "",
                "noteDesc_jp": "",
                "id": 527,
                "remarks_zh-TW": "",
                "shipAd1_zh-CN": "",
                "shipAd4_hy": "",
                "payTerm_hy": "",
                "statement_hy": "",
                "hId": 420,
                "payTerm": "",
                "particular_en": "",
                "shipAd4_cth": "",
                "particular_zh-TW": "",
                "particular_cth": "",
                "particular": "",
                "payTerm_cth": "",
                "remarks_cth": "",
                "remarks_hy": "",
                "particular_zh-CN": "",
                "shipAd2_en": "Connaught Road Central",
                "shipAd4_sxg": "",
                "remarks_sxg": "",
                "noteDesc_cth": "",
                "i18nField": "{\"payTerm_en\": \"\", \"remarks_en\": \"\", \"shipAd1_en\": \"Rm 1403 Wset Tower Shun Tak Centre 168\", \"shipAd2_en\": \"Connaught Road Central\", \"shipAd3_en\": \"Central and Western District\", \"shipAd4_en\": \"Hong Kong\", \"noteDesc_en\": \"\", \"statement_en\": \"\", \"particular_en\": \"\"}",
                "shipAd3_jp": "",
                "remarks_zh-CN": "",
                "statement_en": "",
                "shipAd1_hy": "",
                "shipAd3_zh-TW": "",
                "payTerm_zh-CN": "",
                "particular_sxg": "",
                "payTerm_sxg": "",
                "noteDesc_en": "",
                "shipCodeId": 31,
                "shipAd2_cth": "",
                "noteDesc_zh-CN": "",
                "payTerm_en": "",
                "iRev": 3,
                "shipAd1_cth": "",
                "shipAd3_sxg": "",
                "shipAd4_zh-TW": "",
                "particular_hy": "",
                "noteDesc_sxg": "",
                "ce01Module": "arTran",
                "shipAd3_cth": "",
                "shipAd3_en": "Central and Western District",
                "statement_zh-CN": "",
                "shipAd3_zh-CN": "",
                "shipAd4_zh-CN": "",
                "shipAd1_sxg": "",
                "shipAd4_jp": "",
                "statement_jp": "",
                "noteDesc_hy": "",
                "statement": "",
                "shipAd2_sxg": "",
                "shipAd2_hy": "",
                "remarks_jp": "",
                "payTerm_jp": "",
                "noteDesc_zh-TW": "",
                "shipAd1": "Rm 1403 Wset Tower Shun Tak Centre 168",
                "shipAd2": "Connaught Road Central",
                "shipAd3": "Central and Western District",
                "shipAd4": "Hong Kong",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "Hong Kong",
                "shipAd1_jp": "",
                "shipAd2_zh-CN": "",
                "shipAd3_hy": "",
                "statement_zh-TW": "",
                "remarks": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create AR Transaction

# 一、Description

​ Usage: create or update 【AR Transaction】

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes arTran
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/arTran";
		String param = "&menuCode=arTran";

		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:

{
    "artrant": {
        "values": [
            {
                "domAmt": 400,
                "accId": 22,
                "c_d": "charge",
                "amt": 400
            }
        ]
    },
    "mainartran": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "cpDate": "2022-05-14",
                "curId": 1,
                "AIType": "cus",
                "rate": 1,
                "virDeptId": 4,
                "domAmt": 400,
                "amt": 400,
                "AIId": 12,
                "staffId": 4
            }
        ]
    }
}

​ 4、Response Sample

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

# Delete AR Transaction

# 一、Description

​ Usage: Delete AR Transaction

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes arTran
id long(Query) Yes AR Transaction 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/arTran";
		String param = "&menuCode=arTran&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
}

# Receipt Register

# Fetch Receipt Register List

# 一、Description

​ Usage: Fetch Receipt Register List.

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes recReg
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=recReg&beId=11";

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

​ 4、Response Sample

{
    "stSearch": "recReg",
    "size": 1,
    "stSearchDisplay": "Receipt Register",
    "values": [
        {
            "tDate": "2022-03-19",
            "recReg.AIId.dAICode.code": "237650CUS",
            "batchNo": "",
            "code": "RET22030001",
            "st_code": "RET22030001",
            "recReg.AIId.dAICode.desc": "237650CUS",
            "st_desc": "RET22030001",
            "iRev": 1,
            "st_id": 698,
            "AIType": "cus",
            "recReg.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "id": 698,
            "lastModifyDate": "2022-03-19 11:51:21"
        }
    ]
}

# Load Receipt Register

# 一、Description

​ Usage: Load 【Receipt Register】Record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes recReg
id long(Query) Yes Receipt Register 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/recReg";
			String param = "&menuCode=recReg&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": {
        "remrecreg": [
            {
                "statement_cth": "",
                "remarks_en": "",
                "particular_jp": "",
                "shipAd2_zh-TW": "",
                "statement_sxg": "",
                "shipAd1_en": "",
                "shipAd2_jp": "",
                "id": 747,
                "remarks_zh-TW": "",
                "shipAd1_zh-CN": "",
                "shipAd4_hy": "",
                "statement_hy": "",
                "hId": 698,
                "particular_en": "",
                "shipAd4_cth": "",
                "particular_zh-TW": "",
                "particular_cth": "",
                "particular": "",
                "remarks_cth": "",
                "remarks_hy": "",
                "particular_zh-CN": "",
                "shipAd2_en": "",
                "shipAd4_sxg": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\", \"shipAd1_en\": \"\", \"shipAd2_en\": \"\", \"shipAd3_en\": \"\", \"shipAd4_en\": \"\", \"statement_en\": \"\", \"particular_en\": \"\"}",
                "shipAd3_jp": "",
                "remarks_zh-CN": "",
                "statement_en": "",
                "shipAd1_hy": "",
                "shipAd3_zh-TW": "",
                "particular_sxg": "",
                "shipCodeId": 0,
                "shipAd2_cth": "",
                "iRev": 1,
                "shipAd1_cth": "",
                "shipAd3_sxg": "",
                "shipAd4_zh-TW": "",
                "particular_hy": "",
                "ce01Module": "recReg",
                "shipAd3_cth": "",
                "shipAd3_en": "",
                "statement_zh-CN": "",
                "shipAd3_zh-CN": "",
                "shipAd4_zh-CN": "",
                "shipAd1_sxg": "",
                "shipAd4_jp": "",
                "statement_jp": "",
                "statement": "",
                "shipAd2_sxg": "",
                "shipAd2_hy": "",
                "remarks_jp": "",
                "shipAd1": "",
                "shipAd2": "",
                "shipAd3": "",
                "shipAd4": "",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "",
                "shipAd1_jp": "",
                "shipAd2_zh-CN": "",
                "shipAd3_hy": "",
                "statement_zh-TW": "",
                "remarks": ""
            }
        ],
        "recregdbt": [
            {
                "AI1": 0,
                "c_d": 1,
                "AI2": 0,
                "itemNo": "     1",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "accDesc": "HSBC",
                "payer": "",
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "AI9": 0,
                "iafSrcDocId": "",
                "cusId": 0,
                "id": 908,
                "AI30": 0,
                "debtorType": "cus",
                "hId": 698,
                "chequeNo": "",
                "taxCodeId": 0,
                "creditorType": "ven",
                "bankSlipNo": "",
                "printed": false,
                "venId": 0,
                "receipt": false,
                "cnDeptId": 0,
                "amt": 300,
                "iRev": 1,
                "AI19": 0,
                "ce01Module": "recReg",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "curId": 1,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "rate": 1,
                "domAmt": 300,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "bkopNoId": 27,
                "slmId": 0,
                "chequeDate": 1647619200000,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "proId": 0,
                "AI20": 0,
                "AI21": 0,
                "accId": 25,
                "staffId": 0,
                "bkopAc": "4937481502"
            }
        ],
        "recregt": [
            {
                "AI1": 0,
                "AI2": 0,
                "itemNo": "     1",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "accDesc": "",
                "AI6": 0,
                "AI7": 0,
                "eDiscRate": 0,
                "beId": 1,
                "AI8": 0,
                "shipAd2_zh-TW": "",
                "AI9": 0,
                "iafSrcDocId": "",
                "shipAd1_en": "Rm 1403 Wset Tower Shun Tak Centre 168",
                "shipAd2_jp": "",
                "revertSettled": false,
                "id": 786,
                "AI30": 0,
                "shipAd1_zh-CN": "",
                "shipAd4_hy": "",
                "hId": 698,
                "depositKey": "arTran_435_",
                "shipAd4_cth": "",
                "shipAd2_en": "Mong Kok",
                "shipAd4_sxg": "",
                "i18nField": "{\"shipAd1_en\": \"Rm 1403 Wset Tower Shun Tak Centre 168\", \"shipAd2_en\": \"Mong Kok\", \"shipAd3_en\": \"Central and Western District\", \"shipAd4_en\": \"Hong Kong\"}",
                "shipAd3_jp": "",
                "invRate": 1,
                "curDomAmt": -300,
                "multiRecKey": "",
                "shipAd1_hy": "",
                "shipAd3_zh-TW": "",
                "srcAIId": 1760,
                "shipCodeId": 358,
                "shipAd2_cth": "",
                "settle": true,
                "amt": -300,
                "iRev": 1,
                "shipAd1_cth": "",
                "shipAd3_sxg": "",
                "shipAd4_zh-TW": "",
                "udf002": "",
                "udf001": 0,
                "AI19": 0,
                "sTranId": 435,
                "ce01Module": "recReg",
                "AI17": 0,
                "lot": "",
                "shipAd3_cth": "",
                "AI18": 0,
                "shipAd3_en": "Central and Western District",
                "AI15": 0,
                "curId": 1,
                "AI16": 0,
                "shipAd3_zh-CN": "",
                "shipAd4_zh-CN": "",
                "AI13": 0,
                "AI14": 0,
                "rate": 1,
                "domAmt": -300,
                "curDomEDiscAmt": 0,
                "shipAd1_sxg": "",
                "shipAd4_jp": "",
                "AI11": 0,
                "AI12": 0,
                "shipAd2_sxg": "",
                "AI10": 0,
                "shipAd2_hy": "",
                "eDiscAmt": 0,
                "domEDiscAmt": 0,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "shipAd1": "Rm 1403 Wset Tower Shun Tak Centre 168",
                "AI27": 0,
                "shipAd2": "Mong Kok",
                "AI24": 0,
                "shipAd3": "Central and Western District",
                "AI25": 0,
                "shipAd4": "Hong Kong",
                "shipAd1_zh-TW": "",
                "AI22": 0,
                "shipAd4_en": "Hong Kong",
                "AI23": 0,
                "shipAd1_jp": "",
                "AI20": 0,
                "shipAd2_zh-CN": "",
                "AI21": 0,
                "shipAd3_hy": "",
                "sTranType": "arTran",
                "settleType": "invoice",
                "domAmtDiff": 0
            }
        ],
        "mainrecreg": [
            {
                "settledAmtCurId": 1,
                "setAmt": -300,
                "useAccess": false,
                "virDeptId": 4,
                "suspenseAmtCurId": 1,
                "expiredDate": -2209017600000,
                "AI1": 0,
                "AI2": 0,
                "sysJson": "{\"autoGenCode\":{\"snId\":447,\"code\":\"RET22030001\",\"sn\":\"1\"}}",
                "AI3": 0,
                "AI4": 0,
                "viewCode": "recReg",
                "AI5": 0,
                "AI6": 0,
                "AI7": 0,
                "AI8": 0,
                "AI9": 0,
                "fromSiId": 0,
                "useAccessBl": false,
                "id": 698,
                "lastModifyDate": 1647661881000,
                "createUid": 5,
                "depoUsedAmt": 0,
                "retAmt": 0,
                "accjlId": 0,
                "suspenseAmtRate": 1,
                "depoAppliedAmtRate": 1,
                "receivedAmtRate": 1,
                "manId": 459,
                "multiFlowSrcId": 0,
                "status": "N",
                "multiFlowFlowId": 0,
                "cnDeptId": 177,
                "jlTypeId": 0,
                "iRev": 1,
                "AI19": 0,
                "ce01Module": "recReg",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "statusModifyDate": 1647661881000,
                "aiCnDeptId": 0,
                "multiFlowId": 0,
                "aiMemId": 0,
                "createDate": 1647661881000,
                "debitAmtCurId": 1,
                "settledAmtRate": 1,
                "useAccessWl": false,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "suspenseAmt": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "multiFlowSrcBeId": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "AIId": 1760,
                "useAccessAutoCalc": false,
                "lastModifyUid": 5,
                "aiVirDeptId": 0,
                "aiVenId": 0,
                "beId": 1,
                "receivedAmtCurId": 1,
                "AIType": "cus",
                "AI30": 0,
                "locked": false,
                "rev": "1",
                "batchNo": "",
                "lastApproveUid": 0,
                "aiCusId": 1760,
                "iafTrxDesc": "",
                "expiredUid": 0,
                "fromSoId": 0,
                "multiRecId": 0,
                "aiStaffId": 0,
                "position": "Sales Staff",
                "tDate": 1647619200000,
                "attachmentNo": 0,
                "code": "RET22030001",
                "multiFlowSrcModule": "",
                "amt": -300,
                "curId": 1,
                "expired": false,
                "rate": 1,
                "domAmt": -300,
                "printCount": 0,
                "sorId": 0,
                "debitAmtRate": 1,
                "fpsOffReceiptId": "",
                "loadGpCoData": false,
                "depoAppliedAmtCurId": 1,
                "accdfId": 0,
                "attachmentCount": 0,
                "staffId": 1029
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Receipt Register

# 一、Description

​ Usage: create or update 【Receipt Register】

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes recReg
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/recReg";
		String param = "&menuCode=recReg";

		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:

{
    "recregdbt": {
        "values": [
            {
                "curId": 1,
                "rate": 1,
                "domAmt": 200,
                "accId": 22,
                "amt": 200,
                "chequeDate": "2022-04-15"
            }
        ]
    },
    "recregt": {
        "values": [
            {
                "lot": "A",
                "curId": 1,
                "rate": 1,
                "domAmt": 200,
                "invRate": 1,
                "amt": 200,
                "curDomAmt": 200,
                "sTranType": "arTran",
                "settleType": "invoice",
                "sTranId": 440
            }
        ]
    },
    "mainrecreg": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "curId": 1,
                "AIType": "cus",
                "rate": 1,
                "virDeptId": 4,
                "domAmt": 400,
                "amt": 400,
                "AIId": 12,
                "staffId": 4
            }
        ]
    }
}

​ 4、Response Sample

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

# Delete Receipt Register

# 一、Description

​ Usage: Delete Receipt Register

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes recReg
id long(Query) Yes Receipt Register 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/recReg";
		String param = "&menuCode=recReg&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
}

# AP Initial Balance

# Fetch AP Initial Balance List

# 一、Description

​ Usage: Fetch AP Initial Balance List.

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes apIni
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=apIni&beId=11";

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

​ 4、Response Sample

{
    "stSearch": "apIni",
    "size": 1,
    "stSearchDisplay": "AP Initial Balance",
    "values": [
        {
            "tDate": "2021-09-16",
            "batchNo": "",
            "code": "232516APIB-1",
            "st_code": "232516APIB-1",
            "apIni.lastModifyUid.simpleUser.desc": "admin",
            "st_desc": "232516APIB-1",
            "amt": 100,
            "iRev": 1,
            "apIni.AIId.cAICode.code": "224300BU",
            "st_id": 45,
            "AIType": "virDept",
            "apIni.curId.cur.sym": "HK$",
            "id": 45,
            "lastModifyDate": "2021-09-16 16:59:45",
            "apIni.AIId.cAICode.desc": "224300BU (SC)"
        }
    ]
}

# Load AP Initial Balance

# 一、Description

​ Usage: Load 【AP Initial Balance】Record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes apIni
id long(Query) Yes AP Initial Balance 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/apIni";
			String param = "&menuCode=apIni&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": {
        "mainapini": [
            {
                "useAccess": false,
                "virDeptId": 4,
                "expiredDate": -2209017600000,
                "installNo": 1,
                "AI1": 0,
                "AI2": 0,
                "sysJson": "",
                "AI3": 0,
                "AI4": 0,
                "viewCode": "apIni",
                "AI5": 0,
                "accDesc": "",
                "accDesc_cth": "",
                "AI6": 0,
                "AI7": 0,
                "AI8": 0,
                "AI9": 0,
                "alAmt": 0,
                "useAccessBl": false,
                "id": 45,
                "venInvNo_jp": "",
                "lastModifyDate": 1631782785000,
                "createUid": 1,
                "completed": false,
                "iniAmt": 100,
                "accjlId": 41682,
                "i18nField": "{\"accDesc_zh-CN\": \"\", \"venInvNo_zh-CN\": \"\"}",
                "dayOfMonth": 0,
                "accDesc_en": "",
                "manId": 0,
                "status": "Y",
                "cnDeptId": 0,
                "jlTypeId": 1,
                "iRev": 1,
                "AI19": 0,
                "aInvMonth": 0,
                "ce01Module": "apIni",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "venInvNo_hy": "",
                "AI14": 0,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "venInvNo_zh-CN": "",
                "statusModifyDate": 1631782785000,
                "aiCnDeptId": 0,
                "createDate": 1631782785000,
                "cp": 0,
                "useAccessWl": false,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "venInvNo_zh-TW": "",
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "venInvNo_cth": "",
                "AIId": 26,
                "useAccessAutoCalc": false,
                "cpDate": 1631721600000,
                "lastModifyUid": 1,
                "aiVirDeptId": 26,
                "aiVenId": 0,
                "eDiscRate": 0,
                "beId": 1,
                "accDesc_jp": "",
                "AIType": "virDept",
                "AI30": 0,
                "locked": false,
                "accDesc_sxg": "",
                "showEarlyPayDisc": false,
                "rev": "1",
                "batchNo": "",
                "lastApproveUid": 1,
                "aiCusId": 0,
                "iafTrxDesc": "AP Initial Balance of 224300BU (EN)",
                "expiredUid": 0,
                "completedDate": -2209017600000,
                "aiStaffId": 0,
                "monthEndDate": "0",
                "iniDate": 1631721600000,
                "position": "",
                "venInvNo": "",
                "tDate": 1631721600000,
                "attachmentNo": 0,
                "code": "232516APIB-1",
                "amt": 100,
                "accDesc_zh-TW": "",
                "curId": 1,
                "expired": false,
                "rate": 1,
                "domAmt": 100,
                "printCount": 0,
                "accDesc_hy": "",
                "accDesc_zh-CN": "",
                "venInvNo_sxg": "",
                "accdfId": 147,
                "attachmentCount": 0,
                "venInvNo_en": "",
                "staffId": 1
            }
        ],
        "remaptran": [
            {
                "noteDesc_zh-CN": "",
                "remarks_en": "",
                "particular_jp": "",
                "payTerm_en": "",
                "iRev": 1,
                "particular_hy": "",
                "noteDesc_sxg": "",
                "ce01Module": "apIni",
                "payTerm_zh-TW": "",
                "noteDesc": "",
                "noteDesc_hy": "",
                "noteDesc_jp": "",
                "id": 118,
                "remarks_zh-TW": "",
                "payTerm_hy": "",
                "remarks_jp": "",
                "hId": 45,
                "payTerm": "",
                "particular_en": "",
                "particular_zh-TW": "",
                "particular_cth": "",
                "particular": "",
                "payTerm_cth": "",
                "payTerm_jp": "",
                "noteDesc_zh-TW": "",
                "remarks_cth": "",
                "remarks_hy": "",
                "particular_zh-CN": "",
                "remarks_sxg": "",
                "noteDesc_cth": "",
                "i18nField": "{\"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"noteDesc_zh-CN\": \"\", \"particular_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "payTerm_zh-CN": "",
                "particular_sxg": "",
                "remarks": "",
                "payTerm_sxg": "",
                "noteDesc_en": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create AP Initial Balance

# 一、Description

​ Usage: create or update 【AP Initial Balance】

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes apIni
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/apIni";
		String param = "&menuCode=apIni";

		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:

{
    "mainapini": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "curId": 1,
                "AIType": "ven",
                "rate": 1,
                "virDeptId": 4,
                "domAmt": 400,
                "mainapini": 400,
                "iniDate": "2022-05-14",
                "amt": 400,
                "AIId": 14,
                "staffId": 4
            }
        ]
    }
}

​ 4、Response Sample

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

# Delete AP Initial Balance

# 一、Description

​ Usage: Delete AP Initial Balance

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes apIni
id long(Query) Yes AP Initial Balance 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/apIni";
		String param = "&menuCode=apIni&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
}

# Deposit Payment Initial Balance

# Fetch Deposit Payment Initial Balance List

# 一、Description

​ Usage: Fetch Deposit Payment Initial Balance List.

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes dpIni
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=dpIni&beId=11";

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

​ 4、Response Sample

{
    "stSearch": "dpIni",
    "size": 1,
    "stSearchDisplay": "Deposit Payment Initial Balance",
    "values": [
        {
            "dpIni.AIId.cAICode.desc": "Han Guang Company",
            "tDate": "2021-12-08",
            "batchNo": "",
            "code": "235724DPIB",
            "dpIni.AIId.cAICode.code": "HGSY",
            "st_code": "235724DPIB",
            "st_desc": "235724DPIB",
            "amt": 10000,
            "dpIni.curId.cur.sym": "HK$",
            "iRev": 5,
            "st_id": 24,
            "AIType": "ven",
            "dpIni.lastModifyUid.simpleUser.desc": "admin",
            "id": 24,
            "lastModifyDate": "2021-12-08 14:43:17"
        }
    ]
}

# Load Deposit Payment Initial Balance

# 一、Description

​ Usage: Load 【Deposit Payment Initial Balance】Record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes dpIni
id long(Query) Yes Deposit Payment Initial Balance 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/dpIni";
			String param = "&menuCode=dpIni&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": {
        "maindpini": [
            {
                "lastModifyUid": 1,
                "aiVirDeptId": 0,
                "useAccess": false,
                "orderId": 0,
                "virDeptId": 4,
                "aiVenId": 7,
                "expiredDate": -2209017600000,
                "AI1": 0,
                "AI2": 0,
                "sysJson": "",
                "AI3": 0,
                "AI4": 0,
                "viewCode": "dpIni",
                "AI5": 0,
                "accDesc": "",
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "AI9": 0,
                "alAmt": 0,
                "AIType": "ven",
                "useAccessBl": false,
                "id": 24,
                "AI30": 0,
                "locked": false,
                "lastModifyDate": 1638945797000,
                "createUid": 1,
                "rev": "1",
                "batchNo": "",
                "depositKey": "prodSpjob_0_",
                "lastApproveUid": 1,
                "aiCusId": 0,
                "iafTrxDesc": "",
                "expiredUid": 0,
                "iniAmt": 10000,
                "accjlId": 42413,
                "aiStaffId": 0,
                "multiPayId": 0,
                "manId": 0,
                "iniDate": 1638892800000,
                "position": "",
                "status": "Y",
                "tDate": 1638892800000,
                "attachmentNo": 0,
                "code": "235724DPIB",
                "cnDeptId": 177,
                "jlTypeId": 0,
                "amt": 10000,
                "iRev": 5,
                "petAmt": 0,
                "AI19": 0,
                "sTranId": 0,
                "ce01Module": "dpIni",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "curId": 1,
                "AI16": 0,
                "expired": false,
                "AI13": 0,
                "AI14": 0,
                "rate": 1,
                "domAmt": 10000,
                "AI11": 0,
                "AI12": 0,
                "printCount": 0,
                "AI10": 0,
                "statusModifyDate": 1638945797000,
                "aiCnDeptId": 0,
                "createDate": 1638945794000,
                "sjobId": 0,
                "useAccessWl": false,
                "spjobId": 0,
                "AI28": 0,
                "accdfId": 44,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "attachmentCount": 0,
                "sTranType": "prodSpjob",
                "AIId": 7,
                "useAccessAutoCalc": false,
                "staffId": 1029
            }
        ],
        "rempayreg": [
            {
                "statement_cth": "",
                "remarks_en": "",
                "particular_jp": "",
                "iRev": 5,
                "particular_hy": "",
                "ce01Module": "dpIni",
                "statement_zh-CN": "",
                "statement_sxg": "",
                "statement_jp": "",
                "statement": "",
                "id": 165,
                "remarks_zh-TW": "",
                "remarks_jp": "",
                "statement_hy": "",
                "hId": 24,
                "particular_en": "",
                "particular_zh-TW": "",
                "particular_cth": "",
                "particular": "",
                "remarks_cth": "",
                "remarks_hy": "",
                "particular_zh-CN": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\", \"statement_en\": \"\", \"particular_en\": \"\"}",
                "remarks_zh-CN": "",
                "statement_en": "",
                "statement_zh-TW": "",
                "particular_sxg": "",
                "remarks": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Deposit Payment Initial Balance

# 一、Description

​ Usage: create or update 【Deposit Payment Initial Balance】

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes dpIni
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/dpIni";
		String param = "&menuCode=dpIni";

		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:

{
    "maindpini": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "curId": 1,
                "AIType": "ven",
                "rate": 1,
                "virDeptId": 4,
                "domAmt": 400,
                "iniDate": "2022-05-14",
                "amt": 400,
                "AIId": 14,
                "staffId": 4,
                "iniAmt": 400
            }
        ]
    }
}

​ 4、Response Sample

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

# Delete Deposit Payment Initial Balance

# 一、Description

​ Usage: Delete Deposit Payment Initial Balance

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes dpIni
id long(Query) Yes Deposit Payment Initial Balance 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/dpIni";
		String param = "&menuCode=dpIni&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
}

# AP Transaction

# Fetch AP Transaction List

# 一、Description

​ Usage: Fetch AP Transaction List.

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes apTran
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=apTran&beId=11";

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

​ 4、Response Sample

{
    "stSearch": "apTran",
    "size": 1,
    "stSearchDisplay": "AP Transaction",
    "values": [
        {
            "tDate": "2021-12-30",
            "batchNo": "",
            "code": "AP_211230",
            "st_code": "AP_211230",
            "st_desc": "AP_211230",
            "iRev": 1,
            "apTran.lastModifyUid.simpleUser.desc": "admin",
            "st_id": 109,
            "AIType": "ven",
            "apTran.AIId.cAICode.code": "2021125VEN",
            "id": 109,
            "lastModifyDate": "2021-12-29 11:00:09",
            "apTran.AIId.cAICode.desc": "2021125VEN"
        }
    ]
}

# Load AP Transaction

# 一、Description

​ Usage: Load 【AP Transaction】Record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes apTran
id long(Query) Yes AP Transaction 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/apTran";
			String param = "&menuCode=apTran&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": {
        "mainaptran": [
            {
                "useAccess": false,
                "virDeptId": 17,
                "expiredDate": -2209017600000,
                "installNo": 0,
                "AI1": 0,
                "AI2": 0,
                "sysJson": "",
                "AI3": 0,
                "AI4": 0,
                "viewCode": "apTran",
                "AI5": 0,
                "accDesc": "",
                "accDesc_cth": "",
                "AI6": 0,
                "AI7": 0,
                "AI8": 0,
                "AI9": 0,
                "cusAcc": false,
                "useAccessBl": false,
                "id": 109,
                "venInvNo_jp": "",
                "lastModifyDate": 1640746809000,
                "createUid": 1,
                "method": "cod",
                "taxDomAmt": 0,
                "completed": false,
                "permitNo": "",
                "ttlImportPermitAmt": 0,
                "accjlId": 42532,
                "i18nField": "{\"accDesc_en\": \"\", \"venInvNo_en\": \"\"}",
                "dayOfMonth": 1,
                "accDesc_en": "",
                "taxOrigin": "",
                "manId": 0,
                "multiFlowSrcId": 0,
                "status": "Y",
                "multiFlowFlowId": 0,
                "cnDeptId": 177,
                "jlTypeId": 0,
                "iRev": 1,
                "AI19": 0,
                "aInvMonth": 0,
                "ce01Module": "apTran",
                "AI17": 0,
                "AI18": 0,
                "preTaxAmt": 200,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "venInvNo_hy": "",
                "AI14": 0,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "venInvNo_zh-CN": "",
                "statusModifyDate": 1640746809000,
                "aiCnDeptId": 0,
                "createDate": 1640746809000,
                "cp": 0,
                "useAccessWl": false,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "venInvNo_zh-TW": "",
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "multiFlowSrcBeId": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "venInvNo_cth": "",
                "AIId": 1627,
                "useAccessAutoCalc": false,
                "domAmtDiff": 0,
                "cpDate": 1640793600000,
                "lastModifyUid": 1,
                "aiVirDeptId": 0,
                "aiVenId": 1627,
                "udfDefaultAP": 0,
                "eDiscRate": 0,
                "beId": 1,
                "accDesc_jp": "",
                "AIType": "ven",
                "AI30": 0,
                "locked": false,
                "taxAmt": 0,
                "accDesc_sxg": "",
                "showEarlyPayDisc": false,
                "rev": "1",
                "batchNo": "",
                "lastApproveUid": 1,
                "aiCusId": 0,
                "ttlCharge": 200,
                "iafTrxDesc": "",
                "expiredUid": 0,
                "completedDate": -2209017600000,
                "reverseCharge": false,
                "aiStaffId": 0,
                "monthEndDate": "0",
                "position": "",
                "venInvNo": "",
                "hpSetting": "dayAfterInv",
                "tDate": 1640793600000,
                "attachmentNo": 0,
                "code": "AP_211230",
                "multiFlowSrcModule": "",
                "amt": 200,
                "accDesc_zh-TW": "",
                "depoAmt": 0,
                "curId": 22,
                "expired": false,
                "rate": 1.3,
                "domAmt": 260,
                "printCount": 0,
                "preTaxDomAmt": 260,
                "ttlImportPermitTaxAmt": 0,
                "vatPer": 0,
                "domDepoAmt": 0,
                "accDesc_hy": "",
                "accDesc_zh-CN": "",
                "venInvNo_sxg": "",
                "loadGpCoData": false,
                "accdfId": 129,
                "ttlDisc": 0,
                "attachmentCount": 0,
                "venInvNo_en": "",
                "staffId": 1029
            }
        ],
        "aptrant": [
            {
                "AI1": 0,
                "c_d": "charge",
                "AI2": 0,
                "itemNo": "     1",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "accDesc": "Fee",
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "AI9": 0,
                "cusId": 0,
                "id": 126,
                "AI30": 0,
                "taxAmt": 0,
                "debtorType": "cus",
                "hId": 109,
                "taxDomAmt": 0,
                "particular": "",
                "importPermitAmt": 0,
                "taxCodeId": 0,
                "creditorType": "ven",
                "venId": 0,
                "importPermitTaxAmt": 0,
                "cnDeptId": 0,
                "amt": 200,
                "iRev": 1,
                "ipTaxCodeId": 0,
                "AI19": 0,
                "ce01Module": "apTran",
                "AI17": 0,
                "AI18": 0,
                "preTaxAmt": 200,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "domAmt": 260,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "preTaxDomAmt": 260,
                "vatPer": 0,
                "ipTaxRate": 0,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "proId": 0,
                "AI20": 0,
                "AI21": 0,
                "accId": 22,
                "staffId": 0
            }
        ],
        "remaptran": [
            {
                "noteDesc_zh-CN": "",
                "remarks_en": "",
                "particular_jp": "",
                "payTerm_en": "",
                "iRev": 1,
                "particular_hy": "",
                "noteDesc_sxg": "",
                "ce01Module": "apTran",
                "payTerm_zh-TW": "",
                "noteDesc": "",
                "noteDesc_hy": "",
                "noteDesc_jp": "",
                "id": 157,
                "remarks_zh-TW": "",
                "payTerm_hy": "",
                "remarks_jp": "",
                "hId": 109,
                "payTerm": "",
                "particular_en": "",
                "particular_zh-TW": "",
                "particular_cth": "",
                "particular": "",
                "payTerm_cth": "",
                "payTerm_jp": "",
                "noteDesc_zh-TW": "",
                "remarks_cth": "",
                "remarks_hy": "",
                "particular_zh-CN": "",
                "remarks_sxg": "",
                "noteDesc_cth": "",
                "i18nField": "{\"payTerm_en\": \"\", \"remarks_en\": \"\", \"noteDesc_en\": \"\", \"particular_en\": \"\"}",
                "remarks_zh-CN": "",
                "payTerm_zh-CN": "",
                "particular_sxg": "",
                "remarks": "",
                "payTerm_sxg": "",
                "noteDesc_en": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create AP Transaction

# 一、Description

​ Usage: create or update 【AP Transaction】

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes apTran
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/apTran";
		String param = "&menuCode=apTran";

		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:

{
    "mainaptran": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "cpDate": "2022-05-14",
                "curId": 1,
                "AIType": "ven",
                "rate": 1,
                "virDeptId": 4,
                "domAmt": 400,
                "amt": 400,
                "AIId": 14,
                "staffId": 4
            }
        ]
    },
    "aptrant": {
        "values": [
            {
                "domAmt": 400,
                "accId": 22,
                "c_d": "charge",
                "amt": 400
            }
        ]
    }
}

​ 4、Response Sample

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

# Delete AP Transaction

# 一、Description

​ Usage: Delete AP Transaction

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes apTran
id long(Query) Yes AP Transaction 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/apTran";
		String param = "&menuCode=apTran&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
}

# Payment Register

# Fetch Payment Register List

# 一、Description

​ Usage: Fetch Payment Register List.

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes payReg
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=payReg&beId=11";

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

​ 4、Response Sample

{
    "stSearch": "payReg",
    "size": 1,
    "stSearchDisplay": "Payment Register",
    "values": [
        {
            "tDate": "2022-02-28",
            "batchNo": "",
            "code": "237006PR-1",
            "st_code": "237006PR-1",
            "payReg.lastModifyUid.simpleUser.desc": "Joseph Chui",
            "st_desc": "237006PR-1",
            "payReg.AIId.cAICode.code": "HGSY",
            "iRev": 4,
            "st_id": 149,
            "payReg.AIId.cAICode.desc": "Han Guang Company",
            "AIType": "ven",
            "id": 149,
            "lastModifyDate": "2022-04-06 11:50:45"
        }
    ]
}

# Load Payment Register

# 一、Description

​ Usage: Load 【Payment Register】Record

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes payReg
id long(Query) Yes Payment Register 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/payReg";
			String param = "&menuCode=payReg&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": {
        "rempayreg": [
            {
                "statement_cth": "",
                "remarks_en": "",
                "particular_jp": "",
                "iRev": 4,
                "particular_hy": "",
                "ce01Module": "payReg",
                "statement_zh-CN": "",
                "statement_sxg": "",
                "statement_jp": "",
                "statement": "",
                "id": 173,
                "remarks_zh-TW": "",
                "remarks_jp": "",
                "statement_hy": "",
                "hId": 149,
                "particular_en": "",
                "particular_zh-TW": "",
                "particular_cth": "",
                "particular": "",
                "remarks_cth": "",
                "remarks_hy": "",
                "particular_zh-CN": "",
                "remarks_sxg": "",
                "i18nField": "{\"remarks_en\": \"\", \"statement_en\": \"\", \"particular_en\": \"\"}",
                "remarks_zh-CN": "",
                "statement_en": "",
                "statement_zh-TW": "",
                "particular_sxg": "",
                "remarks": ""
            }
        ],
        "payregdbt": [
            {
                "AI1": 0,
                "c_d": 1,
                "AI2": 0,
                "itemNo": "     1",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "accDesc": "Cash",
                "AI6": 0,
                "AI7": 0,
                "beId": 1,
                "AI8": 0,
                "payee": "Mr. Chan",
                "AI9": 0,
                "cusId": 0,
                "payment": false,
                "id": 213,
                "AI30": 0,
                "debtorType": "cus",
                "hId": 149,
                "chequeNo": "653412",
                "creditorType": "ven",
                "bankSlipNo": "",
                "printed": false,
                "venId": 0,
                "cnDeptId": 0,
                "amt": 6600,
                "iRev": 4,
                "AI19": 0,
                "ce01Module": "payReg",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "curId": 1,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "rate": 1,
                "domAmt": 6600,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "bkopNoId": 32,
                "slmId": 0,
                "chequeDate": 1645977600000,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "proId": 0,
                "AI20": 0,
                "AI21": 0,
                "accId": 57,
                "staffId": 0,
                "bkopAc": "8437256014"
            }
        ],
        "payregt": [
            {
                "AI1": 0,
                "AI2": 0,
                "itemNo": "     1",
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "accDesc": "",
                "AI6": 0,
                "AI7": 0,
                "eDiscRate": 0,
                "beId": 1,
                "AI8": 0,
                "AI9": 0,
                "revertSettled": false,
                "id": 216,
                "AI30": 0,
                "hId": 149,
                "depositKey": "po_3540_A",
                "invRate": 1,
                "curDomAmt": 6600,
                "srcAIId": 7,
                "settle": true,
                "amt": 6600,
                "iRev": 4,
                "AI19": 0,
                "sTranId": 3540,
                "ce01Module": "payReg",
                "AI17": 0,
                "lot": "A",
                "AI18": 0,
                "AI15": 0,
                "curId": 1,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "rate": 1,
                "domAmt": 6600,
                "curDomEDiscAmt": 0,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "eDiscAmt": 0,
                "domEDiscAmt": 0,
                "multiPayKey": "",
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "sTranType": "po",
                "settleType": "deposit",
                "domAmtDiff": 0
            }
        ],
        "mainpayreg": [
            {
                "settledAmtCurId": 1,
                "setAmt": 0,
                "useAccess": false,
                "orderId": 0,
                "virDeptId": 4,
                "suspenseAmtCurId": 1,
                "expiredDate": -2209017600000,
                "AI1": 0,
                "AI2": 0,
                "sysJson": "",
                "AI3": 0,
                "AI4": 0,
                "viewCode": "payReg",
                "AI5": 0,
                "AI6": 0,
                "AI7": 0,
                "AI8": 0,
                "AI9": 0,
                "creditAmtCurId": 1,
                "useAccessBl": false,
                "id": 149,
                "lastModifyDate": 1649217045000,
                "createUid": 1,
                "depoUsedAmt": 0,
                "suspenseAmtRate": 1,
                "depoAppliedAmtRate": 1,
                "receivedAmtRate": 1,
                "manId": 7,
                "multiFlowSrcId": 0,
                "status": "Y",
                "multiFlowFlowId": 0,
                "cnDeptId": 177,
                "jlTypeId": 1,
                "creditAmtRate": 1,
                "iRev": 4,
                "AI19": 0,
                "ce01Module": "payReg",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "statusModifyDate": 1646021145000,
                "aiCnDeptId": 0,
                "multiFlowId": 0,
                "createDate": 1646021145000,
                "settledAmtRate": 1,
                "useAccessWl": false,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "suspenseAmt": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "multiFlowSrcBeId": 0,
                "AI23": 0,
                "AI20": 0,
                "AI21": 0,
                "AIId": 7,
                "useAccessAutoCalc": false,
                "lastModifyUid": 5,
                "aiVirDeptId": 0,
                "aiVenId": 7,
                "beId": 1,
                "receivedAmtCurId": 1,
                "AIType": "ven",
                "AI30": 0,
                "locked": false,
                "rev": "4",
                "batchNo": "",
                "lastApproveUid": 1,
                "aiCusId": 0,
                "expiredUid": 0,
                "aiStaffId": 0,
                "multiPayId": 0,
                "position": "Supervisior",
                "tDate": 1645977600000,
                "attachmentNo": 0,
                "code": "237006PR-1",
                "multiFlowSrcModule": "",
                "amt": 6600,
                "petAmt": 6600,
                "curId": 1,
                "expired": false,
                "rate": 1,
                "domAmt": 6600,
                "printCount": 0,
                "loadGpCoData": false,
                "depoAppliedAmtCurId": 1,
                "attachmentCount": 0,
                "staffId": 1029
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Payment Register

# 一、Description

​ Usage: create or update 【Payment Register】

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes payReg
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/payReg";
		String param = "&menuCode=payReg";

		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:

{
    "payregdbt": {
        "values": [
            {
                "curId": 1,
                "rate": 1,
                "domAmt": 200,
                "accId": 22,
                "amt": 200,
                "chequeDate": "2022-04-15"
            }
        ]
    },
    "payregt": {
        "values": [
            {
                "lot": "A",
                "curId": 1,
                "rate": 1,
                "domAmt": 200,
                "invRate": 1,
                "amt": 200,
                "curDomAmt": 200,
                "sTranType": "apTran",
                "settleType": "invoice",
                "sTranId": 135
            }
        ]
    },
    "mainpayreg": {
        "values": [
            {
                "beId": 1,
                "tDate": "2022-04-15",
                "curId": 1,
                "AIType": "ven",
                "rate": 1,
                "virDeptId": 4,
                "domAmt": 400,
                "amt": 400,
                "AIId": 14,
                "staffId": 4
            }
        ]
    }
}

​ 4、Response Sample

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

# Delete Payment Register

# 一、Description

​ Usage: Delete Payment Register

# 二、API Detail

​ 1、Request URL

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

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes payReg
id long(Query) Yes Payment Register 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/payReg";
		String param = "&menuCode=payReg&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
}