get_basket_items


This request shows the items in the API basket.



Call parameters:


Parameter

Required

Note

uid

yes

Id client

pid

yes

Id Portal

lid

yes

id Language

key

yes

Code of authentication

api_version  

yes

Version API.

request

yes

Name of function request

id_basket

yes

Id basket


The field id_basket allows you the search into the basket:

  1. One item by entering its ID
  2. Multiple ID's, seperated by ;
  3. All the items, by entering into the field *




Reply parameters:

The request can show to types of views.


1 Is returned by the requests 1 and 3. This will show the overall outcome of the request plus the detail of every single request.

2 Results of request 3. This will show all the items present in the API basket.



Reply parameters - general part:


Parameter

Always present

Note

success

yes

true o false, indicate if operations been completed or not

rc

yes

return code.

message

yes

Error message

id_basket

no - only at the request with id_basket = *

Reminder of the research performed

num_rows

no - only at the request  id_basket = *

Numer of records found in the basket

Items

yes ( if rc != -4)

Parent of product into the list


This call can have the following error message


  • -2  Access Denied
  • -4  Fatal Error: There was an internal Error. Please retry or contact webmaster@wwt.it
  • -11 One or more errors occurred while processing your request.



In the situation of error -2 or -4, there will not be a field ITEMS and details of the every message.



Reply parameters - detaild part of request type 1 and 2:


Parameter

Always present

Note

success

yes

true o false, indicate if operations been completed or not

rc

yes

return code.

message

yes

Error message

id_basket

yes

Id basket of requested details

item

yes (if rc != -4)

Details of product in basket

    id_basket

yes (if rc != -4)

Id basket present in DB. Is also included to maintain a general data structure with all 3 types of request.

    id_catalog

yes (if rc = 0)

id of catalog of which the product is part of

    bundle

yes (if rc = 0)

Bundle Name. Valorized only if the product belong  to a bundle

    catalog_name

yes (if rc = 0)

Name of catalog

    id_supplier

yes (if rc = 0)

id supplier

    speed_shipping

yes (if rc = 0)

Shows the speed of preparation supplier

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

    id_product

yes (if rc = 0)

id of product added to the basket

    reference

yes (if rc = 0)

Qty requested

    product_name

yes (if rc = 0)

News qty available in the warehouse after reservering this product into the basket

    ean

yes (if rc = 0)

Code EAN

    weight

 (if rc = 0)

Weight

    qty_reserved

yes (if rc = 0)

Qty reserved

    retail_price

yes (if rc = 0)

Retail price

    discount

yes (if rc = 0)

Discount

    price

yes (if rc = 0)

Sales price

    extra_discount

yes (if rc = 0)

Extra discount in the situation in which are met the requerements of extra_discount_threshold_value

    net_price

yes (if rc = 0)

Sales price after extra discount. This value is at leat the same to 'price', even if  extra_discount = 0

    user_id_order

yes (if rc = 0)

id order final customer

    user_id_user

yes (if rc = 0)

Id client user for partner store

    user_company_name

yes (if rc = 0)

Title of final questomer (Mr., Ms.., etc..  )

    user_first_name

yes (if rc = 0)

First name of final customer

    user_last_name

yes (if rc = 0)

Last name of final customer

    user_address

yes (if rc = 0)

Address of final customer

    user_city

yes (if rc = 0)

City of final customer

    user_country

yes (if rc = 0)

Province of final customer

    user_zipcode

yes (if rc = 0)

ZIP code of final customer

    user_state

yes (if rc = 0)

Country of final customer

    user_mobile

yes (if rc = 0)

Mobile phone of final customer

    user_mail

yes (if rc = 0)

Email of final customer

    user_retail_price

yes (if rc = 0)

Retail price of final customer

    user_discount

yes (if rc = 0)

Discount final customer

    user_price

yes (if rc = 0)

Sales price final customer

    user_cod

si (se rc = 0)

Payment in COD (cod: Cache on Delivery ). Two values are possible:

  • 1 - Yes
  • 0 - No

Default : 0

    user_note

si (se rc = 0)

Note added from the final customer

    internal_note

si (se rc = 0)

Note added from the dropshipment partner




Reply parameters - more details after request type 3


Parameter

Always present

Note

    id_basket

yes  (if there exists at least

one record)

id of basket present in DB

    id_catalog

yes  (if there exists at least

one record)

id of catalog that contains the product

    catalog_name

yes  (if there exists at least

one record)

Name of catalog

  id_supplier

yes  (if there exists at least

one record)

id supplier

  speed_shipping

yes  (if there exists at least

one record)

Shows the speed of preparation of supplier

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

    id_product

yes  (if there exists at least

one record)

id product that is added to the basket

    reference

yes  (if there exists at least

one record)

Qty requested

    product_name

yes  (if there exists at least

one record)

News qty available in the warehouse after reserving this product

    ean

yes  (if there exists at least

one record)

Codic EAN

    weight

yes  (if there exists at least

one record)

Weight

    qty_reserved

yes  (if there exists at least

one record)

Qty reserved

    retail_price

yes  (if there exists at least

one record)

Retail price

    discount

yes  (if there exists at least

one record)

Discount

    price

yes  (if there exists at least

one record)

Sales price

    extra_discount

yes  (if there exists at least

one record)

Extra discount if meet requirements of

extra_discount_threshold_value

    net_price

yes  (if there exists at least

one record)

Sales price after extra discount. This value is at least the same of  price, even if  extra_discount = 0

    user_id_order

yes  (if there exists at least

one record)

id order final customer

    user_id_user

yes  (if there exists at least

one record)

id_client added from the partner store

    user_company_name

yes  (if there exists at least

one record)

Personal title final customer (Mr., Ms., etc..  )

    user_first_name

yes  (if there exists at least

one record)

First name final customer

    user_last_name

yes  (if there exists at least

one record)

Last name final customer

    user_address

yes  (if there exists at least

one record)

Address final customer

    user_city

yes  (if there exists at least

one record)

City final customer

    user_country

yes  (if there exists at least

one record)

Province of final customer

    user_zipcode

yes  (if there exists at least

one record)

ZIP code final customer

    user_state

yes  (if there exists at least

one record)

Country of final customer

    user_mobile

yes  (if there exists at least

one record)

Mobile final customer

    user_mail

yes  (if there exists at least

one record)

Email final customer

    user_retail_price

yes  (if there exists at least

one record)

Retail price final customer

    user_discount

yes  (if there exists at least

one record)

Discount final customer

    user_price

yes  (if there exists at least

one record)

Sales price final customer

    user_cod

yes  (if there exists at least

one record)

Payment in COD (cod: Cache on Delivery ). Two values are possible:

  • 1 - Yes
  • 0 - No

Default : 0

    user_note

yes  (if there exists at least

one record)

Note added from the final customer

    internal_note

yes  (if there exists at least

one record)

Note added from dropshipment partner




Json request structure


1. Json request structure for single items:


{

  "uid"         : "12345",

  "pid"         : "2",

  "lid"         : "1",

  "key”         : "VtKpudWnzRBioQeBKQXPBdSpamppUTw8",

  "api_version" : "1.0.0",

  "request"     : "get_basket_items",

  "id_basket"   : "10"

}



2. Json request structure for multiple items:


{

  "uid"         : "12345",

  "pid"         : "2",

  "lid"         : "1",

  "key”         : "VtKpudWnzRBioQeBKQXPBdSpamppUTw8",

  "api_version" : "1.0.0",

  "request"     : "get_basket_items",

  "id_basket"   : "1;2;3"

}


3. Json request structure for all items present in basket:


{

  "uid"         : "12345",

  "pid"         : "2",

  "lid"         : "1",

  "key”         : "VtKpudWnzRBioQeBKQXPBdSpamppUTw8",

  "api_version" : "1.0.0",

  "request"     : "get_basket_items",

  "id_basket"   : "*"

}



Example of php request:



$data = array(


               "uid"             => 12345,

               "pid"             => 2,

               "lid"             => 1,

               "key"             => "VtKpudWnzRBioQeBKQXPBdSpamppUTw8",

               "api_version"     => "1.0.0",

               "request"         => "get_basket_items",

               "id_basket"       => "1;2;3"


);



$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 la risposta alla chiamata

echo $ce;

curl_close($ch);







Json result structure



Example of a positive response type 1


{

   "success":true,

   "rc":0,

   "message":"",

   "items":[

      {

         "success":true,

         "rc":0,

         "message":"",

         "id_basket":3,

         "item":{

            "id_basket":"3",

            "id_catalog":"369",

            "id_supplier":"18",

            "speed_shipping":"1",

            "catalog_name":"BREIL",

            "id_product":"51788",

            "reference":"BW0052",

            "product_name":"BREIL Mod. LIBERTY lady 3H",

            "ean":"",

            "weight":"200",

            "qty_reserved":"11",

            "retail_price":"190.00",

            "discount":"70.00",

            "price":"57.00",

            "extra_discount":"30.00",

            "net_price":"39.90",

            "user_id_order":"22",

            "user_id_user":"33",

            "user_company_name":"Mr.",

            "user_first_name":"Arabella",

            "user_last_name":"Palermo",

            "user_address":"Bayreuther Strasse 14",

            "user_city":"Offenbach",

            "user_country":"am",

            "user_zipcode":"63073",

            "user_state":"Germany",

            "user_phone":"069 82 66 04",

            "user_mobile":"069 82 66 07",

            "user_mail":"ArabellaPalermo@dayrep.de",

            "user_retail_price":"1000.00",

            "user_discount":"50.30",

            "user_price":"497.00",

            "user_cod":1,

            "user_note":"dGVzdG8gY2xpZW50ZQ==",

            "internal_note":"dGVzdG8gZXNlcmNlbnRl"

         }

      }

   ]

}



Example of negative response type 1 error


{

   "success":false,

   "rc":-11,

   "message":"One or more errors occurred while processing your request",

   "items":[

      {

         "success":false,

         "rc":-12,

         "message":"id_basket 13 not found",

         "id_basket":13,

         "item":null

      }

   ]

}




Example of a positive response type 2


{

   "success":true,

   "rc":0,

   "message":"",

   "items":[

      {

         "success":true,

         "rc":0,

         "message":"",

         "id_basket":3,

         "item":{

            "id_basket":"3",

            "id_catalog":"369",

            "catalog_name":"BREIL",

            "id_supplier":"18",

            "speed_shipping":"1",

            "id_product":"51788",

            "reference":"BW0052",

            "product_name":"BREIL Mod. LIBERTY lady 3H",

            "ean":"",

            "weight":"200",

            "qty_reserved":"11",

            "retail_price":"190.00",

            "discount":"70.00",

            "price":"57.00",

            "extra_discount":"30.00",

            "net_price":"39.90",

            "user_id_order":"22",

            "user_id_user":"33",

            "user_company_name":"Mr.",

            "user_first_name":"Arabella",

            "user_last_name":"Palermo",

            "user_address":"Bayreuther Strasse 14",

            "user_city":"Offenbach",

            "user_country":"am",

            "user_zipcode":"63073",

            "user_state":"Germany",

            "user_phone":"069 82 66 04",

            "user_mobile":"069 82 66 07",

            "user_mail":"ArabellaPalermo@dayrep.de",

            "user_retail_price":"1000.00",

            "user_discount":"50.30",

            "user_price":"497.00",

            "user_cod":1,

            "user_note":"dGVzdG8gY2xpZW50ZQ==",

            "internal_note":"dGVzdG8gZXNlcmNlbnRl"

         }

      },

      {

         "success":true,

         "rc":0,

         "message":"",

         "id_basket":4,

         "item":{

            "id_basket":"4",

            "id_catalog":"589",

            "catalog_name":"BINO",

            "id_supplier":"18",

            "speed_shipping":"1",

            "id_product":"104898",

            "reference":"25408AA",

            "product_name":"BINO MULTIF. LCD",

            "ean":"",

            "weight":"200",

            "qty_reserved":"1",

            "retail_price":"18.00",

            "discount":"75.00",

            "price":"4.50",

            "extra_discount":"30.00",

            "net_price":"3.15",

            "user_id_order":"22",

            "user_id_user":"33",

            "user_company_name":"Ms",

            "user_first_name":"Matilda",

            "user_last_name":"Dale",

            "user_address":"10 Horner Street",

            "user_city":"Akron",

            "user_country":"OH",

            "user_zipcode":"44307",

            "user_state":"United States",

            "user_phone":"330-977-0601",

            "user_mobile":"330-977-0602",

            "user_mail":"MatildaDale@rhyta.com",

            "user_retail_price":"1000.00",

            "user_discount":"50.30",

            "user_price":"497.00",

            "user_cod":1,

            "user_note":"dGVzdG8gY2xpZW50ZQ==",

            "internal_note":"dGVzdG8gZXNlcmNlbnRl"

         }

      }

   ]

}



Example of negative results type 2 error


{

   "success":false,

   "rc":-11,

   "message":"One or more errors occurred while processing your request",

   "items":[

      {

         "success":false,

         "rc":-12,

         "message":"id_basket 2 not found",

         "id_basket":2,

         "item":null

      },

      {

         "success":true,

         "rc":0,

         "message":"",

         "id_basket":3,

         "item":{

            "id_basket":"3",

            "id_catalog":"369",

            "catalog_name":"BREIL",

            "id_supplier":"18",

            "speed_shipping":"1",

            "id_product":"51788",

            "reference":"BW0052",

            "product_name":"BREIL Mod. LIBERTY lady 3H",

            "ean":"",

            "weight":"200",

            "qty_reserved":"11",

            "retail_price":"190.00",

            "discount":"70.00",

            "price":"57.00",

            "extra_discount":"30.00",

            "net_price":"39.90",

            "user_id_order":"22",

            "user_id_user":"33",

            "user_company_name":"Mr.",

            "user_first_name":"Arabella",

            "user_last_name":"Palermo",

            "user_address":"Bayreuther Strasse 14",

            "user_city":"Offenbach",

            "user_country":"am",

            "user_zipcode":"63073",

            "user_state":"Germany",

            "user_phone":"069 82 66 04",

            "user_mobile":"069 82 66 07",

            "user_mail":"ArabellaPalermo@dayrep.de",

            "user_retail_price":"1000.00",

            "user_discount":"50.30",

            "user_price":"497.00",

            "user_cod":1,

            "user_note":"dGVzdG8gY2xpZW50ZQ==",

            "internal_note":"dGVzdG8gZXNlcmNlbnRl"

         }

      }

   ]

}



Different compared to the requests of type 1 and 2, requests of type 3 will not have any error message.

In the case of an empty basket, field num_rows will have a result of '0' and sub-array items = 0.

Naturally also requests of type 3 will be subject to systemic errors such as error -2 or -4.


Example of a positive type 3 request


{

   "success":true,

   "rc":0,

   "message":"",

   "id_basket":"*",

   "num_rows":3,

   "items":[

      {

         "id_basket":"3",

         "id_catalog":"369",

         "catalog_name":"BREIL",

         "id_supplier":"18",

         "speed_shipping":"1",

         "id_product":"51788",

         "reference":"BW0052",

         "product_name":"BREIL Mod. LIBERTY lady 3H",

         "ean":"",

         "weight":"200",

         "qty_reserved":"11",

         "retail_price":"190.00",

         "discount":"70.00",

         "price":"57.00",

         "extra_discount":"30.00",

         "net_price":"39.90",

         "user_id_order":"22",

         "user_id_user":"33",

         "user_company_name":"Mr.",

         "user_first_name":"Arabella",

         "user_last_name":"Palermo",

         "user_address":"Bayreuther Strasse 14",

         "user_city":"Offenbach",

         "user_country":"am",

         "user_zipcode":"63073",

         "user_state":"Germany",

         "user_phone":"069 82 66 04",

         "user_mobile":"069 82 66 07",

         "user_mail":"ArabellaPalermo@dayrep.de",

         "user_retail_price":"1000.00",

         "user_discount":"50.30",

         "user_price":"497.00",

         "user_cod":1,

         "user_note":"dGVzdG8gY2xpZW50ZQ==",

         "internal_note":"dGVzdG8gZXNlcmNlbnRl"

      },

      {

         "id_basket":"4",

         "id_catalog":"589",

         "catalog_name":"BINO",

         "id_supplier":"18",

         "speed_shipping":"1",

         "id_product":"104898",

         "reference":"25408AA",

         "product_name":"BINO MULTIF. LCD",

         "ean":"",

         "weight":"200",

         "qty_reserved":"1",

         "retail_price":"18.00",

         "discount":"75.00",

         "price":"4.50",

         "extra_discount":"30.00",

         "net_price":"3.15",

         "user_id_order":"22",

         "user_id_user":"33",

         "user_company_name":"Ms",

         "user_first_name":"Matilda",

         "user_last_name":"Dale",

         "user_address":"10 Horner Street",

         "user_city":"Akron",

         "user_country":"OH",

         "user_zipcode":"44307",

         "user_state":"United States",

         "user_phone":"330-977-0601",

         "user_mobile":"330-977-0602",

         "user_mail":"MatildaDale@rhyta.com",

         "user_retail_price":"1000.00",

         "user_discount":"50.30",

         "user_price":"497.00",

         "user_cod":1,

         "user_note":"dGVzdG8gY2xpZW50ZQ==",

         "internal_note":"dGVzdG8gZXNlcmNlbnRl"

      },

      {

         "id_basket":"5",

         "id_catalog":"589",

         "catalog_name":"BINO",

         "id_supplier":"18",

         "speed_shipping":"1",

         "id_product":"104903",

         "reference":"26544AA",

         "product_name":"SV. BINO LCD",

         "ean":"1234567890",

         "weight":"200",

         "qty_reserved":"14",

         "retail_price":"15.00",

         "discount":"75.00",

         "price":"3.75",

         "extra_discount":"30.00",

         "net_price":"2.63",

         "user_id_order":"22",

         "user_id_user":"33",

         "user_company_name":"Mr.",

         "user_first_name":"Arabella",

         "user_last_name":"Palermo",

         "user_address":"Bayreuther Strasse 14",

         "user_city":"Offenbach",

         "user_country":"am",

         "user_zipcode":"63073",

         "user_state":"Germany",

         "user_phone":"069 82 66 04",

         "user_mobile":"069 82 66 07",

         "user_mail":"ArabellaPalermo@dayrep.de",

         "user_retail_price":"1000.00",

         "user_discount":"50.30",

         "user_price":"497.00",

         "user_cod":1,

         "user_note":"dGVzdG8gY2xpZW50ZQ==",

         "internal_note":"dGVzdG8gZXNlcmNlbnRl"

      }

   ]

}




Example of a type 3 request without any itmes


{

   "success":true,

   "rc":0,

   "message":"",

   "id_basket":"*",

   "num_rows":0,

   "items":null

}



















       

Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator