get_item


This request shows how to receive the details of the product



Call parameters:


Parameter

Required

Note

uid

yes

Id client

pid

yes

Id Portal

lid

yes

id Language

key

yes

Authentification code

api_version  

yes

Version API.

request

yes

Name of function request

id_product

yes

Id product received from request get_brand_items

display_brand_name

no

Name of brand of which the product is part of

display_reference

no

Product reference

display_name

no

Name of product

display_stock

no

Qty in stock

display_weight

no

Weight of product

display_retail_price

no

Retail price

display_discount

no

Discount

display_price

no

Price

display_id_supplier

no

id supplier - field with number that shows the suppliers ID

display_speed_shipping

no

Display speed of handling supplier

display_ean

no

Ean code

display_currency

no

Currency used

display_icon_path

no

Shows the icon path FQDN

display_image_path

no

Shows the image path of the product FQDN

display_image_last_update

no

Show last image update

display_attributes

no

shows product attributes if available

Note:

unless explicitly requested during call (display_attributes = true), this field is not displayed


The fields not compulsary are filters to reduce traffic with information not requested of not needed.

All these fields are active in default, in the absence of these fields the information will be presented as default in the field of data stream.



Reply parameters:


Parameter

Always present

Note

success

si

true or false, shows if the request was completed with success or not

rc

si

return code.

message

si

Message error

num_rows

no

Shows the number of records found when there are no errors

rows

no

Shows the details of the products available when there are no errors

    id_product

yes (if present in rows)

id product according to the wholesaler classification

    reference

yes (if present in rows)

Product reference according to the official brand

    brand_name

yes (if present in rows)

Name of brand catalog

    name

yes (if present in rows)

Product name

    stock

yes (if present in rows)

Qty in stock

    weight

yes (if present in rows)

Weight

    retail_price

yes (if present in rows)

Ratail price

    discount

yes (if present in rows)

Discount

    price

yes (if present in rows)

Price

    id_supplier

yes (if present in rows)

id supplier

    speed_shipping

yes (if present in rows)

Shows the speed of preparing the product:

  • 0 - Slow
  • 1 - Standard
  • 2 - Express

    ean

yes (if present in rows)

EAN code

    currency

yes (if present in rows)

Currency used

    icon_path

yes (if present in rows)

Shows the icon path FQDN

    image_path

yes (if present in rows)

Shows the image path of the product FQDN

    image_last_update

yes (if present in rows)

Show last image update

    attributes

yes (if present in rows)

Where available, shows the descriptive list of the product attributes



This call can have the following error messages:


  • -2 Access Denied
  • -4 Fatal Error: There was an internal Error. Please retry or contact webmaster@wwt.it




Json request structure:


{

    "uid":         12345,

    "pid":         2,

    "lid":         1,

    "key":         "VtKpudWnzRBioQeBKQXPBdSpamppUTw8",

    "api_version": "1.0.0",

    "request":     "get_item",

    "id_product":  91969,

    "display_brand_name":        true,

    "display_reference":         true,

    "display_name":              true,

    "display_stock":             true,

    "display_weight":            true,

    "display_retail_price":      true,

    "display_discount":          true,

    "display_price":             true,

    "display_id_supplier":       true,

    "display_speed_shipping":    true,

    "display_ean":               true,

    "display_currency":          true,

    "display_icon_path":         true,

    "display_image_path":        true,

    "display_image_last_update": true,

    "display_attributes":        true  //in order to show attributes, this field is mandatory and it's value must be true

    }

}



Example of php request:



$data = array(


               "uid"          => 12345,

               "pid"          => 2,

               "lid"          => 1,

               "key"          => "VtKpudWnzRBioQeBKQXPBdSpamppUTw8",

               "api_version"  => "1.0.0",

               "request"      => "get_brand_items",

               "id_product"   => 91969,

               "display_brand_name"    => true,

               "display_reference"     => true,

               "display_name"          => true,

               "display_stock"         => true,

               "display_weight"        => true,

               "display_retail_price"  => true,

               "display_discount"      => true,

               "display_price"         => true,

               "display_id_supplier"   => true,

               "display_speed_shipping"=> true,

               "display_ean"           => true,

               "display_currency"      => true,

               "display_icon_path"     => true,

               "display_image_path"    => true,

               "display_image_last_update" => true,

                "display_attributes"        => true

               

);



$data = array('data' => json_encode($data));

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,  "https://dev.dropshippingb2b.com/api/");

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,FALSE);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);


$ce = curl_exec($ch); // in $ce result of request


echo $ce;


curl_close($ch);





Example of positive results with product in catalog


{

    "success": true,

    "rc": 0,

    "message": "",

    "num_rows":1,"

    "rows": [{

        "id_product": "91969",

        "reference": "A158WA-1D",

        "brand_name": "CASIO",

        "name": "CASIO Mod. A158WA-1D",

        "stock": "999",

        "weight": "200",

        "retail_price": 29.9,

        "discount": "61.55",

        "price": 11.5,

        "id_supplier": "12",

        "speed_shipping": "1",

        "ean": "4971850436553",

        "currency": "EUR",

        "icon_path": "http://xxx.xx/image/noimage.jpg",

        "image_path": "http://xxx.xx/image/noimage.jpg",

        "image_last_update":"2017-06-26 23:17:18",

        "attributes":"Rezistent la apă: 5 ATM - Natură: Lady - Funcţii: Only Time - Sticlă: Plastic"

    }]

}



Example of positive results with empty catalog:


{

    "success": true,

    "rc": 0,

    "message": "",

    "num_rows":0,"

    "rows": null

}



Example of negative response:


{

  "success": false,

  "rc": -4,

  "message”: "Fatal Error: There was an internal Error. Please retry or contact webmaster@wwt.it"

}







Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator