How to edit the amount of products via API?
Post: http://www.namedoseusite.com.br/api_products_edit.php?action=UPDATE_Products_quantity
Header Parameter | format |
Usuario1 | base64_encode () |
password1 | base64_encode () |
Parameter | format | description |
Products_id | json |
Product ID |
Products_quantity | json | Example: 250 Only Number is Required Format: int (4) * Field Required |
php sample
// sample edit products quantity$ URL = $ tabain_url. ' /api_products_edit.php? Action = Update_Products_quantity ' ;;
$ data = array ("Products_id" = & gt; "442", // Product ID (Only Number Is Required) * Field Required
"Products_quantity" = & gt; "250" // Example: 250 (Only Number Is Required) * Field Required
);$ data_string = json_encode ($ date);
$ CH = curl_init ($ URL);
Curl_Setopt ($ CH, curlopt_customrequest, "post");
Curl_Setopt ($ CH, Curlopt_postFields, $ Data_String);
Curl_Setopt ($ CH, Curlopt_Returntransfer, True);
curl_setopt ($ CH, curlopt_ssl_verifypeer, false);
Curl_Setopt ($ CH, Curlopt_httpheader, Array (
' CONTENT-TYPE: Application/JSON ',
"Cache-Control: No-Cache",
' Usuario1: ' . base64_encode ($ Usuario1),
' password1: ' . base64_encode ($ password1),
' CONTENT-LENGTH: ' . Strlen ($ data_string)))
);$ result = curl_exec ($ CH);
Curl_Close ($ CH);print_r ($ result);
// Sample Edit Products Quantity Eof
Return Error:
Code
MessageReturn Success:
code
Products_quantity
Products_id
Message