Skip to content

βš–οΈ 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:ΒΆ

  1. Place both files in the same folder (e.g. D:\WeighBridge)
  2. Open weighbridge.cfg in Notepad and configure:
    project=your_project_name
    accesstoken=your_access_token
    machineid=1
    
  3. Save the file.
  4. Double click weighbridge.exe to start capturing and transmitting weight data.
  5. To auto-start on Windows boot, place both files in the Startup folder.

πŸ’‘ Internet is mandatory for data transmission to MERCI Cloud ERP.


Use the RunAsService.exe utility to ensure the program runs in the background as a service.

πŸš€ Installation Steps:ΒΆ

  1. Download RunAsService.exe
  2. Create folder: D:\WeighBridge
  3. Copy all files (weighbridge.exe, weighbridge.cfg, RunAsService.exe) into that folder
  4. Open Command Prompt (Admin)
  5. Execute:
    RunAsService install "WeighBridge" "WeighBridge" d:\weighbridge\weighbridge.exe
    
  6. 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!