How to add suppliers via API?

Post: http://www.namedoseusite.com.br/api_products_others.php?action=add_suppliers




Header Parameter format
Usuario1 base64_encode ()
password1 base64_encode ()




Parameter format description
suppliers_group_name json

Main Name of Suppliers
Format: Varchar (255)
* Field Required

suppliers_descript json Description of Suppliers
Format: Text
* Field Required

php sample

 // sample add suppliers

$ URL = $ tabain_url. ' /API_Products_Ors.php? Action = add_suppliers ' ;;

$ data = array ("suppliers_group_name" = & gt; "Main name of suppliers", // main name of suppliers * Field Required
"suppliers_description" = & gt; "Description of Suppliers" // Description of Suppliers * 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 Add Suppliers EOF

Return Error:

Code
Message

Return Success:

code
ID
Message

Leave a Reply 0