update_user_order
This request allows you to edit the shipment addres and other data BEFORE the order has been processed by the logistics - before the second phase.
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 request |
id_order |
yes |
Id order for modification |
user_id_order |
no |
Id order partner |
user_id_user |
no |
Id partner |
user_company_name |
no |
Title of person (Mr, Ms, etc) |
user_first_name |
no |
First name |
user_last_name |
no |
Last name |
user_address |
no |
Address |
user_city |
no |
City |
no |
Country. You can only use the values contained into the field COD of get_shipping_country message |
|
user_zipcode |
no |
ZIP code |
user_state |
no |
Province |
user_phone |
no |
Telephone |
user_mobile |
no |
Mobile |
user_mail |
no |
|
user_retail_price |
no |
Sales price |
user_discount |
no |
Discount client |
user_price |
no |
Final sales price |
user_cod |
no |
Payment by COD (cod: Cache on Delivery ). Two values are possible:
Default : 0 |
user_note |
no |
Note of client |
Reply parameters:
Parameter |
Always present |
Note |
success |
yes |
true o false, indicates if the operation has been fully completed or not. |
rc |
yes |
return code. |
message |
yes |
Error message |
This are the possible error messages:
- -2 Access Denied
- -4 Fatal Error: There was an internal Error. Please retry or contact webmaster@wwt.it
- -16 id_order {0} not found
- -20 user_cod must be 0 or 1
- -27 Invalid Country. Use one of the values available into the field COD (int) of get_shipping_country message
Json request structure:
{ "uid" : "12345", "pid" : "2", "lid" : "1", "key” : "VtKpudWnzRBioQeBKQXPBdSpamppUTw8", "api_version" : "1.0.0", "request": "update_user_order", "id_order": 5, "user_id_order": 1, "user_id_user": 1, "user_company_name": "1Mr.", "user_first_name": "Arabella", "user_last_name": "Palermo", "user_address": "Bayreuther Strasse 14", "user_city": "Offenbach", "user_country": 12, "user_zipcode": "163073", "user_state": "Germany", "user_phone": "069 82 66 04", "user_mobile": "069 82 66 07", "user_mail": "ArabellaPalermo@dayrep.de", "user_retail_price": 1000, "user_discount": 150.3, "user_price": 1497, "user_cod": 1, "user_note": "dGVzdG8gY2xpZW50ZQ==" } |
Example php call:
$data = array( "uid" => 12345, "pid" => 2, "lid" => 1, "key" => "VtKpudWnzRBioQeBKQXPBdSpamppUTw8", "api_version" => "1.0.0", "request" => "update_user_order", "id_order" => 5, 'user_id_order' => 1, 'user_id_user' => 1, 'user_company_name' => '1Mr.', 'user_first_name' => 'Arabella', 'user_last_name' => 'Palermo', 'user_address' => 'Bayreuther Strasse 14', 'user_city' => 'Offenbach', 'user_country' => 12, 'user_zipcode' => '163073', 'user_state' => '', 'user_phone' => '069 82 66 04', 'user_mobile' => '069 82 66 07', 'user_mail' => 'ArabellaPalermo@dayrep.de', 'user_retail_price' => 1000, 'user_discount' => 150.30, 'user_price' => 1497, 'user_cod' => 1, 'user_note' => base64_encode ( 'testo cliente' ) ); $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 call response echo $ce; curl_close($ch); |
Example of positive response
{ "success": true, "rc": 0, "message": "" } |
Example of negative response
{ "success": false, "rc": -16, "message": "id_order 500 not found" } |
Created with the Personal Edition of HelpNDoc: Full-featured EBook editor