ilaclat.com API

(v1.0.0)

API Hakkında

  • API ile kullanılabilir hizmetlere doküman üzerinden ulaşabilirsiniz.
  • API servisine gönderilebilir istekleri ve servisten tarafınıza dönen yanıtları inceleyebilirsiniz.
  • HTTP durum kodlarıyla dönen JSON yanıtlarına örnek API kodları ile ulaşabilirsiniz.
  • REST mimarisi kullanılarak RESTful Web Servis olarak hazırlanmıştır.

Genel Bilgiler

Test Ortam URL olarak https://www.ilaclat.com/api-test adresi kullanılır.

Gerçek Ortam URL olarak https://www.ilaclat.com/api adresi kullanılır.

API endpointlerine ulaşmak için kullanacağınız access_tokendestek@ilaclat.com adresinden talepte bulunmanız gerekmektedir.

İstekleri gönderirken Content-Type header'ı olarak application/json göndermelisiniz.

Aldığınız access_token'ı sorgulara Authorization header'ı olarak Bearer access_token şeklinde göndermelisiniz.


Yapı

Bireysel ── Kurumsal ── Dezenfeksiyon
└── Şehir Listesi
│   └── İlçe Listesi
├── Hizmet Yeri
│   └── Hizmet Alanı ── Hizmet Ölçüleri
├── Hizmet Türü
└── Fiyat Listesi
└── Şipariş Listesi
    └── Sipariş Ekle
    └── Sipariş Sil

Şehir / İlçe Sorgulama

Şehirler

Sistemde kayıtlı tüm şehirleri listelenir.

GEThttps://www.ilaclat.com/api-test/liste/sehir
$token = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";
$veriler = array();
$url = "https://www.ilaclat.com/api-test/liste/sehir";

$ch = curl_init($url);
$headers = array(
   "Accept: application/json",
   "Content-Type: application/json",
   "Authorization: Bearer ".$token
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($veriler));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); // false for json format, true array format
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$jsonData = curl_exec($ch);

if ($jsonData === false){
	print "hata: ".curl_error($ch);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$httpResponse = json_decode($jsonData, true);

if ($httpCode != 200){
	if ($httpCode==400) echo "400 Bad Request ".$httpResponse;
	else if ($httpCode==401) echo "401 Authentication Error ".$httpResponse;
	else if ($httpCode==403) echo "403 Forbidden ".$httpResponse;
	else if ($httpCode==404) echo "404 Not Found Error ".$httpResponse;
	else if ($httpCode==422) echo "422 Unprocessable Entity Error ".$httpResponse;
	else if ($httpCode==500) echo "500 Internal Server Error ".$httpResponse;
	
	//echo $httpCode." ".$httpResponse;
}else{
	if ($httpResponse["kod"] == 900){ // başarılı
		//print_r($httpResponse);
	}else{ // hatalı
		//print_r($httpResponse);
	}
}

Şehirler - Servisten Alınan Cevap

{
    "data": [
        {
            "id": "1",
            "sehir": "Adana"
        },
        {
            "id": "2",
            "sehir": "Adıyaman"
        },
        {
            "id": "3",
            "sehir": "Afyonkarahisar"
        },
	...................
	...................
        {
            "id": "77",
            "sehir": "Yalova"
        },
        {
            "id": "66",
            "sehir": "Yozgat"
        },
        {
            "id": "67",
            "sehir": "Zonguldak"
        }
    ],
    "kod": 900
}

İlçeler

Sistemde kayıtlı tüm şehirleri listelenir.

GEThttps://www.ilaclat.com/api-test/liste/ilce
$token = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";
$veriler = array(
				"id" => 35 // şehir plaka kodu * ZORUNLU
			);
$url = "https://www.ilaclat.com/api-test/liste/ilce";

$ch = curl_init($url);
$headers = array(
   "Accept: application/json",
   "Content-Type: application/json",
   "Authorization: Bearer ".$token
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($veriler));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); // false for json format, true array format
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$jsonData = curl_exec($ch);

if ($jsonData === false){
	print "hata: ".curl_error($ch);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$httpResponse = json_decode($jsonData, true);

if ($httpCode != 200){
	if ($httpCode==400) echo "400 Bad Request ".$httpResponse;
	else if ($httpCode==401) echo "401 Authentication Error ".$httpResponse;
	else if ($httpCode==403) echo "403 Forbidden ".$httpResponse;
	else if ($httpCode==404) echo "404 Not Found Error ".$httpResponse;
	else if ($httpCode==422) echo "422 Unprocessable Entity Error ".$httpResponse;
	else if ($httpCode==500) echo "500 Internal Server Error ".$httpResponse;
	
	//echo $httpCode." ".$httpResponse;
}else{
	if ($httpResponse["kod"] == 900){ // başarılı
		//print_r($httpResponse);
	}else{ // hatalı
		//print_r($httpResponse);
	}
}

İlçeler - Servisten Alınan Cevap

{
    "plaka": {
        "id": "35",
        "sehir": "İzmir"
    },
    "data": [
        {
            "id": "474",
            "ilce": "Aliağa"
        },
        {
            "id": "475",
            "ilce": "Balçova"
        },
        {
            "id": "476",
            "ilce": "Bayındır"
        },
	...................
	...................
        {
            "id": "501",
            "ilce": "Tire"
        },
        {
            "id": "502",
            "ilce": "Torbalı"
        },
        {
            "id": "503",
            "ilce": "Urla"
        }
    ],
    "kod": 900
}

Hizmet Yeri / Alanı / Ölçüsü Sorgulama

Hizmet Yeri / Alanı

Sistemde kayıtlı tüm hizmet yerleri ve varsa o yerlere ait alanlar listelenir.

GEThttps://www.ilaclat.com/api-test/liste/hizmet-yeri
$token = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";
$veriler = array(
				"hizmet_tipi" => "bireysel" // bireysel, kurumsal, dezenfeksiyon * ZORUNLU
			);
$url = "https://www.ilaclat.com/api-test/liste/hizmet-yeri";

$ch = curl_init($url);
$headers = array(
   "Accept: application/json",
   "Content-Type: application/json",
   "Authorization: Bearer ".$token
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($veriler));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); // false for json format, true array format
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$jsonData = curl_exec($ch);

if ($jsonData === false){
	print "hata: ".curl_error($ch);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$httpResponse = json_decode($jsonData, true);

if ($httpCode != 200){
	if ($httpCode==400) echo "400 Bad Request ".$httpResponse;
	else if ($httpCode==401) echo "401 Authentication Error ".$httpResponse;
	else if ($httpCode==403) echo "403 Forbidden ".$httpResponse;
	else if ($httpCode==404) echo "404 Not Found Error ".$httpResponse;
	else if ($httpCode==422) echo "422 Unprocessable Entity Error ".$httpResponse;
	else if ($httpCode==500) echo "500 Internal Server Error ".$httpResponse;
	
	//echo $httpCode." ".$httpResponse;
}else{
	if ($httpResponse["kod"] == 900){ // başarılı
		//print_r($httpResponse);
	}else{ // hatalı
		//print_r($httpResponse);
	}
}

Hizmet Yeri / Alanı - Servisten Alınan Cevap

{
    "hizmet_tipi": "bireysel",
    "data": [
        {
            "id": "1",
            "hizmet_tipi": "Daire",
            "data": [
                {
                    "id": 0,
                    "hizmet_alani": ""
                }
            ]
        },
        {
            "id": "4",
            "hizmet_tipi": "Müstakil Ev",
            "data": [
                {
                    "id": 0,
                    "hizmet_alani": ""
                }
            ]
        },
        {
            "id": "2",
            "hizmet_tipi": "Bina-Toplu Konut",
            "data": [
                {
                    "id": "1",
                    "hizmet_alani": "1 Daire"
                },
                {
                    "id": "11",
                    "hizmet_alani": "2 Daire"
                },
                {
                    "id": "12",
                    "hizmet_alani": "3 Daire"
                },
		...................
		...................
                {
                    "id": "60",
                    "hizmet_alani": "70 - 80 Daire"
                },
                {
                    "id": "61",
                    "hizmet_alani": "80 - 90 Daire"
                },
                {
                    "id": "62",
                    "hizmet_alani": "90 - 100 Daire"
                }
            ]
        },
        {
            "id": "17",
            "hizmet_tipi": "Bina Ortak Alan",
            "data": [
                {
                    "id": 0,
                    "hizmet_alani": ""
                }
            ]
        },
        {
            "id": "6",
            "hizmet_tipi": "Bahçeli Ev",
            "data": [
                {
                    "id": 0,
                    "hizmet_alani": ""
                }
            ]
        },
        {
            "id": "3",
            "hizmet_tipi": "Bahçe",
            "data": [
                {
                    "id": 0,
                    "hizmet_alani": ""
                }
            ]
        },
        {
            "id": "30",
            "hizmet_tipi": "Diğer",
            "data": [
                {
                    "id": 0,
                    "hizmet_alani": ""
                }
            ]
        }
    ],
    "kod": 900
}

Hizmet Alanı Ölçüsü

Sistemde kayıtlı alanlar M2 cinsinden listelenir.

GEThttps://www.ilaclat.com/api-test/liste/hizmet-alani-olculer
$token = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";
$veriler = array();
$url = "https://www.ilaclat.com/api-test/liste/hizmet-alani-olculer";

$ch = curl_init($url);
$headers = array(
   "Accept: application/json",
   "Content-Type: application/json",
   "Authorization: Bearer ".$token
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($veriler));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); // false for json format, true array format
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$jsonData = curl_exec($ch);

if ($jsonData === false){
	print "hata: ".curl_error($ch);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$httpResponse = json_decode($jsonData, true);

if ($httpCode != 200){
	if ($httpCode==400) echo "400 Bad Request ".$httpResponse;
	else if ($httpCode==401) echo "401 Authentication Error ".$httpResponse;
	else if ($httpCode==403) echo "403 Forbidden ".$httpResponse;
	else if ($httpCode==404) echo "404 Not Found Error ".$httpResponse;
	else if ($httpCode==422) echo "422 Unprocessable Entity Error ".$httpResponse;
	else if ($httpCode==500) echo "500 Internal Server Error ".$httpResponse;
	
	//echo $httpCode." ".$httpResponse;
}else{
	if ($httpResponse["kod"] == 900){ // başarılı
		//print_r($httpResponse);
	}else{ // hatalı
		//print_r($httpResponse);
	}
}

Hizmet Alanı Ölçüsü - Servisten Alınan Cevap

{
    "data": [
        {
            "id": "7",
            "hizmet_alani_olculer": "0-100 M2"
        },
        {
            "id": "1",
            "hizmet_alani_olculer": "100-200 M2"
        },
        {
            "id": "2",
            "hizmet_alani_olculer": "200-300 M2"
        },
        {
            "id": "3",
            "hizmet_alani_olculer": "300-500 M2"
        },
        {
            "id": "4",
            "hizmet_alani_olculer": "500-1000 M2"
        },
        {
            "id": "5",
            "hizmet_alani_olculer": "1000-2000 M2"
        },
        {
            "id": "6",
            "hizmet_alani_olculer": "3000 M2"
        }
    ],
    "kod": 900
}

Hizmet Türü Sorgulama

Hizmet Türü

Sistemde kayıtlı talep edilecek tüm hizmet türleri listelenir.

GEThttps://www.ilaclat.com/api-test/liste/hizmet-turu
$token = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";
$veriler = array(
				"hizmet_tipi" => "bireysel" // bireysel, kurumsal, dezenfeksiyon * ZORUNLU
			);
$url = "https://www.ilaclat.com/api-test/liste/hizmet-turu";

$ch = curl_init($url);
$headers = array(
   "Accept: application/json",
   "Content-Type: application/json",
   "Authorization: Bearer ".$token
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($veriler));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); // false for json format, true array format
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$jsonData = curl_exec($ch);

if ($jsonData === false){
	print "hata: ".curl_error($ch);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$httpResponse = json_decode($jsonData, true);

if ($httpCode != 200){
	if ($httpCode==400) echo "400 Bad Request ".$httpResponse;
	else if ($httpCode==401) echo "401 Authentication Error ".$httpResponse;
	else if ($httpCode==403) echo "403 Forbidden ".$httpResponse;
	else if ($httpCode==404) echo "404 Not Found Error ".$httpResponse;
	else if ($httpCode==422) echo "422 Unprocessable Entity Error ".$httpResponse;
	else if ($httpCode==500) echo "500 Internal Server Error ".$httpResponse;
	
	//echo $httpCode." ".$httpResponse;
}else{
	if ($httpResponse["kod"] == 900){ // başarılı
		//print_r($httpResponse);
	}else{ // hatalı
		//print_r($httpResponse);
	}
}

Hizmet Türü - Servisten Alınan Cevap

{
    "hizmet_tipi": "bireysel",
    "data": [
        {
            "id": "9",
            "hizmet_turu": "Koruyucu/kovucu Genel (Yürüyen/uçkun) Haşere Kontrolü"
        },
        {
            "id": "18",
            "hizmet_turu": "Karınca"
        },
        {
            "id": "19",
            "hizmet_turu": "Gümüş Böceği"
        },
	...................
	...................
        {
            "id": "12",
            "hizmet_turu": "Bit"
        },
        {
            "id": "8",
            "hizmet_turu": "Sivrisinek/yakarca"
        },
        {
            "id": "6",
            "hizmet_turu": "Karasinek"
        }
    ],
    "kod": 900
}

Fiyat Sorgulama

Fiyat

Talep edilecek hizmet türüne ait fiyat bilgisi listelenir.

GEThttps://www.ilaclat.com/api-test/liste/fiyat
$token = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";
$veriler = array(
				/*
				"hizmet_il" => "35", // izmir * ZORUNLU
				"hizmet_ilce" => "480", // bornova * ZORUNLU
				"hizmet_tipi" => "bireysel", // bireysel, kurumsal, dezenfeksiyon * ZORUNLU
				"hizmet_turu" => "18", // Karınca * ZORUNLU
				"hizmet_yeri" => "2", // 2 Bina-Toplu Konut * ZORUNLU
				"hizmet_alani" => "23", // 15 Daire * ZORUNLU
				"hizmet_alani_olculer" => "1" // 100-200 M2 * ZORUNLU
				*/
				
				/*
				"hizmet_il" => "35", // izmir * ZORUNLU
				"hizmet_ilce" => "480", // bornova * ZORUNLU
				"hizmet_tipi" => "dezenfeksiyon", // bireysel, kurumsal, dezenfeksiyon * ZORUNLU
				"hizmet_turu" => "22", // Dezenfeksiyon * ZORUNLU
				"hizmet_yeri" => "2", // 2 Bina-Toplu Konut * ZORUNLU
				"hizmet_alani" => "23", // 15 Daire * ZORUNLU
				"hizmet_alani_olculer" => "1" // 100-200 M2 * ZORUNLU
				*/
				
				"hizmet_il" => "35", // izmir * ZORUNLU
				"hizmet_ilce" => "480", // bornova * ZORUNLU
				"hizmet_tipi" => "kurumsal", // bireysel, kurumsal, dezenfeksiyon * ZORUNLU
				"hizmet_turu" => "18", // Karınca * ZORUNLU
				"hizmet_yeri" => "8", // Ofis * ZORUNLU
				"hizmet_alani" => "0", * ZORUNLU
				"hizmet_alani_olculer" => "1" // 100-200 M2 * ZORUNLU
			);
$url = "https://www.ilaclat.com/api-test/liste/fiyat";

$ch = curl_init($url);
$headers = array(
   "Accept: application/json",
   "Content-Type: application/json",
   "Authorization: Bearer ".$token
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($veriler));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); // false for json format, true array format
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$jsonData = curl_exec($ch);

if ($jsonData === false){
	print "hata: ".curl_error($ch);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$httpResponse = json_decode($jsonData, true);

if ($httpCode != 200){
	if ($httpCode==400) echo "400 Bad Request ".$httpResponse;
	else if ($httpCode==401) echo "401 Authentication Error ".$httpResponse;
	else if ($httpCode==403) echo "403 Forbidden ".$httpResponse;
	else if ($httpCode==404) echo "404 Not Found Error ".$httpResponse;
	else if ($httpCode==422) echo "422 Unprocessable Entity Error ".$httpResponse;
	else if ($httpCode==500) echo "500 Internal Server Error ".$httpResponse;
	
	//echo $httpCode." ".$httpResponse;
}else{
	if ($httpResponse["kod"] == 900){ // başarılı
		//print_r($httpResponse);
	}else{ // hatalı
		//print_r($httpResponse);
	}
}

Fiyat - Servisten Alınan Cevap

{
    "data": [
        {
            "hizmet_tipi": "kurumsal",
            "hizmet_il": {
                "plaka": "35",
                "adi": "İzmir"
            },
            "hizmet_ilce": {
                "id": "480",
                "adi": "Bornova"
            },
            "hizmet_turu": {
                "id": "18",
                "adi": "Karınca"
            },
            "hizmet_yeri": {
                "id": "8",
                "adi": "Ofis"
            },
            "hizmet_alani": {
                "id": "0",
                "adi": ""
            },
            "hizmet_alani_olculer": {
                "id": "1",
                "adi": "100-200 M2"
            },
            "hizmet_odemesi": [
                {
                    "hizmet_plani": "teksefer",
                    "hizmet_tutari": "500.94"
                },
                {
                    "hizmet_plani": "1ay",
                    "hizmet_tutari": "500.94"
                },
                {
                    "hizmet_plani": "3ay",
                    "hizmet_tutari": "1471.77"
                },
                {
                    "hizmet_plani": "6ay",
                    "hizmet_tutari": "2881.44"
                },
                {
                    "hizmet_plani": "12ay",
                    "hizmet_tutari": "5638.68"
                }
            ]
        }
    ],
    "kod": 900
}

Sipariş Ekle / Listele / Sil

Sipariş Ekle

Talep edilecek hizmete ait sipariş sisteme eklenir.

POSThttps://www.ilaclat.com/api-test/ekle/siparis
$token = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";
$veriler = array(
				"hizmet_adsoyad" => "Adı Soyadı", // * ZORUNLU
				"hizmet_telefon" => "05551112233", // * ZORUNLU
				"hizmet_eposta" => "deneme@ilaclat.com", // * ZORUNLU DEĞİL
				"hizmet_adres" => "123 sokak", // * ZORUNLU DEĞİL
				
				/*
				"hizmet_il" => "35", // izmir * ZORUNLU
				"hizmet_ilce" => "480", // bornova * ZORUNLU
				"hizmet_tipi" => "bireysel", // bireysel, kurumsal, dezenfeksiyon * ZORUNLU
				"hizmet_turu" => "18", // Karınca * ZORUNLU
				"hizmet_yeri" => "2", // Bina-Toplu Konut * ZORUNLU
				"hizmet_alani" => "23", // 15 Daire * ZORUNLU
				"hizmet_alani_olculer" => "1", // 100-200 M2 * ZORUNLU
				"hizmet_plan" => "teksefer", // teksefer * ZORUNLU
				*/
				
				"hizmet_il" => "35", // izmir * ZORUNLU
				"hizmet_ilce" => "480", // bornova * ZORUNLU
				"hizmet_tipi" => "kurumsal", // bireysel, kurumsal, dezenfeksiyon * ZORUNLU
				"hizmet_turu" => "18", // Karınca * ZORUNLU
				"hizmet_yeri" => "8", // Ofis * ZORUNLU
				"hizmet_alani" => "0", // * ZORUNLU DEĞİL
				"hizmet_alani_olculer" => "1", // 100-200 M2 * ZORUNLU
				"hizmet_plan" => "6ay", // teksefer, 1ay, 3ay, 6ay, 12ay * ZORUNLU

				"hizmet_talep_tarihi" => "2022-12-27 19:00:00", // hizmet ne zaman yapılsın * ZORUNLU DEĞİL
				"odeme_sekli" => "kapidaodeme", // kapidaodeme, kredikarti * ZORUNLU
				"siparis_notu" => "sipariş notu", // * ZORUNLU DEĞİL
				"ip" => "127.0.0.1" // * ZORUNLU
			);
$url = "https://www.ilaclat.com/api-test/ekle/siparis";

$ch = curl_init($url);
$headers = array(
   "Accept: application/json",
   "Content-Type: application/json",
   "Authorization: Bearer ".$token
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($veriler));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); // false for json format, true array format
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$jsonData = curl_exec($ch);

if ($jsonData === false){
	print "hata: ".curl_error($ch);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$httpResponse = json_decode($jsonData, true);

if ($httpCode != 200){
	if ($httpCode==400) echo "400 Bad Request ".$httpResponse;
	else if ($httpCode==401) echo "401 Authentication Error ".$httpResponse;
	else if ($httpCode==403) echo "403 Forbidden ".$httpResponse;
	else if ($httpCode==404) echo "404 Not Found Error ".$httpResponse;
	else if ($httpCode==422) echo "422 Unprocessable Entity Error ".$httpResponse;
	else if ($httpCode==500) echo "500 Internal Server Error ".$httpResponse;
	
	//echo $httpCode." ".$httpResponse;
}else{
	if ($httpResponse["kod"] == 900){ // başarılı
		//print_r($httpResponse);
	}else{ // hatalı
		//print_r($httpResponse);
	}
}

Sipariş Ekle - Servisten Alınan Cevap

{
    "data": [
        {
            "id": 4,
            "siparis_kodu": "618BC1214135315"
        }
    ],
    "kod": 900
}

Sipariş Listele

Sistemde kayıtlı tüm siparişler listelenir.

GEThttps://www.ilaclat.com/api-test/liste/siparis
$token = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";
$veriler = array(
				"siparis_kodu" => "", // sipariş kodu * ZORUNLU DEĞİL
				"current_page" => 1 // sayfa numarası * ZORUNLU
			);
$url = "https://www.ilaclat.com/api-test/liste/siparis";

$ch = curl_init($url);
$headers = array(
   "Accept: application/json",
   "Content-Type: application/json",
   "Authorization: Bearer ".$token
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($veriler));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); // false for json format, true array format
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$jsonData = curl_exec($ch);

if ($jsonData === false){
	print "hata: ".curl_error($ch);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$httpResponse = json_decode($jsonData, true);

if ($httpCode != 200){
	if ($httpCode==400) echo "400 Bad Request ".$httpResponse;
	else if ($httpCode==401) echo "401 Authentication Error ".$httpResponse;
	else if ($httpCode==403) echo "403 Forbidden ".$httpResponse;
	else if ($httpCode==404) echo "404 Not Found Error ".$httpResponse;
	else if ($httpCode==422) echo "422 Unprocessable Entity Error ".$httpResponse;
	else if ($httpCode==500) echo "500 Internal Server Error ".$httpResponse;
	
	//echo $httpCode." ".$httpResponse;
}else{
	if ($httpResponse["kod"] == 900){ // başarılı
		//print_r($httpResponse);
	}else{ // hatalı
		//print_r($httpResponse);
	}
}

Sipariş Listele - Servisten Alınan Cevap

{
    "meta": {
        "current_page": 0,
        "total_pages": 0
    },
    "data": [
        {
            "siparis_kodu": "618BC1214135315",
            "siparis_tarihi": "2022-12-14 13:53:16",
            "siparis_tutari": "2881.44",
            "siparis_durumu": "beklemede",
            "siparis_notu": "sipariş notu",
            "hizmet_adsoyad": "Adı Soyadı",
            "hizmet_telefon": "05551112233",
            "hizmet_eposta": "deneme@ilaclat.com",
            "hizmet_adres": "123 sokak",
            "hizmet_tipi": "kurumsal",
            "hizmet_il": {
                "plaka": "35",
                "adi": "İzmir"
            },
            "hizmet_ilce": {
                "id": "480",
                "adi": "Bornova"
            },
            "hizmet_turu": {
                "id": "18",
                "adi": "Karınca"
            },
            "hizmet_yeri": {
                "id": "8",
                "adi": "Ofis"
            },
            "hizmet_alani": {
                "id": "0",
                "adi": ""
            },
            "hizmet_alani_olculer": {
                "id": "1",
                "adi": "100-200 M2"
            },
            "hizmet_plan": "6ay",
            "hizmet_plan_bitis_tarihi": "2023-06-14",
            "hizmet_talep_tarihi": "2022-12-27 19:00:00",
            "odeme_sekli": "kapidaodeme",
            "odeme_durumu": "odenmemis",
            "teslim_tarihi": "0000-00-00 00:00:00"
        }
    ],
    "kod": 900
}

Sipariş Sil

Sistemde kayıtlı sipariş kalıcı olarak silinir.

DELETEhttps://www.ilaclat.com/api-test/sil/siparis
$token = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";

$veriler = array(
				"siparis_kodu" => "68AA61208213217" // sipariş kodu * ZORUNLU
			);
$url = "https://www.ilaclat.com/api-test/sil/siparis";

$ch = curl_init($url);
$headers = array(
   "Accept: application/json",
   "Content-Type: application/json",
   "Authorization: Bearer ".$token
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($veriler));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); // false for json format, true array format
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$jsonData = curl_exec($ch);

if ($jsonData === false){
	print "hata: ".curl_error($ch);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$httpResponse = json_decode($jsonData, true);

if ($httpCode != 200){
	if ($httpCode==400) echo "400 Bad Request ".$httpResponse;
	else if ($httpCode==401) echo "401 Authentication Error ".$httpResponse;
	else if ($httpCode==403) echo "403 Forbidden ".$httpResponse;
	else if ($httpCode==404) echo "404 Not Found Error ".$httpResponse;
	else if ($httpCode==422) echo "422 Unprocessable Entity Error ".$httpResponse;
	else if ($httpCode==500) echo "500 Internal Server Error ".$httpResponse;
	
	//echo $httpCode." ".$httpResponse;
}else{
	if ($httpResponse["kod"] == 900){ // başarılı
		//print_r($httpResponse);
	}else{ // hatalı
		//print_r($httpResponse);
	}
}

Sipariş Sil - Servisten Alınan Cevap

{
    "data": "Sipariş Başarıyla Silindi",
    "kod": 900
}

Tanımlar

Parametre Anlamı
hizmet_tipi"bireysel", "kurumsal", "dezenfeksiyon" değerlerinir alır.
hizmet_planHizmet Tipi "bireysel" veya "dezenfeksiyon" ise "teksefer" değerini alır, Hizmet Tipi "kurumsal" ise "teksefer" veya "1ay" veya "3ay" veya "6ay" veya "12ay" değerlerinden birini alır.
hizmet_talep_tarihiİleri Bir tarihte randevulu hizmet istediğinde gereklidir. Y-m-d H:i:s (24 saat formatı)
hizmet_plan_bitis_tarihiSistem tarafından üretilir. İleri Bir tarihte randevulu hizmet istedğininde hizmetin bitiş tarihidir. Y-m-d
odeme_sekli"kapidaodeme" veya "kredikarti" değerlerinir alır.
odeme_durumuSistem tarafından üretilir, "odenmis" veya "odenmemis" değerlerini alır.
teslim_tarihiSistem tarafından üretilir, hizmetin tamamlandığı tarih ve saati belirtir.
siparis_koduSistem tarafından üretilir, en az 15 karakterdir.
siparis_durumuSistem tarafından üretilir, "beklemede" veya "takvime_alindi" veya "teslimedildi" veya "iade" değerlerini alır.
siparis_notuMüşteriye ait opsiyonel sipariş notudur.
ipMüşteriye ait IP adresidir zorunlu alandır.

Hata Kodları

Hata Kodu Anlamı
900Başarılı İşlem
901Yetkisiz Erişim - Token tanımlanmamış veya yanlış iletilmiş
902Hizmet Alanı Ölçüler Bulunamadı
903Hizmet Türü Bulunamadı
904Hizmet Yeri Bulunamadı
905Pasif Kullanıcı - API kullanıcısı pasif moda alınmış
906Token Gereklidir
907Hatalı İstek - GET, POST, DELETE metodları yanlış gönderilmiş
908Geçersiz Hizmet Tipi
909Hizmetler Eklenemedi - Veritabanı hatası
910Siparişler Eklenemedi - Veritabanı hatası
911Sipariş Kodu Gereklidir
912Sipariş Kodu Oluşturulamadı - Servis hatası
913Geçersiz Sipariş Kodu
914Hatalı Hizmet Alanı ID
915Hatalı Hizmet Alanı Ölçü ID
916Hatalı Hizmet Türü ID
917Hatalı Hizmet Yeri ID
918Hatalı Şehir ID
919Hatalı İlçe ID
920Sipariş Silinemedi - Veritabanı hatası
921Sipariş Bulunamadı - Sipariş tablosu boş
922Sipariş Kodu Bulunamadı
923Fiyat Hesaplanamadı - Servis hatası
924Hizmet yerine ait olmayan hizmet alanı ID
925Geçersiz Hizmet Planı ID
926Hatalı Hizmet Planı ID
927Geçersiz Ödeme Şekli
928IP Gereklidir
929Geçersiz Ip
930Ad Soyad Gereklidir
931Telefon Gereklidir
932Geçersiz Telefon
933Geçersiz E-Posta
934Şehir Bulunamadı - Servis hatası
935İlçe Bulunamadı
936Sayfa Numarası Gereklidir
937Geçersiz Sayfa Numarası

Destek

ilaclat.com API'yi kullanmak veya görüşlerinizi bizimle paylaşmak isterseniz lütfen bizimle aşağıdaki kanallar üzerinden iletişime geçiniz.

E-Posta : destek@ilaclat.com
Telefon : 0850 303 51 81