Solk ERP API
Stoğu gönder
Ürün koduna göre eldeki miktarı ve depo kırılımını yazar (warehouses: [{name, qty}]; qty yoksa depoların toplamı). Siparişte ve ürün listesinde Stok bu değeri gösterir.
Yetkilendirme
AuthorizationheaderzorunluSolk ERP API anahtarı (erp_…): Ayarlar → Muhasebe ve ERP → Solk ERP API bağlantısı açılınca bir kez gösterilir.
X-Solk-Erp-Key başlığıyla da gönderilebilir.Gövde application/json
itemsarrayzorunluStok:
code, qty, warehouses (name, qty).Hatalar
| HTTP | error | Anlamı |
|---|---|---|
401 | unauthorized | Belirteç yok, geçersiz, süresi dolmuş ya da iptal edilmiş. |
400 | invalid | Eksik ya da geçersiz alan (`message` ayrıntıyı verir). |
413 | too_many | Tek istekte en çok 2.000 kayıt. |
429 | rate_limited | Dakikalık istek sınırı aşıldı (`Retry-After`). |
İstek
curl -X POST https://ornek.solk.app/api/erp/v1/stock \
-H "Authorization: Bearer $SOLK_ERP_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"code": "HS30",
"qty": 5769,
"warehouses": [
{
"name": "Merkez",
"qty": 4200
},
{
"name": "Gebze",
"qty": 1569
}
]
}
]
}'const res = await fetch("https://ornek.solk.app/api/erp/v1/stock", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SOLK_ERP_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"items": [
{
"code": "HS30",
"qty": 5769,
"warehouses": [
{
"name": "Merkez",
"qty": 4200
},
{
"name": "Gebze",
"qty": 1569
}
]
}
]
}),
});
const data = await res.json();import os, requests
r = requests.post(
"https://ornek.solk.app/api/erp/v1/stock",
headers={"Authorization": f"Bearer {os.environ['SOLK_ERP_KEY']}"},
json={
"items": [
{
"code": "HS30",
"qty": 5769,
"warehouses": [
{
"name": "Merkez",
"qty": 4200
},
{
"name": "Gebze",
"qty": 1569
}
]
}
]
},
)
print(r.json())Yanıt
{
"ok": true,
"received": 1
}Örnek yanıt örnek veriyle çalışan bir v54 kurulumundan alındı; listeler en çok iki öğeyle kısaltıldı.