0

I want to update listing attribute like stock count ,pricing in bulk using php. I check Flipcart api doc https://seller.flipkart.com/api-docs/listing-api-docs/LMAPIRef.html there i got these reference:

https://api.flipkart.net/sellers/skus/listings/bulk

But i don't know how to pass parameters the required data on this.Is anyone done this please answer.

Urvashi
  • 239
  • 2
  • 10

1 Answers1

0

Hi from the docs it is POST:

Body Parameter: BulkListingRequest (either listingId or skuId is mandatory)
URL: https://api.flipkart.net/sellers/skus/listings/bulk
Headers: Content-type:application/json
Response: BulkStatusOutput

With data like that :

{
    "listings": [
    {
        "skuId": "SKUID1",
        "fsn": "FSN1",
        "attributeValues": {
            "mrp": "2400",
            "selling_price": "2300",
            "listing_status": "INACTIVE",
            "fulfilled_by": "seller",
            "national_shipping_charge": "20",
            "zonal_shipping_charge": "20",
            "local_shipping_charge": "20",
            "procurement_sla": "3",
            "stock_count": "23",
            "procurement_type": "REGULAR"
        }
    }
}

So you need to use Curl for that :

$ch = curl_init( $url );
# Setup request to send json via POST.
$dataJson= json_encode($data));
curl_setopt( $ch, CURLOPT_POSTFIELDS, $dataJson);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
# Return response instead of printing.
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
# Send request.
$result = curl_exec($ch);
curl_close($ch);
MaximeK
  • 2,039
  • 1
  • 10
  • 16
  • $DATA I have to define like "listings": [ { "skuId": "SKUID1", "fsn": "FSN1", "attributeValues": { "mrp": "2400", "selling_price": "2300", "listing_status": "INACTIVE", "fulfilled_by": "seller", "national_shipping_charge": "20", "zonal_shipping_charge": "20", "local_shipping_charge": "20", "procurement_sla": "3",....................... ? – Urvashi Aug 31 '16 at 13:26
  • So use Curl for transmiting the datas `$ch = curl_init('https://api.flipkart.net/sellers/skus/listings/bulk');` – MaximeK Aug 31 '16 at 13:45
  • i followed all steps but still not getting any response,any blank screen i getting – Urvashi Sep 01 '16 at 10:41