# Accounting & ERP

> Connections to Paraşüt, BizimHesap, DİA, Logo, Netsis, Mikro, SAP Business One, SAP S/4HANA Cloud, Business Central and Odoo — account matching, balance and risk, sales invoices, live stock, sales orders into the ERP; Solk ERP API and Excel.

**Settings → Accounting & ERP** (Workspace, admins) connects your accounting software or ERP to the CRM. The rule is simple: **finance and stock live in the ERP, selling lives in the CRM**. Solk reads what helps the sales team — the customer's balance, overdue amount, invoices, product stock — and writes to the ERP only what selling produces: the **sales order** and, when needed, a **new account**. No accounting entries are created in the CRM, and ERP data is never changed from the CRM.

The section also appears in the **Settings → Apps** catalogue as the *Accounting & ERP* category. There is no plan limit; only admins create connections.

## What is read and written {#scope}

| | Data | Where it shows |
|---|---|---|
| **Read from the ERP** | Account matching (tax number → name) | The company's ERP account; tax number / office written to the matched company |
| | Balance, overdue amount, credit limit | Finance strip on the company card, risk ratio |
| | Sales and return invoices, payment state | Open / overdue invoices, last-12-months revenue and average payment terms on the company card |
| | Item code, list price, live stock | Product matching, *Stock* on orders and the product list |
| | State of a sent order | ERP chip on the Orders list (open · shipped · invoiced · cancelled) |
| **Written to the ERP** | Sales order | Customer's PO number, ERP account code, item code, quantity, price, currency, due date |
| | New account | When the company is missing in the ERP while sending an order (name, tax office / number, address, phone, e-mail) |
| **Not taken** | Purchase invoices, our purchase orders, journal entries, bank / cheque / note, cost, staff and payroll | — |

**Why no purchase orders?** The CRM runs the selling side; orders you place with suppliers and purchase invoices don't change a sales decision and stay in the ERP. What matters for sales is the **customer's PO number**: it is entered in *Customer PO no* on the order, goes to the ERP with the order (`NumAtCard` in SAP, `externalDocumentNumber` in Business Central, `client_order_ref` in Odoo) and matches the PO on the invoice.

## Supported systems {#providers}

| System | Route | Read | Written |
|---|---|---|---|
| **Paraşüt** | Cloud API (OAuth) | Accounts, balances, sales invoices, products, stock | New account |
| **BizimHesap** | B2B API key | Products, warehouse stock | Order → draft sales invoice |
| **DİA** <small>beta</small> | Web service key | Accounts, due balances, invoices, items, warehouse quantities, order state | Order, new account |
| **Logo** (Tiger · Go · j-Platform) <small>beta</small> | Logo REST Service | Accounts, balances, sales invoices, items, stock, order state | Order, new account |
| **Netsis** (NetOpenX) <small>beta</small> | NetOpenX REST | Accounts, invoices, items, stock | Order, new account |
| **Mikro** (Jump · Fly) <small>beta</small> | Mikro API v2 | Accounts and balances, items, warehouse quantities | Order |
| **SAP Business One** | Service Layer | Business partners, balance / credit limit, A/R invoices and credit memos, items, warehouse stock, order state | Order, new business partner |
| **SAP S/4HANA Cloud** <small>beta</small> | Standard OData APIs | Customers, billing documents, products, material stock, order state | Order |
| **Microsoft Dynamics 365 Business Central** | API v2.0 | Customers (balance, credit limit), sales invoices and credit memos, items (inventory), order state | Order, new customer |
| **Odoo** | JSON-RPC | Partners (receivable, credit limit), customer invoices, products (quantity on hand), order state | Order, new partner |
| **Solk ERP API** | Middleware / connector agent | All (you send) | All (you pick up orders) |
| **Excel / CSV** | File upload | Account / balance list, invoice list, stock list | — |

- **Paraşüt** has no sales order document — the order stays in the CRM and its invoice is read from Paraşüt.
- The **BizimHesap** B2B API returns no account list or balances; an order is created as a draft sales invoice (approve it in BizimHesap).
- For providers marked **beta**, field and endpoint names can differ by ERP version; map them as JSON in **Advanced** on the connection's **Connection** tab. Verify once against your own system with **Test connection**.
- Systems not in the list (Uyumsoft, Nebim, Eta, Zirve, Akınsoft, Canias…) connect through the [Solk ERP API](#api).

## Setting up a connection {#setup}

1. Under **Settings → Accounting & ERP → Add connection**, pick your system. The page lists that system's steps.
2. Enter the credentials and press **Connect and test**. The test shows sample accounts / items. Passwords and keys are stored encrypted and never shown again; leave a secret field blank to keep the stored value.
3. On the **Data** tab choose what flows (below) and the **Automatic sync** interval (15 minutes to once a day, or manual only).
4. Start the first sync with **Sync now** on the **Summary** tab, then check unmatched accounts on the **Matching** tab.

**ERP on your own server** (Logo, Netsis, Mikro, SAP Business One): the ERP's REST service must be published over **HTTPS** with the firewall open **only to your installation's server** (the server address is shown on the connection page). If you'd rather not publish the service, a **connector agent** inside your network sends the data through the [Solk ERP API](#api). Solk connects only over HTTPS and only to public addresses.

An installation can have up to **6 connections** (e.g. two companies plus Excel). With several connections, orders go to the **main connection** — *Orders go to this connection* on the Data tab.

## Connection page {#connection}

| Tab | Contents |
|---|---|
| **Summary** | State and last sync, **Sync now** / **Test connection**; accounts (matched / pending), invoices (open, overdue), products and sent orders; companies with the highest balance. |
| **Data** | Datasets and their options, automatic sync, who sees finance, main connection, switch off / delete the connection. |
| **Matching** | Accounts and products: matched / unmatched / ignored filter, search, pick company, create company, ignore. |
| **Orders** | Orders sent to the ERP: state, ERP number, error and **Retry**. |
| **Log** | The result and duration of every sync, test, send and upload. |
| **Connection** | Credentials (**Save and test**), **Advanced** mapping; key and endpoints for the Solk ERP API. |
| **Upload file** | Excel / CSV connections only. |

## Data {#datasets}

| Data | Options |
|---|---|
| **Accounts** | *Unmatched accounts*: match only (default) · create companies for accounts invoiced in the last 12 months · create companies for all. *Write tax number / office to the matched company*. |
| **Balance and risk** | Balance, overdue amount, credit limit and risk ratio on the company card. Accounts must also be on to link them to companies. |
| **Sales invoices** | First sync goes back 3 months – 3 years (default 1 year); afterwards only changes. Return invoices are marked separately. |
| **Products and price** | ERP items match CRM products by code. *Update the matched product's list price from the ERP* (off by default). |
| **Live stock** | **Stock** on orders and the product list: current quantity and warehouse breakdown, cached for 10 minutes. |
| **Order state** | The state of a sent order in the ERP. *Close the CRM order when shipped / invoiced in the ERP* (on by default). |
| **Create new account** <small>writes to the ERP</small> | When sending an order for a company missing in the ERP, the account is created. When off, an unmatched company's order is not sent (pick the account on *Matching*). |
| **Send sales orders** <small>writes to the ERP</small> | *Manual* — **Send to ERP** on the order · *Automatic* — when the order is created. |

Data the provider doesn't support is greyed out as *not available for this provider*. **Who sees finance?** — *Everyone who can see the company* (default) · *The company owner and admins* · *Admins only*; applies to all connections and to the REST API.

## Account matching {#matching}

Each ERP account is linked to a CRM company first by **tax number** (VKN / TCKN), otherwise by **name**. Name matching ignores Turkish letters, case and legal suffixes (*A.Ş.*, *Ltd. Şti.*, *San. ve Tic.*); if several companies fit the same name, nothing is matched. The reason is shown on the row: *Tax no*, *Name*, *Manual*, *Created from ERP*, *Created with order*, *Middleware*.

On the **Matching** tab, for an unmatched account use **Pick company** (search), **create company** or **ignore** (supplier, staff accounts); you can remove a match or move it to another company. Syncing never changes a manual match or a link you removed. *Create companies for all* opens every unmatched account at once (linking to a company with the same name if one exists). A company may have several accounts (e.g. in two legal entities) — the finance summary adds them up.

The company form has **Tax no** and **Tax office** fields; when filled, matching is certain and they are sent when the account is created in the ERP.

## Finance on the company card {#finance}

A matched company's card shows a **finance strip** under the header: **Balance**, **Overdue**, **Credit limit** (fill bar and risk ratio), **Open invoices** (count and amount), **Last 12 months** revenue and **Last invoice**. Clicking the strip opens the company's **Invoices** page: *All · Open · Overdue · Paid* (and *Returns* when present) filter; invoice no, date, due date, amount, remaining, state, PO no — returns with negative amounts.

Amounts are shown in the ERP currency (revenue is converted to the base currency). If the ERP gives no balances (e.g. an invoice list was uploaded), the overdue amount is computed from the invoices' remaining amounts. If the company isn't matched to any account, admins see a *not matched to an ERP account · Match* line on the card.

## Sending an order to the ERP {#orders}

The new-order row on the **Orders** page has a **Customer PO no** field; the PO shows under the company. With an ERP connected, the list shows:

- **stock** next to the product — opens the current quantity and warehouse breakdown from the ERP (*cached* or live; `Shift`-click refreshes).
- **Send to ERP** (send icon) — writes the order to the main connection as a sales order. If the company is missing in the ERP and *Create new account* is on, the account is created first. The product needs an ERP code (it matches automatically when the product code equals the ERP item code; otherwise **Matching → Products**).
- An **ERP chip** on sent orders: *Queued* · *Sending* · *Sent to ERP* · *Open in ERP* · *Shipped* · *Invoiced* · *Closed in ERP* · *Cancelled in ERP* · *Failed*; the chip shows the ERP document number, the tooltip the error or the ERP's status text.

*Automatic* sending covers only orders newly created in the CRM (Quick Entry, order form, order from quote, mobile, API) — historical orders imported from Excel and sample data are not sent. A failed send is retried at growing intervals (5 min – 12 h); the error is shown on the **Orders** tab. When the state becomes shipped / invoiced / closed the CRM order is closed; if it is cancelled in the ERP the order owner is notified. An order is never sent twice.

## Solk ERP API {#api}

For ERPs that aren't listed or must stay inside your network: your own middleware, your integrator or a **connector agent** in your network **sends** data to Solk and **picks up** the orders to write to the ERP. **Add connection → Solk ERP API** creates a key (`erp_…`); it is shown **once** and can be rotated on the **Connection** tab (the old key stops working immediately).

```bash
curl -X POST https://<company>.solk.app/api/erp/v1/customers \
  -H "Authorization: Bearer $SOLK_ERP_KEY" -H "Content-Type: application/json" \
  -d '{"items": [{"ext_id": "120.01.045", "code": "120.01.045", "name": "Kumsal Plastik A.Ş.", "tax_no": "4810123456"}]}'
```

| Endpoint | Job |
|---|---|
| `GET /api/erp/v1/ping` | Checks the key and the enabled datasets. |
| `POST /api/erp/v1/customers` | Accounts (matching + optional company creation). |
| `POST /api/erp/v1/balances` | Balance, overdue, credit limit. |
| `POST /api/erp/v1/invoices` | Sales / return invoices. |
| `POST /api/erp/v1/products` | Items (code, name, unit, price). |
| `POST /api/erp/v1/stock` | Quantity on hand and warehouse breakdown. |
| `GET /api/erp/v1/orders?claim=1` | Picks up (claims) the orders to write to the ERP. |
| `POST /api/erp/v1/orders/{id}` | Reports the order's result in the ERP (`ext_no`, state). |

Bodies are `{"items": [...]}`, at most **2,000 records** per request; 600 requests per minute per connection. The same `ext_id` updates the record instead of duplicating it — an agent can send the full list every time. Fields and example responses: [Solk ERP API reference](/rest-api/erp/ping).

Order loop: **Send to ERP** in the CRM queues the order (*Queued*) → the agent picks it up with `GET /orders?claim=1` (not returned again for 30 minutes) → writes it to the ERP → reports `{"status": "open", "ext_no": "SS-2026-0193"}` with `POST /orders/{id}`. If the account was just created in the ERP, include `customer_ext_id` and the company match is stored. On failure send `{"status": "error", "error": "…"}` — the CRM shows **Retry**.

## Excel / CSV {#file}

From software without an API, upload the account balance list, invoice list and stock list as files: **Add connection → Excel / CSV → Upload file**. Columns are recognised from the header (Turkish or English: *account code, name, tax no, balance, debit, credit, overdue, credit limit · invoice no, date, due date, amount, remaining, PO no · item code, item name, unit, price, quantity*); each list has a downloadable **Template**. If debit and credit are separate columns, balance = debit − credit. Uploading the same file again updates records, it doesn't duplicate them. For an Excel connection, stock is the last uploaded quantity.

## On mobile and in the API {#api-mobile}

In the REST API the company card (`GET /api/v1/customers/{id}`) returns `tax_no`, `tax_office` and `finance`; there are also [Company finance](/rest-api/finance/customer-finance), [Product stock](/rest-api/finance/product-stock) and [Send order to ERP](/rest-api/finance/order-send). `/me` → `api` 54, `caps.erp`, `caps.erp_push`, `caps.erp_stock`. The workspace export includes the `erp_cariler`, `erp_faturalar`, `erp_urunler` and `erp_siparis_gonderimleri` tables.

## Security {#security}

- Only admins create, change and delete connections; every action is written to the audit log.
- Passwords, client secrets and tokens are stored encrypted; for the Solk ERP API key only a hash is kept.
- Requests to the ERP go only over HTTPS and only to public addresses; redirects are checked too.
- Solk does not change accounting records in the ERP — it writes only sales orders and (when on) new accounts.
- Finance visibility can be narrowed in the settings; record visibility (team mode) applies to ERP data as well.