Dış ERP Entegrasyon API'si
MindAeon; SAP, Logo, Mikro, Netsis ve tüm kurumsal sistemlerle sunucu-sunucu (makine-to-makine) entegrasyon için tenant-kapsamlı REST API sunar. Kimlik doğrulama OAuth2 client_credentials akışıyla yapılır; tüm public uçlar /api/v1/* altında sürümlenir. Aşağıdaki 3 adımı izleyin.
1 API İstemcisi oluşturun
MindAeon Web'de Entegrasyon → API İstemcileri → Yeni İstemci. İstemci adını girin, gereken yetkileri (scope) seçin, oluşturun. Client Secret yalnız bir kez gösterilir — güvenli bir yere kaydedin. Yalnız hash'i saklanır.
| Scope | Verdiği yetki |
|---|---|
products:write | Ürün upsert |
products:read | Ürün okuma |
customers:write | Cari upsert |
warehouses:write | Depo upsert |
stock:read | Stok sorgu |
2 Token alın
POST /api/v1/auth/token — istemci kimliğinizle kısa ömürlü (30 dk) erişim token'ı alın. Makine istemcileri refresh token almaz; süre dolunca yeniden token isteyin.
curl -X POST "https://androidsahasatis.com/api/v1/auth/token" \
-H "Content-Type: application/json" \
-d '{
"grantType": "client_credentials",
"companyCode": "DEMO",
"clientId": "mac_x8Kd...",
"clientSecret": "P7f...=="
}'
Yanıt:
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"tokenType": "Bearer",
"expiresIn": 1800,
"scope": "products:write customers:write stock:read"
}
companyCode firma (tenant) kodunuzdur. Yanlış kimlik / pasif / süresi dolmuş istemci → 401 { "error": "invalid_client" }.3 Çağrı yapın
Her istekte Authorization: Bearer <accessToken> başlığını gönderin.
POST Ürün upsert (bulk, idempotent)
externalCode eşleştirme anahtarıdır (yoksa code); aynı externalCode ile ikinci gönderim güncelleme sayılır (mükerrer-güvenli).
curl -X POST "https://androidsahasatis.com/api/v1/products:upsert" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '[
{ "externalCode":"ERP-1001", "code":"URN0001", "name":"Kalem",
"stockType":"Product", "trackingType":"None",
"gtin":"8690000000001", "salesVatRate":20, "isActive":true }
]'
# → { "created":1, "updated":0, "failed":0, "errors":[] }
POST Cari / Depo upsert
POST https://androidsahasatis.com/api/v1/customers:upsert # Customer.Edit / customers:write POST https://androidsahasatis.com/api/v1/warehouses:upsert # Warehouse.Edit / warehouses:write
GET Stok sorgu (çok-depo)
curl "https://androidsahasatis.com/api/v1/stock?warehouseCode=WH01&productCode=URN0001" \
-H "Authorization: Bearer $TOKEN"
# → { "asOf":"...", "items":[
# { "warehouseCode":"WH01","warehouseName":"Merkez Depo",
# "productCode":"URN0001","productName":"Kalem",
# "unitCode":"ADET","quantity":150.0 } ] }
quantity = stok hareketlerinin net toplamıdır (giriş − çıkış).Canlı referans
Tüm uçların şeması, örnek gövdeleri ve "dene" arayüzü için Scalar referansını kullanın. OpenAPI 3 belgesi her ortamda üretilir.
Scalar API Referansı → openapi/v1.json
Güvenlik notları
- Token tenant-kapsamlıdır; yalnız istemcinizin firmasının verisine erişir.
- Erişim, seçtiğiniz scope'larla sınırlıdır (çift kapı: lisans modülü + izin). Scope dışı çağrı →
403. - Client Secret sistemde yalnız hash olarak saklanır (PBKDF2/SHA256, sabit-zaman doğrulama).
- İstemci iptal edilirse (
IsActive=false) veya süresi dolarsa yeni token üretilemez; yayınlanmış token doğal süresiyle (≤30 dk) sonlanır.