Muhasebe, mobil uygulama ve diğer sistemleri mağazanıza bağlayın. Ürün, kategori, marka, sipariş ve kullanıcı uçlarında okuma ve yazma desteğini kullanın.
İlk blokta endpoint ve alanların tam listesi yer alır; altında sık kullanılan işlemler için PHP örnekleri bulunur.
Kurulum adımları, kimlik doğrulama ve tüm REST yollarının özeti.
1. Önce rest API servisi sunan sitede admin statüsünde bir kullanıcı açılmalıdır.
Örnek : email adresi : restapi@domainadi.com şifre : testapi
Sonra bu kullanıcı bir bayi grubuna atanmalı ve bu bayi grubunda "Rest API kullanabilir" işaretlenmelidir.
Son olarak ilgili panelde "XML veya Rest API Kullanabileceği IP'ler" kısmına Rest API kullanacak IP adresi eklenmelidir. Boş bırakılırsa IP kısıtlaması olmaz.
2. Her işlem için POST tipinde auth_email ve auth_key gönderilmelidir. Admin kullanıcı bir bayi grubunda "Rest API kullanabilir" (restactive) işaretli olmalıdır; sistemde en az bir restactive grup varsa bu zorunludur.
auth_email => email adresi.
auth_key şifre ve email'in tekrar şifrelenmiş halidir. Almak için önce şifre md5 olarak şifrelenir, sonra bu değer email adresi eklenerek tekrar şifrelenir.
PHP Örnek : $auth_key = md5('restapi@domainadı.com'.md5('testapi'));
3. Tüm ürünleri listelemek için /rest/products çağrılmalıdır.
Örnek : /rest/products
- Sayfalama için /rest/products/range/_ kullanılabilir.
Örnek : /rest/products/range/{start}_{limit} (/rest/products/range/0_100)
4. Tüm varyasyonları listelemek için /rest/vars çağrılmalıdır.
5. Ürün sorgusu için /rest/products/ID/ veya /rest/products/cat/ veya /rest/products/namePath/ çağrılmalıdır.
Örnek : /rest/products/ID/{urunID} (/rest/products/ID/132)
Örnek : /rest/products/cat/{catID} (/rest/products/cat/10)
Örnek : /rest/products/namePath/{namePath} (/rest/products/namePath/Elektronik_Televizyon)
6. Kategoriye ait ürün sorgusu için /rest/products/catID/ veya /rest/products/namePath/ çağrılmalıdır. (namePath içindeki / karakteri _ ile replace edilmelidir.)
Örnek : /rest/products/catID/{catID} (/rest/products/catID/132)
Örnek : /rest/products/namePath/{namePath} (/rest/products/namePath/Elektronik_Televizyon)
7. Markaya ait ürün sorgusu için /rest/products/markaID/ çağrılmalıdır.
Örnek : /rest/products/markaID/{markaID} (/rest/products/markaID/132)
8. Kategorileri listelemek için /rest/list/kategori çağrılmalıdır.
9. Alt Kategorileri listelemek için /rest/list/kategori/catID veya /rest/list/kategori/namePath çağrılmalıdır. (namePath içindeki / karakteri _ ile replace edilmelidir.)
Örnek : /rest/list/kategori/{catID} (/rest/list/kategori/12)
Örnek : /rest/list/kategori/{namePath} (/rest/list/kategori/Elektronik_Televizyon)
10. Kategori eklemek / güncellemek için /rest/setCategory çağrılmalıdır. POST olarak kategoriye ait veriler gönderilmelidir.
Örnek : /rest/setCategory
POST olarak gönderilebilecek field isimleri :
ID (int) // Yazılıma ait kategori ID değeri
categoryCode (string) // Sizin tarafınızdan gönderilen, benzersiz kategori kodu.
ID ve categoryCode 'dan birinin gönderilmesi zorunludur.
parentID (int) // Yazılım kategori listesinde gelen üst kategori ID değeri.
parentCategoryCode (string) // Sizin tarafınızdan gönderilen, benzersiz üst kategoriye ait kod.
Eğer kategorinin üst kategorisi set edilecekse, parentID ve parentCategoryCode'dan birinin gönderilmesi yeterlidir.
name (string)
İşlem sonrası ilgili kategori bilgileri XML olarak döner. Eğer kategori daha önce eklendiyse, yeni kategori eklenmez ve var olan kategori bilgileri döner.
11. Marka eklemek / güncellemek için /rest/setBrand çağrılmalıdır. POST olarak markaya ait veriler gönderilmelidir.
Örnek : /rest/setBrand
POST olarak gönderilebilecek field isimleri :
ID (int) // Yazılıma ait marka ID değeri (Gönderilmezse ve gönderilen marka yoksa yeni eklenir.)
name (string)
İşlem sonrası ilgili marka bilgileri XML olarak döner. Eğer marka daha önce eklendiyse, yeni marka eklenmez ve var olan marka bilgileri döner.
12. Ürün eklemek / güncellemek için /rest/setProduct çağrılmalıdır. POST olarak ürüne ait veriler gönderilmelidir. Yeni bir ürün eklenmeden önce, kategori ve marka eklenmiş ve ilgili ID'lerin elimizde olması gerekir.
Örnek : /rest/setProduct
POST olarak gönderilebilecek field isimleri :
ID (int) // Yazılıma ait ürün ID değeri
productCode (string) // Sizin tarafınızdan gönderilen, benzersiz ürün kodu.
ID ve productCode'dan birinin gönderilmesi zorunludur.
catID (int), // kategori kodu değil, yazılıma ait kategori ID değeri olmalıdır.
virtualCatIDs (string), // kategori kodu değil, yazılıma ait kategori ID değerleri olmalıdır. (ÖR : 12,22,33,44)
markaID (int), // marka adı değil, yazılıma ait marka ID değeri olmalıdır.
name (string),
listeDetay (string),
onDetay (string),
detay (text),
resim1 (text) ... resim5 (text), // Bir ürüne 5 adet resim eklenebilir. Resim download URL adresi girilmelidir.
veya
resim_base64_1 (base64) ... resim_base64_5 (base64), // Şeklinde base64 olarak resimler upload edilebilir.
stok (float),
kdv (int), // %18 için 18 gönderilmelidir.
fiyat (float),
piyasafiyat (float),
fiyatBirm (string),
garanti (int), // Garanti ay süresi.
desi (float),
gtin (string) // GTIN veya EAN veya UPC veya ISBN gibi barkod bilgisi.
13. Ürün fiyat ve stok güncellemek için /rest/setProduct/priceAndStock çağrılmalıdır. POST olarak ürüne ait veriler gönderilmelidir.
Örnek : /rest/setProduct/priceAndStock
POST olarak gönderilebilecek field isimleri :
ID (int) // Yazılıma ait ürün ID değeri. Zorunludur.
stok (int),
kdv (int), // %18 için 18 gönderilmelidir.
fiyat (float),
piyasafiyat (float),
fiyatBirim (string)
Ürün silmek için /rest/setProduct/remove çağrılmalıdır. POST olarak ürüne ait veriler gönderilmelidir.
Örnek : /rest/setProduct/remove
POST olarak gönderilebilecek field isimleri :
ID (int) // Yazılıma ait ürün ID değeri. Zorunludur.
14. Ürün varyant güncellemek için /rest/setProduct/variant çağrılmalıdır. POST olarak ürüne ait veriler gönderilmelidir. Yazılım altyapısında 2'li varyasyona ait X-Y kombinasyon desteği vardır.
Örnek : /rest/setProduct/variant
Örnek açıklama : Kazan ürününe ait XL bedeni ve Kırmızı renk varyasyonu.
POST olarak gönderilebilecek field isimleri :
ID (int) // Yazılıma ait ürün ID değeri. Zorunludur.
varStock (float), // Varyasyon Stok Adet
varCode (string), // Varyasyon Stok Kodu.
varBarcode (string), // Varyasyon Stok Kodu.
varResim (string), // Varyasyon Resmi download URL adresi.
dstok (float), // Düşülecek Stok Adeti (varsayılan 1)
var1_name (string), // Örnek : Beden
var2_name (string), // Örnek : Renk
var1_var (string), // Örnek XL
var2_var (string), // Örnek Kırmızı
var1_fark (float), // Fiyat farkı.
var2_fark (float), // Fiyat farkı.
14b. Ürün varyant kaldırmak veya pasife almak için /rest/setProduct/variantRemove çağrılmalıdır. POST olarak ürüne ait veriler gönderilmelidir.
Sipariş geçmişinde kullanılan varyant silinemez, pasife alınır (up=0). Kullanılmayan varyant veritabanından silinir.
POST olarak gönderilebilecek field isimleri :
ID (int) // Yazılıma ait ürün ID değeri. Zorunludur.
variantID (int), // urunvarstok tablosundaki varyant ID.
varCode (string), // Varyasyon stok kodu.
varBarcode (string), // Varyasyon barkod/gtin.
var1_var (string), // Örnek XL (varCode/variantID yoksa var1_var zorunlu)
var2_var (string), // Örnek Kırmızı
removeAll (int), // 1 gönderilirse ürünün tüm aktif varyantları kaldırılır/pasife alınır.
15. Ürün filtre güncellemek için /rest/setProduct/filter çağrılmalıdır. POST olarak ürüne ait veriler gönderilmelidir.
Örnek : /rest/setProduct/filter
POST olarak gönderilebilecek field isimleri :
ID (int) // Yazılıma ait ürün ID değeri. Zorunludur.
title (string), // Örnek : Ekran Çözünürlüğü
str (string), // Örnek: Full HD
16. Siparişlere ait sorgu için /rest/orders/date/_ çağrılmalıdır.
Örnek : /rest/orders/date/{baslangicTarih}_{bitisTarih} (/rest/orders/date/2017-12-31_2019-12-31)
17. Tek siparişe ait sorgu için /rest/orders/no/ çağrılmalıdır.
Örnek : /rest/orders/no/{siparisNo} (/rest/orders/no/158238365)
18. Duruma göre siparişleri listelemek için /rest/orders/durum/ çağrılmalıdır.
Örnek : /rest/orders/durum/{durumNo} (/rest/orders/durum/2)
Durum No : 1= Ödeme Onay Bekliyor. 2= Sipariş Onaylandı / Hazırlanıyor., 51= Siparişiniz Kargoya Teslim Edildi., 81= Teslimat Yapıldı., 89= Değişim Talebi Alındı., 90= İptal Talebi Alındı.
19. Siparişe ait durum değiştirmek için /rest/updateOrder/no/ çağrılmalıdır.
Örnek : /rest/updateOrder/no/{siparisNo} (/rest/updateOrder/no/158238365)
Örnek (durum no ile) : /rest/updateOrder/no/158238365/51
POST olarak gönderilebilecek field isimleri :
sdurum (int),
kargoTarih (date),
kargoFirma (int),
kargoSeriNo (string),
kargoURL (string),
faturaNo (string),
faturaURL (string)
Durum No : 1= Ödeme Onay Bekliyor. 2= Sipariş Onaylandı / Hazırlanıyor., 51= Siparişiniz Kargoya Teslim Edildi., 81= Teslimat Yapıldı., 89= Değişim Talebi Alındı., 90= İptal Talebi Alındı.
20. Kargo Firmalarını listelemek için /rest/list/kargo çağrılmalıdır.
21. Ödeme yöntemlerini listelemek için /rest/list/payment çağrılabilir.
22. Bannerları listelemek için /rest/list/banner çağrılmalıdır.
23. Slider resimlerini listelemek için /rest/list/slider çağrılmalıdır.
24. Şehirleri listelemek için /rest/list/city çağrılmalıdır.
25. Semtleri listelemek için /rest/list/town çağrılmalıdır.
26. Kullanıcıları listelemek için /rest/users çağrılmalıdır.
Örnek : /rest/users
Tek bir kullanıcı çağırmak için /rest/users/ID/ çağrılmalıdır.
Örnek : /rest/users/ID/{userID} (/rest/users/ID/132)
NOT: Tek bir kullanıcı sorgulandığında (users/ID, login, loginSMS/verify, setUser), kullanıcıya ait favori ürün detayları da XML yanıtında döner.
FAVORI_URUNLER alanında virgülle ayrılmış ürün ID'leri, FAVORILER bloğunda ise her ürüne ait detaylı bilgiler yer alır:
urun_ID, urun_kod, urun_ad, urun_kategori_kod, urun_kategori_ad, urun_marka_kod, urun_marka_ad, urun_resim, urun_fiyat, urun_piyasafiyat, urun_doviz, urun_kdv, urun_stok, urun_url
27. Kullanıcı eklemek veya güncellemek için setUser çağrılmalıdır.
Örnek : /rest/setUser
POST olarak gönderilebilecek field isimleri :
email (string), // Kullanıcı e-posta değeri zorunludur. Eğer bu e-posta varsa kullanıcı bilgileri güncellenir. Yoksa yeni kullanıcı eklenir.
password (string), // Kullanıcı şifresi. md5 hash ile veri tabanında saklanır.
name (string),
lastname (string),
birtdate (date),
tckNo (int),
vergiDaire (string),
vergiNo (string),
efatura (bool),
city (int), // iller tablosundaki plaka kodu
semt (int), // ilçeler tablosundaki semt ID değeri
address (string),
ceptel (string), // XXX-YYYYYYY formatında telefon girişi. Yeni kullanıcı ise SMS onay kodu gönderilir.
istel (string), // XXX-YYYYYYY formatında telefon girişi
evtel (string), // XXX-YYYYYYY formatında telefon girişi
ebulten (bool),
ebultensms (bool),
bayiStatus (bool), // 1: Onaylı üye. 0: Onaysız üye. (Sadece mevcut kullanıcı güncellemelerinde kullanılır)
Yeni kullanıcı eklenirken ceptel gönderilirse SMS onay kodu gönderilir ve bayiStatus=0 olarak ayarlanır.
SMS onayı için /rest/setUser/verify çağrılmalıdır.
28. Yeni kullanıcı SMS onayı için /rest/setUser/verify çağrılmalıdır.
Örnek : /rest/setUser/verify
POST olarak gönderilebilecek field isimleri :
token (string), // /rest/setUser ile dönen token değeri zorunludur.
code (string), // SMS ile gelen 4 haneli kod zorunludur.
Başarılı durumda kullanıcının bayiStatus değeri 1 yapılır ve kullanıcı bilgileri XML olarak döner.
29. Adresleri listelemek için /rest/list/address/ çağrılmalıdır.
Örnek : /rest/list/address/{userID} (/rest/list/address/1)
30. Adres eklemek veya güncellemek için setAddress çağrılmalıdır.
Örnek : /rest/setAddress
POST olarak gönderilebilecek field isimleri :
userID (int), // Kullanıcı ID değeri zorunludur.
addressID (int), // Address ID varsa güncellenir, yoksa yeni eklenir.
title (string),
address (string),
city (int), // iller tablosundaki plaka kodu
semt (int), // ilçeler tablosundaki semt ID değeri
tckNo (int),
vergiDaire (string),
vergiNo (string)
31. SMS göndermek için /rest/sendSMS/no/ çağrılmalıdır.
Örnek : /rest/sendSMS/no/{smsNo} (/rest/sendSMS/no/158238365)
POST olarak gönderilebilecek field isimleri :
msg (string)
32. HTML olarak taksit ekranı /rest/html/taksit/ ile çağrılmalıdır.
Örnek : /rest/html/taksit/{urunID} (/rest/html/taksit/190)
33. Kullanıcıya favori ürün eklemek için setFavorite çağrılmalıdır.
Örnek : /rest/setFavorite
POST olarak gönderilebilecek field isimleri :
userID (int), // Kullanıcı ID değeri zorunludur.
urunID (int), // Ürün ID değeri zorunludur.
Başarılı durumda success; daha önce eklenmiş ürün veya hata durumunda ERROR yanıtı döner.
34. Kullanıcının favori ürününü kaldırmak için removeFavorite çağrılmalıdır.
Örnek : /rest/removeFavorite
POST olarak gönderilebilecek field isimleri :
userID (int), // Kullanıcı ID değeri zorunludur.
urunID (int), // Ürün ID değeri zorunludur.
Başarılı durumda success; ürün favorilerde değilse veya hata durumunda ERROR yanıtı döner.
35. Bir promosyon kodu eklemek için setPromotion çağrılmalıdır.
Örnek : /rest/setPromotion
POST olarak gönderilebilecek field isimleri :
code (string), // Promosyon kodu zorunludur.
min (float), // Promosyon kodu kullanabilmek için asgari sipariş tutarı.
discount (float), // İndirim oranı. %10 indirim için 0.1 gönderilmelidir.
amount (float), // İndirim tutarı. 10 TL indirim için 10 gönderilmelidir.
tarih (date), // Promosyon kodu son kullanım tarihi. Ör : 2020-12-31
Başarılı durumda success; kod geçersiz veya zaten kayıtlıysa ERROR yanıtı döner.
36. Sepet görüntülemek için /rest/basket/view/ URL'ini kullanabiliriz.
Örnek : /rest/basket/view/{siparisNo} (/rest/basket/view/123456789)
37. Sepete ürün eklemek için /rest/basket/insert/ URL'ini kullanabiliriz.
Örnek : /rest/basket/insert/{siparisNo} (/rest/basket/insert/123456789)
POST olarak gönderilebilecek field isimleri :
urunID (int), // Sepete eklenecek ürün ID
adet (float), // Eklenecek ürün adet.
userID (int), // Eklenecek kullanıcı ID
ozellik1detay (string), // Eklenecek varyasyon detay. Buradaki 1 yerine varyasyon sırasını girebiliriz. Ör : ozellik3detay
38. Sepetten ürün silmek için /rest/basket/remove/ URL'ini kullanabiliriz. Sepet satır ID'sini sepet view ile gelen XML'de görebilirsiniz.
Örnek : /rest/basket/remove/{sepetID} (/rest/basket/remove/123456789)
POST olarak gönderilebilecek field isimleri :
lineID (int), // Silinecek Sepet ID
39. Sepetten ürün adet güncellemek için /rest/basket/update/ URL'ini kullanabiliriz. Sepet satır ID'sini sepet view ile gelen XML'de görebilirsiniz.
Örnek : /rest/basket/update/{sepetID} (/rest/basket/update/123456789)
POST olarak gönderilebilecek field isimleri :
lineID (int), // Güncellenecek Sepet ID
adet (float), // Güncellenecek adet
40. Sepet'i boşaltmak için /rest/basket/clean/ URL'ini kullanabiliriz.
Örnek : /rest/basket/clean/{siparisNo} (/rest/basket/clean/123456789)
41. Sipariş göndermek için /rest/setOrder çağrılmalıdır.
Örnek : /rest/setOrder
POST olarak gönderilebilecek field isimleri :
--Sipariş Bilgileri--
no (int), // 9 haneli benzersiz sipariş numarası (gönderilmezse sunucu üretir)
name (string),
lastname (string),
birtdate (date),
tckNo (int),
vergiDaire (string),
vergiNo (string),
city (int), // iller tablosundaki plaka kodu
semt (int), // ilçeler tablosundaki semt ID değeri
address (string),
city2 (int), // Fatura için iller tablosundaki plaka kodu
semt2 (int), // Fatura için ilçeler tablosundaki semt ID değeri
address2 (string), // Fatura için adres
ceptel (string), // XXX-YYYYYYY formatında telefon girişi
istel (string), // XXX-YYYYYYY formatında telefon girişi
evtel (string), // XXX-YYYYYYY formatında telefon girişi
kargoTutar (float), // Sipariş kargo tutarı
toplamTutarTL (float), // Sipariş toplam tutar TL,
odemeTipi (string), // Ödeme Tipi
--Sepet Bilgileri--
urunID_1 (int), // Sepete eklenecek ürün ID
urunName_1 (string), Eğer veri tabanındaki adından farklıysa eklenecek ürün Adı,
urunFiyat_1 (string), TL Cinsinde satış fiyatı,
urunAdet_1 (float), // Eklenecek ürün adet.
ozellik1detay_1 (string), // Eklenecek varyasyon detay. Buradaki 1 yerine varyasyon sırasını girebiliriz. Ör : ozellik3detay
urunID_2 (int), // Sepete eklenecek ürün ID
urunName_2 (string), Eğer veri tabanındaki adından farklıysa eklenecek ürün Adı,
urunFiyat_2 (string), TL Cinsinde satış fiyatı,
urunAdet_2 (float), // Eklenecek ürün adet.
ozellik1detay_2 (string), // Eklenecek varyasyon detay. Buradaki 1 yerine varyasyon sırasını girebiliriz. Ör : ozellik3detay
...
50 adede kadar sepete ürün eklenebilir.
42. Sipariş durumu güncellemek için /rest/setOrderStatus çağrılmalıdır.
Örnek : /rest/setOrderStatus
POST olarak gönderilebilecek field isimleri :
[Sipariş]
no (int), // 9 haneli benzersiz sipariş numarası
status (int), // Sipariş durum değeri. 1- Onay bekliyor 2- Onaylandı 51-Kargoya teslim edildi. 81- Sipariş teslim edildi. 91- İptal edildi.
faturaURL (string), // Fatura URL adresi.
43. Adres Şehir ve Semt ID'leri için /rest/getCityTown çağrılmalıdır.
Örnek : /rest/getCityTown
44. Kullanıcı girişi için /rest/login çağrılmalıdır.
Örnek : /rest/login
POST olarak gönderilebilecek field isimleri :
username (string), // Kullanıcı email veya username değeri zorunludur.
password (string), // Kullanıcı şifresi zorunludur (plain text olarak gönderin, md5 otomatik yapılacak).
Başarılı durumda kullanıcı bilgileri XML olarak döner, hatalı durumda ERROR yanıtı döner.
45. SMS ile kullanıcı girişi için /rest/loginSMS/send ve /rest/loginSMS/verify çağrılmalıdır.
Örnek : /rest/loginSMS/send
POST olarak gönderilebilecek field isimleri :
phone (string), // Kullanıcı cep telefonu numarası zorunludur (XXX-YYYYYYY formatında).
Başarılı durumda SMS kodu gönderilir ve token değeri döner.
Örnek : /rest/loginSMS/verify
POST olarak gönderilebilecek field isimleri :
token (string), // /send adımında dönen token değeri zorunludur.
code (string), // SMS ile gelen 4 haneli kod zorunludur.
Başarılı durumda kullanıcı bilgileri XML olarak döner, hatalı durumda ERROR yanıtı döner.
NOT: SMS login için mevcut smsrapor tablosu kullanılır, ayrı tablo gerekmez (mod_Login.php benzeri yaklaşım).
JSON / format:
- Yanıt varsayılan XML'dir. JSON için ?format=json veya POST format=json veya Accept: application/json gönderin.
46. Ürün arama için /rest/search/ çağrılmalıdır.
Örnek : /rest/search/{anahtar} (/rest/search/iphone)
Örnek (sayfalama) : /rest/search/{anahtar}?start=0&limit=100 (/rest/search/samsung?start=0&limit=100)
GET veya POST olarak gönderilebilecek field isimleri :
start (int), // Başlangıç offset. Varsayılan 0.
limit (int), // Sayfa başına kayıt. Varsayılan 50, en fazla 500.
Arama, sitedeki standart ürün arama sorgusu (getSearchQuery) ile yapılır; ürün adı ve ilgili alanlarda eşleşen aktif ürünler döner.
XML yanıtında her kayıt için urun_ID, urun_kod, urun_ad, urun_fiyat, urun_stok alanları yer alır.
47. Belirli tarihten sonra güncellenen ürünleri listelemek için /rest/products/updated/ çağrılmalıdır.
Örnek : /rest/products/updated/{tarih} (/rest/products/updated/2024-06-01)
Örnek (saat dahil) : /rest/products/updated/{tarih} (/rest/products/updated/2024-06-01_14:30:00)
Tarih formatı YYYY-MM-DD veya YYYY-MM-DD HH:ii:ss olmalıdır. URL'de boşluk _ ile yazılabilir.
urun.tarih alanı belirtilen tarihten büyük veya eşit olan ürünler, /rest/products ile aynı detaylı ürün XML yapısında döner.
48. Aktif veya pasif ürün listesi için /rest/products/active/<0|1> çağrılmalıdır.
Örnek (yalnızca aktif) : /rest/products/active/{1} (/rest/products/active/1)
Örnek (yalnızca pasif) : /rest/products/active/{0} (/rest/products/active/0)
active=1 yalnızca aktif ürünleri, active=0 yalnızca pasif (active=0) ürünleri listeler.
Yanıt formatı standart ürün export XML'idir; sayfalama için /rest/products/range/_ ile birlikte kullanılabilir.
49. Tek ürünün varyant (stok) listesini okumak için /rest/products/ID//variants çağrılmalıdır.
Örnek : /rest/products/ID/{urunID}/variants (/rest/products/ID/132/variants)
Ürün bulunamazsa rest_PRODUCT_ID_NOT_FOUND hatası döner.
XML yanıtında urun_ID ve her varyant için ID, var1_name, var2_name, var1, var2, kod, gtin, stok, fark alanları yer alır.
Yalnızca up=1 (aktif) varyant satırları listelenir.
50. Kategoriye ait filtre (marka, özellik) özetini almak için /rest/filter/cat/ çağrılmalıdır.
Örnek : /rest/filter/cat/{catID} (/rest/filter/cat/12)
İlgili kategorideki ürünlerden filitre ve marka dağılımı hesaplanır; kategori sayfasındaki filtre cache ile aynı XML yapısı döner.
catID yazılıma ait kategori ID değeri olmalıdır (tedarikciCode değil).
51. Hafif sipariş durum feed'i için /rest/orders/status çağrılmalıdır. Tam sipariş detayı yerine durum ve kargo özeti döner.
Örnek (son 90 gün, varsayılan) : /rest/orders/status
Örnek (son N gün) : /rest/orders/status/{gun} (/rest/orders/status/30)
Örnek (tarih aralığı) : /rest/orders/status/date/{baslangic}_{bitis} (/rest/orders/status/date/2024-01-01_2024-12-31)
GET veya POST ile ek filtre :
start-date (date), finish-date (date), // Tarih aralığı (YYYY-MM-DD)
gun (int), // Son kaç gün. URL'de belirtilmezse varsayılan 90.
Yalnızca durum 1–79 arası siparişler listelenir (iptal/tamamlanmış son durumlar hariç tutulur).
Her kayıtta SIPARIS_NO, DURUM_NO, KargoFirma, KargoTakipNo, KargoURL, KARGO_UCRETI alanları yer alır.
Tam sipariş detayı için /rest/orders/no/ veya /rest/orders/date/... kullanın.
52. Sipariş durum kodları referans listesi için /rest/list/orderStatus çağrılmalıdır.
Örnek : /rest/list/orderStatus
sepetDurum tablosundaki tüm durum kodları XML olarak döner; her kayıtta no (durum ID) ve title (durum adı) yer alır.
setOrderStatus, updateOrder ve orders/durum çağrılarında kullanılacak status/sdurum değerleri bu listeden alınmalıdır.
53. Kullanıcının favori ürün listesi için /rest/list/favorites/ çağrılmalıdır.
Örnek : /rest/list/favorites/{userID} (/rest/list/favorites/15)
userID yazılıma ait kullanıcı ID değeri olmalıdır.
XML yanıtında her favori için urun_ID, urun_kod, urun_ad, urun_fiyat, urun_stok alanları döner.
Favori ekleme/kaldırma için /rest/setFavorite ve /rest/removeFavorite kullanılır.
54. Tanımlı promosyon kodlarını listelemek için /rest/list/promotion çağrılmalıdır.
Örnek : /rest/list/promotion
Her promosyon için ID, code, percent (oran), amount (tutar), min (asgari sepet), date (son kullanım tarihi) alanları XML olarak döner.
Yeni promosyon eklemek için /rest/setPromotion, silmek için /rest/setPromotion/remove kullanılır.
55. Promosyon kodu silmek için /rest/setPromotion/remove çağrılmalıdır.
Örnek : /rest/setPromotion/remove
POST olarak gönderilebilecek field isimleri :
code (string), // Silinecek promosyon kodu. Zorunludur.
Başarılı durumda Success; kod bulunamazsa ERROR yanıtı döner.
56. Toplu fiyat ve stok güncellemek için /rest/setProduct/bulkPriceAndStock çağrılmalıdır.
Örnek : /rest/setProduct/bulkPriceAndStock
POST olarak gönderilebilecek field isimleri (200 ürüne kadar) :
ID_1 (int), fiyat_1 (float), piyasafiyat_1 (float), stok_1 (int), fiyatBirim_1 (string), kdv_1 (int), gtin_1 (string),
ID_2 (int), fiyat_2 (float), stok_2 (int),
...
veya tek ürün için : ID (int), fiyat (float), stok (int), piyasafiyat (float), fiyatBirim (string), kdv (int), gtin (string)
Her ID için en az bir güncellenecek alan gönderilmelidir. Gönderilmeyen alanlar değiştirilmez.
İşlem sonrası XML yanıtında updated etiketi ile güncellenen ürün sayısı döner.
57. Ürünü pasif veya aktif yapmak için /rest/setProduct/active çağrılmalıdır.
Örnek : /rest/setProduct/active
POST olarak gönderilebilecek field isimleri :
ID (int), // Yazılıma ait ürün ID değeri. Zorunludur.
active (int), // 1 = aktif, 0 = pasif. Zorunludur.
İşlem sonrası güncellenmiş ürün bilgileri standart ürün XML formatında döner.
58. Kategoriyi pasife almak (silmeden devre dışı bırakmak) için /rest/setCategory/remove çağrılmalıdır.
Örnek : /rest/setCategory/remove
POST olarak gönderilebilecek field isimleri :
ID (int), // Yazılıma ait kategori ID değeri
categoryCode (string), // Sizin tarafınızdan gönderilen kategori kodu
ID ve categoryCode'dan biri zorunludur.
Kategori veritabanından silinmez; active=0 yapılır. Başarılı durumda Success yanıtı döner.
59. Marka silmek için /rest/setBrand/remove çağrılmalıdır.
Örnek : /rest/setBrand/remove
POST olarak gönderilebilecek field isimleri :
ID (int), // Yazılıma ait marka ID değeri
name (string), // Marka adı
ID ve name'den biri zorunludur.
Markaya bağlı ürün varsa işlem yapılmaz ve hata döner. Başarılı durumda Success yanıtı döner.
60. Kullanıcı adresi silmek için /rest/setAddress/remove çağrılmalıdır.
Örnek : /rest/setAddress/remove
POST olarak gönderilebilecek field isimleri :
userID (int), // Kullanıcı ID. Zorunludur.
addressID (int), // useraddress tablosundaki adres ID. Zorunludur.
Adres yalnızca belirtilen kullanıcıya aitse silinir. Başarılı durumda Success, kayıt yoksa ERROR döner.
61. Stok ve fiyat alarm listesini okumak için /rest/list/alarm/ veya /rest/list/alarm// çağrılmalıdır.
Örnek (tüm alarmlar) : /rest/list/alarm/{userID} (/rest/list/alarm/15)
Örnek (fiyat alarmı) : /rest/list/alarm/{userID}/{tip} (/rest/list/alarm/15/AlarmFiyat)
Örnek (stok alarmı) : /rest/list/alarm/{userID}/{tip} (/rest/list/alarm/15/AlarmStok)
tip değerleri : AlarmFiyat, AlarmStok (ve site yapılandırmasına göre diğer alarmListe.type değerleri).
XML yanıtında ID, userID, urunID, type, date, sent alanları döner. En fazla 500 kayıt listelenir.
62. Ürün yorumlarını listelemek için /rest/list/review çağrılmalıdır.
Örnek (tüm yorumlar) : /rest/list/review
Örnek (ürüne göre) : /rest/list/review/urun/{urunID} (/rest/list/review/urun/132)
Örnek (onay bekleyenler) : /rest/list/review/onay/{0|1} (/rest/list/review/onay/0)
Örnek (onaylı) : /rest/list/review/onay/{0|1} (/rest/list/review/onay/1)
Her yorum için ID, urunID, userID, puan, onay, tarih, aciklama, name alanları XML olarak döner.
En fazla 500 kayıt listelenir.
63. Ürün yorumu eklemek için /rest/setReview çağrılmalıdır.
Örnek : /rest/setReview
POST olarak gönderilebilecek field isimleri :
urunID (int), // Ürün ID. Zorunludur.
userID (int), // Kullanıcı ID. Zorunludur.
aciklama (string), // Yorum metni. Zorunludur.
puan (int), // 1–5 arası puan. Varsayılan 0.
onay (int), // 1 = onaylı, 0 = onay bekliyor. Varsayılan 0.
name (string), lastname (string), email (string), // İsteğe bağlı gösterim bilgileri.
İşlem sonrası ilgili ürünün yorum listesi XML olarak döner.
64. Kullanıcı bakiye ve puan bilgisi için /rest/list/bakiye/ çağrılmalıdır.
Örnek : /rest/list/bakiye/{userID} (/rest/list/bakiye/15)
userID yazılıma ait kullanıcı ID değeri olmalıdır.
XML yanıtında userID, email, bakiye, puanToplanan, puanHarcanan, puanKalan alanları döner.
65. İade ve değişim taleplerini listelemek için /rest/list/return veya /rest/list/return/no/ çağrılmalıdır.
Örnek (tüm talepler) : /rest/list/return
Örnek (siparişe göre) : /rest/list/return/no/{siparisNo} (/rest/list/return/no/158238365)
arizaDurum tablosundaki kayıtlar döner; her kayıtta ID, siparis_no, tarih, status alanları yer alır.
En fazla 500 kayıt listelenir.
66. İade veya değişim talebi oluşturmak / güncellemek için /rest/setReturn çağrılmalıdır.
Örnek : /rest/setReturn
POST olarak gönderilebilecek field isimleri :
no (string), // 9 haneli sipariş numarası (randStr). Zorunludur.
mesaj (string), // Müşteri/tedarikçi mesajı. arizaMesaj tablosuna eklenir.
status (int), // arizaDurum kaydı durum kodu. Varsayılan 1.
durum (int), // Gönderilirse siparis ve sepet tablolarındaki sipariş durumu bu değere güncellenir.
İşlem sonrası ilgili sipariş numarasına ait iade kayıtları XML olarak döner.
Tüm isteklerde auth_email ve auth_key gönderilir. Örneklerdeki alan adı ve URL’leri kendi mağaza adresinize göre güncelleyin.
/rest/setProduct
Ürün oluşturma veya güncelleme
// API bağlantı bilgileri
$api_url = "https://api.siteniz.com/rest/setProduct"; // API URL'sini doğru şekilde ayarlayın
$auth_email = "restapi@domainadi.com"; // API kullanıcı email'i
$auth_password = "testapi"; // API kullanıcı şifresi
// auth_key oluşturma
$auth_key = md5($auth_email . md5($auth_password));
// Ürün bilgilerini tanımlayın
$product_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"productCode" => "PRD001", // Benzersiz ürün kodu
"name" => "Örnek Ürün", // Ürün adı
"catID" => 123, // Kategori ID'si
"markaID" => 456, // Marka ID'si
"stok" => 100, // Stok adedi
"fiyat" => 199.99, // Ürün fiyatı
"kdv" => 20, // KDV oranı (%20)
"detay" => "Bu ürün çok güzel bir üründür.", // Ürün detayı
"resim1" => "https://example.com/images/urun1.jpg", // Ürün resmi URL'si
];
// cURL ile POST isteği yapma fonksiyonu
function sendPostRequest($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // SSL doğrulamasını devre dışı bırakın, eğer sorun yaşarsanız
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Ürün eklemek için API çağrısı
$response = sendPostRequest($api_url, $product_data);
// API yanıtını işleme
if ($response) {
$xml = simplexml_load_string($response);
echo "API Yanıtı: " . $xml->asXML();
} else {
echo "API isteği başarısız oldu!";
}
/rest/setProduct → /rest/setProduct/variant
Önce ana ürün eklenir; ardından varyant satırları
// API bağlantı bilgileri
$api_url = "https://api.siteniz.com/rest/setProduct"; // API URL'sini doğru şekilde ayarlayın
$auth_email = "restapi@domainadi.com"; // API kullanıcı email'i
$auth_password = "testapi"; // API kullanıcı şifresi
// auth_key oluşturma
$auth_key = md5($auth_email . md5($auth_password));
// Ana ürün bilgilerini tanımlayın
$product_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"productCode" => "VARPRD001", // Benzersiz ürün kodu
"name" => "Varyantlı Örnek Ürün", // Ürün adı
"catID" => 123, // Kategori ID'si
"markaID" => 456, // Marka ID'si
"stok" => 50, // Ana stok miktarı
"fiyat" => 299.99, // Ürün fiyatı
"kdv" => 18, // KDV oranı (%18)
"detay" => "Bu varyantlı ürün çok kaliteli.", // Ürün detayları
"resim1" => "https://example.com/images/varyant_urun1.jpg", // Ürün ana resmi
];
// cURL ile POST isteği yapma fonksiyonu
function sendPostRequest($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // SSL doğrulamasını devre dışı bırakın, eğer sorun yaşarsanız
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Ürünü eklemek için API çağrısı
$response = sendPostRequest($api_url, $product_data);
// API yanıtını işleme
if ($response) {
$xml = simplexml_load_string($response);
echo "Ana ürün başarıyla eklendi: " . $xml->asXML();
// Ürünün varyantlarını eklemek için varyant API çağrısı
$product_id = (int)$xml->ID; // Ürünün ID'sini alın (XML yanıtından)
if ($product_id) {
$variant_api_url = "https://api.siteniz.com/rest/setProduct/variant"; // Varyant ekleme URL'si
// İlk varyant (Örnek: Beden: L, Renk: Kırmızı)
$variant_data_1 = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"ID" => $product_id, // Ana ürün ID'si
"varStock" => 10, // Varyant stok adedi
"varCode" => "VAR001-L-Kirmizi", // Varyant kodu
"varBarcode" => "1234567890123", // Varyant barkod
"var1_name" => "Beden", // 1. varyant ismi
"var1_var" => "L", // 1. varyant değeri (L beden)
"var2_name" => "Renk", // 2. varyant ismi
"var2_var" => "Kırmızı", // 2. varyant değeri (Kırmızı renk)
"var1_fark" => 0, // Fiyat farkı (L için yok)
"var2_fark" => 10, // Fiyat farkı (Kırmızı için +10 TL)
];
// İkinci varyant (Örnek: Beden: M, Renk: Mavi)
$variant_data_2 = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"ID" => $product_id, // Ana ürün ID'si
"varStock" => 20, // Varyant stok adedi
"varCode" => "VAR002-M-Mavi", // Varyant kodu
"varBarcode" => "1234567890124", // Varyant barkod
"var1_name" => "Beden", // 1. varyant ismi
"var1_var" => "M", // 1. varyant değeri (M beden)
"var2_name" => "Renk", // 2. varyant ismi
"var2_var" => "Mavi", // 2. varyant değeri (Mavi renk)
"var1_fark" => 0, // Fiyat farkı (M için yok)
"var2_fark" => 5, // Fiyat farkı (Mavi için +5 TL)
];
// Varyantları eklemek için API çağrısı yapıyoruz
$variant_response_1 = sendPostRequest($variant_api_url, $variant_data_1);
$variant_response_2 = sendPostRequest($variant_api_url, $variant_data_2);
echo "Varyant 1 yanıtı: " . $variant_response_1 . "\n";
echo "Varyant 2 yanıtı: " . $variant_response_2 . "\n";
} else {
echo "Ana ürün ID'si alınamadı!";
}
} else {
echo "Ana ürün ekleme isteği başarısız oldu!";
}
/rest/setProduct/variantRemove
Sipariş geçmişi olan varyant pasife alınır; diğerleri silinir
// API bağlantı bilgileri
$api_url = "https://api.siteniz.com/rest/setProduct/variantRemove";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
function sendPostRequest($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Tek varyant - stok kodu ile
$variant_remove_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"ID" => 132,
"varCode" => "VAR001-L-Kirmizi",
];
$response = sendPostRequest($api_url, $variant_remove_data);
echo $response;
// Alternatif: var1_var + var2_var ile
$variant_remove_data2 = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"ID" => 132,
"var1_var" => "L",
"var2_var" => "Kırmızı",
];
$response2 = sendPostRequest($api_url, $variant_remove_data2);
echo $response2;
// Tüm aktif varyantları kaldır/pasife al, sonra yenilerini /variant ile ekle
$variant_remove_all = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"ID" => 132,
"removeAll" => 1,
];
$response3 = sendPostRequest($api_url, $variant_remove_all);
echo $response3;
/rest/setCategory
Kategori oluşturma veya güncelleme
// API bağlantı bilgileri
$api_url = "https://api.siteniz.com/rest/setCategory"; // API URL'sini doğru şekilde ayarlayın
$auth_email = "restapi@domainadi.com"; // API kullanıcı email'i
$auth_password = "testapi"; // API kullanıcı şifresi
// auth_key oluşturma
$auth_key = md5($auth_email . md5($auth_password));
// Kategori bilgilerini tanımlayın
$category_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"categoryCode" => "KAT001", // Benzersiz kategori kodu
"name" => "Örnek Kategori", // Kategori adı
"parentID" => 0, // Üst kategori ID'si, 0 ise ana kategori
];
// cURL ile POST isteği yapma fonksiyonu
function sendPostRequest($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // SSL doğrulamasını devre dışı bırakın, eğer sorun yaşarsanız
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Kategori eklemek için API çağrısı
$response = sendPostRequest($api_url, $category_data);
// API yanıtını işleme
if ($response) {
$xml = simplexml_load_string($response);
echo "API Yanıtı: " . $xml->asXML();
} else {
echo "API isteği başarısız oldu!";
}
/rest/setBrand
Marka oluşturma veya güncelleme
// API bağlantı bilgileri
$api_url = "https://api.siteniz.com/rest/setBrand"; // API URL'sini doğru şekilde ayarlayın
$auth_email = "restapi@domainadi.com"; // API kullanıcı email'i
$auth_password = "testapi"; // API kullanıcı şifresi
// auth_key oluşturma
$auth_key = md5($auth_email . md5($auth_password));
// Marka bilgilerini tanımlayın
$brand_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"name" => "Örnek Marka", // Marka adı
];
// cURL ile POST isteği yapma fonksiyonu
function sendPostRequest($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // SSL doğrulamasını devre dışı bırakın, eğer sorun yaşarsanız
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Marka eklemek için API çağrısı
$response = sendPostRequest($api_url, $brand_data);
// API yanıtını işleme
if ($response) {
$xml = simplexml_load_string($response);
echo "API Yanıtı: " . $xml->asXML();
} else {
echo "API isteği başarısız oldu!";
}
/rest/orders/date/{başlangıç}_{bitiş}
Kimlik bilgisi sorgu parametresi olarak eklenir
// API bağlantı bilgileri
$api_url = "https://api.siteniz.com/rest/orders/date/2023-01-01_2023-12-31"; // API URL'sini tarih aralığına göre güncelleyin
$auth_email = "restapi@domainadi.com"; // API kullanıcı email'i
$auth_password = "testapi"; // API kullanıcı şifresi
// auth_key oluşturma
$auth_key = md5($auth_email . md5($auth_password));
// Sipariş sorgu verilerini tanımlayın
$order_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
];
// cURL ile GET isteği yapma fonksiyonu
function sendGetRequest($url, $data) {
$url_with_params = $url . '?' . http_build_query($data); // Verileri URL'ye ekleyin
$ch = curl_init($url_with_params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // SSL doğrulamasını devre dışı bırakın, eğer sorun yaşarsanız
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Siparişleri çekmek için API çağrısı
$response = sendGetRequest($api_url, $order_data);
// API yanıtını işleme
if ($response) {
$xml = simplexml_load_string($response);
echo "API Yanıtı: " . $xml->asXML();
} else {
echo "API isteği başarısız oldu!";
}
/rest/setOrderStatus
Sipariş numarası ve yeni durum kodu
// API bağlantı bilgileri
$api_url = "https://api.siteniz.com/rest/setOrderStatus"; // API URL'sini doğru şekilde ayarlayın
$auth_email = "restapi@domainadi.com"; // API kullanıcı email'i
$auth_password = "testapi"; // API kullanıcı şifresi
// auth_key oluşturma
$auth_key = md5($auth_email . md5($auth_password));
// Sipariş durumu güncelleme verilerini tanımlayın
$order_status_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"no" => 158238365, // Güncellenecek sipariş numarası
"status" => 51, // Yeni sipariş durumu (örneğin: 51 = Kargoya teslim edildi)
];
// cURL ile POST isteği yapma fonksiyonu
function sendPostRequest($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // SSL doğrulamasını devre dışı bırakın, eğer sorun yaşarsanız
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Sipariş durumu güncellemek için API çağrısı
$response = sendPostRequest($api_url, $order_status_data);
// API yanıtını işleme
if ($response) {
$xml = simplexml_load_string($response);
echo "API Yanıtı: " . $xml->asXML();
} else {
echo "API isteği başarısız oldu!";
}
/rest/setUser
E-posta varsa güncelleme, yoksa yeni kayıt
// API bağlantı bilgileri
$api_url = "https://api.siteniz.com/rest/setUser"; // API URL'sini doğru şekilde ayarlayın
$auth_email = "restapi@domainadi.com"; // API kullanıcı email'i
$auth_password = "testapi"; // API kullanıcı şifresi
// auth_key oluşturma
$auth_key = md5($auth_email . md5($auth_password));
$auth = ["auth_email" => $auth_email, "auth_key" => $auth_key];
// city = plaka kodu, semt = ilce ID — /rest/getCityTown XML'inden alinir
$ch = curl_init("https://api.siteniz.com/rest/getCityTown?" . http_build_query($auth));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$town_xml = simplexml_load_string(curl_exec($ch));
curl_close($ch);
$city = 0;
$semt = 0;
foreach ($town_xml->SEMT as $row) {
if ((string)$row->SEHIR_ADI === 'İstanbul' && (string)$row->SEMT_ADI === 'Kadıköy') {
$city = (int)$row->SEHIR_PLAKA_ID;
$semt = (int)$row->SEMT_ID;
break;
}
}
// Kullanıcı bilgilerini tanımlayın
$user_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"email" => "newuser@domain.com", // Yeni kullanıcının email adresi (Zorunlu)
"password" => md5("userpassword"), // Kullanıcı şifresi (md5 ile şifrelenmiş)
"name" => "Ali", // Kullanıcının adı
"lastname" => "Yılmaz", // Kullanıcının soyadı
"birtdate" => "1990-01-01", // Doğum tarihi (YYYY-MM-DD formatında)
"tckNo" => "12345678901", // Kullanıcının TCKN
"vergiDaire" => "Kadıköy", // Vergi dairesi
"vergiNo" => "1234567890", // Vergi numarası
"efatura" => true, // E-fatura kullanımı
"city" => $city,
"semt" => $semt,
"address" => "Örnek Mah. Örnek Cad. No:1", // Kullanıcının adresi
"ceptel" => "555-1234567", // Cep telefonu numarası (XXX-YYYYYYY formatında)
"istel" => "212-1234567", // İş telefonu numarası (opsiyonel)
"evtel" => "212-1234567", // Ev telefonu numarası (opsiyonel)
"ebulten" => true, // E-posta bülten abonesi
"ebultensms" => false, // SMS bülten abonesi
];
// cURL ile POST isteği yapma fonksiyonu
function sendPostRequest($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // SSL doğrulamasını devre dışı bırakın, eğer sorun yaşarsanız
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Kullanıcı eklemek için API çağrısı
$response = sendPostRequest($api_url, $user_data);
// API yanıtını işleme
if ($response) {
$xml = simplexml_load_string($response);
echo "API Yanıtı: " . $xml->asXML();
} else {
echo "API isteği başarısız oldu!";
}
/rest/setFavorite
Kullanıcı ve ürün kimliği zorunlu
// API bağlantı bilgileri
$api_url = "https://api.siteniz.com/rest/setFavorite"; // API URL'sini doğru şekilde ayarlayın
$auth_email = "restapi@domainadi.com"; // API kullanıcı email'i
$auth_password = "testapi"; // API kullanıcı şifresi
// auth_key oluşturma
$auth_key = md5($auth_email . md5($auth_password));
// Favori ürün ekleme için gerekli veriler
$favorite_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"userID" => 123, // Kullanıcı ID'si (Zorunlu)
"urunID" => 456, // Ürün ID'si (Zorunlu)
];
// cURL ile POST isteği yapma fonksiyonu
function sendPostRequest($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // SSL doğrulamasını devre dışı bırakın, eğer sorun yaşarsanız
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Favori ürünü eklemek için API çağrısı
$response = sendPostRequest($api_url, $favorite_data);
// API yanıtını işleme
if ($response) {
$xml = simplexml_load_string($response);
echo "API Yanıtı: " . $xml->asXML();
} else {
echo "API isteği başarısız oldu!";
}
/rest/setPromotion
Kod, tutar veya oran ile kampanya tanımı
// API bağlantı bilgileri
$api_url = "https://api.siteniz.com/rest/setPromotion"; // API URL'sini doğru şekilde ayarlayın
$auth_email = "restapi@domainadi.com"; // API kullanıcı email'i
$auth_password = "testapi"; // API kullanıcı şifresi
// auth_key oluşturma
$auth_key = md5($auth_email . md5($auth_password));
// Promosyon kodu bilgilerini tanımlayın
$promotion_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"code" => "PROMO123", // Promosyon kodu (Zorunlu)
"min" => 100.00, // Asgari sipariş tutarı (Promosyon kodunun kullanılabilmesi için minimum tutar)
"discount" => 0.1, // İndirim oranı (Örneğin %10 için 0.1 gönderilir)
"amount" => 20.00, // Sabit indirim tutarı (TL cinsinden, örneğin 20 TL)
"tarih" => "2024-12-31", // Promosyon kodunun son kullanım tarihi (YYYY-MM-DD formatında)
];
// cURL ile POST isteği yapma fonksiyonu
function sendPostRequest($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // SSL doğrulamasını devre dışı bırakın, eğer sorun yaşarsanız
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// Promosyon kodu eklemek için API çağrısı
$response = sendPostRequest($api_url, $promotion_data);
// API yanıtını işleme
if ($response) {
$xml = simplexml_load_string($response);
echo "API Yanıtı: " . $xml->asXML();
} else {
echo "API isteği başarısız oldu!";
}
/rest/basket/insert/{siparisNo}
Sipariş numarası bazlı sepete satır ekleme
$api_url = "https://api.siteniz.com/rest/basket/insert/123456789";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$basket_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"urunID" => 190,
"adet" => 2,
"userID" => 25,
"ozellik1detay" => "XL",
];
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($basket_data));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
/rest/setOrder
Temel müşteri + sepet alanları ile sipariş gönderimi
$api_url = "https://api.siteniz.com/rest/setOrder";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$auth = ["auth_email" => $auth_email, "auth_key" => $auth_key];
$ch = curl_init("https://api.siteniz.com/rest/getCityTown?" . http_build_query($auth));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$town_xml = simplexml_load_string(curl_exec($ch));
curl_close($ch);
$city = 0;
$semt = 0;
foreach ($town_xml->SEMT as $row) {
if ((string)$row->SEHIR_ADI === 'İstanbul' && (string)$row->SEMT_ADI === 'Kadıköy') {
$city = (int)$row->SEHIR_PLAKA_ID;
$semt = (int)$row->SEMT_ID;
break;
}
}
$order_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"name" => "Ali",
"lastname" => "Yilmaz",
"city" => $city,
"semt" => $semt,
"address" => "Ornek Mah. No:10",
"ceptel" => "555-1234567",
"odemeTipi" => "Kredi Karti",
"urunID_1" => 190,
"urunAdet_1" => 1,
"urunFiyat_1" => 199.90,
];
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($order_data));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
/rest/products/range/{start}_{limit}
Tüm ürünleri parça parça çekmek için
$api_url = "https://api.siteniz.com/rest/products/range/0_100";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$params = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
];
$ch = curl_init($api_url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
if ($response) {
$xml = simplexml_load_string($response);
echo $xml->asXML();
}
/rest/search/{anahtar}
Anahtar kelime ile ürün arama; start ve limit ile sayfalama
$api_url = "https://api.siteniz.com/rest/search/iphone";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$params = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"start" => 0,
"limit" => 50,
];
$ch = curl_init($api_url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
/rest/products/updated/{tarih}
Belirli tarihten sonra değişen ürünleri çekmek için
$api_url = "https://api.siteniz.com/rest/products/updated/2024-06-01";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$params = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
];
$ch = curl_init($api_url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
/rest/products?format=json
XML yerine JSON yanıt için format parametresi
$api_url = "https://api.siteniz.com/rest/products/ID/132";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$params = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"format" => "json",
];
$ch = curl_init($api_url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Accept: application/json"]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
/rest/setProduct/priceAndStock
Tek ürün fiyat/stok senkronizasyonu
$api_url = "https://api.siteniz.com/rest/setProduct/priceAndStock";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$stock_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"ID" => 132,
"fiyat" => 249.90,
"piyasafiyat" => 299.90,
"stok" => 45,
"fiyatBirim" => "TL",
"kdv" => 20,
];
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($stock_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
/rest/setProduct/bulkPriceAndStock
200 ürüne kadar tek istekte fiyat/stok güncelleme
$api_url = "https://api.siteniz.com/rest/setProduct/bulkPriceAndStock";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$bulk_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"ID_1" => 132,
"fiyat_1" => 199.90,
"stok_1" => 10,
"ID_2" => 133,
"fiyat_2" => 89.50,
"stok_2" => 25,
];
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($bulk_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
$xml = simplexml_load_string($response);
echo "Guncellenen urun: " . (int)$xml->updated;
/rest/orders/no/{siparisNo}
Sipariş numarası ile tam sipariş detayı
$api_url = "https://api.siteniz.com/rest/orders/no/158238365";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$params = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
];
$ch = curl_init($api_url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
/rest/orders/status/{gun}
Kargo takip entegrasyonu için durum özeti
$api_url = "https://api.siteniz.com/rest/orders/status/30";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$params = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
];
$ch = curl_init($api_url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
/rest/login
Mobil uygulama veya harici panel oturum açma
$api_url = "https://api.siteniz.com/rest/login";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$login_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"username" => "musteri@domain.com",
"password" => "kullaniciSifresi",
];
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($login_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
$xml = simplexml_load_string($response);
echo "Kullanici ID: " . (int)$xml->ID;
/rest/list/kategori
Ürün senkronu öncesi kategori ID eşlemesi için
$api_url = "https://api.siteniz.com/rest/list/kategori"; $auth_email = "restapi@domainadi.com"; $auth_password = "testapi"; $auth_key = md5($auth_email . md5($auth_password)); $params = ["auth_email" => $auth_email, "auth_key" => $auth_key]; $ch = curl_init($api_url . '?' . http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close($ch); echo $response;
/rest/products/ID/{urunID}
Belirli ürünün tam XML çıktısı
$api_url = "https://api.siteniz.com/rest/products/ID/132"; $auth_email = "restapi@domainadi.com"; $auth_password = "testapi"; $auth_key = md5($auth_email . md5($auth_password)); $params = ["auth_email" => $auth_email, "auth_key" => $auth_key]; $ch = curl_init($api_url . '?' . http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close($ch); echo $response;
/rest/products/ID/{urunID}/variants
Varyant stok kodu ve stok adetlerini okumak için
$api_url = "https://api.siteniz.com/rest/products/ID/132/variants"; $auth_email = "restapi@domainadi.com"; $auth_password = "testapi"; $auth_key = md5($auth_email . md5($auth_password)); $params = ["auth_email" => $auth_email, "auth_key" => $auth_key]; $ch = curl_init($api_url . '?' . http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close($ch); echo $response;
/rest/list/orderStatus
setOrderStatus ve updateOrder için geçerli durum numaraları
$api_url = "https://api.siteniz.com/rest/list/orderStatus"; $auth_email = "restapi@domainadi.com"; $auth_password = "testapi"; $auth_key = md5($auth_email . md5($auth_password)); $params = ["auth_email" => $auth_email, "auth_key" => $auth_key]; $ch = curl_init($api_url . '?' . http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close($ch); echo $response;
/rest/updateOrder/no/{siparisNo}
Kargo takip no, kargo firması ve fatura URL güncelleme
$api_url = "https://api.siteniz.com/rest/updateOrder/no/158238365";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$order_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"sdurum" => 51,
"kargoTarih" => date("Y-m-d"),
"kargoFirma" => 1,
"kargoSeriNo" => "1234567890",
"kargoURL" => "https://kargo.example.com/takip/1234567890",
"faturaNo" => "FT2024001",
"faturaURL" => "https://example.com/fatura/FT2024001.pdf",
];
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($order_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
/rest/basket/view/{siparisNo}
Sepet satır ID ve içerik kontrolü (basket/remove ve update öncesi)
$api_url = "https://api.siteniz.com/rest/basket/view/123456789"; $auth_email = "restapi@domainadi.com"; $auth_password = "testapi"; $auth_key = md5($auth_email . md5($auth_password)); $params = ["auth_email" => $auth_email, "auth_key" => $auth_key]; $ch = curl_init($api_url . '?' . http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close($ch); echo $response;
/rest/setAddress
Mobil uygulamada kayıtlı adres yönetimi
$api_url = "https://api.siteniz.com/rest/setAddress";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$auth = ["auth_email" => $auth_email, "auth_key" => $auth_key];
// city = il plaka kodu, semt = ilce ID (/rest/getCityTown SEMT_ID ve SEHIR_PLAKA_ID)
$ch = curl_init("https://api.siteniz.com/rest/getCityTown?" . http_build_query($auth));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$town_xml = simplexml_load_string(curl_exec($ch));
curl_close($ch);
$city = 0;
$semt = 0;
foreach ($town_xml->SEMT as $row) {
if ((string)$row->SEHIR_ADI === 'İstanbul' && (string)$row->SEMT_ADI === 'Kadıköy') {
$city = (int)$row->SEHIR_PLAKA_ID;
$semt = (int)$row->SEMT_ID;
break;
}
}
$address_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"userID" => 15,
"title" => "Ev",
"address" => "Ornek Mah. No:10",
"city" => $city,
"semt" => $semt,
];
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($address_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
/rest/setProduct/active
Katalog senkronunda ürünü yayından kaldırma veya açma
$api_url = "https://api.siteniz.com/rest/setProduct/active";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$active_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"ID" => 132,
"active" => 0,
];
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($active_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
/rest/getCityTown
SEMT_ID ve SEHIR_PLAKA_ID alanlarından city/semt eşlemesi
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$auth = ["auth_email" => $auth_email, "auth_key" => $auth_key];
$ch = curl_init("https://api.siteniz.com/rest/getCityTown?" . http_build_query($auth));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$town_xml = simplexml_load_string(curl_exec($ch));
curl_close($ch);
// XML: SEMT -> SEMT_ID (semt alani), SEHIR_PLAKA_ID (city alani), SEHIR_ADI, SEMT_ADI
$city = 0;
$semt = 0;
foreach ($town_xml->SEMT as $row) {
if ((string)$row->SEHIR_ADI === 'İstanbul' && (string)$row->SEMT_ADI === 'Kadıköy') {
$city = (int)$row->SEHIR_PLAKA_ID;
$semt = (int)$row->SEMT_ID;
break;
}
}
echo "city (plaka): $city, semt (ilce ID): $semt\n";
// Alternatif: yalnizca sehir listesi icin /rest/list/city (SEHIR_ID = plaka)
// Ilce listesi icin /rest/list/town (SEMT_ID, SEHIR_PLAKA_ID)
/rest/loginSMS/send → /rest/loginSMS/verify
Önce SMS kodu gönderilir, ardından token ve kod ile oturum açılır
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
// 1) SMS kodu gönder
$send_url = "https://api.siteniz.com/rest/loginSMS/send";
$send_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"phone" => "555-1234567",
];
$ch = curl_init($send_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($send_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$send_response = curl_exec($ch);
curl_close($ch);
$send_xml = simplexml_load_string($send_response);
$token = (string)$send_xml->token;
// 2) SMS kodu ile doğrula (kullanicinin girdigi 4 haneli kod)
$verify_url = "https://api.siteniz.com/rest/loginSMS/verify";
$verify_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"token" => $token,
"code" => "1234",
];
$ch = curl_init($verify_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($verify_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$verify_response = curl_exec($ch);
curl_close($ch);
$xml = simplexml_load_string($verify_response);
echo "Kullanici ID: " . (int)$xml->ID;
/rest/setUser → /rest/setUser/verify
ceptel ile kayıtta SMS kodu gider; verify ile hesap onaylanır
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
// 1) Yeni kullanici (ceptel zorunlu, SMS gider)
$register_url = "https://api.siteniz.com/rest/setUser";
$register_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"email" => "yeni@domain.com",
"password" => md5("sifre123"),
"name" => "Ali",
"lastname" => "Yilmaz",
"ceptel" => "555-9876543",
];
$ch = curl_init($register_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($register_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$register_response = curl_exec($ch);
curl_close($ch);
$reg_xml = simplexml_load_string($register_response);
$token = (string)$reg_xml->token;
// 2) SMS kodu ile onayla
$verify_url = "https://api.siteniz.com/rest/setUser/verify";
$verify_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"token" => $token,
"code" => "1234",
];
$ch = curl_init($verify_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($verify_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$verify_response = curl_exec($ch);
curl_close($ch);
echo $verify_response;
/rest/list/favorites/{userID}
Kullanıcının kayıtlı favori ürünlerini okumak için
$api_url = "https://api.siteniz.com/rest/list/favorites/15"; $auth_email = "restapi@domainadi.com"; $auth_password = "testapi"; $auth_key = md5($auth_email . md5($auth_password)); $params = ["auth_email" => $auth_email, "auth_key" => $auth_key]; $ch = curl_init($api_url . '?' . http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close($ch); echo $response;
/rest/list/promotion
Tanımlı kampanya kodlarını ve son kullanım tarihlerini listeler
$api_url = "https://api.siteniz.com/rest/list/promotion"; $auth_email = "restapi@domainadi.com"; $auth_password = "testapi"; $auth_key = md5($auth_email . md5($auth_password)); $params = ["auth_email" => $auth_email, "auth_key" => $auth_key]; $ch = curl_init($api_url . '?' . http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close($ch); echo $response;
/rest/setReturn
Siparişe bağlı iade/değişim kaydı oluşturma veya güncelleme
$api_url = "https://api.siteniz.com/rest/setReturn";
$auth_email = "restapi@domainadi.com";
$auth_password = "testapi";
$auth_key = md5($auth_email . md5($auth_password));
$return_data = [
"auth_email" => $auth_email,
"auth_key" => $auth_key,
"no" => "158238365",
"mesaj" => "Urun hasarli geldi, degisim talep ediyorum.",
"status" => 1,
"durum" => 89,
];
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($return_data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
echo $response;