empty_basket
This request removes ALL the times from the API basket and put the items back in the warehouse stock.
Call parameters:
Parameter |
Required |
Note |
uid |
yes |
Id client |
pid |
yes |
Id Portal |
lid |
yes |
id Language |
key |
yes |
Code of authetication |
api_version |
yes |
Version API. |
request |
yes |
Name of request |
id_basket |
yes |
Id of basket |
Reply parameters:
This result will be devided in two parts:
- General part which determines whether the entire process of data entry into the basket went well
- Details: which shows the outcomes of every request, including the inclusion into the DB. These results will be encapsulated in the parent node "items"
Reply parameter - general part
Parameter |
Always present |
Note |
success |
yes |
true o false, indicate if operation has been completed or not |
rc |
yes |
return code. |
message |
yes |
Error message |
Items |
yes ( if rc != -4) |
Root of tree itmes |
This part can have the following error messages:
- -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.
- -14 Unable to proceed. User does not have permission to perform this action
in the situation of error -2 or -4, there will not be the fields ITEMS and details of every item.
Reply parameter - detailed part
Parameter |
Always present |
Note |
success |
yes |
true o false, indicates if request has been completed with success of not |
rc |
yes |
return code. |
message |
yes |
Error message |
id_basket
|
yes |
Indicated the Id of API basket This contains only a number when there is at least 1 product in the basket |
This part can have the following error messages:
- -4 Fatal Error: There was an internal Error. Please retry or contact webmaster@wwt.it
- -12 id_basket {0} not found. No change has been made
Json request structure:
{ "uid" : "12345", "pid" : "2", "lid" : "1", "key” : "VtKpudWnzRBioQeBKQXPBdSpamppUTw8", "api_version" : "1.0.0", "request" : "empty_basket" } |
Example of a php request:
$data = array( "uid" => 12345, "pid" => 2, "lid" => 1, "key" => "VtKpudWnzRBioQeBKQXPBdSpamppUTw8", "api_version" => "1.0.0", "request" => "empty_basket" ); $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); |
Example of a positive response:
{ "success": true, "rc": 0, "message": "", "num_rows": 3, "items": [{ "success": true, "rc": 0, "message": "", "id_basket": "85" }, { "success": true, "rc": 0, "message": "", "id_basket": "86" }, { "success": true, "rc": 0, "message": "", "id_basket": "87" }] } |
Example of a negative response:
{ "success": false, "rc": -11, "message": "One or more errors occurred while processing your request.", "num_rows": 3, "items": [{ "success": true, "rc": 0, "message": "", "id_basket": "85" }, { "success": true, "rc": 0, "message": "", "id_basket": "86" }, { "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: Create help files for the Qt Help Framework