N11 JSON API

Kategori Özellik ve Değer Gösterme (GetCategoryAttributes)

İstenilen kategori, üst seviye kategori veya diğer seviye kategorilerden olabilir, bu kategorilere ait olan özelliklerin ve bu özelliklere ait değerlerin listelenmesi için kullanılan metottur.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service CategoryService değerinde olmalıdır
metot GetCategoryAttributes değerinde olmalıdır
categoryId Özelliklerinin listelenmesi istenen kategori ID
pagingData
pagingData.currentPageGösterilen sayfa numarası (currentpage 0 ile başlar)Varsayılan değer: 0
pagingData.pageSizeSayfadaki madde sayısıVarsayılan değer: 100
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"CategoryService","metot":"GetCategoryAttributes","categoryId":1002841,"pagingData":{"currentPage":2,"pageSize":50}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Kategori Özellik Gösterme (GetCategoryAttributesId)

İstenilen kategori, üst seviye kategori veya diğer seviye kategorilerden olabilir, bu kategorilere ait olan özelliklerin listelenmesi için kullanılan metoddur.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service CategoryService değerinde olmalıdır
metot GetCategoryAttributesId değerinde olmalıdır
categoryId Özelliklerinin listelenmesi istenen kategori ID
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"CategoryService","metot":"GetCategoryAttributesId","categoryId":1002841}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Kategori Özellik Gösterme (GetCategoryAttributeValue)

Özelliğe sistemimizde verilen id bilgisini (category.attributeList.attribute.id) girdi vererek, o özelliğe ait değerleri listeler.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service CategoryService değerinde olmalıdır
metot GetCategoryAttributeValue değerinde olmalıdır
categoryProductAttributeId Ürün özelliğine sistemimizde verilen id bilgisi
pagingData
pagingData.currentPageGösterilen sayfa numarası (currentpage 0 ile başlar)Varsayılan değer: 0
pagingData.pageSizeSayfadaki madde sayısıVarsayılan değer: 100
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"CategoryService","metot":"GetCategoryAttributeValue","categoryProductAttributeId":354080997,"pagingData":null}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Üst Kategori Bilgisini Gösterme (GetParentCategory)

Kodu verilen kategorinin birinci seviye üst kategorilerine ulaşmak için bu metot kullanılmalıdır. İkinci seviye üst kategorilere ulaşmak için (Örn. “Deri ayakkabı -> Ayakkabı -> Giysi” kategori ağacında “Giysi “ bilgisi) birinci seviye üst kategorinin (Örn. Ayakkabı) kodu verilerek tekrar servis çağırılmalıdır.

Sorgulanan kategori sistemde bulunamazsa ‘kategori bulunamadı’ hatası alınır. Eğer ilgili kategori herhangi bir üst kategoriye sahip değilse ”parentCategory” bilgisi response içerisinde yer almaz.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service CategoryService değerinde olmalıdır
metot GetParentCategory değerinde olmalıdır
categoryId Alt kategori id bilgisi
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"CategoryService","metot":"GetParentCategory","categoryId":1002958}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Alt Kategori Bilgilerini Listeleme (GetSubCategories)

Kodu verilen kategorinin birinci seviye alt kategorilerine ulaşmak için bu metot kullanılmalıdır. İkinci seviye alt kategorilere ulaşmak için (Örn. “Giysi -> Ayakkabı -> Deri ayakkabı” kategori ağacında “Deri ayakkabı” bilgisi) birinci Seviye alt kategorinin (Örn. Ayakkabı) kodu verilerek tekrar servis çağırılmalıdır.

Sorgulanan kategori sistemde bulunamazsa hata alınır. Eğer ilgili kategori herhangi bir alt kategoriye sahip değilse response bilgisi boş döner.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service CategoryService değerinde olmalıdır
metot GetSubCategories değerinde olmalıdır
categoryId Alt kategori id bilgisi
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"CategoryService","metot":"GetSubCategories","categoryId":1002841}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Üst Kategori Bilgileri (GetTopLevelCategories)

n11 üzerinde tanımlanmış tüm üst seviye kategorileri görmek için bu metot kullanılır. Cevap olarak n11 kategori kodu ve kategori adı döner.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service CategoryService değerinde olmalıdır
metot GetTopLevelCategories değerinde olmalıdır
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"CategoryService","metot":"GetTopLevelCategories"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Şehirleri Listeleme (GetCities)

Sistemde kayıtlı şehirlerin kodları ve plaka numaraları ile birlikte listelenmesi için bu metot kullanılır. Adres ile ilgili işlem yapmak istendiği zaman bu servis aracılığı ile elde edilen şehir kodları kullanılır.

Genel kullanıma açık bir servis olduğu için servisin kullanımı sırasında herhangi bir güvenlik kontrolü yapılmamaktadır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service CityService değerinde olmalıdır
metot GetCities değerinde olmalıdır
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"CityService","metot":"GetCities"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Şehir Bilgisi Gösterme (GetCity)

Şehir plaka numarası verilen şehrin sistemde kayıtlı olan kodunu ve hangi şehir olduğunu öğrenmek için bu metot kullanılmalıdır.
Genel kullanıma açık bir servis olduğu için servisin kullanımı sırasında herhangi bir güvenlik kontrolü yapılmamaktadır.

Sorgulanan şehir sistemde bulunamazsa ‘şehir bulunamadı’ hatası alınır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service CityService değerinde olmalıdır
metot GetCity değerinde olmalıdır
cityCode Şehrin plaka kodu
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"CityService","metot":"GetCity","cityCode":35}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İlçe Bilgilerinin Gösterimi (GetDistrict)

Plaka kodu verilen şehre ait ilçelerinin listelenmesi için bu metot kullanılmalıdır. İlçe kodu adres ekleme/güncelleme işlemlerinde kullanılmaktadır.
Genel kullanıma açık bir servis olduğu için servisin kullanımı sırasında herhangi bir güvenlik kontrolü yapılmamaktadır.
Sorgulanan şehir sistemde bulunamazsa ‘şehir bulunamadı’ hatası alınır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service CityService değerinde olmalıdır
metot GetDistrict değerinde olmalıdır
cityCode Şehrin plaka kodu
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"CityService","metot":"GetDistrict","cityCode":35}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Semt/Mahalle Bilgilerinin Gösterimi (GetNeighborhoods)

İlçe kodu verilen semt/mahallelerin listelenmesi için bu metot kullanılmalıdır.
Genel kullanıma açık bir servis olduğu için servisin kullanımı sırasında herhangi bir güvenlik kontrolü yapılmamaktadır.
Sorgulanan ilçe sistemde bulunamazsa ‘ilçe bulunamadı’ hatası alınır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service CityService değerinde olmalıdır
metot GetNeighborhoods değerinde olmalıdır
districtId İlçe kodu
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"CityService","metot":"GetNeighborhoods","districtId":22372}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

N11 Ürün ID si ile Ürün Bilgilerini Alma (GetProductByProductId)

N11 ürün ID sini kullanarak sistemde kayıtlı olan ürünün bilgilerini getirir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot GetProductByProductId değerinde olmalıdır
productId Ürün N11 ID si
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"GetProductByProductId","productId":417035873}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağaza Ürün Kodu ile Ürün Bilgilerini Alma (GetProductBySellerCode)

Mağaza ürün kodunu kullanarak sistemde kayıtlı olan ürünün bilgilerini getirir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot GetProductBySellerCode değerinde olmalıdır
sellerCode Ürün N11 ID si
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"GetProductBySellerCode","sellerCode":"API_Test_SC"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Ürün Listeleme (GetProductList)

Sistemde ürünleri listelemek için kullanılır. Metot ürün ile ilgili özet bilgileri getirmektedir. Bu metottan dönen “productSellerCode” bilgisini kullanarak “GetProductBySellerCode” metodu veya “id” bilgisini kullanarak “GetProductById” metodu kullanılarak ürünün detaylı bilgilerine ulaşılabilir.

Sonuçlar, sayfalama bilgisi ile beraber döner. “itemsPerPage” parametresi ile her sayfada listelenecek ürün adedi, “currentPage” parametresi ile de listelenmek istenen sayfanın numarası kontrol edilebilir. Herhangi bir değer girilmediği takdirde, her sayfada 100 adet ürün listelenir ve birinci sayfa listelenir.

“pagingData” içinde toplam ürün adedi, sayfa sayısı, mevcut sayfa ve sayfa başına düşen ürün adedi bilgileri kullanıcılara verilir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot GetProductList değerinde olmalıdır
pagingData
pagingData.currentPageGösterilen sayfa numarası (currentpage 0 ile başlar)Varsayılan değer: 0
pagingData.pageSizeSayfadaki madde sayısıVarsayılan değer: 100
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"GetProductList","pagingData":null}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Ürün Kaydetme (SaveProduct)

Yeni ürün oluşturmak veya mevcut ürünü güncellemek için kullanılır. Ürün kodu “productSellerCode” adıyla veirlen data bu mağaza için bir kayıtlı bir ürünü gösteriyorsa bu ürün güncellenir, aksi halde yeni bir ürün oluşturulur.

“stockItems” içinde hem seçenekleri olan ürünlerin (numara, beden gibi), hem de seçeneği olmayan ürünlerin stok girişi yapılabilir. Seçeneği olmayan ürünler için “attributes” alanını boş bırakılabilir.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot SaveProduct değerinde olmalıdır
product.productSellerCode Ürün Mağaza Kodu
product.title Ürün sayfasında görünecek başlık, en fazla 65 karakter olmalıdır.
product.subtitle Ürün sayfasında görünecek altbaşlık, en fazla 65 karakter olmalıdır.
product.description Ürün açıklama bilgileri (HTML olabilir)
product.attributes.attribute

Ürün özelliklerinin adı ve değeri girilen alan

attribute.nameÜrün özelliğinin adı
attribute.valueÜrün özelliğinin değeri
product.category.id Ürün kategori numarası
product.price Ürün baz fiyatı
product.currencyType Ürün liste fiyatı para birimi
product.images.image.url Ürün resmi URL adresi
product.images.image.order Ürün resmi gösterilme sırası
product.saleStartDate Ürün satış başlangıç tarihi (dd/MM/yyyy), boş gönderilirse ürün aynı gün satışa çıkar
product.saleEndDate Ürün satış bitiş tarihi (dd/MM/yyyy), boş gönderilirse çok ileri bir tarihe atanır
product.productionDate Ürün üretim tarihi (dd/MM/yyyy)
product.expirationDate Ürün son kullanma tarihi (dd/MM/yyyy)
product.productCondition Ürün durumu:
1: Yeni
2: 2. el
product.preparingDay Ürün kargoya verilme süresi (gün olarak)
product.domestic Ürünün yerli üretim olup olmadığını belirtir. Boolean olarak true/false değeri alır.
product.discount
discount.typeMağaza İndirim Tipi:
1: İndirim Tutarı Cinsinden
2: İndirim Oranı Cinsinden
3: İndirimli Fiyat Cinsinden
discount.valueİndirim Miktarı (indirim tipinde verilen parametreye göre)
discount.startDateMağaza indirimi başlama tarihi (DD/MM/YYYY)
discount.endDateMağaza indirimi bitiş tarihi (DD/MM/YYYY)
product.shipmentTemplate Teslimat Şablon Adı
product.stockItems.stockItem.quantity Stok miktarı
product.stockItems.stockItem.sellerStockCode Mağaza ürün stok kodu
product.stockItems.stockItem.attributes.attribute.name Eğer ürünün seçenekleri varsa bu bilgiler girilir, isim olarak kendi belirlediğiniz bir değerleri kullanabilirsiniz.
product.stockItems.stockItem.attributes.attribute.value Eğer ürünün seçenekleri varsa bu bilgiler girilir, değer olarak kendi belirlediğiniz bir değerleri kullanabilirsiniz.
product.stockItems.stockItem.optionPrice Ürün stok biriminin liste fiyatı
product.stockItems.stockItem.bundle Birlikte satış yapılan ürünler
product.stockItems.stockItem.mpn Ürünün üretici parça numarası
product.stockItems.stockItem.gtin Ürünün global ticari öğe numarası
product.stockItems.stockItem.oem Parça/Ürün bağlantı numarası
product.stockItems.stockItem.n11CatalogId Ürünün N11 katalog numarası
specialProductInfoList.specialProductInf.key Seyahat kategori ürün açıklama bilgilerinin girildiği alan. Bu Alana; TurProgrami, IptalİadeKosullari,EkHizmetler bilgileri girilerek açıklama oluşturulur
specialProductInfoList.specialProductInf.value Key’e karşılık gelen html verisi
product.groupAttribute Ürünün gruplandığı özellik adı
product.groupItemCode Ürünün gruplandığı özellik grubunun adı (satıcı verir)
product.itemName Ürünün gruplandığı özellik değeri
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"SaveProduct","product":{"productSellerCode":"API_Test_SC","title":"API Test Product Title","subtitle":"API Test Product Subtitle","description":"<strong>Bu bir description dır.<\/strong>","attributes":{"attribute":[{"name":"Marka","value":"XXX"}]},"category":{"id":1000317},"price":500,"currencyType":"TL","images":{"image":[{"url":"https:\/\/cdn.pixabay.com\/photo\/2020\/02\/28\/16\/52\/plumeria-4887944_960_720.jpg","order":2},{"url":"https:\/\/cdn.pixabay.com\/photo\/2014\/09\/14\/18\/04\/dandelion-445228_960_720.jpg","order":1}]},"saleStartDate":"01\/01\/2050","saleEndDate":"02\/01\/2050","productionDate":"01\/01\/2020","expirationDate":"01\/01\/2060","productCondition":1,"preparingDay":4,"domestic":true,"discount":{"type":2,"value":10,"startDate":"01\/01\/2050","endDate":"02\/01\/2050"},"shipmentTemplate":"ONLINE GÖNDERİM","stockItems":{"stockItem":[{"quantity":9998,"sellerStockCode":"STOCKCODE-01","attributes":{"attribute":[{"name":"Kalite","value":"VIP"}]},"optionPrice":1000,"bundle":null,"mpn":null,"gtin":null,"oem":null},{"quantity":9999,"sellerStockCode":"STOCKCODE-02","attributes":{"attribute":[{"name":"Kalite","value":"Normal"}]},"optionPrice":500,"bundle":null,"mpn":null,"gtin":null,"oem":null}]}}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Ürün Arama (SearchProducts)

Mağaza ürünlerini aramak için kullanılır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot SearchProducts değerinde olmalıdır
pagingData
pagingData.currentPageGösterilen sayfa numarası (currentpage 0 ile başlar)Varsayılan değer: 0
pagingData.pageSizeSayfadaki madde sayısıVarsayılan değer: 100
productSearch.name Arama yapılmak istenen kelime
productSearch.saleDate.startDate Ürünün satışa başladığı tarih
productSearch.saleDate.endDate Ürünün satışının bittiği tarih
productSearch.approvalStatus Ürün onay durumu:
1: Aktif (Satışta)
2: Beklemede
3: Yasaklı
4: Liste Dışı
5: Onay bekleyen
6: Reddedilen
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"GetProductList","pagingData":null,"productSearch":[]}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

N11 Ürün ID’si ile Ürün Silme (DeleteProductById)

Kayıtlı olan bir ürünü N11 Id si kullanarak silmek için kullanılır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot DeleteProductById değerinde olmalıdır
productId Ürün N11 ID bilgisi
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"DeleteProductById","productId":417035873}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağaza Ürün Kodu ile Ürün Silme (DeleteProductBySellerCode)

Kayıtlı olan bir ürünü mağaza ürün kodu kullanılarak silmek için kullanılır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot DeleteProductBySellerCode değerinde olmalıdır
productSellerCode Ürünün mağaza tarafındaki Ürün kodu
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"DeleteProductBySellerCode","productSellerCode":"API_Test_SC"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

N11 Ürün ID’si ile İndirim Tutarı Güncelleme (UpdateDiscountValueByProductId)

Bir ürünün N11 ürün ID sini kullanarak indirim bilgilerinin güncellenmesi için kullanılır. Girilen indirim miktarı ürün listeleme fiyatına uygulanır. Liste fiyatı ile ürünün indirimli fiyatı arasındaki fark kadar ürün stok birim fiyatlarına da indirim uygulanır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot UpdateDiscountValueByProductId değerinde olmalıdır
productId Ürünün N11 ürün kodu
productDiscount.discountType Mağaza İndirim Tipi:
1: İndirim Tutarı Cinsinden
2: İndirim Oranı Cinsinden
3: İndirimli Fiyat Cinsinden
productDiscount.discountValue İndirim miktarı (indirim tipinde verilen parametreye göre)
productDiscount.discountStartDate Mağaza indirimi başlama tarihi (DD/MM/YYYY)
productDiscount.discountEndDate Mağaza indirimi bitiş tarihi (DD/MM/YYYY)
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"UpdateDiscountValueByProductId","productId":417035873,"productDiscount":{"discountType":2,"discountValue":15,"discountStartDate":"01\/01\/2050","discountEndDate":"02\/01\/2050"}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağaza Ürün Kodu ile İndirim Tutarı Güncelleme (UpdateDiscountValueBySellerCode)

Bir ürünün mağaza ürün kodunu kullanarak indirim bilgilerinin güncellenmesi için kullanılır. Girilen indirim miktarı ürün listeleme fiyatına uygulanır. Liste fiyatı ile ürünün indirimli fiyatı arasındaki fark kadar ürün stok birim fiyatlarına da indirim uygulanır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot UpdateDiscountValueBySellerCode değerinde olmalıdır
productSellerCode Mağaza ürün kodu
productDiscount.discountType Mağaza İndirim Tipi:
1: İndirim Tutarı Cinsinden
2: İndirim Oranı Cinsinden
3: İndirimli Fiyat Cinsinden
productDiscount.discountValue İndirim miktarı (indirim tipinde verilen parametreye göre)
productDiscount.discountStartDate Mağaza indirimi başlama tarihi (DD/MM/YYYY)
productDiscount.discountEndDate Mağaza indirimi bitiş tarihi (DD/MM/YYYY)
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"UpdateDiscountValueBySellerCode","productSellerCode":"API_Test_SC","productDiscount":{"discountType":2,"discountValue":20,"discountStartDate":"01\/01\/2050","discountEndDate":"02\/01\/2050"}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

N11 Ürün Kodu ile Ürün Fiyatı Güncelleme (UpdateProductPriceById)

Bir ürünün N11 ürün ID si kullanılarak ürünün sadece baz fiyat bilgilerini, ürün stok birimi fiyat bilgilerini veya her ikisinin güncellenmesi için kullanılır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot UpdateProductPriceById değerinde olmalıdır
productId Ürünün N11 ID si
price Güncellenmek istenen ürün fiyatı
currencyType Ürün listeleme fiyatı para birimi (1: TL , 2: USD , 3: EUR)
stockItems.stockItem.sellerStockCode Mağaza ürün stok kodu
stockItems.stockItem.optionPrice Ürün stok biriminin liste fiyatı
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"UpdateProductPriceById","productId":417035873,"price":700,"currencyType":1,"stockItems":{"stockItem":[{"sellerStockCode":"STOCKCODE-01","optionPrice":1400},{"sellerStockCode":"STOCKCODE-02","optionPrice":700}]}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağaza Ürün Kodu ile Ürün Fiyatı Güncelleme (UpdateProductPriceBySellerCode)

Bir ürünün mağaza ürün kodu kullanarak fiyat bilgilerinin güncellenmesi için kullanılır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot UpdateProductPriceBySellerCode değerinde olmalıdır
productSellerCode Ürünün mağaza tarafındaki ürün kodu
price Güncellenmek istenen ürün fiyatı
currencyType Ürün listeleme fiyatı para birimi (1: TL , 2: USD , 3: EUR)
stockItems.stockItem.sellerStockCode Mağaza ürün stok kodu
stockItems.stockItem.optionPrice Ürün stok biriminin liste fiyatı
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"UpdateProductPriceBySellerCode","productSellerCode":"API_Test_SC","price":500,"currencyType":1,"stockItems":{"stockItem":[{"sellerStockCode":"STOCKCODE-01","optionPrice":1000},{"sellerStockCode":"STOCKCODE-02","optionPrice":500}]}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Temel Ürün Özellikleri Güncelleme (UpdateProductBasic)

Kayıtlı olan bir ürünün, N11 ürün ID’si ya da mağaza kodu ile ürün fiyatını, ürün üzerindeki indirimi ve isteğe bağlı olarak stok ID’si ya da mağaza stok kodu ile belirtilen stoklarının, miktarı ve ilgili stok biriminin liste fiyatının güncellenmesi için kullanılır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot UpdateProductBasic değerinde olmalıdır
productId Ürün N11 ID bilgisi
productSellerCode Ürün mağaza kodu
price Ürünün baz fiyatı
productDiscount.discountType Mağaza İndirim Tipi:
1: İndirim Tutarı Cinsinden
2: İndirim Oranı Cinsinden
3: İndirimli Fiyat Cinsinden
productDiscount.discountValue İndirim Miktarı (indirim tipinde verilen parametreye göre)
productDiscount.discountStartDate Mağaza indirimi başlama tarihi
productDiscount.discountEndDate Mağaza indirimi bitiş tarihi
stockItems.stockItem.sellerStockCode Ürün stok mağaza kodu
stockItems.stockItem.id Ürün stok N11 ID si
stockItems.stockItem.optionPrice Ürün stok biriminin liste fiyatı
stockItems.stockItem.quantity Ürün stok miktarı
description Ürün Açıklaması
images.image.order Resim öncelik numarası
images.image.url Resim url adresi
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"UpdateProductBasic","productSellerCode":"API_Test_SC","price":500,"productDiscount":{"discountType":2,"discountValue":20,"discountStartDate":"01\/01\/2050","discountEndDate":"02\/01\/2050"},"stockItems":{"stockItem":[{"sellerStockCode":"STOCKCODE-01","id":126822928879,"optionPrice":1000,"quantity":9998},{"sellerStockCode":"STOCKCODE-02","id":126822928880,"optionPrice":500,"quantity":9999}]},"description":"<strong>Bu yepyeni bir description dır.<\/strong>","images":{"image":[{"url":"https:\/\/cdn.pixabay.com\/photo\/2020\/02\/28\/16\/52\/plumeria-4887944_960_720.jpg","order":2},{"url":"https:\/\/cdn.pixabay.com\/photo\/2014\/09\/14\/18\/04\/dandelion-445228_960_720.jpg","order":1}]}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Ürün Sorularını Listeleme (GetProductQuestionList)

Müşterileriniz tarafından mağazanıza sorulan soruları listeler. Sorularınızı listelemek için Appkey ve Appsecret bilgileriniz gerekmektedir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot GetProductQuestionList değerinde olmalıdır
productQuestionSearch.productId Ürün N11 ID si
productQuestionSearch.buyerEmail Müşteri e-posta adresi
productQuestionSearch.subject Sorunun konusu
productQuestionSearch.status Gelen soruların durumları
productQuestionSearch.questionDate Sorunun gelme tarihi
pagingData
pagingData.currentPageGösterilen sayfa numarası (currentpage 0 ile başlar)Varsayılan değer: 0
pagingData.pageSizeSayfadaki madde sayısıVarsayılan değer: 100
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"GetProductQuestionList","productQuestionSearch":{"productId":417035873,"buyerEmail":null,"subject":null,"status":null,"questionDate":"02\/01\/2050"},"pagingData":{"currentPage":2,"pageSize":50}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Ürün Sorularını Detaylandırma (GetProductQuestionDetail)

GetProductQuestionList ile sıralanan soruların içeriğini, buradan gelen ID ve getProductQuestionDetail yardımıyla görüntüleyebilirsiniz.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot GetProductQuestionDetail değerinde olmalıdır
productQuestionId Gelen Sorunun N11 id’si
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"GetProductQuestionDetail","productQuestionId":13479715}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Ürün Sorularını Cevaplandırma (SaveProductAnswer)

Müşterilerden gelen ürün sorularını cevaplamak için kullanılır. Cevap vermek için productQuestionId değeri zorunludur ve GetProductQuestionList‘ten id edinilebilir.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot SaveProductAnswer değerinde olmalıdır
productQuestionId Gelen Sorunun N11 id’si
productAnswer Sorunun cevabı
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"SaveProductAnswer","productQuestionId":13479715,"productAnswer":"Bu metin soruya verilen mağaza yanıtıdır."}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Ürün-Statü Sayısını alma (ProductApprovalStatus)

Seller ın sahip olduğu tüm ürünleri, ait olduğu statülere göre sınıflandırıp, statü/ sayı bilgisi döner. Seller a göre cevap döndüğü için istekte sadece authorization olması yeterlidir. Her bir seller maksimum 3 kez istek gönderebilir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductService değerinde olmalıdır
metot ProductApprovalStatus değerinde olmalıdır
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductService","metot":"ProductApprovalStatus"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

N11 Ürün ID’si ile Ürünün Satışını Başlat (StartSellingProductByProductId)

Satışta olmayan bir ürünün N11 ürün ID si kullanılarak satışa başlanması için kullanılır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductSellingService değerinde olmalıdır
metot StartSellingProductByProductId değerinde olmalıdır
productId Ürünün n11 tarafındaki ürün ID’si
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductSellingService","metot":"StartSellingProductByProductId","productId":417035873}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağaza Ürün Kodu ile Ürünün Satışını Başlat (StartSellingProductBySellerCode)

Satışta olmayan bir ürünün mağaza ürün kodu kullanılarak satışa başlanması için kullanılır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductSellingService değerinde olmalıdır
metot StartSellingProductBySellerCode değerinde olmalıdır
productSellerCode Ürünün mağaza tarafındaki ürün kodu
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductSellingService","metot":"StartSellingProductBySellerCode","productSellerCode":"API_Test_SC"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

N11 Ürün ID’si ile Ürünün Satışını Durdur (StopSellingProductByProductId)

Satışta olan ürünün n11 ürün ID si kullanılarak satışa kapatılması için kullanılır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductSellingService değerinde olmalıdır
metot StopSellingProductByProductId değerinde olmalıdır
productId Ürünün n11 tarafındaki Ürün kodu
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductSellingService","metot":"StopSellingProductByProductId","productId":417035873}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağaza Ürün Kodu ile Ürünün Satışını Durdur (StopSellingProductBySellerCode)

Satışta olan ürünün mağaza ürün kodu kullanılarak satışının durdurulması için kullanılır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductSellingService değerinde olmalıdır
metot StopSellingProductBySellerCode değerinde olmalıdır
productSellerCode Ürünün mağaza tarafındaki Ürün kodu
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductSellingService","metot":"StopSellingProductBySellerCode","productSellerCode":"API_Test_SC"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

N11 Ürün ID si ile Stok Bilgisi Listeleme (GetProductStockByProductId)

Sistemde kayıtlı olan ürünün N11 ürün ID si ile ürün stok bilgilerini getiren metottur.
Cevap içinde stok durumunun “version” bilgisi de vardır, ürün stoklarında değişme olduysa bu versiyon bilgisi artacaktır, çağrı yapan taraf versiyon bilgisini kontrol ederek N11 e verilen stok bilgilerinde değişim olup olmadığını anlayabilir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductStockService değerinde olmalıdır
metot GetProductStockByProductId değerinde olmalıdır
productId Ürün ID bilgisi
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductStockService","metot":"GetProductStockByProductId","productId":417035873}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağaza Ürün Kodu ile Stok Bilgisi Listeleme (GetProductStockBySellerCode)

Sistemde kayıtlı olan ürünün mağaza ürün kodu ile ürün stok bilgilerini getiren metottur.
Cevap içinde stok durumunun “version” bilgisi de vardır, ürün stoklarında değişme olduysa bu versiyon bilgisi artacaktır, çağrı yapan taraf versiyon bilgisini kontrol ederek N11 e verilen stok bilgilerinde değişim olup olmadığını anlayabilir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductStockService değerinde olmalıdır
metot GetProductStockBySellerCode değerinde olmalıdır
productSellerCode Mağaza ürün kodu
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductStockService","metot":"GetProductStockBySellerCode","productSellerCode":"API_Test_SC"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Stok Özellikleri ile Stok Miktarı Güncelleme (DeleteAndUpdateStockByStockAttributes)

Ürün stok seçenek bilgilerini kullanarak kayıtlı ürünün stok bilgilerini güncellemek için kullanılır. Ürün n11 ID si ve stok seçenek bilgileri girilerek güncelleme işlemi yapılır. Bir ürüne ait stok bilgilerine, ProductStockService içindeki GetProductStockByProductId veya GetProductStockBySellerCode metotları ile ulaşılabilir. Bir ürün için tüm stok bilgilerini güncelleme işlemi gerçekleştirilebilir.

N11 tarafında değişen stok miktarlarını ezmemek için, “version” bilgisi verilmesi durumunda ilgili ürün stok bilgisinin N11 de versiyonu ile karşılaştırma yapılır, stok versiyon numaraları uyumsuz ise işlem gerçekleştirilmez.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductStockService değerinde olmalıdır
metot DeleteAndUpdateStockByStockAttributes değerinde olmalıdır
product.id Ürün ID bilgisi
product.stockItems.stockItem.attributes.attribute.name Ürün stok özellik adı
product.stockItems.stockItem.attributes.attribute.value Ürün stok özellik değeri
product.stockItems.stockItem.quantity Güncellenmek istenen ürün stok miktarı
product.stockItems.stockItem.version Ürün versiyon numarası
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductStockService","metot":"DeleteAndUpdateStockByStockAttributes","product":{"id":417035873,"stockItems":{"stockItem":[{"quantity":8888,"attributes":{"attribute":[{"name":"Kalite","value":"VIP"}]}},{"quantity":7777,"attributes":{"attribute":[{"name":"Kalite","value":"Normal"}]}}]}}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

N11 Ürün Stok ID ile Stok Güncelleme (UpdateStockByStockId)

n11 ürün stok ID si kullanarak kayıtlı ürünün stok bilgilerini güncellemek için kullanılır. n11 ürün stok ID si ve miktar bilgileri girilerek güncelleme işlemi yapılır. Bir ürüne ait n11 ürün stok ID sine, ProductStockService içindeki GetProductStockByProductId veya GetProductStockBySellerCode metotları ile ulaşılabilir.

N11 tarafında değişen stok miktarlarını ezmemek için, “version” bilgisi verilmesi durumunda ilgili ürün stok bilgisinin N11 de versiyonu ile karşılaştırma yapılır, stok versiyon numaraları uyumsuz ise işlem gerçekleştirilmez.
API'de UpdateStockByStockId ve UpdateStockByStockSellerCode metodları ile stok güncelleme işlemi için tek bir istek içerisinde en fazla 100 stok değeri güncelleyebilirsiniz.
Hata almamak için güncellemeleri ürüne göre yapmayı unutmayın.
Örneğin, ilk 100 stok içinde güncellediğiniz ürün, diğer 100 stok içinde de yer alıyorsa, sistem ilk güncellemeyi hala devam ettirdiği için "Ürün, 60 saniye güncellenemez" hatası alırsınız. Bu sebeple, aynı ürünü aynı 100 stok değeri içinde güncellemeniz gerekir.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductStockService değerinde olmalıdır
metot UpdateStockByStockId değerinde olmalıdır
stockItems.stockItem.id Ürün stok N11 ID si
stockItems.stockItem.quantity Yeni ürün stok miktarı
stockItems.stockItem.version Ürün stok versiyon numarası
stockItems.stockItem.delist
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductStockService","metot":"UpdateStockByStockId","stockItems":{"stockItem":[{"id":126822928879,"quantity":8877,"attributes":{"attribute":[{"name":"Kalite","value":"VIP"}]}},{"id":126822928880,"quantity":7766,"attributes":{"attribute":[{"name":"Kalite","value":"Normal"}]}}]}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağaza Stok Kodu ile Stok Güncelleme (UpdateStockByStockSellerCode)

Mağaza ürün stok kodu kullanarak kayıtlı ürünün stok bilgilerini güncellemek için kullanılır. Mağaza ürün stok kodu ve miktar bilgileri girilerek güncelleme işlemi yapılır.

N11 tarafında değişen stok miktarlarını ezmemek için, “version” bilgisi verilmesi durumunda ilgili ürün stok bilgisinin N11 de versiyonu ile karşılaştırma yapılır, stok versiyon numaraları uyumsuz ise işlem gerçekleştirilmez.

API'de UpdateStockByStockId ve UpdateStockByStockSellerCode metodları ile stok güncelleme işlemi için tek bir istek içerisinde en fazla 100 stok değeri güncelleyebilirsiniz.
Hata almamak için güncellemeleri ürüne göre yapmayı unutmayın.
Örneğin, ilk 100 stok içinde güncellediğiniz ürün, diğer 100 stok içinde de yer alıyorsa, sistem ilk güncellemeyi hala devam ettirdiği için "Ürün, 60 saniye güncellenemez" hatası alırsınız. Bu sebeple, aynı ürünü aynı 100 stok değeri içinde güncellemeniz gerekir.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductStockService değerinde olmalıdır
metot UpdateStockByStockSellerCode değerinde olmalıdır
stockItems.stockItem.sellerStockCode Ürün stok mağaza kodu
stockItems.stockItem.quantity Yeni ürün stok miktarı
stockItems.stockItem.version Ürün stok versiyon numarası
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductStockService","metot":"UpdateStockByStockSellerCode","stockItems":{"stockItem":[{"sellerStockCode":"STOCKCODE-01","quantity":8878,"attributes":{"attribute":[{"name":"Kalite","value":"VIP"}]}},{"sellerStockCode":"STOCKCODE-02","quantity":7767,"attributes":{"attribute":[{"name":"Kalite","value":"Normal"}]}}]}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Stok Özellikleri ile Stok Miktarı Artırma (IncreaseStockByStockAttributes)

Bir ürünün stok seçenek bilgilerini kullanarak stok miktarını arttırmak için kullanılır.

N11 tarafında değişen stok miktarlarını ezmemek için, “version” bilgisi verilmesi durumunda ilgili ürün stok bilgisinin N11 de versiyonu ile karşılaştırma yapılır, stok versiyon numaraları uyumsuz ise işlem gerçekleştirilmez.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductStockService değerinde olmalıdır
metot IncreaseStockByStockAttributes değerinde olmalıdır
product.id Ürünün n11 ID si
product.stockItems.stockItem.attributes.attribute.name Stok tanımının olduğu seçenek adı
product.stockItems.stockItem.attributes.attribute.value Stok tanımının olduğu seçenek değeri
product.stockItems.stockItem.quantityToIncrease Arttıralacak stok miktarı
product.stockItems.stockItem.version Ürün stok versiyon numarası
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductStockService","metot":"IncreaseStockByStockAttributes","product":{"id":417035873,"stockItems":{"stockItem":[{"attributes":{"attribute":[{"name":"Kalite","value":"VIP"}]},"quantityToIncrease":5},{"attributes":{"attribute":[{"name":"Kalite","value":"Normal"}]},"quantityToIncrease":5}]}}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

N11 Ürün Stok ID ile Stok Miktarı Artırma (IncreaseStockByStockId)

Bir ürünün n11 ürün stok ID bilgisini kullanarak stok miktarını arttırmak için kullanılır. Bir ürüne ait n11 ürün stok ID sine, ProductStockService içindeki GetProductStockByProductId veya GetProductStockBySellerCode metotları ile ulaşılabilir.

N11 tarafında değişen stok miktarlarını ezmemek için, “version” bilgisi verilmesi durumunda ilgili ürün stok bilgisinin N11 de versiyonu ile karşılaştırma yapılır, stok versiyon numaraları uyumsuz ise işlem gerçekleştirilmez.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductStockService değerinde olmalıdır
metot IncreaseStockByStockId değerinde olmalıdır
stockItems.stockItem.id Ürün stok id bilgisi
stockItems.stockItem.quantityToIncrease Arttıralacak stok miktarı
stockItems.stockItem.version Ürün versiyon numarası
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductStockService","metot":"IncreaseStockByStockId","stockItems":{"stockItem":[{"id":126822928879,"quantityToIncrease":2},{"id":126822928880,"quantityToIncrease":1}]}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağaza Stok Kodu ile Stok Miktarı Arttırma (IncreaseStockByStockSellerCode)

Bir ürünün mağaza stok kodu kullanarak stok miktarını arttırmak için kullanılır.

N11 tarafında değişen stok miktarlarını ezmemek için, “version” bilgisi verilmesi durumunda ilgili ürün stok bilgisinin N11 de versiyonu ile karşılaştırma yapılır, stok versiyon numaraları uyumsuz ise işlem gerçekleştirilmez.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ProductStockService değerinde olmalıdır
metot IncreaseStockByStockSellerCode değerinde olmalıdır
stockItems.stockItem.sellerStockCode Mağaza stok kodu
stockItems.stockItem.quantityToIncrease Arttıralacak stok miktarı
stockItems.stockItem.version Ürün stok versiyon numarası
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ProductStockService","metot":"IncreaseStockByStockSellerCode","stockItems":{"stockItem":[{"sellerStockCode":"STOCKCODE-01","quantityToIncrease":2},{"sellerStockCode":"STOCKCODE-02","quantityToIncrease":1}]}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Detaylı Sipariş Listeleme (DetailedOrderList)

Verilen arama kriterlerine göre sipariş bilgisi ile beraber sipariş maddelerini de listelemek için kullanılır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service OrderService değerinde olmalıdır
metot DetailedOrderList değerinde olmalıdır
searchData.productId Ürün n11 ID si
searchData.status Sipariş durumu:
“New”: Yeni siparişler
“Approved”: Onaylanmış Siparişler
“Rejected”: İptal Edilmiş Siparişler
“Shipped”: Kargolanmış Siparişler
“Delivered”: Teslim Edilen Siparişler
“Completed”: Tamamlanmış Siparişler
“Claimed”: İptal/İade/Değişim Durumundaki Siparişler
“LATE_SHIPMENT” Kargolanması Geciken Siparişler
searchData.buyerName Siparişi veren N11 üye adı
searchData.orderNumber Sipariş numarası
searchData.productSellerCode Ürünün mağaza kodu
searchData.recipient Teslim alacak alıcının adı
searchData.period.startDate Sipariş oluşturma tarihi başlangıç
searchData.period.endDate Sipariş oluşturma tarihi bitiş
searchData.sortForUpdateDate Siparişleri UpdateDate göre listeler

1.true (Daha önce yaratılmış ancak belirtilen taihte güncellenmiş siparişleri listeler)
2.false (Belirtilen tarihte yaratılan siparişleri listeler)
pagingData
pagingData.currentPageGösterilen sayfa numarası (currentpage 0 ile başlar)Varsayılan değer: 0
pagingData.pageSizeSayfadaki madde sayısıVarsayılan değer: 100
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"OrderService","metot":"DetailedOrderList","searchData":{"productId":null,"status":null,"buyerName":null,"orderNumber":null,"productSellerCode":null,"recipient":null,"period":{"startDate":null,"endDate":null},"sortForUpdateDate":null},"pagingData":null}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Sipariş Listeleme (OrderList)

Bu metot sipariş ile ilgili özet bilgileri listelemek için kullanılır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service OrderService değerinde olmalıdır
metot OrderList değerinde olmalıdır
searchData.productId Ürün n11 ID si
searchData.status Sipariş durumu:
“New”: Yeni siparişler
“Approved”: Onaylanmış Siparişler
“Rejected”: İptal Edilmiş Siparişler
“Shipped”: Kargolanmış Siparişler
“Delivered”: Teslim Edilen Siparişler
“Completed”: Tamamlanmış Siparişler
“Claimed”: İptal/İade/Değişim Durumundaki Siparişler
“LATE_SHIPMENT” Kargolanması Geciken Siparişler
searchData.buyerName Siparişi veren N11 üye adı
searchData.orderNumber Sipariş numarası
searchData.productSellerCode Ürünün mağaza kodu
searchData.recipient Teslim alacak alıcının adı
searchData.period.startDate Sipariş oluşturma tarihi başlangıç
searchData.period.endDate Sipariş oluşturma tarihi bitiş
searchData.sortForUpdateDate Siparişleri UpdateDate göre listeler

1.true (Daha önce yaratılmış ancak belirtilen taihte güncellenmiş siparişleri listeler)
2.false (Belirtilen tarihte yaratılan siparişleri listeler)
pagingData
pagingData.currentPageGösterilen sayfa numarası (currentpage 0 ile başlar)Varsayılan değer: 0
pagingData.pageSizeSayfadaki madde sayısıVarsayılan değer: 100
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"OrderService","metot":"OrderList","searchData":{"productId":null,"status":null,"buyerName":null,"orderNumber":null,"productSellerCode":null,"recipient":null,"period":{"startDate":null,"endDate":null},"sortForUpdateDate":null},"pagingData":null}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Sipariş Detayı (OrderDetail)

Sipariş N11 ID bilgisi kullanarak sipariş detaylarını almak için kullanılır, sipariş N11 ID bilgisine OrderService OrderList veya DetailedOrderList metotlarıyla ulaşılabilir.
n11 platform üzerinden kargo ücretinin ödenmesi ve bunun tahsilat bilgileri “serviceItemList” alanından ulaşılabilir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service OrderService değerinde olmalıdır
metot OrderDetail değerinde olmalıdır
orderRequest.id Sipariş N11 ID si
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"OrderService","metot":"OrderDetail","orderRequest":{"id":113975650}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Sipariş Maddesinin Kabul Edilmesi (OrderItemAccept)

Sipariş maddesinin n11 ID si kullanılarak kabul edilmesi için kullanılır. Kabul edilen sipariş daha sonra mağaza tarafından reddedilemez. Sipariş n11 ID sine OrderService içinden OrderDetail veya DetailedOrderList metodu kullanılarak erişilir.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service OrderService değerinde olmalıdır
metot OrderItemAccept değerinde olmalıdır
orderItemList.orderItem.id Sipariş kalemi n11 ID si
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"OrderService","metot":"OrderItemAccept","orderItemList":{"orderItem":{"id":18675500}}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Sipariş Kaleminin Reddedilmesi (OrderItemReject)

Sipariş maddesinin n11 ID si kullanılarak reddedilmesi için kullanılır. Reddedilen sipariş daha sonra mağaza tarafından kabul edilemez. Sipariş n11 ID sine OrderService içinden OrderDetail veya DetailedOrderList metodu kullanılarak erişilir.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service OrderService değerinde olmalıdır
metot OrderItemReject değerinde olmalıdır
orderItemList.orderItem.id Sipariş maddesi n11 ID bilgisi
rejectReason Sipariş reddetme sebebi
rejectReasonType Sipariş reddetme tipi :
OUT_OF_STOCK (Stokta yok), OTHER(Diğer)
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"OrderService","metot":"OrderItemReject","orderItemList":{"orderItem":{"id":18675500}},"rejectReason":"Stokta yok","rejectReasonType":"OUT_OF_STOCK"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Sipariş Kaleminin Kargoya Verilmesi (MakeOrderItemShipment)

Sipariş maddesinin n11 ID si kullanılarak kargoya verilmesi için kullanılır. Sipariş n11 ID sine OrderService içinden OrderDetail veya DetailedOrderList metodu kullanılarak erişilir.

Ön koşul olarak güncelleme yapılmak istenen sipariş maddesinin durumunun (OrderItemStatus) “Ödendi” veya “Kabul edildi” olması gerekmektedir. Aksi durumda “ön koşullar sağlanamadı” cevabı alınır.

Kargo şirketlerinin listesi için ShipmentCompanyService den GetShipmentCompanies metodu kullanılmalıdır.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service OrderService değerinde olmalıdır
metot MakeOrderItemShipment değerinde olmalıdır
orderItemList.orderItem.id Ürün n11 ID si
orderItemList.orderItem.shipmentInfo.shipmentCompany.id Kargo şirketinin n11 ID si
orderItemList.orderItem.shipmentInfo.campaignNumber Sipariş kampanya numarası
orderItemList.orderItem.shipmentInfo.trackingNumber Takip numarası
orderItemList.orderItem.shipmentInfo.shipmentMethod Kargo yöntemi
1: Kargo
2: Diğer
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"OrderService","metot":"MakeOrderItemShipment","orderItemList":{"orderItem":{"id":18675500,"shipmentInfo":{"shipmentCompany":{"id":381},"campaignNumber":null,"trackingNumber":123,"shipmentMethod":2}}}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Kargo Şirketlerini Listeleme (GetShipmentCompanies)

Sistemde tanımlı olan tüm kargo şirketlerini listeler.
Genel kullanıma açık bir servis olduğu için servisin kullanımı sırasında herhangi bir güvenlik kontrolü yapılmamaktadır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ShipmentCompanyService değerinde olmalıdır
metot GetShipmentCompanies değerinde olmalıdır
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ShipmentCompanyService","metot":"GetShipmentCompanies"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Teslimat Şablonu Listeleme (GetShipmentTemplate)

Teslimat şablon ismi ile aratılan şablonun adres metod gibi özelliklerini gösterme. deliverableCities teslimat yapılacak şehirlerin seçimini yaptığımız alan bu alana değer girilmezse tüm şehirlere gönderim yapılacak anlamındadır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ShipmentService değerinde olmalıdır
metot GetShipmentTemplate değerinde olmalıdır
name Kargo şablonu adı
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ShipmentService","metot":"GetShipmentTemplate","name":"ONLINE GÖNDERİM"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Teslimat Şablonu Oluşturma, Güncelleme (CreateOrUpdateShipmentTemplate)

Teslimat şablonu kargonun nasıl gideceğine dair oluşturulan bir şablondur.Siparişlerde kullanılacak olan teslimat şablonu özellikleriyle birlikte bu servis aracılığı ile oluşturulur. claimshipmentCompany alanı kullan yani “1” ise zorunludur.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ShipmentService değerinde olmalıdır
metot CreateOrUpdateShipmentTemplate değerinde olmalıdır
shipment.templateName Kargo şablonu
shipment.installmentInfo Kurulum bilgileri/text bilgisi girilecek
shipment.exchangeInfo Değişim bilgileri/text bilgisi girilecek
shipment.shippingInfo Teslimat bilgileri/text bilgisi girilecek
shipment.specialDelivery Özel teslimat true/false
shipment.deliveryFeeType Kargo ödeme yöntemi
1 ise alıcı öder 2 ise mağaza öder 3 ise şartlı kargo
shipment.combinedShipmentAllowed 1’den fazla ürün gönderim durumu
true ise 1’den fazla ürün var demek ; false ise tek ürün olduğunu belirtir.
shipment.shipmentMethod Ürünün ulaşma şekli
1 ise kargo 2 ise diğer
shipment.warehouseAddess.title Depo adres başlığı
shipment.warehouseAddess.address Depo adres bilgisi
shipment.warehouseAddess.district.name Depo ilçe adı
shipment.warehouseAddess.district.id Depo adres ilçe idsi
shipment.warehouseAddess.city.name Depo adres şehir adı
shipment.warehouseAddess.city.code Depo adres şehir kodu
shipment.warehouseAddess.postalCode Depo adres posta kodu
shipment.exchangeAddress.address İade adres açıklaması
shipment.exchangeAddress.city.code İade adres şehir kodu
shipment.exchangeAddress.city.name İade adres şehir ismi
shipment.exchangeAddress.district.id İade adres bölge idsi
shipment.exchangeAddress.district.name İade adres bölge adı
shipment.exchangeAddress.postalCode İade adres posta kodu
shipment.exchangeAddress.title İade adres başlık adı
shipment.shipmentCompanies.shipmentCompany.name Kargo şirket adı
shipment.shipmentCompanies.shipmentCompany.shortName Kargo şirket kısa adı
shipment.deliverableCities.city.code Teslimat yapılacak şehir kodu
shipment.deliverableCities.city.name Teslimat yapılacak şehir adı
shipment.claimShipmentCompany.name İade/Değişim kargo şirket adı
shipment.claimShipmentCompany.shortName İade/Değişim kargo şirket kısa adı
shipment.cargoAccountNo Kargo hesap no
shipment.useDmallCargo n11.com entegrasyonlu kargo firmasi kullanımı:
1: kullan
0: kullanma
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ShipmentService","metot":"CreateOrUpdateShipmentTemplate","shipment":{"templateName":"XX GÖNDERİM","installmentInfo":"Programı kullanım hakkınız süresince, internet sitemizdeki İletişim sayfamızdan bize her türlü görüş, öneri ve talebinizi iletebilirsiniz. Müşteri ilişkileri departmanımız size her türlü probleminizin gideriminde yardımcı olmaktan memnuniyet duyacaklardır.","exchangeInfo":"“Cayma Hakkı Kullanımı ve İade şartları\", “6502 Sayılı Tüketicinin Korunması Hakkındaki Kanun” ve “Mesafeli Satışlara Dair Yönetmelik” hükümlerine tabi olacaktır.\\n\\nBilgi için \"http:\/\/www.n11.com\/genel\/cayma-hakki-ve-iade-surec-bilgileri-65205\" adresini ziyaret edebilirsiniz.","shippingInfo":"Program kullanımı için size gönderilecek olan KULLANICI ADI ve ŞİFRE\\nbilgileriniz ve faturanız eposta adresinize online olarak gönderilmektedir.","specialDelivery":false,"deliveryFeeType":2,"combinedShipmentAllowed":true,"shipmentMethod":2,"warehouseAddress":{"title":"EPOSTA","address":"info@oranmerkezi.com","district":{"name":"Ödemiş","id":22372},"city":{"name":"İzmir","code":35},"postalCode":35750},"exchangeAddress":{"address":"info@oranmerkezi.com","city":{"code":35,"name":"İzmir"},"district":{"name":"Ödemiş","id":22372},"postalCode":35750,"title":"EPOSTA"},"shipmentCompanies":{"shipmentCompany":[{"name":"Yurtiçi","shortName":"YK"}]},"deliverableCities":{"city":[{"name":"Adana","code":1},{"name":"Adıyaman","code":2}]},"claimShipmentCompany":{"name":"Yurtiçi","shortName":"YK"},"cargoAccountNo":11111,"useDmallCargo":1}}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Teslimat Şablonu Listeleme (GetShipmentTemplateList)

Oluşturulan teslimat şablonu bilgilerini listelemek için kullanılan metoddur.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ShipmentService değerinde olmalıdır
metot GetShipmentTemplateList değerinde olmalıdır
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ShipmentService","metot":"GetShipmentTemplateList"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Satış/Uzlaşma Listeleme (GetSettlementList)

Seçilen tarih aralığına göre ödeme bilgilerini listeleyen servis.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service SettlementService değerinde olmalıdır
metot GetSettlementList değerinde olmalıdır
startDate Tarih aralığı başlangıcı (YYYY-MM-DD)
endDate Tarih aralığı bitişi (YYYY-MM-DD)
pagingData
pagingData.currentPageGösterilen sayfa numarası (currentpage 0 ile başlar)Varsayılan değer: 0
pagingData.pageSizeSayfadaki madde sayısıVarsayılan değer: 100
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"SettlementService","metot":"GetSettlementList","startDate":"2019-01-01","endDate":"2021-01-01","pagingData":null}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Satış/Uzlaşma Detaylandırma (GetSettlementDetail)

GetSettlementList metodu ile listelenen ödemelere ait ayrıntıları gösteren metod. Belirli bir gün seçilerek, o güne ait satış/uzlaşma detayları getirilir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service SettlementService değerinde olmalıdır
metot GetSettlementDetail değerinde olmalıdır
date Uzlaşma tarihi (YYYY-MM-DD)
pagingData
pagingData.currentPageGösterilen sayfa numarası (currentpage 0 ile başlar)Varsayılan değer: 0
pagingData.pageSizeSayfadaki madde sayısıVarsayılan değer: 100
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"SettlementService","metot":"GetSettlementDetail","date":"2020-04-09","pagingData":null}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağazaya Atanan Talepleri Listeleme (TicketListingAssignedToSeller)

Mağazaya atanan talepleri liste halinde yollayan servis.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service TicketService değerinde olmalıdır
metot TicketListingAssignedToSeller değerinde olmalıdır
sellerId Mağaza İdsi
first Liste gösterilecek olan ticketların kaçıncı sıradan başlayacağını gösterir
pageSize Sayfadaki madde sayısı
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"TicketService","metot":"TicketListingAssignedToSeller","sellerId":2171962,"first":0,"pageSize":5}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağazanın Açtığı talepleri listeleme (TicketListingBelongsToSeller)

Mağazanın açtığı talepleri liste halinde yollayan servis.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service TicketService değerinde olmalıdır
metot TicketListingBelongsToSeller değerinde olmalıdır
sellerId Mağaza İdsi
first Liste gösterilecek olan ticketların kaçıncı sıradan başlayacağını gösterir
pageSize Sayfadaki madde sayısı
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"TicketService","metot":"TicketListingBelongsToSeller","sellerId":2171962,"first":0,"pageSize":5}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağazanın Taleplere Cevap Vermesi (TicketAnswer)

Mağazanın kendisinin açtığı yada kendine açılan taleplere cevap vermesini sağlayan servis.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service TicketService değerinde olmalıdır
metot TicketAnswer değerinde olmalıdır
sellerId Cevap veren mağaza İdsi
ticketId Cevap verilen talep idsi
content Cevap İçeriği
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"TicketService","metot":"TicketAnswer","sellerId":2791005,"ticketId":12345,"content":"Bu bir yanıt örneğidir."}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağazanın Talep Açması (TicketCreate)

Mağazanın talep açmasını sağlayan servis.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service TicketService değerinde olmalıdır
metot TicketCreate değerinde olmalıdır
reasonId Talep açma sebenin idsi
sellerId Talepi açan mağazanın idsi
header Talep Başlığı
content Talep İçeriği
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"TicketService","metot":"TicketCreate","reasonId":2056,"sellerId":2791005,"header":"API Geliştirme Test Başlığı","content":"API geliştirme test metni."}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Mağaza Talep Sebebleri (TicketReasons)

Mağaza talep açarken girmesi gereken sebelerinin bilgilerini ileten servis.
Yollanan data arasında Root-Parent-Child-Child ilişkisi bulunmaktadır.
Mağaza talep açarken yollaması gereken reasondId 3.leveldeki child idsi olmalıdır.

isReqired alanı sadece 4.level reason içinde bulunur.True ya da False olabilir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service TicketService değerinde olmalıdır
metot TicketReasons değerinde olmalıdır
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"TicketService","metot":"TicketReasons"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Talep ve Cevap Okuma (TicketRead)

Okunan talep ve cevapların statülerini okundu olarak güncelleyen servis
SellerId ve TicketId ile istek yapıldığında o talep ve ona bağlı bütün cevapları okundu olarak günceller.

TicketListingAssignedToSeller ve TicketListingBelongsToSeller
Servislerindeki ticket ve answer a ait olan isReadBySeller alanını kontrol ederek görülebilir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service TicketService değerinde olmalıdır
metot TicketRead değerinde olmalıdır
ticketId Statüsü güncellenek olan talep in idsi.
sellerId Talep ve cevabı okuyan mağazanın idsi
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"TicketService","metot":"TicketReasons","ticketId":12345,"sellerId":2791005}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Fatura Detaylandırma (GetSapCommissionEInvoiceDetail)

Fatura detayı için günlük sorgulama limiti sayısı 3 olarak set edilmiştir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service SapCommissionEInvoiceDetailService değerinde olmalıdır
metot GetSapCommissionEInvoiceDetail değerinde olmalıdır
date Fatura detayı alınacak tarih (YYYY-MM)
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"SapCommissionEInvoiceDetailService","metot":"GetSapCommissionEInvoiceDetail","date":"2020-05-08"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

Hesap Ekstresi (GetSapBankStatementEInvoice)

Hesap ekstresi için günlük sorgulama limiti sayısı 3 olarak set edilmiştir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service SapBankStatementEInvoiceService değerinde olmalıdır
metot GetSapBankStatementEInvoice değerinde olmalıdır
startDate Tarih aralığı başlangıcı (YYYY-MM-DD)
endDate Tarih aralığı bitişi (YYYY-MM-DD)
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"SapBankStatementEInvoiceService","metot":"GetSapBankStatementEInvoice","startDate":"2019-01-01","endDate":"2021-01-01"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İptal Talepleri Listeleme (ClaimCancelList)

Mağazaya gelen sipariş iptal taleplerini liste halinde yollayan servis. Her sayfada 20 iptal bilgisi gelir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ClaimCancelService değerinde olmalıdır
metot ClaimCancelList değerinde olmalıdır
searchData.status Sipariş iptal talebi durumu. Boş gönderilir ya da aşağıdaki tipler haricinde bir değer gönderilir ise “REQUESTED” durumundaki siparişler görüntülenir.

“REQUESTED”: İptal Talebi Geldi
“RETRACTED”: İptal Geri Çekildi
“COMPLETED”: İptal Edildi
“DENIED”: İptaş Talebi Reddedildi
“REJECT”: Reddedildi
“MANUAL_REFUND” : Manuel Para İadesi Tamamlandı
“ALL”: Bütün iptal durumları
searchData.executer İşlemi yapan bilgisi. Aşağıdaki tipler haricinde bir değer gönderilir ise boş kabul edilir.

“BUYER”: Alıcı
“SELLER”: Satıcı
“OPERATOR”: Operatör
“SYSTEM”: Sistem
“SHIPMENT”: Kargo Şirketi
searchData.searchInfoType İptal talebi detayı aramada searchData.searchQuery ile arama yapılacaksa gönderilmelidir. Arama detayı tipini belirtir. Aşağıdaki tipler haricinde bir değer gönderilir ise boş kabul edilir.

“BUYEREMAIL”: Alıcı Mail Adresi
“RECIPIENTS”: Teslim Alan
“BUYERNAME”: Alıcı Adı Soyadı
“ORDERID”: Sipariş Kodu
“PRODUCTID”: Ürün Kodu
searchData.searchQuery searchData.searchInfoType ‘ a göre arama yapılmak istenen kelime / kod.
searchData.searchDate.searchDateType İptal talebi aramada girilen searchData.searchDate.period alanının tipini belirtir.
Boş gönderilir ya da aşağıdaki tipler haricinde bir değer gönderilir ise “REQUESTED” olarak kabul edilir.

“REQUESTED”: Talep Tarihi
“ACCEPTED”: Kabul Tarihi
“DENIED”: Reddedilme Tarihi
searchData.searchDate.period.startDate searchDateType’ a göre tarih başlangıç. (dd/mm/yyyy)
searchData.searchDate.period.endDate searchDateType’ a göre tarih bitiş. (dd/mm/yyyy)
pagingData.currentPage Gösterilen sayfa numarası (currentpage 0 ile başlar).
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ClaimCancelService","metot":"ClaimCancelList","searchData":{"status":"ALL","executer":null,"searchInfoType":null,"searchQuery":null,"searchDate":{"searchDateType":null,"period":{"startDate":"2019-01-01","endDate":"2021-01-01"}}},"pagingData":null}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İptal Talebi Reddetme (ClaimCancelDeny)

İptal talebini reddetme servisi.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ClaimCancelService değerinde olmalıdır
metot ClaimCancelDeny değerinde olmalıdır
claimCancelId Reddedilecek iptal talebinin idsi.
denyReasonId Red sebebinin idsi. ClaimCancelDenyReasonType servisinden alınacaktır.
denyReasonNote Red açıklaması.
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ClaimCancelService","metot":"ClaimCancelDeny","claimCancelId":1111111,"denyReasonId":2,"denyReasonNote":"Bu not bir red sebebidir."}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İptal Talebi Ret Sebepleri Listeleme (ClaimCancelDenyReasonType)

Ret sebeplerini listeleyen servis. İptal talebi ret servisinde (ClaimCancelDenyRequest) kullanılacaktır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ClaimCancelService değerinde olmalıdır
metot ClaimCancelDenyReasonType değerinde olmalıdır
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ClaimCancelService","metot":"ClaimCancelDenyReasonType"}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İptal Talebi Onaylama (ClaimCancelApprove)

İptal talebini onaylama servisi.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ClaimCancelService değerinde olmalıdır
metot ClaimCancelApprove değerinde olmalıdır
claimCancelId Onaylanacak iptal talebinin idsi.
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ClaimCancelService","metot":"ClaimCancelApprove","claimCancelId":1111111}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İade Talepleri Listeleme (ClaimReturnList)

Mağazaya gelen sipariş iade taleplerini liste halinde yollayan servis. Her sayfada 20 iptal bilgisi gelir.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ReturnService değerinde olmalıdır
metot ClaimReturnList değerinde olmalıdır
searchData.status Sipariş iptal talebi durumu. Boş gönderilir ya da aşağıdaki tipler haricinde bir değer gönderilir ise “REQUESTED” durumundaki siparişler görüntülenir.

“REQUESTED”: İptal Talebi Geldi
“RETRACTED”: İptal Geri Çekildi
“COMPLETED”: İptal Edildi
“DENIED”: İptaş Talebi Reddedildi
“REJECT”: Reddedildi
“MANUAL_REFUND” : Manuel Para İadesi Tamamlandı
“ALL”: Bütün iptal durumları
searchData.executer İşlemi yapan bilgisi. Aşağıdaki tipler haricinde bir değer gönderilir ise boş kabul edilir.

“BUYER”: Alıcı
“SELLER”: Satıcı
“OPERATOR”: Operatör
“SYSTEM”: Sistem
“SHIPMENT”: Kargo Şirketi
searchData.searchInfoType İptal talebi detayı aramada searchData.searchQuery ile arama yapılacaksa gönderilmelidir. Arama detayı tipini belirtir. Aşağıdaki tipler haricinde bir değer gönderilir ise boş kabul edilir.

“BUYEREMAIL”: Alıcı Mail Adresi
“RECIPIENTS”: Teslim Alan
“BUYERNAME”: Alıcı Adı Soyadı
“ORDERID”: Sipariş Kodu
“PRODUCTID”: Ürün Kodu
searchData.searchQuery searchData.searchInfoType ‘ a göre arama yapılmak istenen kelime / kod.
searchData.period.startDate İade talebi gelme tarihi başlangıç. (dd/mm/yyyy)
searchData.period.endDate İade talebi gelme tarihi bitiş. (dd/mm/yyyy)
pagingData.currentPage Gösterilen sayfa numarası (currentpage 0 ile başlar).
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ReturnService","metot":"ClaimReturnList","searchData":{"status":"ALL","executer":null,"searchInfoType":null,"searchQuery":null,"period":{"startDate":"2019-01-01","endDate":"2021-01-01"}},"pagingData":null}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İade Talebi Ret Sebepleri Listeleme (ClaimReturnDenyReasonType)

Ret sebeplerini listeleyen servis. İade talebi ret servisinde (ClaimReturnDenyRequest) kullanılacaktır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ReturnService değerinde olmalıdır
metot ClaimReturnDenyReasonType değerinde olmalıdır
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İade Talebi Erteleme Sebepleri Listeleme (ClaimReturnPendingReasonType)

Erteleme sebeplerini listeleyen servis. İade talebi erteleme servisinde (ClaimReturnPending) kullanılacaktır.

* Bu servis ücretsiz üyeliklerle de kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ReturnService değerinde olmalıdır
metot ClaimReturnPendingReasonType değerinde olmalıdır
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İade Talebi Onaylama (ClaimReturnApprove)

İade talebini onaylama servisi.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ReturnService değerinde olmalıdır
metot ClaimReturnApprove değerinde olmalıdır
claimReturnId Onaylanacak iade talebinin idsi.
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ReturnService","metot":"ClaimReturnApprove","claimReturnId":1111111}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İade Talebi Erteleme (ClaimReturnPending)

İade talebini ertleme servisi.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ReturnService değerinde olmalıdır
metot ClaimReturnPending değerinde olmalıdır
claimReturnId Ertelenecek iade talebinin idsi.
pendingReasonId Erteleme sebebinin idsi. ClaimReturnPendingReasonType servisinden alınacaktır.
pendingDayCount Erteleme Gün Sayısı.
pendingReasonNote Erteleme Açıklaması.
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ReturnService","metot":"ClaimReturnPending","claimReturnId":1111111,"pendingReasonId":21,"pendingDayCount":3,"pendingReasonNote":"Talep bu sebeple ertelenmiştir."}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.

İade Talebi Reddetme (ClaimReturnDeny)

İade talebini reddetme servisi.

* Bu servis sadece ücretli üyelikler ile kullanılabilir.

Parametre Açıklama
apiKey Servislere erişim için kullanılacak uygulama anahtarı
apiPassword Servislere erişim için kullanılacak uygulama şifresi
service ReturnService değerinde olmalıdır
metot ClaimReturnDeny değerinde olmalıdır
claimReturnId Reddelilecek iade talebinin idsi.
denyReasonId Reddelilecek sebebinin idsi. ClaimReturnDenyReasonType servisinden alınacaktır.
denyReasonNote Red Açıklaması.
returnShipmentType Gönderim Tipi.

"CUSTOM" = Takip Numarası İle
"CAMPAIGN" = Kargo Kampanyası İle
  • Aynı Gün Teslimat, Özel Teslimat ve Bilet siparişlerinin iade taleplerinin reddinde; Bu alan boş bırakılmalıdır.
  • Red sebebi “Ürün Mağazaya Ulaşmadı” seçildi ise; Bu alan boş bırakılmalıdır.Alıcının talep için girmiş olduğu takip numarası otomatik olarak gönderilecektir.
  • Diğer red sebepleri için;
    • “CUSTOM” seçilirse; ürünü kargoya verdiyseniz lütfen takip numarasını ilgili alana girin.
    • “CAMPAIGN” seçilirse; shipmentCompanyId , trackingNumber , deliveryReceiptNumber alanları boş bırakılmalıdır. Ürünü iade için henüz kargoya vermediyseniz kampanya kodu kullanarak belirtilen kargo şirketi ile gönderdiğinizde, takip kodu sisteme otomatik olarak tanımlanır, ve iade talebiniz otomatik olarak onaylanmış olur. Onayladığınız takdirde ürünler için üretilecek olan kargo kampanya kodlarına tablodaki "Mağaza Gönderi Kampanya No" kolonundan ulaşabilirsiniz.
shipmentCompanyId Kargo şirketi Idsi. ShipmentCompanyService servisinden alınacaktır.
returnShipmentType “CUSTOM” ise ve Red sebebi “Ürün Mağazaya Ulaşmadı” değil ise; Bu alan zorunludur.Diğer durumlar için; Bu alan boş bırakılmalıdır.
trackingNumber Takip Numarası.

returnShipmentType “CUSTOM” ise ve Red sebebi “Ürün Mağazaya Ulaşmadı” değil ise; Bu alan zorunludur.
Diğer durumlar için; Bu alan boş bırakılmalıdır.
deliveryReceiptNumber Teslim Fiş No.

Aynı Gün Teslimat, Özel Teslimat ve Bilet siparişlerinin iade taleplerinin reddinde; Bu alan zorunludur.
Diğer durumlar için; Bu alan boş bırakılmalıdır.
Zorunlu parametreler koyu renkle gösterilmiştir.
ÖRNEK JSON (POST) SORGUSU

API URL: http://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html

{"apiKey":"***","apiPassword":"***","service":"ReturnService","metot":"ClaimReturnDeny","claimReturnId":1111111,"denyReasonId":2,"denyReasonNote":"Talep bu sebeple reddedilmiştir.","returnShipmentType":null,"shipmentCompanyId":null,"trackingNumber":null,"deliveryReceiptNumber":555555}

ÖRNEK UYGULAMALAR
<?php 
// API URL değerini ayarlayalım
$url = 'https://www.n11jsonapi.com/index.php/N11API/N11JSONAPI.html';

// Yeni bir cURL kaynağı oluşturalım
$ch = curl_init($url);

// POST ile göndereceğimiz örnek parametrelerimizi CategoryService servisinin GetTopLevelCategories metodu için aşağıda örnekledik.
$jsonstr = json_encode(array(
    'apiKey' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'apiPassword' => 'xxxxxxxxxxxxxxxx',//sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
    'service' => 'CategoryService',
    'metot' => 'GetTopLevelCategories',
   )
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonstr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Sorgumuzda hata dönerse bunu göreceğiz
if ( $status !== 201 && $status !== 200 ) {
   die("Hay aksi! $url adresine gerçekleştirdiğiniz sorgunuz $status hatası üretti.");
}

curl_close($ch);

// API sorgumuzun sonucunu ekrana yazdıralım
echo $result;

Forma 1 memo, 1 edit ve 1 de button yerleştirelim. Formun unit dosyası aşağıdaki gibi olmalıdır.

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, REST.Types,
  REST.Client, Data.Bind.Components, Data.Bind.ObjectScope;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel2: TPanel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  JsonToSend: TStringStream;
 RESTClient: TRESTClient;
 RESTRequest: TRESTRequest;
 RESTResponse: TRESTResponse;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  JsonToSend := TStringStream.Create('{'
  +'"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"'   //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"apiPassword":"xxxxxxxxxxxxxxxx"'  //sitemizde tanımladığınız değeri girin; henüz daha tanımlamadıysanız mağazanızı sitemizde tanımlayın.
  +',"service":"CategoryService"'
  +',"metot":"GetTopLevelCategories"'
  +'}'
  ,TEncoding.UTF8);

  RESTClient := TRESTClient.Create(edit1.Text);
 RESTClient.ContentType := 'application/json';
 RESTClient.Accept := 'text/javascript';
 RESTClient.AcceptEncoding := 'utf-8';

 RESTResponse := TRESTResponse.Create(nil);
 RESTResponse.ContentType := 'application/json';

 RESTRequest := TRESTRequest.Create(nil);
 RESTRequest.Method := TRESTRequestMethod.rmPOST;
 RESTRequest.Response := RESTResponse;
 RESTRequest.Client := RESTClient;
 RESTRequest.AddBody(JsonToSend, TRESTContentType.ctAPPLICATION_JSON);

 RESTRequest.Execute;

 memo1.Text:=RESTResponse.Content;

 end;

end.
														

Diğer kodlama altyapılarında çalışan kod talepleriniz için İletişim sayfamızdan bizimle irtibata geçebilirsiniz.