Solk ERP API
Send sales invoices
Sends sales and return invoices; the company card's open / paid, overdue and last-12-months revenue come from these. customer is the account's ext_id or code (with only customer_name it is matched by name). remaining = unpaid amount; without status it is derived from it (open, partial, paid, cancelled). kind: return is a return invoice (amounts count as negative). po is the customer's order number — used to match the CRM order. If no balances are sent, the overdue amount is computed from invoices.
Authorization
AuthorizationheaderrequiredSolk ERP API key (erp_…): shown once when a Solk ERP API connection is created under Settings → Accounting & ERP. May also be sent as the
X-Solk-Erp-Key header.Body application/json
itemsarrayrequiredInvoices:
ext_id, no, customer, customer_name, date, due, currency, net, total, remaining, status, kind (sales · return), po, lines (code, name, qty, price).Errors
| HTTP | error | Meaning |
|---|---|---|
401 | unauthorized | Missing, invalid, expired or revoked token. |
400 | invalid | Missing or invalid field (`message` explains). |
413 | too_many | At most 2,000 records per request. |
429 | rate_limited | Per-minute request limit exceeded (`Retry-After`). |
Request
curl -X POST https://ornek.solk.app/api/erp/v1/invoices \
-H "Authorization: Bearer $SOLK_ERP_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"ext_id": "SF2026000412",
"no": "SF2026000412",
"customer": "120.01.045",
"date": "2026-08-28",
"due": "2026-09-27",
"currency": "TRY",
"net": 49500,
"total": 59400,
"remaining": 59400,
"po": "PO-7702",
"lines": [
{
"code": "HS30",
"name": "HS 30 Isıl Yapışma Laki",
"qty": 450,
"price": 110
}
]
},
{
"ext_id": "SF2026000455",
"no": "SF2026000455",
"customer": "120.01.045",
"date": "2026-09-30",
"due": "2026-11-29",
"currency": "TRY",
"net": 132000,
"total": 158400,
"remaining": 158400,
"po": "PO-7745"
},
{
"ext_id": "SF2026000391",
"no": "SF2026000391",
"customer": "120.01.045",
"date": "2026-07-26",
"due": "2026-09-24",
"currency": "TRY",
"net": 80000,
"total": 96000,
"remaining": 0,
"status": "paid"
}
]
}'const res = await fetch("https://ornek.solk.app/api/erp/v1/invoices", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SOLK_ERP_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"items": [
{
"ext_id": "SF2026000412",
"no": "SF2026000412",
"customer": "120.01.045",
"date": "2026-08-28",
"due": "2026-09-27",
"currency": "TRY",
"net": 49500,
"total": 59400,
"remaining": 59400,
"po": "PO-7702",
"lines": [
{
"code": "HS30",
"name": "HS 30 Isıl Yapışma Laki",
"qty": 450,
"price": 110
}
]
},
{
"ext_id": "SF2026000455",
"no": "SF2026000455",
"customer": "120.01.045",
"date": "2026-09-30",
"due": "2026-11-29",
"currency": "TRY",
"net": 132000,
"total": 158400,
"remaining": 158400,
"po": "PO-7745"
},
{
"ext_id": "SF2026000391",
"no": "SF2026000391",
"customer": "120.01.045",
"date": "2026-07-26",
"due": "2026-09-24",
"currency": "TRY",
"net": 80000,
"total": 96000,
"remaining": 0,
"status": "paid"
}
]
}),
});
const data = await res.json();import os, requests
r = requests.post(
"https://ornek.solk.app/api/erp/v1/invoices",
headers={"Authorization": f"Bearer {os.environ['SOLK_ERP_KEY']}"},
json={
"items": [
{
"ext_id": "SF2026000412",
"no": "SF2026000412",
"customer": "120.01.045",
"date": "2026-08-28",
"due": "2026-09-27",
"currency": "TRY",
"net": 49500,
"total": 59400,
"remaining": 59400,
"po": "PO-7702",
"lines": [
{
"code": "HS30",
"name": "HS 30 Isıl Yapışma Laki",
"qty": 450,
"price": 110
}
]
},
{
"ext_id": "SF2026000455",
"no": "SF2026000455",
"customer": "120.01.045",
"date": "2026-09-30",
"due": "2026-11-29",
"currency": "TRY",
"net": 132000,
"total": 158400,
"remaining": 158400,
"po": "PO-7745"
},
{
"ext_id": "SF2026000391",
"no": "SF2026000391",
"customer": "120.01.045",
"date": "2026-07-26",
"due": "2026-09-24",
"currency": "TRY",
"net": 80000,
"total": 96000,
"remaining": 0,
"status": "paid"
}
]
},
)
print(r.json())Response
{
"new": 3,
"ok": true,
"received": 3
}Example responses were captured from a v54 installation running sample data; lists are shortened to two items.