Delivery Charge Get DeliveryCharge by passing required parameter.
Key | Value |
---|---|
URL | https://api.ovvihq.com/OnlineOrder/DeliveryCharge |
APIKey | Provided by OVVI |
- public string GetDeliveryCharge()
- {
- get
- {
- string strResult = string.Empty;
- try
- {
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://api.ovvihq.com/OnlineOrder/DeliveryCharge");
- request.ContentType = "application/json";
- request.Method = "GET";
- request.Headers.Add("APIKey", "Provided by OVVI");
- // Set some reasonable limits on resources used by this request
- request.ContentLength = 0;
- // Set credentials to use for this request.
- request.Credentials = CredentialCache.DefaultCredentials;
- HttpWebResponse response = (HttpWebResponse)request.GetResponse();
- // Get the stream associated with the response.
- Stream receiveStream = response.GetResponseStream();
- // Pipes the stream to a higher level stream reader with the required encoding format.
- StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
- strResult = readStream.ReadToEnd().ToString();
- response.Close();
- readStream.Close();
- return strResult;
- }
- catch (Exception ex)
- {
- strResult = Convert.ToString(ex.Message);
- return strResult;
- }
- }
- }
- 1) .If there is Fixed Delivery charge.
- <DeliveryCharge>
- <Name> Delivery Fee </Name>
- <Amount> 2.50 </Amount>
- </DeliveryCharge>
- 2) . If there is Delivery charge by distance.
- <DeliveryChargeByDistance>
- <Rules>
- <Name> RULE 1 </Name>
- <FromDistance> 0.00 </FromDistance>
- <ToDistance> 3.00 </ToDistance>
- <Amount> 0.00 </Amount>
- </Rules>
- <Rules>
- <Name> RULE 2 </Name>
- <FromDistance> 4.00 </FromDistance>
- <ToDistance> 10000.00 </ToDistance>
- <Amount> 5.00 </Amount>
- </Rules>
- </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. |