Logo Objects REST, Nebim V3 Integrator & GİB UBL-TR e-Document Write-Safety for AI Agents
Why direct SQL writes corrupt Logo Tiger/GO and Nebim V3 ledgers and Turkish e-Invoice locks—and how to architect safe kinetic AI actions over official business-object APIs and UBL-TR 1.2.1 Schematron gates.
- 01Never execute direct SQL INSERT or UPDATE statements against Logo Tiger (INVOICE, STFICHE) or Nebim V3 tables; bypassing business-object layers corrupts stock allocations, AR/AP totals, and GİB e-document locks (ESTATUS, EDESPSTATUS).
- 02Nebim V3 Integrator’s Connect endpoint can return HTTP 200 ("Connection Created Successfully") even on bad credentials—always verify sessions immediately with GetUserInfo and account for NebimPassport.pass (19.10.1+) and .NET 9 IIS hosting (25.10.1).
- 03Every kinetic AI action that creates an invoice or dispatch note in Turkey must pass a deterministic UBL-TR 1.2.1 XSD + GİB Schematron pre-flight gate and human approval before calling the ERP API.
1. Why Direct SQL Corrupts Logo Tiger/GO: Logo Objects REST (:32001) & e-Logo Status Locks
In Logo Tiger 3, Tiger Enterprise, and GO 3 databases, informal "lock-opening" SQL scripts such as UPDATE LG_001_01_INVOICE SET ESTATUS = 0 or UPDATE LG_001_01_STFICHE SET EDESPSTATUS = 0 sever the state link between ERP slips and envelopes already transmitted to Turkey’s Revenue Administration (GİB) via e-Logo or Logo Connect. Mutating EARCHIVEDET.EARCHIVESTATUS in SQL creates the same reconciliation drift.
Even read-side attachment helpers fail without ontology constraints: querying INVOICE.GUID by LOGICALREF to pull an e-Logo PostBoxService.svc PDF without filtering TRCODE = 8 (wholesale sales invoice) can silently retrieve a purchase invoice (TRCODE = 1) sharing the same integer key. AI agents must read through typed ontology views and route all mutations through official business-object interfaces.
- Logo Objects REST Service (
:32001/api/v1): Stateless HTTP/JSON interface authenticated viaPOST /api/v1/tokenwithFirmno; enforces slip numbering, VAT calculation, and ledger posting rules. - Unity Objects COM (
LObjects.exe/UnityApplication): 32-bit in-process Windows COM engine; isolate behind a serialized single-worker queue rather than invoking COM apartments concurrently from async agent loops. - e-Logo Polling Hygiene: Respect the recommended <=60 requests/minute ceiling (500 ms pacing) when reconciling GİB status codes (
1200Processing,1210Completed,1220Approved,1230Rejected,1240Cancelled).
2. Nebim V3 Integrator API: False-200 Connect, ModelType 0–234 & Runtime Licensing
For Nebim V3, the sanctioned external write and procedural read surface is the IIS-hosted Nebim V3 Integrator (IntegratorService) REST/JSON API—using RunQuery (ModelType = 32) and RunProc (ModelType = 33) for registered reads, and POST with a numeric ModelType for creating cards and slips.
While official Integrator manuals document 10 core models (1 Connect, 2–3 Customers, 4 Product, 5–6 Orders, 7–8 Invoices, 32 Query, 33 Procedure), production runtimes expose enum values 0 through 234 (including 59 StoreTransfer, 84 DispatchOrderWS, 109 InnerWT, and 208 OnlineInstallmentPayment). Production agent connectors must handle four operational gotchas:
- False-Positive
ConnectReply:IntegratorService/Connectreturns"Status": "Connection Created Successfully"even when credentials fail. Always callGetUserInfoimmediately afterwards to confirmCompanyCode,OfficeCode,StoreCode, andWarehouseCode. - IIS Session (
InProc) vs.Token(Off) Mode: Session URLs embed/(S(<session-id>))/in the path and fail with"Attempting to deserialize an empty stream."after idle timeouts; token mode passes aTokenheader instead. - Concurrent User & Per-Movement License Checks: Connections consume
Office UserorStore Userseats, and since release18.4.1, everyPOSTvalidates module-specific licenses (such as multi-currency offices) before committing. - Platform Milestones (
19.10.1&25.10.1): SQL Server connections require theNebimPassport.passcertificate from19.10.1onward, while25.10.1migrates IIS web apps to.NET 9and sunsets SOVOS (FIT) e-document integration in favor of active partners such as eFinans, Edoksis, Doğan e-Dönüşüm, and Uni-Dox.
3. GİB UBL-TR 1.2.1 Schematron Pre-Flight Gates & Human-in-the-Loop Execution
Posting an invoice or dispatch note in a Turkish ERP triggers legally binding OASIS UBL 2.1 (CustomizationID = TR1.2) envelopes (Invoice, DespatchAdvice, ReceiptAdvice, ApplicationResponse). Before an AI agent hands a payload to Logo Objects REST or Nebim V3 Integrator, a deterministic pre-flight gate must validate regulatory invariants.
Agent Action Request: create_return_invoice(draft_payload)
│
├─ 1. Scenario & Type Rule : ProfileID == "TICARIFATURA" && InvoiceTypeCode == "IADE"
│ -> REJECT (IADE invoice type is forbidden under TICARIFATURA!)
├─ 2. Mandatory Extensions : Purchase return requires BillingReference/InvoiceDocumentReference
│ (ID, IssueDate, DocumentTypeCode — Nebim V3 25.4.1+ rule)
├─ 3. Inventory Integrity : Verify OrderLineID chain & sp_ValidateItemInventory* checks
└─ 4. Human Approval Gate : Present structured diff to finance/ops reviewer -> On sign-off,
dispatch via Logo Objects REST (:32001) or Nebim Integrator POST.Use governed read-only SQL views for sub-second analytics, and route every order, dispatch, invoice, or ledger write through human sign-off + UBL-TR validation + official ERP business-object APIs.
Glossary Concepts Referenced in This Guide
UPDATE/INSERT statements on ERP/CRM databases, requiring typed action proposals validated against preconditions and approved by a named human role.STAT = 4, SPEC_CODE = "B2") in operational tables to verified business states and calculation inclusion rules.Free to reference in engineering docs, ADRs, articles, and course syllabi with attribution.
[Logo Objects REST, Nebim V3 Integrator & GİB UBL-TR e-Document Write-Safety for AI Agents — Ontoloji.org](https://ontoloji.org/en/guides/logo-objects-rest-nebim-v3-integrator-ubl-tr-ai-write-safety)