update_order_status


This request provide the update of the order status.


There are two possible outcomes:


Order_status = 0

  • The order is New.
  • The logistics don't see the order
  • It is possible to change the shipment address or other data before the logistics completes the order


Order_status = 1

  • The order has the status Ready.
  • The logistics can see the order
  • It is possible to change the shipment address or other BUT after the logistics acknowledgement  to prevent possible problems.


Order_status = 2

  • The order has the status Logistic Locked.
  • Logistics has exclusive order control and places it in the works.
  • Shipment address and other data can not be changed anymore
  • The order status can not be changed
  • The following information is presented: Name of courier and tracking number



Order_status = 3

  • The order has the status Order Shipped
  • The end user data can not be modified
  • The state is no longer editable
  • Carrier and its tracking number are inserted into order.


Order_status = 4

  • The order has the status Order Shipped with Zero Items
  • The end user data can not be modified
  • The state is no longer editable
  • This status indicates that the order is not evadibile


The order status has no influence on the main store, this means after confirming the order with the checkout from the basket the logistics will proceed and will take responsibility to complete the order, including changing the order status to FINAL - Shipped. Also the billing of the products will be seperate and regardless of the order status.



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 the request

id_order

yes

id of order

order_status

yes

New status of order

shipping_company

yes: if order_status = 1 and you do not have turnkey subscription

no: if order status = 0 or you have turnkey subscription

Insert the cod value obtained by calling get_shipping_company

Is mandatory if order_status call is put at 1 (Ready) and you do not have turnkey subscription



Result 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


The following error messages can be presented:

  • -2  Access Denied
  • -4  Fatal Error: There was an internal Error. Please retry or contact webmaster@wwt.it
  • -16 id_order {0} not found
  • -17 Order status > 1. Change is forbidden
  • -18 Allowed values are 0 and 1
  • -21 Order status can not be decremented
  • -28 Invalid Country. Call the message update_user_order and change the user_country field using one of the vaslues 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_order_status",

  "id_order"    : 5,

  "order_status": 1,

  "shipping_company"  : "FEDEX"

}



Example of php request:



$data = array(


               "uid"             => 12345,

               "pid"             => 2,

               "lid"             => 1,

               "key"             => "VtKpudWnzRBioQeBKQXPBdSpamppUTw8",

               "api_version"     => "1.0.0",

               "request"         => "update_order_status",

               "id_order"        => 500,

               'order_status'    => 1,

            'shipping_company'=> "FEDEX"

);




$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": ""

}



Example of a negative response


{

    "success": false,

    "rc": -16,

    "message": "id_order 500 not found"

}





















Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator