Method PostCharge

Summary

Post Charge

Parameters

TypeDescription
System.Net.Http.Formatting.FormDataCollection x-www-form-urlencoded POST with the following: customerID=value&chargeCode=value&chargeDesc=value&chargeAmt=value&chargeComment=value&transDate=value&applCode=value&locationID=value&applID2=value

Example

POST http://localhost/FusionServices/v2/Naviline/MiscReceivables/Charge

Sample Responses

Sample Code

using System.Net;
using Newtonsoft.Json.Linq;

public void MethodName(parms)
{
   string uri = "http://localhost/FusionServices/v2/Naviline/MiscReceivables/Charge";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("customerID",System.Web.HttpUtility.UrlEncode("000000004"));
   postParms.Add("chargeCode",System.Web.HttpUtility.UrlEncode("ANPUC"));
   postParms.Add("chargeDesc",System.Web.HttpUtility.UrlEncode("ANIMAL PICKUP CAT"));
   postParms.Add("chargeAmt",System.Web.HttpUtility.UrlEncode("00000001700"));
   postParms.Add("chargeComment",System.Web.HttpUtility.UrlEncode("THIS IS A SCRATCHY JOB"));
   postParms.Add("transDate",System.Web.HttpUtility.UrlEncode("022819"));
   postParms.Add("applCode",System.Web.HttpUtility.UrlEncode(""));
   postParms.Add("locationID",System.Web.HttpUtility.UrlEncode("000000000"));
   postParms.Add("applID2",System.Web.HttpUtility.UrlEncode(""));

   WebClient req = new WebClient();
   wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
   wc.Headers.Set("X-APPID", "YOURID");
   wc.Headers.Set("X-APPKEY", "YOURKEY");

   byte[] responseBytes = wc.UploadValues(new Uri(uri), "POST", postParms);
   string stringResult = Encoding.UTF8.GetString(responseBytes); 
   JObject response = JObject.Parse(stringResult);
   string error = response["OutputParms"]["ErrorCode"].ToString();
   if (error == "0000")
   {
         // TODO - YOUR CODE HERE
   }
}