How to get the list of delivery ways via API?
URL: http://www.NamedosEusite.com.br/api_ds_orders.php?action=calculate_shipping&amntry= l.
Header Parameter | format |
token | base64_encode () |
Secret | base64_encode () |
base64_encode () |
Parameter | format | description |
country | get | Country Number Only Number is Required |
post_code | get | Delivery Post code is Required |
Products_id | json | use the api to list the order data to get the product_id format: int (11) |
Products_quantity | json | Quantity Number Only Number is Required |
Php Sample:
// sample calculate_shipping
$ URL = $ tabain_url. ' /api_ds_orders.php? Action = calculate_shipping & amp; country = ' $ _ get [' country ']. ' & amp; post_code = ' #39; post_code '];
$ Data_Products [0] = array ("Products_id" = & gt; $ _Get [' Products_id '], // Example: 130 (Only Number Is Required) * Field Required
"Products_quantity" = & gt; $ _Get [' Products_quantity '] // Example: 1 (Only Number is Required) * Field Required
);$ Data_Products [1] = Array ("Products_id" = & gt; $ _Get [' Products_id1 '], // Example: 130 (Only Number Is Required) * Field Required
"Products_quantity" = & gt; $ _Get [' Products_quantity1 '] // Example: 1 (Only Number is Required) * Field Required
);$ Data = array ("Products" = & gt; $ data_products // * 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",
' TOKEN: ' . base64_encode ($ token),
' Secret: ' . base64_encode ($ secret),
' E-mail: ' . base64_encode ($ email),
' CONTENT-LENGTH: ' . Strlen ($ data_string)))
);$ result = curl_exec ($ CH);
Curl_Close ($ CH);print_r ($ result);
// sample Calculate_Shipping EOF
return:
id
Text