Sales2.svc
All calculations for indivudal entities can be found here in the Administrator Portal Reports. Specifically the Sales Summary Report as most of those data points are exposed via the API.
Calls
- GetCurrentBusinessDate - Retrieve the Business Date on the Register.
- GetDeposits - Retrieve the Deposits made on a specific business date.
- GetFutureDateOrderDeposits - Retrieve the Deposits made on a specific business date for an order one or more days in advance.
- GetFutureDateOrders - Retrieve the Future Date Orders for a specific date range.
- GetOrders - Retrieve the Orders opened on a specific business date.
- GetTills - Retrieve the Tills on a specific business date.
Sending a Request to Sales2.svc
All calls to Sales2.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.
Sales2.svc Endpoint
Endpoint
https://{{server}}.brinkpos.net/Sales2.svc
HTTP Web Request Headers
Header Name
Header Value
AccessToken
{{AccessToken}}
LocationToken
{{LocationToken}}
This call is to submit orders to Brink. It is an important call to API integrators who submit orders via the Ordering.svc.
The response tells you what the Business Date is on the Register. The server may say something different because the Register could be ahead or behind. In the event that the server and Register business dates are different, these sync issues reported to Main Support.
Note: This call should only be made once a day, or at most once every three hours per location. The Register is unlikely to change the Business Date unless End of Day is run.
The response tells you what the Business Date is on the Register. The server may say something different because the Register could be ahead or behind. In the event that the server and Register business dates are different, these sync issues reported to Main Support.
Note: This call should only be made once a day, or at most once every three hours per location. The Register is unlikely to change the Business Date unless End of Day is run.
GetCurrentBusinessDate Response
Data Name
Data Type
Data Description
Message
string
Returns a Brink error message if the request did not go through successfully. 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
BusinessDate
DateTime
Current Business Date shown on the register in a YYYY-MM-DD format (the time component will always return as 00:00:00)
Note: this reflects what is stored in the Register.sdf.
Note: this reflects what is stored in the Register.sdf.
This call is to retrieve cash deposits received by the Register on the business date requested.
Note: This call does not allow for a DateTime Range. Therefore, if you would like Deposits for a week, month, or range any of dates, you need to do a loop that makes the call on a per day basis.
Please use the Best Practice Guide on the frequency of your calls.
Note: This call does not allow for a DateTime Range. Therefore, if you would like Deposits for a week, month, or range any of dates, you need to do a loop that makes the call on a per day basis.
Please use the Best Practice Guide on the frequency of your calls.
GetDeposits Request
Data Name
Data Type
Data Description
BusinessDate
DateTime
Specify the Business Date would you like to see Deposits for
GetDeposits Response
Data Name
Data Type
Data Description
Message
string
Returns a Brink error message if the request did not go through successfully. 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
Deposit Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of this Deposit
Bag
string
Id for this Deposit, used for tracking purposes in Brink
BusinessDate
DateTime
Business date on which this Deposit was made (the time component will always return as 00:00:00)
DepositTypeId
int
Type of this Deposit
Note: Deposit Ids are not exposed via the API.
Note: Deposit Ids are not exposed via the API.
Id
int
Unique Id for this Deposit
Notes
string
Notes for this Deposit
Number
int
Number of the Register that accepted this Deposit. Since locations can have multiple Tills, the number is an indication of which Till received this Deposit.
Time
DateTimeOffset
Date and time of when this Deposit was made in UTC
This call returns any Deposits made for Future Date Orders received by the Register on the business date requested.
Future Date Orders are defined as orders that are made one or more days in advance.
Note: This call does not allow for a DateTime Range. Therefore, if you would like Deposits for a week, month, or range any of dates, you need to do a loop that makes the call on a per day basis.
Please use the Best Practice Guide on how many times per minute you should make this call!
Future Date Orders are defined as orders that are made one or more days in advance.
Note: This call does not allow for a DateTime Range. Therefore, if you would like Deposits for a week, month, or range any of dates, you need to do a loop that makes the call on a per day basis.
Please use the Best Practice Guide on how many times per minute you should make this call!
GetFutureDateOrderDeposits Request
Data Name
Data Type
Data Description
BusinessDate
DateTime
Specify at what Date would you like to see the Deposits for
GetFutureDateOrderDeposits Response
Data Name
Data Type
Data Description
Message
string
Returns a Brink error message if the request did not go through successfully. 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
Deposits
Array of FutureDateOrderDeposit
Future date order deposits for this location on the business date requested
FutureDateOrderDeposit Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of this FutureDateOrderDeposit
AuthCode
string
Authorization Code sent back from the payment processor used for credit card payments
BusinessDate
DateTime
Business date on which this FutureDateOrderDeposit was made (the time component will always return as 00:00:00)
Note: This corresponds with the date of the request and when the payment was processed, not when the Order was made.
Note: This corresponds with the date of the request and when the payment was processed, not when the Order was made.
CardHolderName
string
Name of the cardholder of this FutureDateOrderDeposit, for card payments
CardNumber
string
Account number of the credit card for this FutureDateOrderDeposit, for card payments.
Note: Most Payment Processors only return the last four digits, and the rest is hashed out.
Note: Most Payment Processors only return the last four digits, and the rest is hashed out.
EmployeeId
int?
Maps to the Id of the Employee who applied this FutureDateOrderDeposit.
Note: If there was no Employee who applied the Deposit (e.g. the Register or Till auto-deposited), then this value will be null.
Note: If there was no Employee who applied the Deposit (e.g. the Register or Till auto-deposited), then this value will be null.
MerchantAccountType
int?
Returns one of the following if this FutureDateOrderDeposit was a credit card payment:
Otherwise, this value will be null.
- 0 = Payment was processed at the location
- 1 = E-Commerce Payment that was made and processed online
Otherwise, this value will be null.
OrderId
long
Maps to the Id of the future date Order of this FutureDateOrderDeposit. Note: Storing it in your own database would be beneficial.
OrderTotal
decimal
Total value of the future date Order that the FutureDateOrderDeposit was made for, including any discounts, promotions, surcharges, and/or taxes
PaymentId
int
Unique Id of the payment for this FutureDateOrderDeposit
TenderId
int
Maps to the Id of the Tender used to pay this FutureDateOrderDeposit.
Note: Future date orders or online orders cannot have Cash as a payment tender.
Note: Future date orders or online orders cannot have Cash as a payment tender.
TillNumber
int?
Number of the Register that accepted this Deposit.
Note: If the Order was made online, via the API, then this value will be null.
Note: If the Order was made online, via the API, then this value will be null.
Time
DateTimeOffset
Date and time of when this FutureDateOrderDeposit was made in UTC
TipAmount
decimal
Tip amount for this FutureDateOrderDeposit
This call is to retrieve Future Date Orders. Future Date Orders are classified if the Order has a PickUpTime one day or more in advance.
Note: Once the current Business Date is equal to the PickUpTime of the Future Date Order, the Future Date Order becomes an Order, which can be viewed via the call GetOrders.
Note: Once the current Business Date is equal to the PickUpTime of the Future Date Order, the Future Date Order becomes an Order, which can be viewed via the call GetOrders.
GetFutureDateOrders Request
Data Name
Data Type
Data Description
FutureDateRange
DateRange
Specify a date range you would like to retrieve the FutureDateOrders for
PriceRollUp
string
PriceRollUp is a way to tell Brink how you want your information to be displayed, specifically for combo Items. Default is RollUp if not specified.
We will use Child Items and Parent Items in the definitions below. Child Items are items that belong to a combo. So if I have an API Combo, which comes with Fries and a Drink, then the Fries and Drink are the Child Items and the API Combo is the Parent Item.
There are three different ways to specify PriceRollUp:
We will use Child Items and Parent Items in the definitions below. Child Items are items that belong to a combo. So if I have an API Combo, which comes with Fries and a Drink, then the Fries and Drink are the Child Items and the API Combo is the Parent Item.
There are three different ways to specify PriceRollUp:
- RollUp = The Child Items' prices roll up into the Combo. In other words, the Child Items will display a price of 0, but the Parent Item or Combo will have a value.
- DetailsOnly = The Combo Items or Parent Items will have a value of 0, and the Child Items will have their individual pricing. No rolling up of pricing here.
- RollUpAndDetails = The Combo Items or Parent Items will display their Combo Pricing and any Child Items will also have their pricing displayed. There are no displayed values of 0 unless the Item already has a value of 0 originally.
GetFutureDateOrders Response
Data Name
Data Type
Data Description
Message
string
Returns a Brink error message if the request did not go through successfully. 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
This call is to retrieve all Orders opened on the business date requested.
Note: This call is quite heavy. We recommend a longer wait time on the Response, and to implement at least a 2-minute sleep in between calls to this method. Please refer to the Best Practice Guide.
Returns one of the following for credit card payments:
Note: This call is quite heavy. We recommend a longer wait time on the Response, and to implement at least a 2-minute sleep in between calls to this method. Please refer to the Best Practice Guide.
GetOrders Request
Data Name
Data Type
Data Description
BusinessDate
DateTime
Specify the business date that you would like to retrieve Orders for
ExcludeOpenOrders
bool
Specify True to display only closed Orders, or False to display both open and closed Orders. Default is False if not specified.
ModifiedTime
DateTimeOffset?
(Optional) When specified, only Orders that have been modified on or after the specified time will be retrieved. This compares against any edited Orders on the Register time.
PriceRollUp
string
PriceRollUp is a way to tell Brink how you want your information to be displayed, specifically for combo Items. Default is RollUp if not specified.
We will use Child Items and Parent Items in the definitions below. Child Items are items that belong to a combo. So if I have an API Combo, which comes with Fries and a Drink, then the Fries and Drink are the Child Items and the API Combo is the Parent Item.
There are three different ways to specify PriceRollUp:
We will use Child Items and Parent Items in the definitions below. Child Items are items that belong to a combo. So if I have an API Combo, which comes with Fries and a Drink, then the Fries and Drink are the Child Items and the API Combo is the Parent Item.
There are three different ways to specify PriceRollUp:
- RollUp = The Child Items' prices roll up into the Combo. In other words, the Child Items will display a price of 0, but the Parent Item or Combo will have a value.
- DetailsOnly = The Combo Items or Parent Items will have a value of 0, and the Child Items will have their individual pricing. No rolling up of pricing here.
- RollUpAndDetails = The Combo Items or Parent Items will display their Combo Pricing and any Child Items will also have their pricing displayed. There are no displayed values of 0 unless the Item already has a value of 0 originally.
GetOrders Response
Data Name
Data Type
Data Description
Message
string
Returns a Brink error message if the request did not go through successfully. 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
Order Type
Data Name
Data Type
Data Description
BusinessDate
DateTime
Business date of this Order (the time component will always return as 00:00:00)
ClosedTime
DateTimeOffset?
Date and time this Order was closed in UTC, null if not yet closed
Count
int
Returns one of the following, depending on content of the Order:
- 0 = Reflects an empty Order (e.g. Entries deleted or voided, Total is 0)
- 1 = Reflects a full Order
CustomerId
Guid?
Id of the Customer on this Order, or null if there was no assigned Customer
DisplaySubtotal
decimal
Same as Subtotal unless this Order contains inclusive tax, then those taxes would be added to this DisplaySubtotal and subtracted from DisplayTax
DisplayTax
decimal
Same as Tax unless this Order contains inclusive tax, then those taxes won't be counted in this DisplayTax
Entries
Array of OrderEntry
Entries in this Order. An OrderEntry can either be of type OrderItem or an OrderGiftCard.
FirstSendTime
DateTimeOffset?
Date and time this Order was first sent to the kitchen in UTC, null if not sent
GrossSales
decimal
Gross sales for this Order
GuestCount
int
Number of guests for this Order
GuestCountFractional
decimal
Fractional number of guests for this Order
Id
long
Unique Id of this Order
IdEncoded
string
Unique encoded Id of this Order
IdNoLocation
int
Unique Id of this order with location identifier removed. This is shorter and generally passed to integrations, including credit processors.
IsClosed
bool
True if this Order is closed, False if not
IsFutureOrder
bool
True if this Order is a future order, False if not
IsRefund
bool
True if this Order is a refund, False if not
IsTaxExempt
bool
True if this Order is exempt from taxes, False if not
ModifiedTime
DateTimeOffset
Date and time this Order was last modified in the location's local time
Name
string
Name of this Order
NetSales
decimal
Net sales for this Order
Number
short
Order, receipt, or call out number that cashiers use to call the customer for this Order
OpenedTime
DateTimeOffset
Date and time this Order was opened in UTC
OrderAdditionalDetails
string
Additional loyalty or payment information for this Order, depending on each individual processor
Note:This is a JSON-formatted string.
Note:This is a JSON-formatted string.
PickupTime
DateTime?
Date and time this Order is scheduled for pick up in UTC, null if not applicable
Rounding
decimal
Amount by which the Order was rounded to, reflecting the rounding settings
Subtotal
decimal
Subtotal of this Order
Tax
decimal
Total tax for this Order
TaxExemptId
string
Tax identifier for the tax-exempt entity
TerminalId
int
Id of the terminal this Order was placed on
TillNumber
int?
Id of the till that owns this Order, null if not owned
Total
decimal
Total for this Order
OrderDeposit Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of this OrderDeposit
BusinessDate
DateTime
Business date this OrderDeposit was taken
Id
int
Unique Id of this OrderDeposit
IsApplied
bool
True if this OrderDeposit has been applied to the Order, False if not
IsDeleted
bool
True if this OrderDeposit has been deleted, False if not
IsReversal
bool
True if this OrderDeposit is a reversal that offsets a deleted deposit, False if not
OriginalOrderDepositId
int?
Id of the original OrderDeposit being reversed, if this OrderDeposit is a reversal
PaymentId
int
Id of the OrderPayment that correlates to this OrderDeposit
OrderDiscount Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of this OrderDiscount
ExternalLoyaltyAccount
string
Number of the external loyalty account through which this OrderDiscount is applied
Id
int
Unique Id of this OrderDiscount within the Order
LoyaltyRewardId
int?
Maps to the Id of the LoyaltyReward if this OrderDiscount is applied via a loyalty reward
Name
string
Name of this OrderDiscount
Source
int
Returns one of the following:
- 0 = Other
- 1 = LoyaltyCard
- 2 = LoyaltyReward
OrderEntry - OrderItem Type
Data Name
Data Type
Data Description
CompositeOrderItemId
int?
Maps to the Id of the OrderItem within the Order that is the CompositeOrderItem, if this OrderItem is part of a combo
Denominator
byte
Denominator by which is OrderItem was split
Description
string
Description of this OrderItem
DisplayPrice
decimal
Price displayed for this OrderItem
GrossSales
decimal
Gross sales for this OrderItem and its children
Id
int
Unique Id of this OrderItem within the Order
IsCleared
bool
True if this OrderItem was cleared, False if not
IsDeleted
bool
True if this OrderItem was deleted, False if not
IsVoided
bool
True if this OrderItem was voided, False if not
ItemGrossSales
decimal
Gross sales for this OrderItem only
ItemNetSales
decimal
Net sales for this OrderItem only
NetSales
decimal
Net sales for this OrderItem and its children
Note
string
Note for this OrderItem
Price
decimal
Price of this OrderItem
SplitItemId
short
Maps to the Id of the OrderItem within the Order that this OrderItem was split from
OrderEntry - OrderGiftCard Type
Data Name
Data Type
Data Description
Description
string
Description of this OrderGiftCard
Id
int
Unique Id of this OrderGiftCard within the Order
Price
decimal
Price of this OrderGiftCard
OrderItemDiscount Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of discount applied to the OrderItem
Id
int
Unique Id of this OrderItemDiscount within the OrderItem
OrderItemModifier Type
Data Name
Data Type
Data Description
DisplayPrice
decimal
Price displayed for this OrderItemModifier
GrossSales
decimal
Gross sales for this OrderItemModifier and its children
Id
int
Unique Id of this OrderItemModifier within the OrderItem
ItemGrossSales
decimal
Gross sales for this OrderItemModifier only
ItemNetSales
decimal
Net sales for this OrderItemModifier only
NetSales
decimal
Net sales for this OrderItemModifier and its children
Price
decimal
Price of this OrderItemModifier
OrderEntryPromotion Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of promotion applied to the OrderEntry
Id
int
Unique Id of this OrderItemPromotion within the OrderEntry
OrderEntryTax Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of tax applied to the OrderEntry
Id
int
Unique Id of this OrderEntryTax within the OrderEntry
IsInclusive
bool
True if this OrderEntryTax is an inclusive tax, False if not
OrderItemVoid Type
Data Name
Data Type
Data Description
Time
DateTimeOffset
Time at which this OrderItemVoid was processed in UTC
VoidReasonId
int
Specify the Id of the reason
OrderPayment Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of this OrderPayment
BusinessDate
DateTime
Business date this OrderPayment was applied (the time component will always return as 00:00:00)
CardHolderName
string
Name of the cardholder of this OrderPayment, for card payments
CardNumber
string
Card number of this OrderPayment, populated for credit card and gift card payments (typically only the last 4 digits)
Change
decimal
Change given on this OrderPayment
CreditCardTransaction Information
Additional credit card transaction information returned by Vantiv
Id
int
Unique Id of this OrderPayment within the Order
IsDeleted
bool
True is this OrderPayment was deleted, False if not
MerchantAccountType
int?
Returns one of the following for credit card payments:
- 0 = Standard Merchant Account
- 1 = eCommerce Merchant Account
TipAmount
decimal
Tip amount for this OrderPayment
AdditionalData
List<NameValuePair>
Any additional information
CreditCardTransactionInformation Type
Data Name
Data Type
Data Description
AuthorizationCode
string
Authorization code returned from Vantiv
CardToken
string
Card token returned from Vantiv
ClientTransactionIdentifier
string
Client transaction identifier returned from Vantiv
Result
string
Result returned from Vantiv
OrderPaymentDetail Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of this OrderPaymentDetail
Id
int
Unique Id of this OrderPaymentDetail within the Order
TipAmount
decimal
Tip amount for this OrderPaymentDetail
Type
int
Returns one of the following for the type of detail:
- 1 = Initial Payment
- 2 = Adjustment
- 3 = Change given
- 4 = Transfer from
- 5 = Transfer to
OrderPromotion Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of promotion applied to the Order
Id
int
Unique Id of this OrderPromotion within the Order
Name
string
Name of this OrderPromotion
OrderSurcharge Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of surcharge applied to the Order
Id
int
Unique Id of this OrderSurcharge within the Order
IsSystemApplied
bool
True if this OrderSurcharge is automatically applied by the system, False if not
Name
string
Name of this OrderSurcharge
This call is to retrieve Tills on the business date requested.
GetTills Request
Data Name
Data Type
Data Description
BusinessDate
DateTime
Specify the Business Date that you would like to get Tills for
GetTills Response
Data Name
Data Type
Data Description
Message
string
Returns a Brink error message if the request did not go through successfully. 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
Till Type
Data Name
Data Type
Data Description
BusinessDate
DateTime
Business date of this Till (This DateTime object's time component will be equal to 00:00:00)
ClosedByEmployeeId
int?
Maps to the Id of the Employee who closed this Till, otherwise null if auto-closed
ClosedTime
DateTimeOffset?
Time that this Till was closed, for tills that have been closed
DeclaredCash
decimal?
Amount of cash declared for this Till, for tills that have been closed
EmployeeId
int?
Maps to the Id of the Employee who owns this Till, for non-public tills, otherwise null
IsClosed
bool
True if Till has been closed, False if not
IsPublic
bool
True if Till is public, False if not. Public tills are not owned by an employee.
IsVirtual
bool
True if Till is virtual, False if not. Virtual tills are not tied to a cash drawer.
Number
int
Unique identifier for this Till
OpenedTime
DateTimeOffset
Time that this Till was opened
OverShort
decimal?
Calculated amount that this Till was over or short, for tills that have been closed
StartingBank
decimal
Starting bank that was declared for this Till when it was opened
PaidInOut Type
Data Name
Data Type
Data Description
AccountType
int
Returns one of the following:
- 0 = Cash In
- 1 = Cash Out
Amount
decimal
Amount that was paid for this PaidInOut
Description
string
Description for this PaidInOut
Number
int
Unique identifier for this PaidInOut
Time
DateTimeOffset
Time at which this PaidInOut was processed in UTC
Skim Type
Data Name
Data Type
Data Description
CashDrawerName
string
Name of the CashDrawer from which Skim is performed
Duration
TimeSpan
Time from first prompt until Skim performed
SkimAmount
decimal
Amount that was processed in this Skim
SkimTime
DateTimeOffset
Time at which this Skim was processed in UTC
UserName
string
Name of the Employee who processed this Skim
GetCurrentBusinessDate 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 Sales2_GetCurrentBusinessDate.Sales2ServiceReference;
namespace Sales2_GetCurrentBusinessDate
{
class Program
{
static void Main(string[] args)
{
//Connect to Sales2 service client
var client = new SalesWebService2Client();
//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";
//Make GetCurrentBusinessDate call
var response = client.GetCurrentBusinessDate();
//If call is successful
if (response.ResultCode == 0)
{
Console.WriteLine("Current Business Date: " + response.BusinessDate);
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetDeposits 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 Sales2_GetDeposits.Sales2ServiceReference;
namespace Sales2_GetDeposits
{
class Program
{
static void Main(string[] args)
{
//Connect to Sales2 service client
var client = new SalesWebService2Client();
//Set security protocol to TLS 1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
int count = 1;
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";
//Include BusinessDate parameter in request body
var request = new GetDepositsRequest()
{
BusinessDate = new DateTime(2001, 01, 01),
};
//Make GetDeposits call
var response = client.GetDeposits(request);
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Deposit objects returned
foreach (var deposit in response.Deposits)
{
Console.WriteLine("Deposit #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + deposit.Id);
Console.WriteLine("Amount: "+ deposit.Amount);
Console.WriteLine("Bag: " + deposit.Bag);
Console.WriteLine("BusinessDate: " + deposit.BusinessDate);
Console.WriteLine("DepositTypeId: " + deposit.DepositTypeId);
Console.WriteLine("Notes: " + deposit.Notes);
Console.WriteLine("Number: " + deposit.Number);
Console.WriteLine("Time: ");
Console.WriteLine("\tDateTime: " + deposit.Time.DateTime);
Console.WriteLine("\tOffsetMinutes: " + deposit.Time.Offset);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetFutureDateOrderDeposits 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 Sales2_GetFutureDateOrderDeposits.Sales2ServiceReference;
namespace Sales2_GetFutureDateOrderDeposits
{
class Program
{
static void Main(string[] args)
{
//Connect to Sales2 service client
var client = new SalesWebService2Client();
//Set security protocol to TLS 1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
int count = 1;
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";
//Include BusinessDate parameter in request body
var request = new GetFutureDateOrderDepositsRequest()
{
BusinessDate = new DateTime(2001, 01, 01),
};
//Make GetFutureDateOrderDeposits call
var response = client.GetFutureDateOrderDeposits(request);
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of FutureDateOrderDeposit objects returned
foreach (var deposit in response.Deposits)
{
Console.WriteLine("FutureDateOrderDeposit #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Amount: " + deposit.Amount);
Console.WriteLine("AuthCode: " + deposit.AuthCode);
Console.WriteLine("Business Date: " + deposit.BusinessDate);
Console.WriteLine("CardHolderName: " + deposit.CardHolderName);
Console.WriteLine("CardNumber: " + deposit.CardNumber);
Console.WriteLine("EmployeeId: " + deposit.EmployeeId);
Console.WriteLine("MerchantAccountType: " + deposit.MerchantAccountType);
Console.WriteLine("OrderId: " + deposit.OrderId);
Console.WriteLine("OrderTotal: " + deposit.OrderTotal);
Console.WriteLine("PaymentId: " + deposit.PaymentId);
Console.WriteLine("SectionId: " + deposit.SectionId);
Console.WriteLine("TenderId: " + deposit.TenderId);
Console.WriteLine("TillNumber: " + deposit.TillNumber);
Console.WriteLine("Time: ");
Console.WriteLine("\tDateTime: " + deposit.Time.DateTime);
Console.WriteLine("\tOffset:" + deposit.Time.Offset);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetFutureDateOrders Minified 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 Sales2_GetFutureDateOrders.Sales2ServiceReference;
namespace Sales2_GetFutureDateOrders
{
class Program
{
public static void DisplayModifiers(OrderItemModifier[] modifiers)
{
//Loop through collection of OrderItemModifier objects returned
foreach (var mod in modifiers)
{
Console.WriteLine("\t\tId: " + mod.Id);
Console.WriteLine("\t\tItemId: " + mod.ItemId);
Console.WriteLine("\t\tModifierCodeId: " + mod.ModifierCodeId);
Console.WriteLine("\t\tModifierGroupId: " + mod.ModifierGroupId);
Console.WriteLine("\t\tPrice: " + mod.Price);
//Loop through collection of OrderItemModifier objects returned
if (mod.Modifiers.Length != 0)
{
DisplayModifiers(mod.Modifiers);
}
Console.WriteLine("\t\t------------");
}
}
static void Main(string[] args)
{
//Connect to Sales2 service client
var client = new SalesWebService2Client();
//Set security protocol to TLS 1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
int count = 1;
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";
var dateRange = new DateRange();
dateRange.Start = new DateTime(2001, 01, 01);
dateRange.End = new DateTime(2001, 01, 08);
//Include FutureDateRange and PriceRollUp parameters in request body
var request = new GetFutureDateOrdersRequest()
{
FutureDateRange = dateRange,
PriceRollUp = "RollUpAndDetails",
};
//Make GetFutureDateOrders call
var response = client.GetFutureDateOrders(request);
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Order objects returned
foreach (var futureDateOrder in response.FutureDateOrders)
{
Console.WriteLine("Order #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("BusinessDate: " + futureDateOrder.BusinessDate);
Console.WriteLine("ClosedTime: " + futureDateOrder.ClosedTime);
Console.WriteLine("CustomerId: " + futureDateOrder.CustomerId);
Console.WriteLine("EmployeeId: " + futureDateOrder.EmployeeId);
Console.WriteLine("Entries:");
//Loop through collection of OrderItem objects returned
foreach (var entry in futureDateOrder.Entries.OfType<OrderItem>())
{
Console.WriteLine("\tModifiers: ");
if (entry.Modifiers.Length != 0)
{
DisplayModifiers(entry.Modifiers);
}
}
Console.WriteLine("FirstSendTime: " + futureDateOrder.FirstSendTime);
Console.WriteLine("Id: " + futureDateOrder.Id);
Console.WriteLine("IsClosed: " + futureDateOrder.IsClosed);
Console.WriteLine("ModifiedTime: " + futureDateOrder.ModifiedTime);
Console.WriteLine("Name: " + futureDateOrder.Name);
Console.WriteLine("OpenedTime: " + futureDateOrder.OpenedTime);
Console.WriteLine("Payments:");
//Loop through collection of OrderPayment objects returned
if (futureDateOrder.Payments.Length != 0)
{
foreach (var payment in futureDateOrder.Payments)
{
Console.WriteLine("\tId: " + payment.Id);
Console.WriteLine("\tAmount: " + payment.Amount);
Console.WriteLine("\tBusinessDate: " + payment.BusinessDate);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("PickUpTime: " + futureDateOrder.PickupTime);
Console.WriteLine("Total: " + futureDateOrder.Total);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetOrders Minified 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 Sales2_GetOrders.Sales2ServiceReference;
namespace Sales2_GetOrders
{
class Program
{
public static void DisplayModifiers(OrderItemModifier[] modifiers)
{
//Loop through collection of OrderItemModifier objects returned
foreach (var mod in modifiers)
{
Console.WriteLine("\t\tId: " + mod.Id);
Console.WriteLine("\t\tItemId: " + mod.ItemId);
Console.WriteLine("\t\tModifierCodeId: " + mod.ModifierCodeId);
Console.WriteLine("\t\tModifierGroupId: " + mod.ModifierGroupId);
Console.WriteLine("\t\tPrice: " + mod.Price);
//Loop through collection of OrderItemModifier objects returned
if (mod.Modifiers.Length != 0)
{
DisplayModifiers(mod.Modifiers);
}
Console.WriteLine("\t\t------------");
}
}
static void Main(string[] args)
{
//Connect to Sales2 service client
var client = new SalesWebService2Client();
//Set security protocol to TLS 1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
int count = 1;
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";
DateTime businessDate = new DateTime(2001, 01, 01);
DateTimeOffset modifiedTime = new DateTimeOffset(2001, 01, 01, 12, 0, 0, new TimeSpan(0));
//Include parameters in request body
var request = new GetOrdersRequest()
{
BusinessDate = businessDate,
ExcludeOpenOrders = false,
//ModifiedTime = modifiedTime,
PriceRollUp = "RollUpAndDetails",
};
//Make GetOrders call
var response = client.GetOrders(request);
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Order objects returned
foreach (var order in response.Orders)
{
Console.WriteLine("Order #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("BusinessDate: " + order.BusinessDate);
Console.WriteLine("ClosedTime: " + order.ClosedTime);
Console.WriteLine("CustomerId: " + order.CustomerId);
Console.WriteLine("EmployeeId: " + order.EmployeeId);
Console.WriteLine("Entries:");
//Loop through collection of OrderItem objects returned
foreach (var entry in order.Entries.OfType<OrderItem>())
{
Console.WriteLine("\tModifiers: ");
if (entry.Modifiers.Length != 0)
{
DisplayModifiers(entry.Modifiers);
}
}
Console.WriteLine("FirstSendTime: " + order.FirstSendTime);
Console.WriteLine("Id: " + order.Id);
Console.WriteLine("IsClosed: " + order.IsClosed);
Console.WriteLine("ModifiedTime: " + order.ModifiedTime);
Console.WriteLine("Name: " + order.Name);
Console.WriteLine("OpenedTime: " + order.OpenedTime);
Console.WriteLine("Payments:");
//Loop through collection of OrderPayment objects returned
if (order.Payments.Length != 0)
{
foreach (var payment in order.Payments)
{
Console.WriteLine("\tId: " + payment.Id);
Console.WriteLine("\tAmount: " + payment.Amount);
Console.WriteLine("\tBusinessDate: " + payment.BusinessDate);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("PickUpTime: " + order.PickupTime);
Console.WriteLine("Total: " + order.Total);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetTills 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 Sales2_GetTills.Sales2ServiceReference;
namespace Sales2_GetTills
{
class Program
{
static void Main(string[] args)
{
//Connect to Sales2 service client
var client = new SalesWebService2Client();
//Set security protocol to TLS 1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
int count = 1;
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";
//Include BusinessDate parameter in request body
var request = new GetTillsRequest()
{
BusinessDate = new DateTime(2001, 01, 01),
};
//Make GetTills call
var response = client.GetTills(request);
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Till objects returned
foreach (var till in response.Tills)
{
Console.WriteLine("Till #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("BusinessDate: " + till.BusinessDate);
Console.WriteLine("CashDrawerId: " + till.CashDrawerId);
Console.WriteLine("ClosedByEmployeeId: " + till.ClosedByEmployeeId);
Console.WriteLine("ClosedTime: " + till.ClosedTime);
Console.WriteLine("DeclaredCash " + till.DeclaredCash);
Console.WriteLine("EmployeeId: " + till.EmployeeId);
Console.WriteLine("IsClosed: " + till.IsClosed);
Console.WriteLine("IsPublic: " + till.IsPublic);
Console.WriteLine("IsVirtual: " + till.IsVirtual);
Console.WriteLine("Number: " + till.Number);
Console.WriteLine("OpenedTime: " + till.OpenedTime);
Console.WriteLine("OverShort: " + till.OverShort);
Console.WriteLine("PaidInOuts: ");
//Loop through collection of PaidInOut objects returned
foreach (var paidInOut in till.PaidInOuts)
{
Console.WriteLine("\tEmployeeId: " + paidInOut.EmployeeId);
Console.WriteLine("\tAccountType: " + paidInOut.AccountType);
Console.WriteLine("\tAmount:" + paidInOut.Amount);
Console.WriteLine("\tDescription: " + paidInOut.Description);
Console.WriteLine("\tNumber: " + paidInOut.Number);
Console.WriteLine("\tPettyAccountId: " + paidInOut.PettyAccountId);
Console.WriteLine("\tTime: " + paidInOut.Time.DateTime);
Console.WriteLine("\t-----------------------");
}
//Loop through collection of Skim objects returned
foreach (var skim in till.Skims)
{
Console.WriteLine("\tCashDrawerName: " + skim.CashDrawerName);
Console.WriteLine("\tDuration: " + skim.Duration);
Console.WriteLine("\tSkimAmount:" + skim.SkimAmount);
Console.WriteLine("\tSkimTime: " + skim.SkimTime.DateTime);
Console.WriteLine("\UserName: " + skim.UserName);
Console.WriteLine("\t-----------------------");
}
Console.WriteLine("StartingBank: " + till.StartingBank);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}