update_bundle


This call allows to add or remove products to the bundle.

If during bundle changes, shipping_item id remain the same, all changes to bundle linked address remain valid.

If the shipping_item id changes, the new reference address overwrite the existing one and all changes to bundle linked address will be lost.



Call parameters:


Parameter

Required

Note

uid

yes

Id client

pid

yes

Id Portal

lid

yes

id Language

key

yes

Autentication Code

api_version  

yes

API Version.

request

yes

Name of function requested

items

yes

List of id_basket to be included in the bundle.

shipping_item

yes

id_basket product that will be used as the main shipping address.

This value must be selected only inside the items list.



Reply parameters:


Parameter

Always present

Note

success

si

true o false, indicate if operation has been completed or not

rc

si

return code.

message

si

Error Message


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
  • -6  Field [items|shipping_item] si mandatory
  • -12 id_basket [id_basket] not found
  • -14 Unable to proceed. User does not have permission to perform this action
  • -29 The Bundle specified does not exist
  • -30 Unable to find basket product into the bundle. Please check if they were removed from another interface/call or contact webmaster@wwt.it
  • -34 A bundle must be composed of at least 2 items.
  • -35 shipping_item must be in the items list
  • -36 The following items cannot be used into this bundle: [items]



Json request structure:


{

    "uid": 12345,

    "pid": 2,

    "lid": 1,

    "key": "VtKpudWnzRBioQeBKQXPBdSpamppUTw8",

    "api_version": "1.0.0",

    "request": "update_bundle",

    "bundle": "A",

    "items": "1;2;3",

    "shipping_item" => "1"

}



Example php call:



$data = array(

    "uid"           => 12345,

    "pid"           => 2,

    "lid"           => 1,

    "key"           => "VtKpudWnzRBioQeBKQXPBdSpamppUTw8",

    "api_version"   => "1.0.0",

    "request"       => "update_bundle",

    "bundle"        => "A",

    "items"         => "1;2;3",

    "shipping_item" => 1

);



$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);


echo $ce;


curl_close($ch);





Example of a positive response:


{

   "success":true,

   "rc":0,

   "message":""

}



Example of negative response:


{

   "success":false,

   "rc":-36,

   "message":"The following items cannot be used into this bundle: 1,2"

}

































































Created with the Personal Edition of HelpNDoc: Create iPhone web-based documentation