HouseAccounts.svc
Calls
- GetHouseAccount - What is the general information for this House Account?
- GetHouseAccountCharges - What are the charges towards this House Account for a date range?
- GetHouseAccountPayments - What are the payments from this House Account for a date range?
- GetHouseAccounts - What are all the House Accounts for this location?
Sending a Request to HouseAccounts.svc
All calls to HouseAccounts.svc require the AccessToken and the LocationToken in the HTTP Web Request Headers of the request. The parameters for the request body of each call are outlined in the sections below.
HouseAccounts.svc Endpoint
Endpoint
https://{{server}}.brinkpos.net/HouseAccounts.svc
HTTP Web Request Headers
Header Name
Header Value
AccessToken
{{AccessToken}}
LocationToken
{{LocationToken}}
This call is to retrieve a HouseAccount object of the location.
GetHouseAccount Request
Data Name
Data Type
Data Description
AccountNumber
string?
Specify the account number of the HouseAccount you would like to retrieve. This can be null if Id is specified.
Id
int
Specify the Id of the HouseAccount you would like to retrieve. This can be null if AccountNumber is specified.
GetHouseAccount Response
Data Name
Data Type
Data Description
Message
string
Returns a Brink Error message if the request did not go through. Otherwise, this field will be null.
ResultCode
int
Returns one of the following:
- 0 = Request went through successfully
- 1 = Request returned an unknown error
- 2 = Request was not valid
- 3 = Server is currently unavailable and unable to receive the request
- 4 = Access Denied
HouseAccount Type
Data Name
Data Type
Data Description
Id
int
Unique Id of this HouseAccount
AccountNumber
string
Unique Account Number of this HouseAccount
Active
bool
True if House Account is active, False if not
Address1
string
Address for this HouseAccount
Address2
string
Address for this HouseAccount
Address3
string
Address for this HouseAccount
Address4
string
Address for this HouseAccount
Balance
decimal
Balance of this HouseAccount
City
string
City of this HouseAccount
EmailAddress
string
Email address for this HouseAccount
EnforceLimit
bool
True if value in the Limit field is enforced, False if not
FirstName
string
First name of the person who owns this HouseAccount
LastName
string
Last name of the person who owns this HouseAccount
Limit
decimal
Limit for this HouseAccount, or 0 if there is no limit
MiddleName
string
Middle name of the person who owns this HouseAcocunt
Name
string
Name of the person who owns this HouseAccount
PhoneNumber
string
Phone number for this HouseAccount
State
string
State of this HouseAccount
Zip
string
Zip code of this HouseAccount
This call is to retrieve an array of HouseAccountCharge objects for the location.
GetHouseAccountCharges Request
Data Name
Data Type
Data Description
EndDate
DateTime
Specify the end date to which you would like to see HouseAccountCharges made for this location
Id
int
Specify the Id of the House Account you would like to see HouseAccountCharges for. If left null, HouseAccountCharges will not be filtered by HouseAccount.
StartDate
DateTime
Specify the start date from which you would like to see HouseAccountCharges made for this location
GetHouseAccountCharges Response
Data Name
Data Type
Data Description
Message
string
Returns a Brink Error message if the request did not go through. Otherwise, this field will be null.
ResultCode
int
Returns one of the following:
- 0 = Request went through successfully
- 1 = Request returned an unknown error
- 2 = Request was not valid
- 3 = Server is currently unavailable and unable to receive the request
- 4 = Access Denied
Charges
Array of HouseAccountCharge
Charges within the date range for the location or for the house account specified
HouseAccountCharge Type
Data Name
Data Type
Data Description
Amount
decimal
Amount charged to the HouseAccount
TransactionTime
DateTime
Date and time of this HouseAccountCharge
This call is to retrieve an array of HouseAccountPayment objects for the location.
GetHouseAccountPayments Request
Data Name
Data Type
Data Description
Id
int
Specify the Id of the HouseAccount you would like to retrieve HouseAccountPayments for
GetHouseAccountPayments Response
Data Name
Data Type
Data Description
Message
string
Returns a Brink Error message if the request did not go through. Otherwise, this field will be null.
ResultCode
int
Returns one of the following:
- 0 = Request went through successfully
- 1 = Request returned an unknown error
- 2 = Request was not valid
- 3 = Server is currently unavailable and unable to receive the request
- 4 = Access Denied
HouseAccountPayment Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of this HouseAccountPayment
TransactionTime
DateTime
Date and time of this HouseAccountPayment
This call is to retrieve an array of HouseAccount objects for the location.
GetHouseAccounts Request
Data Name
Data Type
Data Description
Id
int
Specify the Id of the HouseAccount you would like to retrieve HouseAccounts for
GetHouseAccounts Response
Data Name
Data Type
Data Description
Message
string
Returns a Brink Error message if the request did not go through. Otherwise, this field will be null.
ResultCode
int
Returns one of the following:
- 0 = Request went through successfully
- 1 = Request returned an unknown error
- 2 = Request was not valid
- 3 = Server is currently unavailable and unable to receive the request
- 4 = Access Denied
GetHouseAccount Sample Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using HouseAccounts_GetHouseAccount.HouseAccountsServiceReference;
namespace HouseAccounts_GetHouseAccount
{
class Program
{
static void Main(string[] args)
{
//Connect to HouseAccounts service client
var client = new HouseAccountsWebServiceClient();
//Set security protocol to TLS 1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
using (var scope = new OperationContextScope(client.InnerChannel))
{
//Include tokens in HTTP Web Request Headers
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = @"AccessToken";
headers["LocationToken"] = @"LocationToken";
int accountId = 1;
string accountNumber = "1";
//Include either Id or AccountNumber parameter in request body
var request = new GetHouseAccountRequest()
{
Id = accountId,
//AccountNumber = accountNumber,
};
//Make GetHouseAccount call
var response = client.GetHouseAccount(request);
//If call is successful
if (response.ResultCode == 0)
{
//Read HouseAccount object returned
var account = response.Account;
Console.WriteLine("Id: " + account.Id)
Console.WriteLine("AccountNumber: " + account.AccountNumber);
Console.WriteLine("Name: " + account.Name);
Console.WriteLine("Active: " + account.Active);
Console.WriteLine("Balance: " + account.Balance);
Console.WriteLine("FirstName: " + account.FirstName);
Console.WriteLine("MiddleName: " + account.MiddleName);
Console.WriteLine("LastName: " + account.LastName);
Console.WriteLine("Address1: " + account.Address1);
Console.WriteLine("Address2: " + account.Address2);
Console.WriteLine("Address3: " + account.Address3);
Console.WriteLine("Address4: " + account.Address4);
Console.WriteLine("City: " + account.City);
Console.WriteLine("State: " + account.State);
Console.WriteLine("Zip: " + account.Zip);
Console.WriteLine("EmailAddress: " + account.EmailAddress);
Console.WriteLine("PhoneNumber: " + account.PhoneNumber);
Console.WriteLine("EnforceLimit: " + account.EnforceLimit);
Console.WriteLine("Limit: " + account.Limit);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetHouseAccountCharges Sample Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using HouseAccounts_GetHouseAccountCharges.HouseAccountsServiceReference;
namespace HouseAccounts_GetHouseAccountCharges
{
class Program
{
static void Main(string[] args)
{
//Connect to HouseAccounts service client
var client = new HouseAccountsWebServiceClient();
//Set security protocol to TLS 1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
using (var scope = new OperationContextScope(client.InnerChannel))
{
//Include tokens in HTTP Web Request Headers
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = @"AccessToken";
headers["LocationToken"] = @"LocationToken";
int accountId = 1;
DateTime startDate = new DateTime(2001, 01, 01);
DateTime endDate = new DateTime(2001, 01, 08);
//Include Id, StartDate, and EndDate parameters in request body
var request = new GetHouseAccountChargesRequest()
{
Id = accountId,
StartDate = startDate,
EndDate = endDate,
};
//Make GetHouseAccountCharges call
var response = client.GetHouseAccountCharges(request);
//If call is successful
if (response.ResultCode == 0)
{
if (response.Charges.Length > 0)
{
//Loop through collection of HouseAccountCharge objects returned
foreach (var charge in response.Charges)
{
Console.WriteLine("AccountId: " + charge.AccountId);
Console.WriteLine("Amount: " + charge.Amount);
Console.WriteLine("OrderId: " + charge.OrderId);
Console.WriteLine("PaymentId: " + charge.PaymentId);
Console.WriteLine("TransactionTime: " + charge.TransactionTime);
Console.WriteLine("---------------------------");
}
}
else
{
Console.WriteLine("No House Account Charges");
Console.WriteLine("---------------------------");
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetHouseAccountPayments Sample Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using HouseAccounts_GetHouseAccountPayments.HouseAccountsServiceReference;
namespace HouseAccounts_GetHouseAccountPayments
{
class Program
{
static void Main(string[] args)
{
//Connect to HouseAccounts service client
var client = new HouseAccountsWebServiceClient();
//Set security protocol to TLS 1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
using (var scope = new OperationContextScope(client.InnerChannel))
{
//Include tokens in HTTP Web Request Headers
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = @"AccessToken";
headers["LocationToken"] = @"LocationToken";
int accountId = 1;
//Include Id parameter in request body
var request = new GetHouseAccountPaymentsRequest()
{
Id = accountId,
};
//Make GetHouseAccountPayments call
var response = client.GetHouseAccountPayments(request);
//If call is successful
if (response.ResultCode == 0)
{
if (response.Payments.Length > 0)
{
//Loop through collection of HouseAccountPayment objects returned
foreach (var payment in response.Payments)
{
Console.WriteLine("AccountId: " + payment.AccountId);
Console.WriteLine("Amount: " + payment.Amount);
Console.WriteLine("TransactionTime: " + payment.TransactionTime);
Console.WriteLine("---------------------------");
}
}
else
{
Console.WriteLine("No House Account Payments");
Console.WriteLine("---------------------------");
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetHouseAccounts Sample Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using HouseAccounts_GetHouseAccounts.HouseAccountsServiceReference;
namespace HouseAccounts_GetHouseAccounts
{
class Program
{
static void Main(string[] args)
{
//Connect to HouseAccounts service client
var client = new HouseAccountsWebServiceClient();
//Set security protocol to TLS 1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
using (var scope = new OperationContextScope(client.InnerChannel))
{
//Include tokens in HTTP Web Request Headers
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = @"AccessToken";
headers["LocationToken"] = @"LocationToken";
//Create an empty request (no Id parameter is necessary)
var request = new GetHouseAccountsRequest();
//Make GetHouseAccounts call
var response = client.GetHouseAccounts(request);
//If call is successful
if (response.ResultCode == 0)
{
if (response.Accounts.Length > 0)
{
//Loop through collection of HouseAccount objects returned
foreach (var account in response.Accounts)
{
Console.WriteLine("Id: " + account.Id);
Console.WriteLine("AccountNumber: " + account.AccountNumber);
Console.WriteLine("Name: " + account.Name);
Console.WriteLine("Active: " + account.Active);
Console.WriteLine("Balance: " + account.Balance);
Console.WriteLine("FirstName: " + account.FirstName);
Console.WriteLine("MiddleName: " + account.MiddleName);
Console.WriteLine("LastName: " + account.LastName);
Console.WriteLine("Address1: " + account.Address1);
Console.WriteLine("Address2: " + account.Address2);
Console.WriteLine("Address3: " + account.Address3);
Console.WriteLine("Address4: " + account.Address4);
Console.WriteLine("City: " + account.City);
Console.WriteLine("State: " + account.State);
Console.WriteLine("Zip: " + account.Zip);
Console.WriteLine("EmailAddress: " + account.EmailAddress);
Console.WriteLine("PhoneNumber: " + account.PhoneNumber);
Console.WriteLine("EnforceLimit: " + account.EnforceLimit);
Console.WriteLine("Limit: " + account.Limit);
Console.WriteLine("---------------------------");
}
}
else
{
Console.WriteLine("No House Accounts");
Console.WriteLine("---------------------------");
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}