Ordering.svc
Calls
- ApplyPayment - Apply partial or complete payment to an order at a location.
- CalculateOrder - Calculate the taxes, subtotals, and totals for this Order.
- CancelOrder - Cancel an open Order that has not yet been sent to the kitchen.
- GetItemAvailability - Quantity still available for one or more particular Items.
- GetMasterTerminalStatus - Is the Primary Register online or offline?
- GetOrder - Retrieve an open Order from current Business Date.
- GetParty - Retrieve an open Party from current Business Date.
- GetUnavailableItems - Retrieve the list of item IDs that are active but unavailable at the location on current Business Date.
- SendOrder - Manually send an order from current Business Date to kitchen at this location.
- SubmitOrder - Submit a new Order at the location.
- UpdateItemAvailability - Update the quantity available for one or more particular items.
Sending a Request to Ordering.svc
All calls to Ordering.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.
Ordering.svc Endpoint
Endpoint
https://{{server}}.brinkpos.net/Ordering.svc
HTTP Web Request Headers
Header Name
Header Value
AccessToken
{{AccessToken}}
LocationToken
{{LocationToken}}
This call is to apply a partial or complete payment to an order created (In-store or outside the store) or to orders that are not auto-closed at a location.
ApplyPayment Request
Data Name
Data Type
Data Description
OrderId
long
Specify the OrderId you would like to add a payment to.
ApplyPayment 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:
ResultCodes specific to ApplyPayment:
- 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
ResultCodes specific to ApplyPayment:
- 101 = Payment could not be processed
- 102 = Order not found
- 103 = Order already closed
- 104 = Store is offline
- 106 = Error corresponding to the tender specified in the ApplyPayment request
This call is to calculate an Order's taxes and totals after automatically applied promotions, discounts, and surcharges at the location.
CalculateOrder Request
Data Name
Data Type
Data Description
CalculateOrder 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:
ResultCodes specific to CalculateOrder:
- 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
ResultCodes specific to CalculateOrder:
- 101 = Order could not be calculated due to one or more errors in the request
This call is to cancel an open Order at the location.
CancelOrder Request
Data Name
Data Type
Data Description
OrderId
long
Specify the Id of the Order you would like to cancel
SuppressCancellationEmail
bool
(Optional) True if you would like the cancellation email suppressed, False if not. Default is False if not specified.
CancelOrder 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:
ResultCodes specific to CancelOrder:
- 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
ResultCodes specific to CancelOrder:
- 101 = OrderId you specified in the request was not found and could not be cancelled
- 102 = The Order you specified has already been sent to the kitchen and could not be cancelled
- 103 = The Order you specified has already been closed and could not be cancelled
- 104 = The Order you specified is currently being edited and could not be cancelled
- 106 = Store is offline and could not be cancelled
- 108 = Payment(s) in the request could not be cancelled, so the Order could not be cancelled
This call is to get the availability of one or more Items at the location.
GetItemAvailability Request
Data Name
Data Type
Data Description
GetItemAvailability Response
Data Name
Data Type
Data Description
Mesage
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
This call is to check whether the Primary Register of the location is online (connected to the cloud) or offline.
GetMasterTerminalStatus 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 - check that your AccessToken and LocationToken are correct and you are properly provisioned
Status
byte
Returns a status result:
- 0 = Offline
- 1 = Online
This call is to retrieve an open Order at the location.
GetOrder Request
Data Name
Data Type
Data Description
OrderId
long
Specify the Id of the Order you would like to retrieve
GetOrder 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:
ResultCodes specific to GetOrder
- 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 - check that your AccessToken and LocationToken are correct and you are properly provisioned
ResultCodes specific to GetOrder
- 101 = An Order with an Id equal to the OrderId you specified in the request was not found
This call is to retrieve an open Party at the location.
GetParty Request
Data Name
Data Type
Data Description
BusinessDate
DateTime
The Current Business Date of the location
TableId
int
Specify the Table that contains the party we want to retrieve information for
GetParty 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:
ResultCodes specific to GetParty
- 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 - check that your AccessToken and LocationToken are correct and you are properly provisioned
ResultCodes specific to GetParty
- 101 = Party not found
This call is to retrieve the list of item IDs that are active but unavailable at the location on current business date.
This call is to manually send an Order of the current business date to kitchen at the location.
SendOrder Request
Data Name
Data Type
Data Description
OrderId
long
Specify the Id of the Order you would like to manual send
SendOrder 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:
ResultCodes specific to SendOrder:
- 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
ResultCodes specific to SendOrder:
- 101 = Order sent
- 102 = Order not found
- 103 = Order is not flagged for Manual Send
This call is used to submit an Order at a location. Previously, the maximum number of successful SubmitOrder calls per location per business date was capped at 2048. Starting from the 5.0M release onwards, this limit has been increased to 18431.
SubmitOrder Request
Data Name
Data Type
Data Description
SuppressConfirmationEmail
bool
True if you would like the confirmation email suppressed, False if not. Default is False if not specified.
SubmitOrder Response
Data Name
Data Type
Data Description
Mesage
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:
ResultCodes specific to SubmitOrder:
- 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
ResultCodes specific to SubmitOrder:
- 101 = Store is Offline
- 102 = Loyalty award already redeemed
- 103 = Ordering not allowed
- 104 = Error corresponding to the order specified in the SubmitOrder request
- 105 = Order already submitted
- 106 = Future date orders not allowed
- 107 = One or more of the payments could not be processed
- 108 = One or more of the payments on the order could not be cancelled
- 109 = No more of item is available
OrderId
long
Id of the Order you submitted, if the request was successful
This call is to update the availability of one or more Items at the location.
UpdateItemAvailability Request
Data Name
Data Type
Data Description
Details
Array of ItemAvailabilityDetail
Array of ItemAvailabilityDetails to update the available quantity of one or more Items
UpdateItemAvailability 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
Global Type
All the Types available in Ordering.svc will be displayed below.
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
FutureOrderDetails Type
Data Name
Data Type
Data Description
EmailAddress
string
Contact email address for this FutureOrder
IsCancelled
bool
True if the future order is cancelled, False if not
ManualSend
bool
True if you would like to tell the Register to not send the order to the Kitchen based on the Configured Send Time rules, False if not.
PhoneNumber
string
Contact phone number for this FutureOrder
PickupTime
DateTimeOffset
Time for this FutureOrder to be picked up or delivered in UTC. The time specified here must be later than the time at which you submit your Order.
ItemAvailabilityDetail Type
Data Name
Data Type
Data Description
IsAvailable
bool
True if the Item is still available, False if not.
When updating: If you specify True, the default for QuantityAvailable is -1 to indicate an unlimited supply, unless a quantity is specified. If you specify False, the QuantityAvailable is set to 0.
When updating: If you specify True, the default for QuantityAvailable is -1 to indicate an unlimited supply, unless a quantity is specified. If you specify False, the QuantityAvailable is set to 0.
QuantityAvailable
int?
Quantity still available for the Item, or -1 if Item has unlimited availability
NewDeliveryDetails Type
Data Name
Data Type
Data Description
Address1
string
Address for this new Delivery
Address2
string
Address for this new Delivery
City
string
City for this new Delivery
Country
string
Country for this new Delivery
PostalCode
string
Postal code for this new Delivery
StateCode
string
State code for this new Delivery
NewFutureOrderDetails Type
Data Name
Data Type
Data Description
EmailAddress
string
Contact email address for this NewFutureOrder
ManualSend
bool
True if you would like to tell the Register to not send the order to the Kitchen based on the Configured Send Time rules, False if not.
PhoneNumber
string
Contact phone number for this NewFutureOrder
PickupTime
DateTimeOffset
Time for this NewFutureOrder to be picked up or delivered in UTC. The time specified here must be later than the time at which you submit your NewOrder.
SendReminderEmail
bool
True if the Reminder Email is to be sent to the customer regarding their pending future order, False if not
NewOrder Type
Data Name
Data Type
Data Description
CustomerId
Guid
Maps to the Id of the Customer on this NewOrder, or an empty guid if there was no specific Customer
ExternalLoyalty Account
string
External Loyalty Account Number associated with NewOrder, if Loyalty is used outside Brink Loyalty program
IsTaxExempt
bool
True if this Order is exempt from taxes, False if not. Default is False if not specified.
LaneId
int?
Maps to the Id of the Lane associated to this NewOrder
Name
string
Name of this NewOrder
Payments
Array of NewOrderPayment
Payments to apply to to this NewOrder. A NewOrderPayment can be of type NewCheckPayment, NewCreditCardPayment, NewExternalPayment, NewGiftCardPayment, NewGiftCertificatePayment, NewExternallyTokenizedCreditCardPayment
AdditionalData
Dictionary<string,string>
Any additional information
NewOrderDiscount Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of discount to apply to the NewOrder
Id
int
Incremental Id within the NewOrder
LoyaltyRewardId
int
Maps to the Id of the Award of the customer associated with the NewOrder, if using Brink Loyalty program
Name
string
Name of this NewOrderDiscount
Percent
decimal
Percentage of discount to apply to the NewOrder
NewOrderItemModifier Type
Data Name
Data Type
Data Description
Description
string
Description of this NewOrderItemModifier
Id
int
Incremental Id within the NewOrder
MenuItemId
int
Maps to the Id of the MenuItem if this NewOrderItem is from a specific menu. Affects valid modifier choices.
Price
decimal
Price of this NewOrderItemModifier
Quantity
int
Quantity of this NewOrderItemModifier
NewOrderPayment - NewCheckPayment Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of the check for this NewCheckPayment
CheckNumber
string
Number of the check for this NewCheckPayment
Id
int
Incremental Id within the NewOrder
TipAmount
decimal
Tip amount for this NewCheckPayment, if applicable
NewOrderPayment - NewCreditCardPayment Type
Data Name
Data Type
Data Description
AccountNumber
string
Account number of the credit card for this NewCreditCardPayment
Amount
decimal
Amount to be charged to the credit card for this NewCreditCardPayment
City
string
City of the billing address of the credit card for this NewCreditCardPayment
Country
string
Country of the billing address of the credit card for this NewCreditCardPayment
Cvv
string
CVV code of the credit card for this NewCreditCardPayment
ExpirationDate
string
Expiration date of the credit card for this NewCreditCardPayment
Id
int
Incremental Id within the NewOrder
NameOnCard
string
Name on the credit card for this NewCreditCardPayment
PostalCode
string
Postal code of the billing address of the credit card for this NewCreditCardPayment
State
string
State of the billing address of the credit card for this NewCreditCardPayment
StreetAddress
string
Street address of the billing address of the credit card for this NewCreditCardPayment
TipAmount
decimal
Tip amount for this NewCreditCardPayment, if applicable
NewOrderPayment - NewExternalPayment Type
Data Name
Data Type
Data Description
Amount
decimal
Amount charged to the external account from this NewExternalPayment
Id
int
Incremental Id within the NewOrder
ReferenceDetails
Array of PaymentReferenceDetail
Optional list of reference details to include about this NewExternalPayment
TipAmount
decimal
Tip amount for this NewExternalPayment, if applicable
NewOrderPayment - NewExternallyTokenizedCreditCardPayment Type
Data Name
Data Type
Data Description
Amount
decimal
Amount charged to the external account from this NewExternalTokenizedCreditCardPayment
Id
int
Id of the NewExternalTokenizedCreditCardPayment
TipAmount
decimal
Tip amount for this NewExternalTokenizedCreditCardPayment, if applicable
Token
string
Token for this NewExternalTokenizedCreditCardPayment
CardExpirationDate
string
Expiration date of the credit card for this NewExternalTokenizedCreditCardPayment
Cvv
string
CVV code of the credit card for this NewExternalTokenizedCreditCardPayment
NameOnCard
string
Name on the credit card for this NewExternalTokenizedCreditCardPayment
StreetAddress
string
Street address of the billing address of the credit card for this NewExternalTokenizedCreditCardPayment
City
string
City of the billing address of the credit card for this NewExternalTokenizedCreditCardPayment
Country
string
Country of the billing address of the credit card for this NewExternalTokenizedCreditCardPayment
State
string
State of the billing address of the credit card for this NewExternalTokenizedCreditCardPayment
PostalCode
string
PostalCode of the billing address of the credit card for this NewExternalTokenizedCreditCardPayment
NewOrderPayment - NewGiftCardPayment Type
Data Name
Data Type
Data Description
AccountNumber
string
Account number of the gift card for this NewGiftCardPayment
Amount
decimal
Amount to be charged to the gift card for this NewGiftCardPayment
Cvv
string
Cvv of the gift card for this NewGiftCardPayment
ExpirationDate
string
Expiration date of the gift card for this NewGiftCardPayment
Id
int
Incremental Id within the NewOrder
TipAmount
decimal
Tip amount for this NewGiftPayment, if applicable
NewOrderPayment - NewGiftCertificatePayment Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of the gift certificate for this NewGiftCertificatePayment
Id
int
Incremental Id within the NewOrder
TipAmount
decimal
Tip amount for this NewGiftCertificatePayment, if applicable
NewOrderPromotion Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of promotion to apply to the NewOrder
Code
string
Code of the promotion of this NewOrderPromotion
Id
int
Incremental Id within the NewOrder
Name
string
Name of this NewOrderPromotion
RequiredOrderItemIds
List<int>
List of Id(s) of the NewOrderItem that are required by this NewOrderPromotion (Required field for BOGO promotion)
TargetOrderItemIds
List<int>
List of Id(s) of the NewOrderItem that are targeted by this NewOrderPromotion (Required field for All type of promotions)
NewOrderSurcharge Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of surcharge to apply to the NewOrder
Id
int
Incremental Id within the NewOrder
Name
string
Name of this NewOrderSurcharge
Order Type
Data Name
Data Type
Data Description
Balance
decimal
Balance remaining on this Order
BusinessDate
DateTime
Business date of this Order (the time component will always return as 00:00:00)
CreatedTime
DateTimeOffset
Date and time this Order was created in UTC
CustomerId
Guid
Id of the Customer on this Order, or an empty guid if there was no assigned Customer
Entries
Array of OrderEntry
Entries for this Order. An OrderEntry can either be of type OrderItem or an OrderGiftCard.
Id
long
Unique Id of this Order
IdEncoded
string
Unique encoded Id of this Order
IsClosed
bool
True if this Order is closed, False if not
IsSent
bool
True if this Order has been sent to the kitchen, False if not
IsTaxExempt
bool
True if this Order is exempt from taxes, False if not
LaneId
int
Id of the Lane for this Order
Name
string
Name of this Order
Number
int
Order, receipt, or call out number that cashiers use to call the customer for this Order
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
Total
decimal
Total for this Order
OrderDiscount Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of discount applied to the Order
Id
int
Unique Id of this OrderDiscount within the Order
Name
string
Name of this OrderDiscount
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
OrderEntry - OrderItem Type
Data Name
Data Type
Data Description
ComponentId
int?
Maps to the Id of the ItemCompositeComponent for this OrderItem, if this OrderItem is part of a combo
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
Id
int
Unique Id of this OrderItem within the Order
Note
string
Note for this OrderItem
Price
decimal
Price of this OrderItem
Seat
byte
Seat number of this OrderItem
SplitItemId
short
Id of the SplitItem if this OrderItem is Split, 0 if not split
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
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
Description
string
Description of this OrderItemModifier
Id
int
Unique Id of this OrderItemModifier within the OrderItem
Price
decimal
Price of this OrderItemModifier
OrderPayment Type
Data Name
Data Type
Data Description
AccountNumber
string
Account number of this OrderPayment, populated for credit card, gift card, and house account payments
AccountType
int
Account type of this OrderPayment for credit card payments
Returns one of the following:
Returns one of the following:
- 0 = Unspecified
- 1 = MasterCard
- 2 = Visa
- 3 = American Express
- 4 = Diners
- 5 = Discover
- 6 = enRoute
- 7 = JCB
- 8 = Private
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
CreditCardTransaction Information
Additional credit card transaction information returned by Vantiv
Id
int
Id of this OrderPayment within the Order
IsDeposit
bool
True if this OrderPayment was a deposit, False if not
ReferenceNumber
string
Reference number of this OrderPayment, populated with the authorization code for credit card and gift card payments
Time
DateTimeOffset
Date and time that this OrderPayment was made in UTC
TipAmount
decimal
Tip amount for this OrderPayment
AdditionalData
List<NameValuePair>
Any additional information
OrderPromotion Type
Data Name
Data Type
Data Description
Amount
decimal
Amount of promotion applied to the Order
Code
string
Code for this OrderPromotion
Id
int
Unique Id of this OrderPromotion within the Order
IsSystemApplied
bool
True if this OrderPromotion is system applied, False if not
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 system applied, False if not
Name
string
Name of this OrderSurcharge
OrderingOptions Type
Data Name
Data Type
Data Description
CalculateItemPrice
bool
True if the item prices should be calculated by the server, or False if the specified custom prices in the request should be used. Default is False if not specified.
Party Type
Data Name
Data Type
Data Description
CreatedTime
DateTime
Date and time this Party was created in UTC
Id
long
Unique Id of this Party
Name
string
Name of this Party
Size
decimal
Size of this Party
PaymentReferenceDetail Type
Data Name
Data Type
Data Description
Name
string
Name of the reference item, e.g. "Card Type"
Value
string
Value of the reference item, e.g. "Visa"
NewOrderItem Type
Data Name
Data Type
Data Description
ComboItems
Array of NewOrderItem
Combo component items in this NewOrderItem, if this NewOrderItem is a combo and applicable
ComponentId
int?
Maps to the Id of the ItemCompositeComponent for this OrderItem, if this NewOrderItem is part of a combo
Description
string
Description of this NewOrderItem
Id
int
Incremental Id within the NewOrder
Note
string
Note for this NewOrderItem
Price
decimal
Price of this NewOrderItem
Quantity
int
Quantity of this NewOrderItem
Seat
byte
Seat number of this NewOrderItem
ApplyPayment Sample Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel.Web;
using System.ServiceModel;
using Ordering_ApplyPayment.OrderingServiceReference;
namespace Ordering_ApplyPayment
{
class Program
{
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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";
long orderId = 12345;
//Include OrderId and Payment parameter in request body
var request = new ApplyPaymentRequest()
{
OrderId = orderId,
Payment = new NewExternalPayment()
{
Amount = 10.75m,
Id = 1,
TenderId = 1,
TipAmount = 0,
ReferenceDetails = new PaymentReferenceDetail[]
{
new PaymentReferenceDetail()
{
Name = "Card Type",
Value = "Visa",
}
}
}
};
//Make ApplyPayment call
var response = client.ApplyPayment(request);
if (response.ResultCode == 0)
{
Console.WriteLine($"Payment has been applied to Order {orderId}.");
Console.WriteLine("---------------------------");
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
}
Console.ReadKey();
}
}
}
}
CalculateOrder 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 Ordering_CalculateOrder.OrderingServiceReference;
namespace Ordering_CalculateOrder
{
class Program
{
public static CalculateOrderRequest CreateOrder()
{
int positiveId = 1;
var request = new CalculateOrderRequest()
{
Options = new OrderingOptions()
{
CalculateItemPrice = true,
},
Order = new NewOrder()
{
DestinationId = 1,
IsTaxExempt = false,
Items = new NewOrderItem[]
{
new NewOrderItem()
{
Description = "Cheeseburger",
Id = positiveId,
ItemId = 123,
DestinationId = 1,
},
},
Name = "Online Order",
}
};
return request;
}
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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";
//Include ordering options and an order as parameters in request body
var request = CreateOrder();
//Make CalculateOrder call
var response = client.CalculateOrder(request);
//If call is successful
if (response.ResultCode == 0)
{
var order = response.Order;
Console.WriteLine("Balance: " + order.Balance);
Console.WriteLine("Entries:");
//Loop through collection of OrderEntry objects returned
if (order.Entries != null)
{
foreach (var entry in order.Entries.OfType<OrderItem>())
{
Console.WriteLine("\tDescription: " + entry.Description);
Console.WriteLine("\tId: " + entry.Id);
Console.WriteLine("\tItemId: " + entry.ItemId);
Console.WriteLine("\tPrice: " + entry.Price);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Id: " + order.Id);
Console.WriteLine("Name: " + order.Name);
Console.WriteLine("Subtotal: " + order.Subtotal);
Console.WriteLine("Tax: " + order.Tax);
Console.WriteLine("Total: " + order.Total);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
}
}
}
}
CancelOrder 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 Ordering_CancelOrder.OrderingServiceReference;
namespace Ordering_CancelOrder
{
class Program
{
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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";
long orderId = 12345;
//Include ordering options and an order as parameters in request body
var request = new CancelOrderRequest()
{
OrderId = orderId,
SuppressCancellationEmail = true,
};
//Make CancelOrder call
var response = client.CancelOrder(request);
//If call is successful
if (response.ResultCode == 0)
{
Console.WriteLine("Order " + orderId + " successfully cancelled.");
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetItemAvailability 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 Ordering_GetItemAvailability.OrderingServiceReference;
namespace Ordering_GetItemAvailability
{
class Program
{
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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";
int itemId = 12345;
//Include ordering options and an order as parameters in request body
var request = new GetItemAvailabilityRequest()
{
ItemIds = new int[]
{
itemId,
}
};
//Make GetItemAvailability call
var response = client.GetItemAvailability(request);
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of SecurityLevel objects returned
if (response.Details != null)
{
foreach (var detail in response.Details)
{
Console.WriteLine("Detail #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("IsAvailable: " + detail.IsAvailable);
Console.WriteLine("ItemId: " + detail.ItemId);
Console.WriteLine("QuantityAvailable: " + detail.QuantityAvailable);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetMasterTerminalStatus 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 Ordering_GetMasterTerminalStatus.OrderingServiceReference;
namespace Ordering_GetMasterTerminalStatus
{
class Program
{
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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 GetMasterTerminalStatus call
var response = client.GetMasterTerminalStatus();
//If call is successful
if (response.ResultCode == 0)
{
Console.WriteLine("Status: " + response.Status);
if (response.Status == 1)
{
Console.WriteLine("Master Terminal is Online.");
}
else
{
Console.WriteLine("Master Terminal is Offline.");
}
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
GetOrder 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 Ordering_GetOrder.OrderingServiceReference;
namespace Ordering_GetOrder
{
class Program
{
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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";
long orderId = 12345;
//Include OrderId parameter in request body
var request = new GetOrderRequest()
{
OrderId = orderId,
};
//Make GetOrder call
var response = client.GetOrder(request);
//If call is successful
if (response.ResultCode == 0)
{
var order = response.Order;
Console.WriteLine("Balance: " + order.Balance);
Console.WriteLine("Entries:");
//Loop through collection of OrderEntry objects returned
if (order.Entries != null)
{
foreach (var entry in order.Entries.OfType<OrderItem>())
{
Console.WriteLine("\tDescription: " + entry.Description);
Console.WriteLine("\tId: " + entry.Id);
Console.WriteLine("\tItemId: " + entry.ItemId);
Console.WriteLine("\tPrice: " + entry.Price);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Id: " + order.Id);
Console.WriteLine("Name: " + order.Name);
Console.WriteLine("Subtotal: " + order.Subtotal);
Console.WriteLine("Tax: " + order.Tax);
Console.WriteLine("Total: " + order.Total);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
}
}
}
}
GetParty Minified Sample Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Ordering_GetParty.OrderingServiceReference;
namespace Ordering_GetParty
{
class Program
{
public static void DisplayModifiers(OrderItemModifier1[] modifiers)
{
//Loop through collection of OrderItemModifier objects returned
foreach (var mod in modifiers)
{
Console.WriteLine("\t\t\tId: " + mod.Id);
Console.WriteLine("\t\t\tItemId: " + mod.ItemId);
Console.WriteLine("\t\t\tModifierCodeId: " + mod.ModifierCodeId);
Console.WriteLine("\t\t\tModifierGroupId: " + mod.ModifierGroupId);
//Loop through collection of OrderItemModifier objects returned
if (mod.Modifiers != null)
{
DisplayModifiers(mod.Modifiers);
}
Console.WriteLine("\t\t\t------------");
}
}
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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";
DateTime businessDate = DateTime.Today.Date;
int tableId = 12345;
//Include BusinessDate and TableId parameter in request body
var request = new GetPartyRequest()
{
BusinessDate = businessDate,
TableId = tableId
};
//Make GetParty call
var response = client.GetParty(request);
//If call is successful
if (response.ResultCode == 0)
{
var party = response.Party;
Console.WriteLine("CreatedTime: " + party.CreatedTime);
Console.WriteLine("Id: " + party.Id);
Console.WriteLine("Name: " + party.Name);
foreach (var order in party.Orders)
{
Console.WriteLine("\tBusinessDate: " + order.BusinessDate);
Console.WriteLine("\tCount: " + order.Count);
Console.WriteLine("\tCustomerId: " + order.CustomerId);
Console.WriteLine("\tEmployeeId: " + order.EmployeeId);
Console.WriteLine("\tEntries:");
//Loop through collection of OrderEntry objects returned
if (order.Entries != null)
{
foreach (var entry1 in order.Entries.OfType<OrderItem1>)
{
Console.WriteLine("\t\tModifiers:");
//Loop through collection of OrderItemModifier objects returned
if (entry1.Modifiers != null)
{
DisplayModifiers(entry1.Modifiers);
}
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\tFirstSendTime: " + order.FirstSendTime);
Console.WriteLine("\tGuestCount: " + order.GuestCount);
Console.WriteLine("\tId: " + order.Id);
Console.WriteLine("\tIsClosed: " + order.IsClosed);
Console.WriteLine("\tModifiedTime: " + order.ModifiedTime);
Console.WriteLine("\tName: " + order.Name);
Console.WriteLine("\tOpenedTime: " + order.OpenedTime);
Console.WriteLine("\tPayments:");
//Loop through collection of OrderPayment objects returned
if (order.Payments != null)
{
foreach (var payment in order.Payments)
{
Console.WriteLine("\t\tAmount: " + payment.Amount);
Console.WriteLine("\t\tBusinessDate: " + payment.BusinessDate);
Console.WriteLine("\t\tId: " + payment.Id);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\tPickupTime: " + order.PickupTime);
Console.WriteLine("\tTotal: " + order.Total);
Console.WriteLine("\t\t------------");
}
Console.WriteLine("Size: " + party.Size);
Console.WriteLine("TableId: " + party.TableId);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
}
Console.ReadKey();
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Ordering_GetUnavailableItems.OrderingServiceReference;
namespace Ordering_GetUnavailableItems
{
class Program
{
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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 GetUnavailableItems call
var response = client.GetUnavailableItems();
//If call is successful
if (response.ResultCode == 0)
{
//Retrieve and print item IDs from the response
Console.WriteLine("Unavailable Item IDs:");
if (response.ItemIds != null && response.ItemIds.Any())
{
foreach (var itemId in response.ItemIds)
{
Console.WriteLine(itemId);
}
}
else
{
Console.WriteLine("No unavailable items found.");
}
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
else
{
//Print error information
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference3;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Ordering_GetUnavailableItems
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddOrderingServiceClient()
{
services.AddTransient<IOrderingWebService>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress("{YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<IOrderingWebService> factory = new ChannelFactory<IOrderingWebService>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddOrderingServiceClient();
IOrderingWebService client = services.BuildServiceProvider().GetRequiredService<IOrderingWebService>();
try
{
int count = 1;
using (OperationContextScope scope = new OperationContextScope((IContextChannel)client))
{
OperationContext context = OperationContext.Current;
HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty();
httpRequestProperty.Headers["AccessToken"] = "AccessToken";
httpRequestProperty.Headers["LocationToken"] = "LocationToken";
context.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;
var response = client.GetUnavailableItemsAsync();
Console.WriteLine("GetUnavailableItems");
Console.WriteLine("-----------------------");
//If call is successful
if (response.Result.ResultCode == 0)
{
//Retrieve and print item IDs from the response
Console.WriteLine("Unavailable Item IDs:");
if (response.Result.ItemIds != null && response.Result.ItemIds.Any())
{
foreach (var itemId in response.Result.ItemIds)
{
Console.WriteLine(itemId);
}
}
else
{
Console.WriteLine("No unavailable items found.");
}
Console.WriteLine("---------------------------");
Console.WriteLine("End");
}
else
{
//Print error information
Console.WriteLine($"Error Code: {response.Result.ResultCode}");
Console.WriteLine($"Message: {response.Result.Message}");
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetUnavailableItems operation: " + ex.Message);
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.brinksoftware.com/webservices/ordering/20140219">
<soapenv:Header/>
<soapenv:Body>
<ns:GetUnavailableItems/>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
accessToken = 'AccessToken'
locationToken = 'LocationToken'
#Include tokens in HTTP Web Request Headers
session = requests.Session()
session.headers.update({'AccessToken':accessToken,'LocationToken':locationToken})
transport = Transport(session=session)
#Connect to Ordering service client
client = Client(wsdl={YOUR_WSDL_URL_GOES_HERE}, transport=transport)
service = client.create_service(
'{http://tempuri.org/}BasicHttpBinding_IOrderingWebService',
'https://{YourStack}.brinkpos.net/Ordering.svc'
)
try:
#Make GetUnavailableItems call
res = service.GetUnavailableItems()
#If call is successful
if(res.ResultCode == 0):
print("Unavailable Item IDs:")
if(res.ItemIds):
for (item_id) in res.ItemIds:
print(item_id)
else:
print("No unavailable items found.")
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
SendOrder 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 Ordering_SendOrder.OrderingServiceReference;
namespace Localhost_Ordering_SendOrder_SampleCode
{
class Program
{
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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";
long orderId = 12345;
//Include OrderId parameter in request body
var request = new SendOrderRequest()
{
OrderId = orderId,
};
//Make SendOrder call
var response = client.SendOrder(request);
//If call is successful
if (response.ResultCode == 0)
{
Console.WriteLine($"Order {orderId} has been sent.");
Console.WriteLine("---------------------------");
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
}
Console.ReadKey();
}
}
}
}
SubmitOrder 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 Ordering_SubmitOrder.OrderingServiceReference;
namespace Ordering_SubmitOrder
{
class Program
{
public static NewOrder CreateOrder()
{
int positiveId = 1;
var order = new NewOrder()
{
DestinationId = 1,
FutureOrder = new NewFutureOrderDetails()
{
PickupTime = new DateTimeOffset(DateTime.Now.AddMinutes(30)),
SendReminderEmail = false,
},
Items = new NewOrderItem[]
{
new NewOrderItem()
{
Description = "Cheeseburger",
Id = positiveId,
ItemId = 123,
DestinationId = 1,
},
},
Name = "Online Order",
};
return order;
}
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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";
//Include ordering options and an order as parameters in request body
var request = new SubmitOrderRequest()
{
Options = new OrderingOptions()
{
CalculateItemPrice = true,
},
Order = CreateOrder(),
SuppressConfirmationEmail = true,
};
//Make SubmitOrder call
var response = client.SubmitOrder(request);
//If call is successful
if (response.ResultCode == 0)
{
Console.WriteLine("Order " + response.OrderId + " successfully submitted.");
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
}
}
}
}
UpdateItemAvailability 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 Ordering_UpdateItemAvailability.OrderingServiceReference;
namespace Ordering_UpdateItemAvailability
{
class Program
{
static void Main(string[] args)
{
//Connect to Ordering service client
var client = new OrderingWebServiceClient();
//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 itemId = 12345;
int quantityAvailable = -1;
//Include details parameter in request body
var request = new UpdateItemAvailabilityRequest()
{
Details = new ItemAvailabilityDetail[]
{
new ItemAvailabilityDetail()
{
IsAvailable = true,
ItemId = itemId,
QuantityAvailable = quantityAvailable,
},
}
};
//Make UpdateItemAvailability call
var response = client.UpdateItemAvailability(request);
//If call is successful
if (response.ResultCode == 0)
{
Console.WriteLine("Availability of Item " + itemId + " has successfully been updated.");
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}