Method GetUtilitiesAccount

Summary

Returns information about a utilities account

Remarks

This service returns the utility customer’s account information and settings.

It requires the customer and location number to return the information for, which can be retrieved by using the Account Search services.

The information available is:

Common uses:

Input Parameters

NameTypeLengthDescription
customerNumber numeric 9 [Required] Customer Number. See Account Search methods.
locationNumber numeric 9 [Required] Location Number. See Account Search methods.

Example

GET http://localhost/FusionServices/v2/Naviline/Utilities/{CustomerNumber}/{LocationNumber}

Return Values

NameDescription
CustomerName Customer name, in format: Last, First
LocationAddress Street address
LocationCity City
LocationState State
LocationZip Zip code
AmountDue Total Amount due
PendingAmount Amount that has been received, but not yet paid
AmountDueWithoutPending Adjusted Amount due. (Amount due – Pending amount)
PendingMiscCharges Charges that will be due, but not yet charged to the account. Example: bank fees assesed for processing payment
AmountDueWithoutPendingAndMiscCharges Amount due before any pending charges are added on.
DelinquentAmount Amount currently past due
DueDateOfLastBill Date when last bill is due. Format: mmddyyyy
CutoffDate Date services will be turned off if bill is not paid. Format: mmddyyyy
LastPaymentAmount Amount of last payment received. This should normally have a minus sign (-) at the end indicating it was credited to the account
LastPaymentDate Date the last payment was received. Format: mmddyyyy
LastBillAmount Amount due on last bill
LastBillDate Date the last bill was issued. Format: mmddyyyy
PendingPayment Payment Amount that has been received, but not yet paid
LastBillCharge Amount of overdue fees applied to last bill
Telephone Customer’s phone number
AccountStatusCode Code to indicate the account’s current statusThe account status codes and their descriptions are: A = Active, C = Collections, D = Deleted, F = Finalled, I = Inactive, S = Shutoff, T = Terminated, N = Terminated (non-payment), V = Vacation, W = Writeoff
AccountStatusDescription The description of what the account status code means.
CustomerTypeCode Code to indicate if this is a residential or non-residential (commercial) customer. RESDNT=Residential, NONRES=Non-Residential
CustomerTypeDescription The description of what the customer type code means.
CashOnly Indicates that only cash payments will be accepted for this customer. Y=Yes, N=No
AutoPayCode Current auto pay setting. Default is empty. Null/empty/N = not enabled, C=Checking, R=Credit Card, S=Savings
AutoPayDescription The description of what the auto pay code means. Normally this is the type of account being used.
PaperlessBilling The current paperless billing setting. Choices: eBill, paper, both. 1=eBill only, 2=Both eBill and paper, Else=paper only
EMail The customer’s email used for paperless billing. It will only be set if the paperless billing option is set to eBill only or Both eBill and paper.

Sample Responses

Sample Code

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

public void MethodName(parms)
{
    string uri = "http://localhost/FusionServices/v2/Naviline/Utilities/27211/9258";
    WebClient wc = new WebClient();
    wc.Headers.Set("X-APPID", "YOURID");
    wc.Headers.Set("X-APPKEY", "YOURKEY");
    string stringResult = wc.DownloadString(new Uri(uri));
    
    JObject response = JObject.Parse(stringResult);
    string error = response["OutputParms"]["ErrorCode"].ToString();
    if (error == "0000")
    {
         // TODO - YOUR CODE HERE
    }
}

$.get('http://localhost/FusionServices/v2/Naviline/Utilities/27211/9258', function(response) {
    $('#resultDiv).html(response); 
 });

C# Razor MVC Sample Code

using System;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Collections.Specialized;
using FusionServiceHelper.Models;

// NOTE: Use the namespace generated when you add the class, so that it is correct.
namespace FusionRazor.Models
{
   public class GetUtilitiesAccount
   {
       // Add property for each input param in order to map a field to it
       [Required(ErrorMessage = "Required")]
       [RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
       public string customerNumber{get; set;}

       [Required(ErrorMessage = "Required")]
       [RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
       public string locationNumber{get; set;}

       public GetUtilitiesAccount()
       {
           //Set any defaults here
           customerNumber = DefaultData.Get("customerNumber");
           locationNumber = DefaultData.Get("locationNumber");
       }
   }
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the GetUtilitiesAccount class. *@
@* NOTE: Select Edit as the Scaffold template. *@
@* NOTE: Use the @model line that is generated at the top.  Replace the rest with the lines below.
@model FusionRazor.Models.GetUtilitiesAccount

@{
   ViewBag.Title = "GetUtilitiesAccount";
   string myUrl = "http://localhost/FusionServices/v2/Naviline/Utilities/" + Model.CustomerNumber + "/" + Model.LocationNumber;
}

<h2>GetUtilitiesAccount</h2>
@using (Html.BeginForm()) {
   @Html.AntiForgeryToken()
   @Html.ValidationSummary(true)
   <fieldset>
   <legend>GetUtilitiesAccount</legend>
       <div class="editor-label">Use the fields below to change the values and resubmit.</div>
       <div class="editor-label">
           @Html.LabelFor(model => model.customerNumber)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.customerNumber)
           @Html.ValidationMessageFor(model => model.customerNumber)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.locationNumber)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.locationNumber)
           @Html.ValidationMessageFor(model => model.locationNumber)
       </div>
       <p>
       <input type="submit" value="Submit"/>
       </p>
   </fieldset>

}

@section Scripts {
   @Scripts.Render("~/bundles/jqueryval")
}
using System;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FusionServiceHelper.Models;

// NOTE: Replace 'MyController' with the name of your controller.

// 
// GET: /MyController/GetUtilitiesAccount
public ActionResult GetUtilitiesAccount()
{
   // Create a new instance of the model to pick up any default values.
   GetUtilitiesAccount model =  new GetUtilitiesAccount();

   // pass model to set to default values
   // NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
   return View("~/Views/MyFolderPath/GetUtilitiesAccount.cshtml", model);
}

// 
// POST: /MyController/GetUtilitiesAccount
[HttpPost]
public ActionResult GetUtilitiesAccount(FormCollection collection)
{
   string url = "v2/Naviline/Utilities/{CustomerNumber}/{LocationNumber}";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("customerNumber", collection["customerNumber"]);
   inputParms.Add("locationNumber", collection["locationNumber"]);

   try
   {
       // Send the request
       FusionServiceRequest request = new FusionServiceRequest();
       FusionServiceResult result = request.Get(url, inputParms);

       return View("Result", result);
   }
   catch(Exception e)
   {
       HandleErrorInfo info = new HandleErrorInfo(e, "MyController", "GetUtilitiesAccount");
       return View("Error", info);
   }
}