get_brand_items


This request shows all products in a specific brand category.



Call parameters:


Parameter

Required

Note

uid

yes

Id client

pid

yes

Id Portal

lid

yes

id Langauge

key

yes

Autentication code

api_version  

yes

Version API.

request

yes

Name of function request

id_brand

yes

Id of brand obtained by request get_brands

display_brand_name

no

Brand name to which the product belongs

display_reference

no

Product reference

display_name

no

Product name

display_stock

no

Qty available in stock

display_weight

no

Weight of product

display_retail_price

no

Retail price

display_discount

no

Discount

display_price

no

Sales price

display_id_supplier

no

id supplier - field with number that shows the suppliers ID

display_speed_shipping

no

Display the speed of handling of warehouse

display_ean

no

Ean code

display_currency

no

Display the currency

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 Required 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

yes

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

rc

yes

return code.

message

yes

Error message

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 catalog brand

    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)

Retail price

    discount

yes (if present in rows)

Discount

    price

yes (if present in rows)

Price

    id_supplier

yes (if present in rows)

id suppliers wholesaler

    speed_shipping

yes (if present in rows)

Discover the speed of preparation wholesaler

  • 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_brand_items",

    "id_brand": 240,

    "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_brand"     => 240,

               "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 request of results


echo $ce;


curl_close($ch);






Example of a positive response with products in catalog


{

    "success": true,

    "rc": 0,

    "message": "",

    "num_rows":381,"

    "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/store/1/CASIO/icona_A158WA-1D.jpg",

        "image_path": "http://xxx.xx/store/1/CASIO/A158WA-1D.jpg",

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

        "attributes":"Rezistent la apă: 5 ATM - Natură: Lady - Material de caz: Plastic"

    }, {

        "id_product": "91970",

        "reference": "A168WA-1Y",

        "brand_name": "CASIO",

        "name": "CASIO Mod. A168WA-1Y",

        "stock": "955",

        "weight": "200",

        "retail_price": 34.9,

        "discount": "53.19",

        "price": 16.34,

        "speed_shipping": "2",

        "id_supplier": "12",

        "ean": "4971850541257",

        "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 a positive response 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: Easily create PDF Help documents