βοΈ MERCI API - Weighbridge / Scales Integration GuideΒΆ
API guide to help hardware suppliers and developers integrate their weighbridge machines or software with MERCI Cloud ERP seamlessly.
π API EndpointΒΆ
https://erp.merciglobal.com/apis/weighbridgeapi.php?project=urvashi&accesstoken=ACCESS_TOKEN&machineid=1&weight=9999.999&date=2024-03-12&time=11:13
This API is used to transmit weight data from a weighbridge machine/software to MERCI Cloud.
π₯ Parameters (GET/POST)ΒΆ
Parameter | Description |
---|---|
project |
Project name (e.g. urvashi) |
accesstoken |
Access Token (Found in: My Profile β Set at bottom) |
machineid |
Unique machine ID (e.g. 1, 2, 3...) |
weight |
Weight value with 3 decimal places (e.g. 9999.999) |
date |
Date of weight reading (YYYY-MM-DD ) |
time |
Time of weight reading (HH:MM ) |
π Method Supported: POST
or GET
π Languages Supported: ANY (CURL, .NET, Embedded, Python, etc.)
βοΈ Implementation NotesΒΆ
- API should be called directly by the weighbridge machine or software.
- Ensure internet connectivity for successful transmission.
- An active subscription is required to use this API.
πͺ Windows Utility Program for COM PortΒΆ
To simplify integration with COM port-based weighbridge machines, MERCI provides a Windows executable utility.
π¦ Files to Download:ΒΆ
π οΈ Setup Instructions:ΒΆ
- Place both files in the same folder (e.g.
D:\WeighBridge
) - Open
weighbridge.cfg
in Notepad and configure:project=your_project_name accesstoken=your_access_token machineid=1
- Save the file.
- Double click
weighbridge.exe
to start capturing and transmitting weight data. - To auto-start on Windows boot, place both files in the Startup folder.
π‘ Internet is mandatory for data transmission to MERCI Cloud ERP.
π Run as Windows Service (Optional but Recommended)ΒΆ
Use the RunAsService.exe
utility to ensure the program runs in the background as a service.
π Installation Steps:ΒΆ
- Download
RunAsService.exe
- Create folder:
D:\WeighBridge
- Copy all files (
weighbridge.exe
,weighbridge.cfg
,RunAsService.exe
) into that folder - Open Command Prompt (Admin)
- Execute:
RunAsService install "WeighBridge" "WeighBridge" d:\weighbridge\weighbridge.exe
- Restart the computer
β Program will now auto-start in background.
π Contact MERCI Cloud ERP Sales Team for licensing details.
𧩠Front-End Code Integration (JS)¢
Add the following code snippet into your <project>_core.js
file to pull live weight into a specific field:
function {modulename}_add_afterload(){
let machineid = 1; // Change machine ID as needed
let field = 'weight'; // Change to actual field name where weight will be displayed
if (branchcode == 'PM3'){
machineid = 2;
}
$(`#${field}`).data('tool','ok');
$(`#${field}`).after(`<div class="inptool" data-id="weightapi" onclick="getWeightFromApi(${machineid},'${field}');">
<i class="fa-duotone fa-solid fa-dumbbell" style="font-size:12pt;"></i>
</div>`);
}
π© SupportΒΆ
For technical support or to request API access: π Contact MERCI Global ERP Sales/Support Team.
β You're now ready to automate your weighbridge data capture with MERCI!