1

SO trying to post product listing on sandbox but it is showing error like Invalid Fsn firstly i tried the authentication which response with token using below url https://sandbox-api.flipkart.net/oauth-service/oauth/token?grant_type=client_credentials&scope=Seller_Api then after that I am trying to post list using seller api using below url https://sandbox-api.flipkart.net/sellers/listings/v3

but in response it is showing below error

{"sku":{"status":"FAILURE","errors":[{"severity":"ERROR","code":25001,"description":"Invalid FSN abc."}]}}

my code is

 $url  = "https://sandbox-api.flipkart.net/oauth-service/oauth/token?grant_type=client_credentials&scope=Seller_Api";
        $curl = curl_init(); 
        curl_setopt($curl, CURLOPT_URL,$url);
    
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_USERPWD, "app id:app secret");
        $result = curl_exec($curl);
        curl_close($curl);
    
        $tokan = json_decode($result,true);
       $url  = "https://sandbox-api.flipkart.net/sellers/listings/v3";
        $curl = curl_init(); 
    
        $json = '{
        "sku": {
            "product_id": "abc",
            "price": {
                "mrp": 100,
                "selling_price": 100,
                "currency": "INR"
            },
            "tax": {
                "hsn": "39264099",
                "tax_code" : "GST_5"
            },
            "listing_status": "ACTIVE",
            "shipping_fees": {
                "local": 0,
                "zonal": 0,
                "national": 0,
                "currency": "INR"
            },
            "fulfillment_profile": "NON_FBF",
            "fulfillment": {
                "dispatch_sla": 1,
                "shipping_provider": "SELLER",
                "procurement_type": "REGULAR"
            },
            "packages": [
                {
                    "name": "RHBUS001",
                    "dimensions": {
                        "length": 1,
                        "breadth": 1,
                        "height": 1
                    },
                    "weight": 1,
                    "description": "",
                    "handling": {
                        "fragile": true
                    },
    
                    "notional_value": {
                        "amount": 1,
                        "unit": "PERCENTAGE"
                    }
                }
            ],
            "locations": [
                {
                    "id": "WH",
                    "status": "ENABLED",
                    "inventory": 1
                }
            ]
        }
    }';
        curl_setopt($curl, CURLOPT_URL,$url);
    
        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        'Content-Type:application/json',
        'Authorization:Bearer '.$tokan['access_token'],
        ''
        ));
        $result = curl_exec($curl);
        $ee = curl_getinfo($curl);
        echo "<pre>";
        print_r($ee);
        curl_close($curl);
        print_r($result);
rahul
  • 408
  • 6
  • 21

1 Answers1

2

You can not create product id by just putting product ids specified by you. Email to seller-api-queries@flipkart.com and they will provide you the product Ids

rahul
  • 408
  • 6
  • 21