API Referans
Eronta REST API'si, panel üzerindeki tüm operasyonlara programatik erişim sağlar. Tüm yanıtlar JSON formatındadır.
Temel URL
İstek Formatı
Tüm isteklerde Content-Type: application/json gereklidir. Kimlik doğrulaması için JWT Bearer token (Authorization: Bearer <token>) veya API anahtarı (X-API-Client + X-API-Key) başlıkları kullanılabilir.
Kimlik Doğrulama
Eronta API iki farklı kimlik doğrulama yöntemini destekler:
| Yöntem | Header(lar) | Kullanım Amacı |
|---|---|---|
| JWT Bearer Token | Authorization: Bearer <token> |
Panel kullanıcıları; /api/auth/login ile alınan token. 7 gün geçerlidir. |
| API Key | X-API-Client: <clientId>X-API-Key: <clientSecret> |
Harici entegrasyonlar ve özel uygulamalar. Paneldeki Özel Uygulamalar sayfasından oluşturulur. Detaylar → |
Hata Kodları
| Kod | Açıklama |
|---|---|
400 | Geçersiz istek (eksik veya hatalı parametre) |
401 | Kimlik doğrulama gerekli veya token geçersiz |
403 | Bu işlem için yetkiniz yok |
404 | Kayıt bulunamadı |
429 | Rate limit aşıldı |
500 | Sunucu hatası |
Giriş Yap
| Alan | Tip | Açıklama |
|---|---|---|
email | string | E-posta zorunlu |
password | string | Şifre zorunlu |
POST /api/auth/login
{
"email": "kullanici@firma.com",
"password": "sifre123"
}
{
"ok": true,
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": 42,
"email": "kullanici@firma.com",
"fullName": "Ad Soyad",
"role": "admin",
"tenantId": 7,
"tenantName": "Firma Adı"
}
}
Oturum Bilgisi
{ "ok": true, "user": { "id": 42, "email": "...", "role": "admin", "tenantId": 7 } }
Token Yenile
Geçerli token ile yeni token alınır. Süresi dolmadan önce çağrılmalıdır.
{ "ok": true, "token": "eyJhbGciOiJIUzI1NiIs..." }
API Key Kimlik Doğrulama
| Header | Açıklama |
|---|---|
X-API-Client | Uygulamanın Client ID değeri (UUID formatı) zorunlu |
X-API-Key | Uygulamanın Client Secret değeri (64 hex karakter) zorunlu |
GET /api/products?limit=20
X-API-Client: 59cbbab1-867a-4020-be4a-da534a3c4aca
X-API-Key: 6f85f588f9...
curl "https://api.eronta.com/api/products?limit=20" \
-H "X-API-Client: <clientId>" \
-H "X-API-Key: <clientSecret>"
Panel → Özel Uygulamalar → Yeni Uygulama Ekle ile oluşturulan her uygulama için bir clientId ve clientSecret üretilir. clientSecret yalnızca bir kere gösterilir; kaybedilirse yeniden oluşturulmalıdır.
{
"ok": true,
"products": [ ... ],
"total": 9954
}
{ "ok": false, "error": "Oturum gerekli" }
Ürün Listesi
| Parametre | Tip | Açıklama |
|---|---|---|
page | number | Sayfa no (varsayılan: 1) isteğe bağlı |
limit | number | Sayfa başına kayıt (maks: 200) isteğe bağlı |
q | string | Ad / barkod araması isteğe bağlı |
marketplace | string | trendyol | hepsiburada isteğe bağlı |
{
"ok": true,
"total": 1240,
"products": [
{
"id": "MP-001",
"barcode": "8691234567890",
"title": "Ürün Başlığı",
"marketplace": "trendyol",
"price": 299.90,
"stock": 42,
"status": "active"
}
]
}
Ürün Detayı
{
"ok": true,
"product": {
"id": "MP-001",
"barcode": "8691234567890",
"title": "Ürün Başlığı",
"marketplace": "trendyol",
"price": 299.90,
"listPrice": 349.90,
"stock": 42,
"brand": "Marka",
"status": "active"
}
}
Ürün Oluştur
| Alan | Tip | Açıklama |
|---|---|---|
title | string | Ürün adı zorunlu |
barcode | string | Barkod — benzersiz olmalı isteğe bağlı |
sku | string | Stok kodu / SKU isteğe bağlı |
sellPrice | number | Satış fiyatı isteğe bağlı |
listPrice | number | Liste fiyatı (KDV dahil) isteğe bağlı |
discountPrice | number | İndirimli fiyat isteğe bağlı |
buyPrice | number | Alış fiyatı isteğe bağlı |
stockCount | number | Stok adedi isteğe bağlı |
description | string | Ürün açıklaması (HTML destekli) isteğe bağlı |
brand | string | Marka adı isteğe bağlı |
category | string | Kategori adı isteğe bağlı |
images | string[] | Görsel URL listesi isteğe bağlı |
attributesKV | object[] | [{"key":"Renk","value":"Siyah"}] isteğe bağlı |
source | string | Kaynak platform. Varsayılan: eronta isteğe bağlı |
POST /api/products
Content-Type: application/json
Authorization: Bearer <token>
{
"title": "Pamuklu T-Shirt Siyah L",
"barcode": "8690000112233",
"sku": "TSH-BLK-L",
"sellPrice": 249.90,
"listPrice": 299.90,
"stockCount": 50,
"brand": "MyBrand",
"category": "Giyim > T-Shirt",
"description": "<p>%100 pamuk, taşlama yıkama.</p>",
"images": ["https://cdn.example.com/tshirt-black-l.jpg"],
"attributesKV": [
{ "key": "Renk", "value": "Siyah" },
{ "key": "Beden", "value": "L" }
]
}
{
"ok": true,
"product": {
"id": "f9a3c1d2-...",
"source": "eronta",
"title": "Pamuklu T-Shirt Siyah L",
"barcode": "8690000112233",
"sku": "TSH-BLK-L",
"sellPrice": 249.90,
"listPrice": 299.90,
"stockCount": 50,
"createdAt": 1743000000000
}
}
409 Conflict — Aynı barkodla ürün zaten varsa: {"ok":false,"error":"Bu barcode ile zaten bir ürün mevcut.","code":"BARCODE_CONFLICT"}
Ürün Güncelle
| Alan | Tip | Açıklama |
|---|---|---|
name / title | string | Ürün adı isteğe bağlı |
barcode | string | Yeni barkod isteğe bağlı |
sku | string | SKU / stok kodu isteğe bağlı |
sellPrice | number | Satış fiyatı isteğe bağlı |
discountPrice | number | İndirimli fiyat isteğe bağlı |
buyPrice | number | Alış fiyatı isteğe bağlı |
stockCount | number | Stok adedi isteğe bağlı |
description | string | Açıklama isteğe bağlı |
brand | string | Marka isteğe bağlı |
category | string | Kategori isteğe bağlı |
isActive | boolean | Aktif / pasif isteğe bağlı |
attributesKV | object[] | Özellikler [{key, value}] isteğe bağlı |
priceLists | object[] | [{priceListId, salePrice, discountedPrice}] — fiyat listesi satırları isteğe bağlı |
Yalnızca gönderilen alanlar güncellenir. Stok veya fiyat değiştiğinde Trendyol / Hepsiburada'ya otomatik push tetiklenir (barkod eşleşmesi varsa).
PUT /api/products/f9a3c1d2-...
Content-Type: application/json
{
"sellPrice": 279.90,
"discountPrice": 259.90,
"stockCount": 42,
"isActive": true
}
{ "ok": true, "product": { "id": "f9a3c1d2-...", "sellPrice": 279.90, "stockCount": 42, ... } }
Stok Güncelle
PUT /api/products/:id endpoint'inin stok odaklı kullanımı. Yalnızca stockCount gönderildiğinde Trendyol / Hepsiburada stok push'u otomatik tetiklenir.
PUT /api/products/f9a3c1d2-...
Content-Type: application/json
{ "stockCount": 100 }
{ "ok": true, "product": { "id": "f9a3c1d2-...", "stockCount": 100, "updatedAt": 1743120000000 } }
Toplu stok için: Birden fazla ürün güncellemek istiyorsanız POST /api/products/import (Excel/CSV) veya fiyat listeleri üzerinden toplu güncelleme yapabilirsiniz.
Fiyat Güncelle
PUT /api/products/:id endpoint'inin fiyat odaklı kullanımı. Stok değişmeden sadece fiyat güncellemek için:
PUT /api/products/f9a3c1d2-...
Content-Type: application/json
{ "sellPrice": 349.90, "discountPrice": 299.90 }
PUT /api/products/f9a3c1d2-...
{
"sellPrice": 349.90,
"priceLists": [
{ "priceListId": "pl-001", "salePrice": 349.90, "discountedPrice": 299.90 }
]
}
{ "ok": true, "product": { "id": "f9a3c1d2-...", "sellPrice": 349.90, ... } }
Görsel Yükle
En fazla 20 görsel, toplam 20 MB yüklenebilir. Desteklenen formatlar: jpg, png, webp.
curl -X POST https://api.eronta.com/api/products/f9a3c1d2-.../images \
-H "Authorization: Bearer <token>" \
-F "images=@/path/to/photo1.jpg" \
-F "images=@/path/to/photo2.jpg"
{
"ok": true,
"added": 2,
"images": [
"https://api.eronta.com/api/uploads/abc123.jpg",
"https://api.eronta.com/api/uploads/def456.jpg"
]
}
Ürün Sil
{ "ok": true, "deleted": "f9a3c1d2-..." }
{ "ok": false, "error": "Product not found" }
Toplu İçe Aktar
multipart/form-data ile .xlsx veya .csv dosyası gönderin. Dosya şablonunu Ürünler → Dışa Aktar menüsünden indirebilirsiniz.
| Alan | Tip | Açıklama |
|---|---|---|
file | file | xlsx veya csv dosyası zorunlu |
mode | string | upsert (varsayılan) | stock_only | price_only isteğe bağlı |
curl -X POST https://api.eronta.com/api/products/import \
-H "Authorization: Bearer <token>" \
-F "file=@products.xlsx" \
-F "mode=upsert"
{
"ok": true,
"imported": 145,
"updated": 32,
"skipped": 3,
"errors": []
}
Sipariş Listesi
| Alan | Tip | Açıklama |
|---|---|---|
source | string | trendyol | hepsiburada | all isteğe bağlı |
status | string | Sipariş durumu isteğe bağlı |
startDate | string | ISO 8601 tarih isteğe bağlı |
endDate | string | ISO 8601 tarih isteğe bağlı |
q | string | Sipariş no / müşteri adı isteğe bağlı |
page | number | Sayfa no isteğe bağlı |
limit | number | Sayfa başına kayıt isteğe bağlı |
{
"source": "trendyol",
"startDate": "2026-03-01T00:00:00Z",
"endDate": "2026-03-28T23:59:59Z",
"page": 1,
"limit": 25
}
{
"ok": true,
"total": 318,
"orders": [
{
"id": "12345678",
"source": "trendyol",
"status": "Delivered",
"customerName": "Ahmet Y.",
"totalPrice": 459.90,
"currency": "TRY",
"createdAt": "2026-03-20T14:32:00Z"
}
]
}
Sipariş Detayı
source: trendyol | hepsiburada | ikas | id: Sipariş numarası
GET /api/orders/trendyol/12345678
Authorization: Bearer <token>
{
"ok": true,
"order": {
"id": "12345678",
"source": "trendyol",
"status": "Delivered",
"statusLabel": "Teslim Edildi",
"createdAt": "2026-03-20T14:32:00Z",
"customerName": "Ahmet Yılmaz",
"customerEmail": "ahmet@example.com",
"shippingAddress": {
"fullName": "Ahmet Yılmaz",
"address": "Atatürk Cad. No:5",
"city": "İstanbul",
"district": "Kadıköy",
"zipCode": "34710"
},
"lines": [
{
"barcode": "8690000112233",
"productName": "Pamuklu T-Shirt Siyah L",
"quantity": 2,
"amount": 249.90,
"totalAmount": 499.80
}
],
"totalPrice": 499.80,
"currency": "TRY",
"cargoTrackingNumber": "TR123456789",
"cargoCompany": "Yurtiçi Kargo"
}
}
Sipariş İstatistikleri
{
"ok": true,
"today": { "orderCount": 24, "revenue": 8740.50 },
"last7days": { "orderCount": 187, "revenue": 68450.75 },
"last30days": { "orderCount": 823, "revenue": 298120.40 },
"bySource": {
"trendyol": { "count": 512, "revenue": 183000 },
"hepsiburada": { "count": 311, "revenue": 115120 }
}
}
Fatura Kes
source: trendyol veya hepsiburada | id: Sipariş numarası
{ "ok": true, "invoiceNo": "EAR-2026-00124", "invoiceUrl": "https://..." }
Siparişleri Dışa Aktar
| Alan | Tip | Açıklama |
|---|---|---|
format | string | csv | xlsx zorunlu |
startDate | string | Başlangıç tarihi isteğe bağlı |
endDate | string | Bitiş tarihi isteğe bağlı |
Yanıt olarak dosya stream döner (application/octet-stream).
Müşteri Sorularını Listele
| Alan | Tip | Açıklama |
|---|---|---|
status | string | WAITING_FOR_ANSWER (varsayılan) | ANSWERED isteğe bağlı |
page | number | Sayfa (0'dan başlar) isteğe bağlı |
size | number | Sayfa başına kayıt, maks 200 isteğe bağlı |
GET /api/questions/list?status=WAITING_FOR_ANSWER&page=0&size=20
Authorization: Bearer <token>
{
"ok": true,
"totalElements": 14,
"questions": [
{
"id": "q-98765",
"text": "Bu ürün L beden büyük mü kesiliyor?",
"status": "WAITING_FOR_ANSWER",
"createdDate": "2026-03-26T10:15:00Z",
"barcode": "8690000112233",
"productName": "Pamuklu T-Shirt Siyah L",
"platform": "trendyol",
"answer": null,
"aiAnswer": null
}
]
}
AI Cevap Üret
Eronta AI, ürün açıklaması, özellikleri ve mağaza notlarını göz önünde bulundurarak doğal dilde cevap taslağı üretir. Cevabı göndermek için POST /api/questions/:id/answer kullanın.
| Alan | Tip | Açıklama |
|---|---|---|
question | string | Müşteri soru metni zorunlu |
barcode | string | Ürün barkodu — katalogdan bağlam çekilir isteğe bağlı |
productData | object | Manuel ürün bağlamı (barkod yerine) isteğe bağlı |
POST /api/questions/generate
Content-Type: application/json
Authorization: Bearer <token>
{
"question": "Bu ürün L beden büyük mü kesiliyor?",
"barcode": "8690000112233"
}
{
"ok": true,
"answer": "Merhaba! Ürünümüz standart kesimde olmakla birlikte rahat bir kullanım için bir beden büyük almanızı öneririz. İyi alışverişler!"
}
Not: Bu endpoint AI paketi gerektiren bir özelliktir. Paketsiz hesaplarda 403 FEATURE_DISABLED döner.
Cevap Gönder
| Alan | Tip | Açıklama |
|---|---|---|
text | string | Cevap metni (10–2000 karakter) zorunlu |
POST /api/questions/q-98765/answer
Content-Type: application/json
{ "text": "Merhaba! Ürünümüz standart kesimde olmakla birlikte ..." }
{ "ok": true, "message": "Cevap gönderildi." }
Cevap Trendyol API'sine anında iletilir ve panel tarihçesine kaydedilir.
Oto-Cevap Ayarları
{
"ok": true,
"storePrompt": "Mağazamız hafta içi 09:00-18:00 açıktır. Kargo 1-3 iş günü.",
"autoMode": "generate",
"lastAutoRunAt": 1743100000000
}
autoMode değerleri: off — devre dışı | generate — AI taslak oluşturur, onay bekler | auto — bekleyen tüm soruları otomatik yanıtlar
POST /api/questions/settings
Content-Type: application/json
{
"storePrompt": "Kargo 1-3 iş günü. İadeler 14 gün içinde kabul edilir.",
"autoMode": "generate"
}
{ "ok": true, "message": "Ayarlar kaydedildi.", "autoMode": "generate" }
Fiyat Listeleri — Listele
{
"ok": true,
"priceLists": [
{ "id": 3, "name": "Trendyol Yazlık", "currency": "TRY", "itemCount": 248, "createdAt": "2026-01-15T08:00:00Z" }
]
}
Fiyat Listesi — Oluştur
| Alan | Tip | Açıklama |
|---|---|---|
name | string | Liste adı zorunlu |
description | string | Açıklama isteğe bağlı |
currency | string | Para birimi (varsayılan: TRY) isteğe bağlı |
{ "ok": true, "id": 5, "name": "Yaz Kampanyası" }
Fiyat Listesi — Ürün Ekle
| Alan | Tip | Açıklama |
|---|---|---|
barcode | string | Ürün barkodu zorunlu |
price | number | Satış fiyatı zorunlu |
salePrice | number | İndirimli fiyat isteğe bağlı |
{ "barcode": "8691234567890", "price": 249.90, "salePrice": 199.90 }
{ "ok": true }
Fiyat Listesi — İçe / Dışa Aktar
Excel dosyası (application/octet-stream) döner.
multipart/form-data ile file alanında XLS gönderilir.
{ "ok": true, "imported": 248, "skipped": 2 }
Buybox Ürünleri
{
"ok": true,
"products": [
{
"barcode": "8691234567890",
"title": "Ürün Başlığı",
"marketplace": "trendyol",
"myPrice": 299.90,
"buyboxPrice": 279.90,
"hasBuybox": false
}
]
}
Fiyat Öner (Reprice)
| Alan | Tip | Açıklama |
|---|---|---|
barcode | string | Ürün barkodu zorunlu |
marketplace | string | trendyol | hepsiburada zorunlu |
{ "ok": true, "suggestedPrice": 274.90, "minAllowedPrice": 267.50, "profitMargin": 0.14 }
Buybox Ayarları
{ "ok": true, "settings": { "autoSync": true, "autoSyncInterval": 30, "minMarginPercent": 10 } }
AI Sohbet
| Alan | Tip | Açıklama |
|---|---|---|
message | string | Kullanıcı sorusu zorunlu |
conversationId | string | Devam eden sohbet ID'si isteğe bağlı |
{ "ok": true, "conversationId": "conv_xkq82", "reply": "Bu hafta en çok satan 5 ürününüz..." }
AI İçgörüler
{
"ok": true,
"insights": [
{ "id": "ins_m9k3", "type": "low_stock", "severity": "warning", "title": "8 ürününüzde stok kritik", "isRead": false }
]
}
AI Öneriler
{
"ok": true,
"recommendations": [
{ "id": "rec_p2a1", "type": "price_adjustment", "title": "Buybox kazanmak için fiyat düşürün", "impact": "high" }
]
}
Ayarları Getir
{ "ok": true, "settings": { "stockBuffer": 2, "currency": "TRY", "timezone": "Europe/Istanbul" } }
Kullanıcılar
{
"ok": true,
"users": [
{ "id": 42, "email": "kullanici@firma.com", "fullName": "Ad Soyad", "role": "admin", "isActive": true }
]
}