Class Api1cClient

java.lang.Object
org.bgerp.plugin.inventory.sync1c.service.Api1cClient

public class Api1cClient extends Object
HTTP client for 1C ERP REST API. One instance per 1C instance (holds auth credentials).
  • Constructor Details

  • Method Details

    • getStocks

      public List<Api1cStock> getStocks(String warehouseName, String locationName)
      Calls POST /hs/gtd_numbers/stocks and returns the list of stock records.
      Parameters:
      warehouseName - 1C warehouse name (engineer full name or warehouse title)
      locationName - 1C location (construction site / object)
      Returns:
      list of stock items; empty list on error
    • testConnection

      public String testConnection()
      Tests the connection by calling getStocks with empty params and checking for HTTP response.
    • sendWriteoff

      public String sendWriteoff(int processId, String warehouseId, List<Api1cClient.WriteoffItem> items)
      Calls POST /hs/gtd_numbers/writeoff and sends write-off items to 1C.
      Parameters:
      processId - BGERP process ID (used as external reference in 1C)
      warehouseId - 1C UUID of the warehouse
      items - list of items to write off
      Returns:
      null on success, error message on failure