Delivery Charge Get DeliveryCharge by passing required parameter.

Delivery Charge
Key Value
URL https://api.ovvihq.com/OnlineOrder/DeliveryCharge
APIKey Provided by OVVI
                                    
  1. public string GetDeliveryCharge()
  2. {
  3. get
  4. {
  5. string strResult = string.Empty;
  6. try
  7. {
  8. HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://api.ovvihq.com/OnlineOrder/DeliveryCharge");
  9. request.ContentType = "application/json";

  10. request.Method = "GET";
  11. request.Headers.Add("APIKey", "Provided by OVVI");
  12. // Set some reasonable limits on resources used by this request
  13. request.ContentLength = 0;
  14. // Set credentials to use for this request.
  15. request.Credentials = CredentialCache.DefaultCredentials;
  16. HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  17. // Get the stream associated with the response.
  18. Stream receiveStream = response.GetResponseStream();
  19. // Pipes the stream to a higher level stream reader with the required encoding format.
  20. StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
  21. strResult = readStream.ReadToEnd().ToString();
  22. response.Close();
  23. readStream.Close();
  24. return strResult;
  25. }
  26. catch (Exception ex)
  27. {
  28. strResult = Convert.ToString(ex.Message);
  29. return strResult;
  30. }
  31. }
  32. }
                                
  1. 1) .If there is Fixed Delivery charge.
  2. <DeliveryCharge>
  3. <Name> Delivery Fee </Name>
  4. <Amount> 2.50 </Amount>
  5. </DeliveryCharge>
  6. 2) . If there is Delivery charge by distance.
  7. <DeliveryChargeByDistance>
  8. <Rules>
  9. <Name> RULE 1 </Name>
  10. <FromDistance> 0.00 </FromDistance>
  11. <ToDistance> 3.00 </ToDistance>
  12. <Amount> 0.00 </Amount>
  13. </Rules>
  14. <Rules>
  15. <Name> RULE 2 </Name>
  16. <FromDistance> 4.00 </FromDistance>
  17. <ToDistance> 10000.00 </ToDistance>
  18. <Amount> 5.00 </Amount>
  19. </Rules>
  20. </DeliveryChargeByDistance>
Xml Node Description
DeliveryCharge
Name Delivery Charge name.
Amount Delivery charge amount.
DeliveryChargeByDistance
Rules There may be more then one rule for delivery charge.
Name Name of the rule.
FromDistance From Distance.
ToDistance To Distance
Amount Delivery charge amount.