• 16-09-2021, 13:56:50
    #1
    Merhaba arkadaşlar kod aşağıdadır. Sonuç hep aynı dönüyor ürünü bulamıyor.

     public function UpdateStockByStockSellerCode($products = array())
      {
      
        $this->setUrl('https://api.n11.com/ws/ProductStockService.wsdl');
        
        self::$_parameters['stockItems']['stockItem']['sellerStockCode'] = "Stok Kodu";    
        self::$_parameters['stockItems']['stockItem']['quantity'] = "5";
        self::$_parameters['stockItems']['stockItem']['version'] = "";    
        
        $result[] = self::$_sclient->UpdateStockByStockSellerCode(self::$_parameters);
        
            
    
            return $result;
    Dönen sonuç budur. Ürünün n11 kendi stok kodumu da yazıyorum aynı sonuç ürün n11 Id de yazıyorum aynı sonucu veriyor.

    Array
    (
        [0] => stdClass Object
            (
                [result] => stdClass Object
                    (
                        [status] => failure
                        [errorCode] => SELLER_API.notFound
                        [errorMessage] => XXXX bulunamadı
    
                        [errorCategory] => SELLER_API
                    )
    
            )
    
    )
  • 16-09-2021, 13:58:53
    #2
    Gönderdiğin XML çıktısını ekler misin konuya? Gönderim yaparken API bilgilerin gidiyor mu?
  • 16-09-2021, 14:20:09
    #3
    PİKA adlı üyeden alıntı: mesajı görüntüle
    Gönderdiğin XML çıktısını ekler misin konuya? Gönderim yaparken API bilgilerin gidiyor mu?
    Api bilgilerini kontrol ettim her hangi bir sorun görünmüyor. Tam olarak kullandığım kod aşağıdadır.

    abc.php

    Class N11 {
        protected static $_appKey, $_appSecret, $_parameters, $_sclient;
        public $_debug = false;
        
        public function __construct(array $attributes = array()) {
            self::$_appKey = $attributes['appKey'];
            self::$_appSecret = $attributes['appSecret'];
            self::$_parameters = ['auth' => ['appKey' => self::$_appKey, 'appSecret' => self::$_appSecret]];
        }
        
        public function setUrl($url) {
            self::$_sclient = new \SoapClient($url);
        }
     
    
      //Stok Güncelleme
    
      public function UpdateStockByStockSellerCode($products = array())
      {
        
    
      
        $this->setUrl('https://api.n11.com/ws/ProductStockService.wsdl');
        
        self::$_parameters['stockItems']['stockItem']['sellerStockCode'] = "Stok Kodu";    
        self::$_parameters['stockItems']['stockItem']['quantity'] = "5";
        self::$_parameters['stockItems']['stockItem']['version'] = "";    
        
        $result[] = self::$_sclient->UpdateStockByStockSellerCode(self::$_parameters);
        
            
    
            return $result;
      
      }
    
    
    public function __destruct() {
            if ($this->_debug) {
                print_r(self::$_parameters);
            }
        }
        }
    guncelle.php

        require_once ('abc.php');
        $n11Params = [
            'appKey' => 'xxxx',    
            'appSecret' => 'xxx',        
        ];
        
        $n11 = new N11($n11Params);
        
        
    
    
        
    $productList = $n11->UpdateStockByStockSellerCode();
    print_r($productList);
  • 16-09-2021, 16:20:43
    #4
    <sch:UpdateStockByStockIdRequest>
             <auth>
                <appKey>***</appKey>
                <appSecret>***</appSecret>
             </auth>
         <stockItems>
         <!--1 or more repetitions:-->
        <stockItem>
            <id>[I][COLOR=#B8312F]Ürün stok N11 ID si[/COLOR][/I]</id>
            <quantity>[COLOR=#B8312F]1 ile 100 arası bir stok değeri girmelisin.[/COLOR]</quantity>
            <version>1</version>
           <delist>1</delist>
       </stockItem>
       </stockItems>
    </sch:UpdateStockByStockIdRequest>
    Yukarıdaki formatta verilerin gittiğine emin misin? Değerlerini kontrol etmelisiniz en son method çağrısı yaparken kullandığın Client bu formata çeviriyor mu?
  • 16-09-2021, 16:52:20
    #5
    PİKA adlı üyeden alıntı: mesajı görüntüle
    <sch:UpdateStockByStockIdRequest>
             <auth>
                <appKey>***</appKey>
                <appSecret>***</appSecret>
             </auth>
         <stockItems>
         <!--1 or more repetitions:-->
        <stockItem>
            <id>[I][COLOR=#B8312F]Ürün stok N11 ID si[/COLOR][/I]</id>
            <quantity>[COLOR=#B8312F]1 ile 100 arası bir stok değeri girmelisin.[/COLOR]</quantity>
            <version>1</version>
           <delist>1</delist>
       </stockItem>
       </stockItems>
    </sch:UpdateStockByStockIdRequest>
    Yukarıdaki formatta verilerin gittiğine emin misin? Değerlerini kontrol etmelisiniz en son method çağrısı yaparken kullandığın Client bu formata çeviriyor mu?
    Bu şekilde dönmesi lazım ama dediğim gibi hata veriyor.

    UpdateStockByStockSellerStockCode Örnek Çağrı
    Request

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.n11.com/ws/schemas">
       <soapenv:Header/>
       <soapenv:Body>
          <sch:UpdateStockByStockSellerCodeRequest>
             <auth>
                <appKey>***</appKey>
                <appSecret>***</appSecret>
             </auth>
             <stockItems>
                <!--1 or more repetitions:-->
                <stockItem>
                   <sellerStockCode>StokKod1234567</sellerStockCode>
                   <quantity>20</quantity>
                   <version>1</version>
                </stockItem>
             </stockItems>
          </sch:UpdateStockByStockSellerCodeRequest>
       </soapenv:Body>
    </soapenv:Envelope>
  • 16-09-2021, 17:19:00
    #6
    Client problemli olabilir güncel olduğuna emin misin? N11 API servislerini neredeyse App uygulama gibi her hafta güncelliyor direkt servislere XML formatında request at Curl ile daha hızlı entegre olursun.
  • 16-09-2021, 23:14:08
    #7
    Servis güncel çalışıyor bir yerde eksiklik var ama nerede çözemedim.