get_brands


This request shows all catalogus available in the store.



Call parameters:


Parameter

Required

Note

uid

yes

Id client

pid

yes

Id Portal

lid

yes

id Language

key

yes

Identification code

api_version  

yes

Version API.

request

yes

Name of function request



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

Message error

num_rows

no

Shows the number of records found when there are no errors in processing

rows

no

Shows the details of brands available if there are no errors in processing

    id_brand


Unique code of the brand

    group

yes

Category membership group

    category

yes

Name of the category which it belongs to (charset UTF-8)

    name

yes

Name of category  (charset UTF-8)

    min_qty

yes

Minimum order for this category if necessary

    extra_discount_threshold_value

yes

Minimum order to receive an extra discount. After ordering the minimum qty of this field you will be entitled to an extra discount specified in the 'extra_discount_percentage_value'

    extra_discount_percentage_value

yes

Percentage of discount to which you are entitled to if you buy for at least 'extra_discount_threshold_value'



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_brands"

}



Example of php request:



$data = array(


               "uid"             => 12345,

               "pid"             => 2,

               "lid"             => 1,

               "key"             => "VtKpudWnzRBioQeBKQXPBdSpamppUTw8",

               "api_version"     => "1.0.0",

               "request"         => "get_brands"

);




$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 is the result of the call.

echo $ce;

curl_close($ch);




Example of html request:


<html>

    <body>

        <form method=”POST” action=”https://dev.dropshipping.com/api/”>

            <input type=”text” name=“data” value=’{"uid":"12345", "pid":"2", "lid":"2", "key" : "VtKpudWnzRBioQeBKQXPBdSpamppUTw8", "request": "get_brands"}’>

            <input type=”submit” value=”Submit” name=”Submit”>

        </form>

    </body>

</html>



Example of a positive response


{

   "success":true,

   "rc":0,

   "message":"",

   "num_rows":317,

   "rows":[

      {

         "id_brand":"716",

         "group":"WATCHES",

         "category":"WATCH ACCESSORIES",

         "name":"WATCH BOX",

         "min_qty":"0",

         "from_euro":0,

         "brand_discount":0

      },

      {

         "id_brand":"533",

         "group":"WATCHES",

         "category":"WATCH ACCESSORIES",

         "name":"LEATHER STRAPS\u00ae",

         "min_qty":"20",

         "from_euro":0,

         "brand_discount":0

      },

      {

         "id_brand":"185",

         "group":"WATCHES",

         "category":"WATCH ACCESSORIES",

         "name":"SWATCH STRAPS",

         "min_qty":"20",

         "extra_discount_threshold_value":"1200",

         "extra_discount_percentage_value":"32"

      }

   ]

}



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 EPub books