using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_DeleteBusinessHours.ServiceReference1;
namespace API_Settings2_DeleteBusinessHours
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var deleteBusinessHoursRequest = new DeleteBusinessHoursRequest()
{
BusinessDate = new DateTime(2023, 1,1),
ChangesetName = "DeleteBusinessHours",
IsImmediatePublish = false,
BusinessHourIds = new[] { 1,2,3 }
};
var deleteBusinessHoursResponse = clientSettingsWebService2Client.DeleteBusinessHours(deleteBusinessHoursRequest);
if (deleteBusinessHoursResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deleteBusinessHoursResponse.ResultCode}");
Console.WriteLine($"Message: {deleteBusinessHoursResponse.Message}");
foreach (var saveResult in deleteBusinessHoursResponse.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.Xml.Linq;
namespace Settings2_DeleteBusinessHours
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
try
{
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 deleteBusinessHoursRequest = new DeleteBusinessHoursRequest()
{
BusinessDate = new DateTime(2024, 3, 30),
ChangesetName = "DeleteBusinessHours",
IsImmediatePublish = false,
BusinessHourIds = new[] { 676652170 }
};
var deleteBusinessHoursResponse = client.DeleteBusinessHoursAsync(deleteBusinessHoursRequest);
Console.WriteLine("DeleteBusinessHours");
Console.WriteLine("--------------------");
if (deleteBusinessHoursResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deleteBusinessHoursResponse.Result.ResultCode}");
Console.WriteLine($"Message: {deleteBusinessHoursResponse.Result.Message}");
foreach (var saveResult in deleteBusinessHoursResponse.Result.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling DeleteBusinessHours operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:DeleteBusinessHours>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>DeleteBusinessHours</v2:ChangesetName>
<v2:IsImmediatePublish>1</v2:IsImmediatePublish>
<v2:BusinessHourIds>
<!--Zero or more repetitions:-->
<arr:int>1</arr:int>
<arr:int>2</arr:int>
<arr:int>3</arr:int>
</v2:BusinessHourIds>
</v2:request>
</v2:DeleteBusinessHours>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
from datetime import datetime
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the parameter in request body
businessdate = datetime.today()
changesetname = "DeleteBusinessHours"
isimmediatepublish = 0
BusinessHourIds = [1,2,3]
reqType = client.get_type('ns1:DeleteBusinessHoursRequest')
req = reqType(BusinessDate = businessdate, IsImmediatePublish = isimmediatepublish, BusinessHourIds=BusinessHourIds)
count=1
try:
#Make DeleteBusinessHours call
res = service.DeleteBusinessHours(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_DeleteDestinations.ServiceReference1;
namespace API_Settings2_DeleteDestinations
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var deleteDestinationsRequest = new DeleteDestinationsRequest()
{
BusinessDate = new DateTime(2023, 1,1),
ChangesetName = "DeleteDestinations",
IsImmediatePublish = false,
DestinationsIds = new[] { 1,2,3 }
};
var deleteDestinationsResponse = clientSettingsWebService2Client.DeleteDestinations(deleteDestinationsRequest);
if (deleteDestinationsResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deleteDestinationsResponse.ResultCode}");
Console.WriteLine($"Message: {deleteDestinationsResponse.Message}");
foreach (var saveResult in deleteDestinationsResponse.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_DeleteDestinations
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 deleteDestinationsRequest = new DeleteDestinationsRequest()
{
BusinessDate = new DateTime(2023, 1, 1),
ChangesetName = "DeleteDestinations",
IsImmediatePublish = false,
DestinationsIds = new[] { 1, 2, 3 }
};
var deleteDestinationsResponse = client.DeleteDestinationsAsync(deleteDestinationsRequest);
if (deleteDestinationsResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deleteDestinationsResponse.Result.ResultCode}");
Console.WriteLine($"Message: {deleteDestinationsResponse.Result.Message}");
foreach (var saveResult in deleteDestinationsResponse.Result.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling DeleteDestinations operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:DeleteDestinations>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>DeleteDestinations</v2:ChangesetName>
<v2:IsImmediatePublish>1</v2:IsImmediatePublish>
<v2:DestinationsIds>
<!--Zero or more repetitions:-->
<arr:int>1</arr:int>
<arr:int>2</arr:int>
<arr:int>3</arr:int>
</v2:DestinationsIds>
</v2:request>
</v2:DeleteDestinations>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
from datetime import datetime
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the parameter in request body
businessdate = datetime.today()
changesetname = "DeleteDestinations"
isimmediatepublish = 0
destinationsids = [1,2,3]
reqType = client.get_type('ns1:DeleteDestinationsRequest')
req = reqType(BusinessDate = businessdate, IsImmediatePublish = isimmediatepublish, DestinationsIds=destinationsids)
count=1
try:
#Make DeleteDestinations call
res = service.DeleteDestinations(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_DeleteExceptionDates.ServiceReference1;
namespace API_Settings2_DeleteExceptionDates
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var deleteExceptionDatesRequest = new DeleteExceptionDatesRequest()
{
BusinessDate = new DateTime(2023, 1,1),
ChangesetName = "DeleteExceptionDates",
IsImmediatePublish = false,
ExceptionDateIds = new[] { 1,2,3 }
};
var deleteExceptionDatesResponse = clientSettingsWebService2Client.DeleteExceptionDates(deleteExceptionDatesRequest);
if (deleteExceptionDatesResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deleteExceptionDatesResponse.ResultCode}");
Console.WriteLine($"Message: {deleteExceptionDatesResponse.Message}");
foreach (var saveResult in deleteExceptionDatesResponse.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_DeleteExceptionDates
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
try
{
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 deleteExceptionDatesRequest = new DeleteExceptionDatesRequest()
{
BusinessDate = new DateTime(2024, 3, 30),
ChangesetName = "DeleteExceptionDates",
IsImmediatePublish = false,
ExceptionDateIds = new[] { 676652047 }
};
var deleteExceptionDatesResponse = client.DeleteExceptionDatesAsync(deleteExceptionDatesRequest);
Console.WriteLine("DeleteExceptionDates");
Console.WriteLine("---------------------------");
if (deleteExceptionDatesResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deleteExceptionDatesResponse.Result.ResultCode}");
Console.WriteLine($"Message: {deleteExceptionDatesResponse.Result.Message}");
foreach (var saveResult in deleteExceptionDatesResponse.Result.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling DeleteExceptionDates operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:DeleteExceptionDates>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>DeleteExceptionDates</v2:ChangesetName>
<v2:IsImmediatePublish>1</v2:IsImmediatePublish>
<v2:ExceptionDateIds>
<!--Zero or more repetitions:-->
<arr:int>1</arr:int>
<arr:int>2</arr:int>
<arr:int>3</arr:int>
</v2:ExceptionDateIds>
</v2:request>
</v2:DeleteExceptionDates>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
from datetime import datetime
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the parameter in request body
businessdate = datetime.today()
changesetname = "DeleteExceptionDates"
isimmediatepublish = 0
ExceptionDateIds = [1,2,3]
reqType = client.get_type('ns1:DeleteExceptionDatesRequest')
req = reqType(BusinessDate = businessdate, IsImmediatePublish = isimmediatepublish, ExceptionDateIds=ExceptionDateIds)
count=1
try:
#Make DeleteExceptionDates call
res = service.DeleteExceptionDates(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_DeleteItems.ServiceReference1;
namespace API_Settings2_DeleteItems
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"AccessToken";
var locationToken = @"LocationToken";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var deleteItemsRequest = new DeleteItemsRequest()
{
BusinessDate = new DateTime(2023, 07, 28),
ChangesetName = "DeleteItems",
IsImmediatePublish = false,
ItemIds = new[] { 1,2,3 }
};
DeleteItemsRequest1 request1 = new DeleteItemsRequest1();
request1.request = deleteItemsRequest;
var deleteItemsResponse = clientSettingsWebService2Client.DeleteItems(request1);
if (deleteItemsResponse.DeleteItemsResult.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deleteItemsResponse.DeleteItemsResult.ResultCode}");
Console.WriteLine($"Message: {deleteItemsResponse.DeleteItemsResult.Message}");
foreach (var error in deleteItemsResponse.DeleteItemsResult.Errors)
{
Console.WriteLine($"\tError: {error}");
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_DeleteItems
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 deleteItemsRequest = new DeleteItemsRequest()
{
BusinessDate = new DateTime(2024, 03, 30),
ChangesetName = "DeleteItems",
IsImmediatePublish = false,
ItemIds = new[] { 676652110 }
};
var deleteItemsResponse = client.DeleteItemsAsync(deleteItemsRequest);
Console.WriteLine("Deleteitems");
Console.WriteLine("-------------");
if (deleteItemsResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deleteItemsResponse.Result.ResultCode}");
Console.WriteLine($"Message: {deleteItemsResponse.Result.Message}");
foreach (var error in deleteItemsResponse.Result.Errors)
{
Console.WriteLine($"\tError: {error}");
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling DeleteItems operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:DeleteItems>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>DeleteItems</v2:ChangesetName>
<v2:IsImmediatePublish>1</v2:IsImmediatePublish>
<v2:ItemsIds>
<!--Zero or more repetitions:-->
<arr:int>676651720</arr:int>
</v2:ItemsIds>
</v2:request>
</v2:DeleteItems>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
from datetime import datetime
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the parameter in request body
businessdate = datetime.today()
changesetname = "DeleteItems"
isimmediatepublish = 0
itemids = [1,2,3]
reqType = client.get_type('ns1:DeleteItemsRequest')
req = reqType(BusinessDate = businessdate, IsImmediatePublish = isimmediatepublish, ItemIds=itemids)
try:
#Make DeleteItems call
res = service.DeleteItems(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_DeletePriceChanges.ServiceReference1;
namespace API_Settings2_DeletePriceChanges
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var deletePriceChangesRequest = new DeletePriceChangesRequest()
{
BusinessDate = new DateTime(2023, 01, 01),
ChangesetName = "DeletePriceChanges",
IsImmediatePublish = false,
PriceChangeIds = new[] {1, 2, 3}
};
var deletePriceChangesResponse = clientSettingsWebService2Client.DeletePriceChanges(deletePriceChangesRequest);
if (deletePriceChangesResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deletePriceChangesResponse.ResultCode}");
Console.WriteLine($"Message: {deletePriceChangesResponse.Message}");
foreach (var error in deletePriceChangesResponse.Errors)
{
Console.WriteLine($"\tError: {error}");
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_DeletePriceChanges
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 deletePriceChangesRequest = new DeletePriceChangesRequest()
{
BusinessDate = new DateTime(2024, 03, 30),
ChangesetName = "DeletePriceChanges",
IsImmediatePublish = false,
PriceChangeIds = new[] { 676652166 }
};
var deletePriceChangesResponse = client.DeletePriceChangesAsync(deletePriceChangesRequest);
Console.WriteLine("DeletePriceChanges");
Console.WriteLine("------------------");
if (deletePriceChangesResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deletePriceChangesResponse.Result.ResultCode}");
Console.WriteLine($"Message: {deletePriceChangesResponse.Result.Message}");
foreach (var error in deletePriceChangesResponse.Result.Errors)
{
Console.WriteLine($"\tError: {error}");
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling DeletePriceChanges operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:DeletePriceChanges>
<v2:request>
<v2:BusinessDate>2023-01-01</v2:BusinessDate>
<v2:ChangesetName>DeletePriceChanges</v2:ChangesetName>
<v2:IsImmediatePublish>false</v2:IsImmediatePublish>
<v2:PriceChangeIds>
<!--Zero or more repetitions:-->
<arr:int>1</arr:int>
<arr:int>2</arr:int>
</v2:PriceChangeIds>
</v2:request>
</v2:DeletePriceChanges>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
from datetime import datetime
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the parameter in request body
businessdate = datetime.today()
changesetname = "DeletePriceChanges"
isimmediatepublish = 0
pricechangeids = [1,2,3]
reqType = client.get_type('ns1:DeletePriceChangesRequest')
req = reqType(BusinessDate = businessdate,IsImmediatePublish = isimmediatepublish,PriceChangeIds=pricechangeids)
count = 1
try:
#Make DeletePriceChanges call
res = service.DeletePriceChanges(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_DeleteTaxes.ServiceReference1;
namespace API_Settings2_DeleteTaxes
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var deleteTaxesRequest = new DeleteTaxesRequest()
{
BusinessDate = new DateTime(2023, 1, 1),
ChangesetName = "DeleteTaxes",
IsImmediatePublish = false,
TaxIds = new[] { 1,2,3 }
};
var deleteTaxesResponse = clientSettingsWebService2Client.DeleteTaxes(deleteTaxesRequest);
if (deleteTaxesResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deleteTaxesResponse.ResultCode}");
Console.WriteLine($"Message: {deleteTaxesResponse.Message}");
foreach (var saveResult in deleteTaxesResponse.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_DeleteTaxes
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 deleteTaxesRequest = new DeleteTaxesRequest()
{
BusinessDate = new DateTime(2024, 3, 30),
ChangesetName = "DeleteTaxes",
IsImmediatePublish = false,
TaxIds = new[] { 676652178 }
};
var deleteTaxesResponse = client.DeleteTaxesAsync(deleteTaxesRequest);
Console.WriteLine("DeleteTaxes");
Console.WriteLine("------------");
if (deleteTaxesResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
}
else
{
Console.WriteLine($"Error Code: {deleteTaxesResponse.Result.ResultCode}");
Console.WriteLine($"Message: {deleteTaxesResponse.Result.Message}");
foreach (var saveResult in deleteTaxesResponse.Result.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling DeleteTaxes operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:DeleteTaxes>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.plus(3).format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>DeleteTaxes</v2:ChangesetName>
<v2:IsImmediatePublish>0</v2:IsImmediatePublish>
<v2:TaxIds>
<!--Zero or more repetitions:-->
<arr:int>1</arr:int>
<arr:int>2</arr:int>
<arr:int>3</arr:int>
</v2:TaxIds>
</v2:request>
</v2:DeleteTaxes>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
from datetime import datetime
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the parameter in request body
businessdate = datetime.today()
changesetname = "DeleteTaxes"
isimmediatepublish = 0
taxids = [1,2,3]
reqType = client.get_type('ns1:DeleteTaxesRequest')
req = reqType(BusinessDate = businessdate, IsImmediatePublish = isimmediatepublish, TaxIds=taxids)
try:
#Make DeleteTaxes call
res = service.DeleteTaxes(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetBrands.Settings2ServiceReference;
namespace Settings2_GetBrands
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
//Make GetBrands call
var response = client.GetBrands();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Brand objects returned
if (response.Collection != null)
{
foreach (var item in response.Collection)
{
Console.WriteLine("Brand #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetBrands
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetBrandsAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of Brand objects returned
if (response.Result.Collection != null)
{
foreach (var item in response.Result.Collection)
{
Console.WriteLine("Brand #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetBrands operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetBrands/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetBrands call
res = service.GetBrands()
#If call is successful
if(res.ResultCode == 0):
if(res.Collection != None):
#Loop through collection of Brand objects returned
for item in res.Collection.Brand:
print('Brand #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetBusinessHours.Settings2ServiceReference;
namespace Settings2_GetBusinessHours
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
var request = new GetBusinessHoursRequest()
{
StartDate="2020-11-11",
EndDate="2020-12-12"
};
//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 GetBusinessHours call
var response = client.GetGetBusinessHours(request);
//If call is successful
if (response.GetBusinessHoursResult.ResultCode == 0)
{
//Loop through collection of LocationOptions objects returned
if (response.GetBusinessHoursResult.LocationOptions != null)
{
foreach (var item in response.GetBusinessHoursResult.LocationOptions)
{
foreach (var businessHour in response.GetBusinessHoursResult.LocationOptions.BusinessHours)
{
Console.WriteLine("---------------------------");
Console.WriteLine("CloseTime: " + businessHour.CloseTime);
Console.WriteLine("DayOfWeek: " + businessHour.DayOfWeek);
Console.WriteLine("OpenTime: " + businessHour.OpenTime);
}
foreach (var excDate in response.GetBusinessHoursResult.LocationOptions.ExceptionDates)
{
Console.WriteLine("---------------------------");
Console.WriteLine("CloseTime: " + excDate.CloseTime);
Console.WriteLine("Date: " + excDate.Date);
Console.WriteLine("IsOpen: " + excDate.IsOpen);
Console.WriteLine("OpenTime: " + excDate.OpenTime);
}
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.GetBusinessHoursResult.ResultCode);
Console.WriteLine("Message: " + response.GetBusinessHoursResult.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetBusinessHours
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
try
{
var request = new GetBusinessHoursRequest()
{
StartDate = new DateTime(2022, 12, 20),
EndDate = new DateTime(2027, 12, 22)
};
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.GetBusinessHoursAsync(request);
if (response.Result.ResultCode == 0)
{
//Loop through collection of LocationOptions objects returned
if (response.Result.LocationOptions != null)
{
Console.WriteLine("---------------------------");
Console.WriteLine("BusinessHours");
foreach (var businessHour in response.Result.LocationOptions.BusinessHours)
{
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + businessHour.Id);
Console.WriteLine("CloseTime: " + businessHour.CloseTime);
Console.WriteLine("DayOfWeek: " + businessHour.DayOfWeek);
Console.WriteLine("OpenTime: " + businessHour.OpenTime);
}
Console.WriteLine("---------------------------");
Console.WriteLine("ExceptionDates");
foreach (var excDate in response.Result.LocationOptions.ExceptionDates)
{
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + excDate.Id);
Console.WriteLine("Name: " + excDate.Name);
Console.WriteLine("CloseTime: " + excDate.CloseTime);
Console.WriteLine("Date: " + excDate.Date);
Console.WriteLine("IsOpen: " + excDate.IsOpen);
Console.WriteLine("OpenTime: " + excDate.OpenTime);
}
}
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetBusinessHours operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetBusinessHours>
<v2:request>
<v2:EndDate>2023-01-01</v2:EndDate>
<v2:StartDate>2022-01-01</v2:StartDate>
</v2:request>
</v2:GetBusinessHours>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
from datetime import datetime
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the MenuId parameter in request body
startDate = datetime.today()
endDate = datetime.today()
reqType = client.get_type('ns1:GetBusinessHoursRequest')
req = reqType(StartDate = startDate,EndDate = endDate)
count = 1
try:
#Make GetBusinessHours call
res = service.GetBusinessHours(req)
#If call is successful
if(res.ResultCode == 0):
item = res.LocationOptions
print('BusinessHours: ' + str(item.BusinessHours))
print('ExceptionDate: ' + str(item.ExceptionDate))
print('\t-----------------------')
count += 1
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using ServiceReference1;
namespace Settings2_GetCharities
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
var request = new GetCharitiesRequest();
//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";
//Make GetCharities call
var response = client.GetCharities(request);
//If call is successful
if (response.GetCharitiesResult.ResultCode == 0)
{
//Loop through collection of Charity objects returned
if (response.GetCharitiesResult.Collection != null)
{
foreach (var charity in response.GetCharitiesResult.Collection)
{
Console.WriteLine("Charity #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + charity.Id);
Console.WriteLine("Name: " + charity.Name);
Console.WriteLine("AutomaticallyApply: " + charity.AutomaticallyApply);
Console.WriteLine("Days: " + charity.Days);
Console.WriteLine("EndDate: " + charity.EndDate);
Console.WriteLine("EndTime: " + charity.EndTime);
Console.WriteLine("EnforceDateRange: " + charity.EnforceDateRange);
Console.WriteLine("EnforceDays: " + charity.EnforceDays);
Console.WriteLine("EnforceMaximumPerOrder: " + charity.EnforceMaximumPerOrder);
Console.WriteLine("EnforceTimeRange: " + charity.EnforceTimeRange);
Console.WriteLine("IsActive: " + charity.IsActive);
Console.WriteLine("Items: ");
if (charity.Items != null)
{
foreach (var item in charity.Items)
{
Console.WriteLine("\tItemId: " + item.ItemId);
}
}
Console.WriteLine("MaximumPerOrder: " + charity.MaximumPerOrder);
Console.WriteLine("Percent: " + charity.Percent);
Console.WriteLine("RoundUp: " + charity.RoundUp);
Console.WriteLine("StartDate: " + charity.StartDate);
Console.WriteLine("StartTime: " + charity.StartTime);
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.GetCharitiesResult.ResultCode);
Console.WriteLine("Message: " + response.GetCharitiesResult.Message);
Console.ReadKey();
}
}
}
}
}
using Microsoft.Extensions.DependencyInjection;
using ServiceReference1;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetCharities
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress("{YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 request = new GetCharitiesRequest();
var response = client.GetCharitiesAsync(request);
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of Charity objects returned
if (response.Result.Collection != null)
{
foreach (var charity in response.Result.Collection)
{
Console.WriteLine("Charity #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + charity.Id);
Console.WriteLine("Name: " + charity.Name);
Console.WriteLine("AutomaticallyApply: " + charity.AutomaticallyApply);
Console.WriteLine("Days: " + charity.Days);
Console.WriteLine("EndDate: " + charity.EndDate);
Console.WriteLine("EndTime: " + charity.EndTime);
Console.WriteLine("EnforceDateRange: " + charity.EnforceDateRange);
Console.WriteLine("EnforceDays: " + charity.EnforceDays);
Console.WriteLine("EnforceMaximumPerOrder: " + charity.EnforceMaximumPerOrder);
Console.WriteLine("EnforceTimeRange: " + charity.EnforceTimeRange);
Console.WriteLine("IsActive: " + charity.IsActive);
Console.WriteLine("Items: ");
if (charity.Items != null)
{
foreach (var item in charity.Items)
{
Console.WriteLine("\tItemId: " + item.ItemId);
}
}
Console.WriteLine("MaximumPerOrder: " + charity.MaximumPerOrder);
Console.WriteLine("Percent: " + charity.Percent);
Console.WriteLine("RoundUp: " + charity.RoundUp);
Console.WriteLine("StartDate: " + charity.StartDate);
Console.WriteLine("StartTime: " + charity.StartTime);
}
}
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetCharity operation: " + ex.Message);
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:set="http://schemas.datacontract.org/2004/07/SettingsApi.V2.Operations.GetCharities" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:GetCharities>
<!--Optional:-->
<v2:request>
<!--Optional:-->
<set:CharityIds>
<!--Zero or more repetitions:-->
<arr:int>101</arr:int>
</set:CharityIds>
</v2:request>
</v2:GetCharities>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetCharities call
res = service.GetCharities()
#If call is successful
if(res.ResultCode == 0):
if(res.Collection != None):
#Loop through collection of Charity objects returned
for charity in res.Collection.Charity:
print('Charity #' + str(count))
print('---------------------------')
print('Id: ' + str(charity.Id))
print('Name: ' + str(charity.Name))
print('AutomaticallyApply: ' + str(charity.AutomaticallyApply))
print('Days: ' + str(charity.Days))
print('EndDate: ' + str(charity.EndDate))
print('EndTime: ' + str(charity.EndTime))
print('EnforceDateRange: ' + str(charity.EnforceDateRange))
print('EnforceDays: ' + str(charity.EnforceDays))
print('EnforceMaximumPerOrder: ' + str(charity.EnforceMaximumPerOrder))
print('EnforceTimeRange: ' + str(charity.EnforceTimeRange))
print('IsActive: ' + str(charity.IsActive))
print('MaximumPerOrder: ' + str(charity.MaximumPerOrder))
print('Percent: ' + str(charity.Percent))
print('RoundUp: ' + str(charity.RoundUp))
print('StartDate: ' + str(charity.StartDate))
print('StartTime: ' + str(charity.StartTime))
print('Items:')
if(charity.Items != None):
#Loop through collection of CharityItem objects returned
for change in charity.Items:
print('\tItemId: ' + str(change.ItemId))
print('---------------------------')
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetDestinations.Settings2ServiceReference;
namespace Settings2_GetDestinations
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
//Make GetDestinations call
var response = client.GetDestinations();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Destination objects returned
if (response.Collection != null)
{
foreach (var item in response.Collection)
{
Console.WriteLine("Destination #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AllItems: " + item.AllItems);
Console.WriteLine("AutoCloseFutureOrders: " + item.AutoCloseFutureOrders);
Console.WriteLine("AutoPrintType: " + item.AutoPrintType);
Console.WriteLine("AutoPrintCreditVouchers: " + item.AutoPrintCreditVouchers);
Console.WriteLine("AutoPrintPrinterId: " + item.AutoPrintPrinterId);
Console.WriteLine("DeliveryMinutes: " + item.DeliveryMinutes);
Console.WriteLine("Description: " + item.Description);
Console.WriteLine("Indicator: " + item.Indicator);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("IsDelivery: " + item.IsDelivery);
Console.WriteLine("KitchenChitHeader: " + item.KitchenChitHeader);
Console.WriteLine("KitchenDescription: " + item.KitchenDescription);
Console.WriteLine("KitchenVideoColor: " + item.KitchenVideoColor);
Console.WriteLine("LimitByDeliveryZone: " + item.LimitByDeliveryZone);
Console.WriteLine("LimitByPostalCode: " + item.LimitByPostalCode);
Console.WriteLine("OrderMinimum: " + item.OrderMinimum);
Console.WriteLine("PartyLabelOverride: " + item.PartyLabelOverride);
Console.WriteLine("SeatLabelOverride: " + item.SeatLabelOverride);
Console.WriteLine("SuppressBarcode: " + item.SuppressBarcode);
Console.WriteLine("TipAndSignatureDialogEnabled: " + item.TipAndSignatureDialogEnabled);
Console.WriteLine("ValidDeliveryZones:");
//Loop through collection of DestinationDeliveryZone objects returned
if (item.ValidDeliveryZones != null)
{
foreach (var change in item.ValidDeliveryZones)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tName: " + change.Name);
Console.WriteLine("\tSurchargeId: " + change.SurchargeId);
Console.WriteLine("\tCoordinates:");
//Loop through collection of DestinationDeliveryZoneCoordinates objects returned
if (change.Coordinates != null)
{
foreach (var compChange in change.Coordinates)
{
Console.WriteLine("\t\tId: " + compChange.Id);
Console.WriteLine("\t\tLatitude: " + compChange.Latitude);
Console.WriteLine("\t\tLongitude: " + compChange.Longitude);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("ValidPostalCodes:" + item.ValidPostalCodes);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetDestinations
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetDestinationsAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of Destination objects returned
if (response.Result.Collection != null)
{
foreach (var item in response.Result.Collection)
{
Console.WriteLine("Destination #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AllItems: " + item.AllItems);
Console.WriteLine("AutoCloseFutureOrders: " + item.AutoCloseFutureOrders);
Console.WriteLine("AutoPrintType: " + item.AutoPrintType);
Console.WriteLine("AutoPrintCreditVouchers: " + item.AutoPrintCreditVouchers);
Console.WriteLine("AutoPrintPrinterId: " + item.AutoPrintPrinterId);
Console.WriteLine("DeliveryMinutes: " + item.DeliveryMinutes);
Console.WriteLine("Description: " + item.Description);
Console.WriteLine("Indicator: " + item.Indicator);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("IsDelivery: " + item.IsDelivery);
Console.WriteLine("KitchenChitHeader: " + item.KitchenChitHeader);
Console.WriteLine("KitchenDescription: " + item.KitchenDescription);
Console.WriteLine("KitchenVideoColor: " + item.KitchenVideoColor);
Console.WriteLine("LimitByDeliveryZone: " + item.LimitByDeliveryZone);
Console.WriteLine("LimitByPostalCode: " + item.LimitByPostalCode);
Console.WriteLine("OrderMinimum: " + item.OrderMinimum);
Console.WriteLine("PartyLabelOverride: " + item.PartyLabelOverride);
Console.WriteLine("SeatLabelOverride: " + item.SeatLabelOverride);
Console.WriteLine("SuppressBarcode: " + item.SuppressBarcode);
Console.WriteLine("TipAndSignatureDialogEnabled: " + item.TipAndSignatureDialogEnabled);
Console.WriteLine("ValidDeliveryZones:");
//Loop through collection of DestinationDeliveryZone objects returned
if (item.ValidDeliveryZones != null)
{
foreach (var change in item.ValidDeliveryZones)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tName: " + change.Name);
Console.WriteLine("\tSurchargeId: " + change.SurchargeId);
Console.WriteLine("\tCoordinates:");
//Loop through collection of DestinationDeliveryZoneCoordinates objects returned
if (change.Coordinates != null)
{
foreach (var compChange in change.Coordinates)
{
Console.WriteLine("\t\tId: " + compChange.Id);
Console.WriteLine("\t\tLatitude: " + compChange.Latitude);
Console.WriteLine("\t\tLongitude: " + compChange.Longitude);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("ValidPostalCodes:" + item.ValidPostalCodes);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetDestinations operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetDestinations/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetDestinations call
res = service.GetDestinations()
#If call is successful
if(res.ResultCode == 0):
if(res.Collection != None):
#Loop through collection of Destination objects returned
for item in res.Collection.Destination:
print('Destination #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('Description: ' + str(item.Description))
print('AllItems: ' + str(item.AllItems))
print('AutoCloseFutureOrders: ' + str(item.AutoCloseFutureOrders))
print('AutoPrintType: ' + str(item.AutoPrintType))
print('AutoPrintCreditVouchers: ' + str(item.AutoPrintCreditVouchers))
print('AutoPrintPrinterId: ' + str(item.AutoPrintPrinterId))
print('DeliveryMinutes: ' + str(item.DeliveryMinutes))
print('Indicator: ' + str(item.Indicator))
print('IsActive: ' + str(item.IsActive))
print('IsDelivery: ' + str(item.IsDelivery))
print('KitchenChitHeader: ' + str(item.KitchenChitHeader))
print('KitchenDescription: ' + str(item.KitchenDescription))
print('KitchenVideoColor: ' + str(item.KitchenVideoColor))
print('LimitByDeliveryZone: ' + str(item.LimitByDeliveryZone))
print('LimitByPostalCode: ' + str(item.LimitByPostalCode))
print('OrderMinimum: ' + str(item.OrderMinimum))
print('PartyLabelOverride: ' + str(item.PartyLabelOverride))
print('SeatLabelOverride: ' + str(item.SeatLabelOverride))
print('SuppressBarcode: ' + str(item.SuppressBarcode))
print('TipAndSignatureDialogEnabled: ' + str(item.TipAndSignatureDialogEnabled))
print('ValidPostalCodes: ' + str(item.ValidPostalCodes))
print('ValidDeliveryZone:')
if(item.ValidDeliveryZones != None):
#Loop through collection of DestinationDeliveryZone objects returned
for change in item.ValidDeliveryZones:
print('\tId: ' + str(change.Id))
print('\tName: ' + str(change.Name))
print('\tSurchargeId: ' + str(change.SurchargeId))
print('\tCoordinates:')
if(change.Coordinates != None):
#Loop through collection of DestinationDeliveryZoneCoordinates objects returned
for compChange in change.Coordinates:
print('\tId: ' + str(compChange.Id))
print('\tLatitude: ' + str(compChange.Latitude))
print('\tLongitude: ' + str(compChange.Longitude))
print('\t-----------------------')
print('\t-----------------------')
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetEmployees.Settings2ServiceReference;
namespace Settings2_GetEmployees
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
//Make GetEmployees call
var response = client.GetEmployees();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Employee objects returned
foreach (var item in response.Collection)
{
Console.WriteLine("Employee #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("AlternateId: " + item.AlternateId);
Console.WriteLine("DisplayName: " + item.DisplayName);
Console.WriteLine("FirstName: " + item.FirstName);
Console.WriteLine("LastName: " + item.LastName);
Console.WriteLine("Address1: " + item.Address1);
Console.WriteLine("Address2: " + item.Address2);
Console.WriteLine("City: " + item.City);
Console.WriteLine("State: " + item.State);
Console.WriteLine("Zip: " + item.Zip);
Console.WriteLine("CellPhone: " + item.CellPhone);
Console.WriteLine("HomePhone: " + item.HomePhone);
Console.WriteLine("EmailAddress: " + item.EmailAddress);
Console.WriteLine("EmployeeUniqueId: " + item.EmployeeUniqueId);
Console.WriteLine("MaritalStatus: " + item.MaritalStatus);
Console.WriteLine("BirthDate: " + item.BirthDate);
Console.WriteLine("HireDate: " + item.HireDate);
Console.WriteLine("TerminationDate: " + item.TerminationDate);
Console.WriteLine("Terminated: " + item.Terminated);
Console.WriteLine("Jobs:");
//Loop through collection of EmployeeJob objects returned
if (item.Jobs.Length > 0)
{
foreach (var job in item.Jobs)
{
Console.WriteLine("\tId: " + job.Id);
Console.WriteLine("\tJobId: " + job.JobId);
Console.WriteLine("JobUniqueId: " + item.JobUniqueId);
Console.WriteLine("\tPayRate: " + job.PayRate);
Console.WriteLine("\tSecurityLevelId: " + job.SecurityLevelId);
Console.WriteLine("SecurityLevelUniqueId: " + item.SecurityLevelUniqueId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("CanLoginWithCard: " + item.CanLoginWithCard);
Console.WriteLine("CanLoginWithFinger: " + item.CanLoginWithFinger);
Console.WriteLine("CanLoginWithPin: " + item.CanLoginWithPin);
Console.WriteLine("CardNumber: " + item.CardNumber);
Console.WriteLine("ClockedInDiscountId: " + item.ClockedInDiscountId);
Console.WriteLine("ClockedOutDiscountId: " + item.ClockedOutDiscountId);
Console.WriteLine("ExportToPayroll: " + item.ExportToPayroll);
Console.WriteLine("HealthCardExpirationDate: " + item.HealthCardExpirationDate);
Console.WriteLine("HomeLocationId: " + item.HomeLocationId);
Console.WriteLine("IdentificationVerified: " + item.IdentificationVerified);
Console.WriteLine("IsExempt: " + item.IsExempt);
Console.WriteLine("IsSalaried: " + item.IsSalaried);
Console.WriteLine("LimitLocations: " + item.LimitLocations);
Console.WriteLine("MaximumDailyDiscountAmount: " + item.MaximumDailyDiscountAmount);
Console.WriteLine("MaximumDailyDiscountCount: " + item.MaximumDailyDiscountCount);
Console.WriteLine("PayrollId: " + item.PayrollId);
Console.WriteLine("Permissions:");
//Loop through collection of EmployeePermission objects returned
if (item.Permissions.Length > 0)
{
foreach (var permission in item.Permissions)
{
Console.WriteLine("\tId: " + permission.Id);
Console.WriteLine("\tPermissionId: " + permission.PermissionId);
Console.WriteLine("PermissionUniqueId: " + item.PermissionUniqueId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Pin: " + item.Pin);
Console.WriteLine("TaxWithholdingAllowance: " + item.TaxWithholdingAllowance);
Console.WriteLine("ValidLocations:");
//Loop through collection of EmployeeLocation objects returned
if (item.ValidLocations.Length > 0)
{
foreach (var location in item.ValidLocations)
{
Console.WriteLine("\tId: " + location.Id);
Console.WriteLine("\tLocationId: " + location.LocationId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Notes: " + item.Notes);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetEmployees
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetEmployeesAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of Employee objects returned
foreach (var item in response.Result.Collection)
{
Console.WriteLine("Employee #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("AlternateId: " + item.AlternateId);
Console.WriteLine("DisplayName: " + item.DisplayName);
Console.WriteLine("FirstName: " + item.FirstName);
Console.WriteLine("LastName: " + item.LastName);
Console.WriteLine("Address1: " + item.Address1);
Console.WriteLine("Address2: " + item.Address2);
Console.WriteLine("City: " + item.City);
Console.WriteLine("State: " + item.State);
Console.WriteLine("Zip: " + item.Zip);
Console.WriteLine("CellPhone: " + item.CellPhone);
Console.WriteLine("HomePhone: " + item.HomePhone);
Console.WriteLine("EmailAddress: " + item.EmailAddress);
Console.WriteLine("EmployeeUniqueId: " + item.EmployeeUniqueId);
Console.WriteLine("MaritalStatus: " + item.MaritalStatus);
Console.WriteLine("BirthDate: " + item.BirthDate);
Console.WriteLine("HireDate: " + item.HireDate);
Console.WriteLine("TerminationDate: " + item.TerminationDate);
Console.WriteLine("Terminated: " + item.Terminated);
Console.WriteLine("Jobs:");
//Loop through collection of EmployeeJob objects returned
if (item.Jobs.Length > 0)
{
foreach (var job in item.Jobs)
{
Console.WriteLine("\tId: " + job.Id);
Console.WriteLine("\tJobId: " + job.JobId);
Console.WriteLine("JobUniqueId: " + job.JobUniqueId);
Console.WriteLine("\tPayRate: " + job.PayRate);
Console.WriteLine("\tSecurityLevelId: " + job.SecurityLevelId);
Console.WriteLine("SecurityLevelUniqueId: " + job.SecurityLevelUniqueId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("CanLoginWithCard: " + item.CanLoginWithCard);
Console.WriteLine("CanLoginWithFinger: " + item.CanLoginWithFinger);
Console.WriteLine("CanLoginWithPin: " + item.CanLoginWithPin);
Console.WriteLine("CardNumber: " + item.CardNumber);
Console.WriteLine("ClockedInDiscountId: " + item.ClockedInDiscountId);
Console.WriteLine("ClockedOutDiscountId: " + item.ClockedOutDiscountId);
Console.WriteLine("ExportToPayroll: " + item.ExportToPayroll);
Console.WriteLine("HealthCardExpirationDate: " + item.HealthCardExpirationDate);
Console.WriteLine("HomeLocationId: " + item.HomeLocationId);
Console.WriteLine("IdentificationVerified: " + item.IdentificationVerified);
Console.WriteLine("IsExempt: " + item.IsExempt);
Console.WriteLine("IsSalaried: " + item.IsSalaried);
Console.WriteLine("LimitLocations: " + item.LimitLocations);
Console.WriteLine("MaximumDailyDiscountAmount: " + item.MaximumDailyDiscountAmount);
Console.WriteLine("MaximumDailyDiscountCount: " + item.MaximumDailyDiscountCount);
Console.WriteLine("PayrollId: " + item.PayrollId);
Console.WriteLine("Permissions:");
//Loop through collection of EmployeePermission objects returned
if (item.Permissions.Length > 0)
{
foreach (var permission in item.Permissions)
{
Console.WriteLine("\tId: " + permission.Id);
Console.WriteLine("\tPermissionId: " + permission.PermissionId);
Console.WriteLine("PermissionUniqueId: " + permission.PermissionUniqueId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Pin: " + item.Pin);
Console.WriteLine("TaxWithholdingAllowance: " + item.TaxWithholdingAllowance);
Console.WriteLine("ValidLocations:");
//Loop through collection of EmployeeLocation objects returned
if (item.ValidLocations.Length > 0)
{
foreach (var location in item.ValidLocations)
{
Console.WriteLine("\tId: " + location.Id);
Console.WriteLine("\tLocationId: " + location.LocationId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Notes: " + item.Notes);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetEmployees operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetEmployees/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetEmployees call
res = service.GetEmployees()
#If call is successful
if (res.ResultCode == 0):
#Loop through collection of Employee objects returned
for item in res.Collection.Employee:
print('Employee # ' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('AlternateId: ' + str(item.AlternateId))
print('DisplayName: ' + item.DisplayName)
print('FirstName: ' + str(item.FirstName))
print('LastName: ' + str(item.LastName))
print('Address1: ' + str(item.Address1))
print('Address2: ' + str(item.Address2))
print('City: ' + str(item.City))
print('State: ' + str(item.State))
print('CellPhone: ' + str(item.CellPhone))
print('HomePhone: ' + str(item.HomePhone))
print('EmailAddress: ' + str(item.EmailAddress))
print('MaritalStatus: ' + str(item.MaritalStatus))
print('BirthDate: ' + str(item.BirthDate))
print('HireDate: ' + str(item.HireDate))
print('TerminationDate: ' + str(item.TerminationDate))
print('Terminated: ' + str(item.Terminated))
if(item.Jobs != None):
print('Jobs:')
#Loop through collection of EmployeeJob objects returned
for job in item.Jobs.EmployeeJob:
print('\tId: ' + str(job.Id))
print('\tJobId: ' + str(job.JobId))
print('\tPayRate: ' + str(job.PayRate))
print('\tSecurityLevelId: ' + str(job.SecurityLevelId))
print('\t------------')
else:
print('Jobs: None')
print('CanLoginWithCard: ' + str(item.CanLoginWithCard))
print('CanLoginWithFinger: ' + str(item.CanLoginWithFinger))
print('CanLoginWithPin: ' + str(item.CanLoginWithPin))
print('CardNumber: ' + str(item.CardNumber))
print('ClockedInDiscountId: ' + str(item.ClockedInDiscountId))
print('ClockedOutiscountId: ' + str(item.ClockedOutDiscountId))
print('ExportToPayroll: ' + str(item.ExportToPayroll))
print('HealthCardExpirationDate: ' + str(item.HealthCardExpirationDate))
print('HomeLocationId: ' + str(item.HomeLocationId))
print('IdentificationVerified: ' + str(item.IdentificationVerified))
print('IsExempt: ' + str(item.IsExempt))
print('IsSalaried: ' + str(item.IsSalaried))
print('LimitLocations: ' + str(item.LimitLocations))
print('MaximumDailyDiscountAmount: ' + str(item.MaximumDailyDiscountAmount))
print('MaximumDailyDiscountCount: ' + str(item.MaximumDailyDiscountCount))
print('PayrollId: ' + str(item.PayrollId))
if(item.Permissions != None):
print('Permissions:')
#Loop through collection of EmployeePermission objects returned
for permission in item.Permissions.EmployeePermission:
print('\tId: ' + str(permission.Id))
print('\tPermissionId: ' + str(permission.PermissionId))
print('\t------------')
else:
print('Permissions: None')
print('Pin: ' + str(item.Pin))
print('TaxWithholdingAllowance: ' + str(item.TaxWithholdingAllowance))
if (item.ValidLocations != None):
print('ValidLocations:')
#Loop through collection of EmployeeLocation objects returned
for location in item.ValidLocations.EmployeeLocation:
print('\tId: ' + str(location.Id))
print('\tLocationId: ' + str(location.LocationId))
print('\t------------')
else:
print('ValidLocations: None')
print('Notes: ' + str(item.Notes))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetFutureOrderingOptions.Settings2ServiceReference;
namespace Settings2_GetFutureOrderingOptions
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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 GetFutureOrderingOptions call
var response = client.GetFutureOrderingOptions();
//If call is successful
if (response.ResultCode == 0)
{
var item = response.FutureOrderingOptions;
Console.WriteLine("AllowFutureDateOrdering: " + item.AllowFutureDateOrdering);
Console.WriteLine("Destinations:");
//Loop through collection of OnlineOrderingDestination objects returned
if (item.Destinations != null)
{
foreach (var destination in item.Destinations)
{
Console.WriteLine("\tDestinationId: " + destination.DestinationId);
Console.WriteLine("\tInstructions: " + destination.Instructions);
Console.WriteLine("\tIsDefault: " + destination.IsDefault);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("IsEnabled: " + item.IsEnabled);
Console.WriteLine("LeadTimeThresholds:");
//Loop through collection of LeadTimeThreshold objects returned
if (item.LeadTimeThresholds != null)
{
foreach (var threshold in item.LeadTimeThresholds)
{
Console.WriteLine("\tLeadMinutes: " + threshold.LeadMinutes);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("MaximumDaysInAdvance: " + item.MaximumDaysInAdvance);
Console.WriteLine("MinimumLeadMinutes: " + item.MinimumLeadMinutes);
Console.WriteLine("MinimumPrepMinutes: " + item.MinimumPrepMinutes);
Console.WriteLine("PrepTimeThresholds:");
//Loop through collection of PrepTimeThreshold objects returned
if (item.PrepTimeThresholds != null)
{
foreach (var threshold in item.PrepTimeThresholds)
{
Console.WriteLine("\tPrepMinutes: " + threshold.PrepMinutes);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("RequiredDepositPercent: " + item.RequiredDepositPercent);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetFutureOrderingOptions
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetFutureOrderingOptionsAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
var item = response.Result.FutureOrderingOptions;
Console.WriteLine("AllowFutureDateOrdering: " + item.AllowFutureDateOrdering);
Console.WriteLine("Destinations:");
//Loop through collection of OnlineOrderingDestination objects returned
if (item.Destinations != null)
{
foreach (var destination in item.Destinations)
{
Console.WriteLine("\tDestinationId: " + destination.DestinationId);
Console.WriteLine("\tInstructions: " + destination.Instructions);
Console.WriteLine("\tIsDefault: " + destination.IsDefault);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("IsEnabled: " + item.IsEnabled);
Console.WriteLine("LeadTimeThresholds:");
//Loop through collection of LeadTimeThreshold objects returned
if (item.LeadTimeThresholds != null)
{
foreach (var threshold in item.LeadTimeThresholds)
{
Console.WriteLine("\tLeadMinutes: " + threshold.LeadMinutes);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("MaximumDaysInAdvance: " + item.MaximumDaysInAdvance);
Console.WriteLine("MinimumLeadMinutes: " + item.MinimumLeadMinutes);
Console.WriteLine("MinimumPrepMinutes: " + item.MinimumPrepMinutes);
Console.WriteLine("PrepTimeThresholds:");
//Loop through collection of PrepTimeThreshold objects returned
if (item.PrepTimeThresholds != null)
{
foreach (var threshold in item.PrepTimeThresholds)
{
Console.WriteLine("\tPrepMinutes: " + threshold.PrepMinutes);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("RequiredDepositPercent: " + item.RequiredDepositPercent);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetFutureOrderingOptions operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetFutureOrderingOptions/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
try:
#Make GetFutureOrderingOptions call
res = service.GetFutureOrderingOptions()
if(res.ResultCode == 0):
item = res.FutureOrderingOptions
print('AllowFutureDateOrdering: ' + str(item.AllowFutureDateOrdering))
if(item.Destinations != None):
print('Destinations:')
#Loop through collection of OnlineOrderingDestination objects returned
for destination in item.Destinations.LeadTimeThreshold:
print('\tDestinationId: ' + str(destination.DestinationId))
print('\tInstructions: ' + str(destination.Instructions))
print('\tIsDefault: ' + str(destination.IsDefault))
print('\t------------')
else:
print('Destinations: None')
print('IsEnabled: ' + str(item.IsEnabled))
if(item.LeadTimeThresholds != None):
print('LeadTimeThresholds:')
#Loop through collection of LeadTimeThreshold objects returned
for threshold in item.LeadTimeThresholds.LeadTimeThreshold:
print('\tLeadMinutes: ' + str(threshold.LeadMinutes))
print('\t------------')
else:
print('LeadTimeThresholds: None')
print('MaximumDaysInAdvance: ' + str(item.MaximumDaysInAdvance))
print('MinimumLeadMinutes: ' + str(item.MinimumLeadMinutes))
print('MinimumPrepMinutes: ' + str(item.MinimumPrepMinutes))
if(item.PrepTimeThresholds != None):
print('PrepTimeThresholds:')
#Loop through collection of PrepTimeThreshold objects returned
for threshold in item.PrepTimeThresholds.PrepTimeThreshold:
print('\tPrepMinutes: ' + str(threshold.PrepMinutes))
print('\t------------')
else:
print('LeadTimeThresholds: None')
print('RequiredDepositPercent: ' + str(item.RequiredDepositPercent))
print('---------------------------')
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetItems.Settings2ServiceReference;
namespace Settings2_GetItems
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
var request = new GetItemsRequest1();
//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";
//Make GetItems call
var response = client.GetItems(request);
//If call is successful
if (response.GetItemsResult.ResultCode == 0)
{
//Loop through collection of Item objects returned
if (response.GetItemsResult.Collection != null)
{
foreach (var item in response.GetItemsResult.Collection)
{
Console.WriteLine("Item #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AllowAutoCombo: " + item.AllowAutoCombo);
Console.WriteLine("AlternateId: " + item.AlternateId);
Console.WriteLine("AlternateKitchenName: " + item.AlternateKitchenName);
Console.WriteLine("AskName: " + item.AskName);
Console.WriteLine("AskPrice: " + item.AskPrice);
Console.WriteLine("AvailableEndDate: " + item.AvailableEndDate);
Console.WriteLine("AvailableSelectDates: " + item.AvailableSelectDates);
Console.WriteLine("AvailableSelectDays: " + item.AvailableSelectDays);
Console.WriteLine("AvailableStartDate: " + item.AvailableStartDate);
Console.WriteLine("BlinkInKitchen: " + item.BlinkInKitchen);
Console.WriteLine("ClearsAllOtherModifiers: " + item.ClearsAllOtherModifiers);
Console.WriteLine("Cost: " + item.Cost);
if (item.CustomFields != null)
{
foreach (var customfield in item.CustomFields)
{
Console.WriteLine("customfield: ");
Console.WriteLine("\tId: " + customfield.Id);
Console.WriteLine("\tFieldName: " + customfield.FieldName);
Console.WriteLine("\tValue: " + customfield.Value);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("DaysAvailable: " + item.DaysAvailable);
Console.WriteLine("Description: " + item.Description);
Console.WriteLine("DiscountId: " + item.DiscountId);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("IsQuantityCounted: " + item.IsQuantityCounted);
Console.WriteLine("ItemGroups: " + item.ItemGroups);
Console.WriteLine("ModifierTierId: " + item.ModifierTierId);
Console.WriteLine("ModifierWeight: " + item.ModifierWeight);
Console.WriteLine("Plu: " + item.Plu);
Console.WriteLine("Price: " + item.Price);
Console.WriteLine("PricePer: " + item.PricePer);
Console.WriteLine("PrinterGroupId: " + item.PrinterGroupId);
Console.WriteLine("RevenueCenterId: " + item.RevenueCenterId);
Console.WriteLine("Skus: " + item.Skus);
Console.WriteLine("SortPriority: " + item.SortPriority);
Console.WriteLine("TareId: " + item.TareId);
Console.WriteLine("Taxes: " + item.Taxes);
Console.WriteLine("Type: " + item.Type);
Console.WriteLine("UnitName: " + item.UnitName);
Console.WriteLine("UnitPrecision: " + item.UnitPrecision);
Console.WriteLine("VideoGroupId: " + item.VideoGroupId);
Console.WriteLine("BrandAllocations:");
//Loop through collection of ItemBrandAllocations objects returned
if (item.BrandAllocations != null)
{
foreach (var change in item.BrandAllocations)
{
Console.WriteLine("ItemBrandAllocations: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tBrandId: " + change.BrandId);
Console.WriteLine("\tWeight: " + change.Weight);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("Components:");
//Loop through collection of ItemCompositeComponent objects returned
if (item.Components != null)
{
foreach (var change in item.Components)
{
Console.WriteLine("ItemCompositeComponent: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tName: " + change.Name);
Console.WriteLine("\tItemGroupId: " + change.ItemGroupId);
Console.WriteLine("\tOverridePrice: " + change.OverridePrice);
Console.WriteLine("\tPrice: " + change.Price);
Console.WriteLine("\tRollupPrice: " + change.RollupPrice);
Console.WriteLine("\tItems:");
//Loop through collection of ItemCompositeComponentItem objects returned
if (change.Items != null)
{
foreach (var compChange in change.Items)
{
Console.WriteLine("ItemCompositeComponentItem: ");
Console.WriteLine("\t\tId: " + compChange.Id);
Console.WriteLine("\t\tIsDefault: " + compChange.IsDefault);
Console.WriteLine("\t\tItemId: " + compChange.ItemId);
Console.WriteLine("\t\tOverridePrice: " + compChange.OverridePrice);
Console.WriteLine("\t\tPrice: " + compChange.Price);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\tPanels:");
//Loop through collection of ItemCompositeComponentPanel objects returned
if (change.Panels != null)
{
foreach (var compChange in change.Panels)
{
Console.WriteLine("ItemCompositeComponentPanel: ");
Console.WriteLine("\t\tId: " + compChange.Id);
Console.WriteLine("\t\tPanelId: " + compChange.PanelId);
Console.WriteLine("\t\tScreenId: " + compChange.ScreenId);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("Ingredients:");
//Loop through collection of ItemIngredients objects returned
if (item.Ingredients != null)
{
foreach (var change in item.Ingredients)
{
Console.WriteLine("ItemIngredients: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tItemId: " + change.ItemId);
Console.WriteLine("\tPosition: " + change.Position);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("IncludedModifiers:");
//Loop through collection of ItemIncludedModifier objects returned
if (item.IncludedModifiers != null)
{
foreach (var change in item.IncludedModifiers)
{
Console.WriteLine("ItemIncludedModifier: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tAutomaticallyAdd: " + change.AutomaticallyAdd);
Console.WriteLine("\tIsIncluded: " + change.IsIncluded);
Console.WriteLine("\tItemId: " + change.ItemId);
Console.WriteLine("\tModifierGroupId: " + change.ModifierGroupId);
Console.WriteLine("\tPosition: " + change.Position);
Console.WriteLine("\tPrintInKitchen: " + change.PrintInKitchen);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("DestinationAvailabilities:");
//Loop through collection of ItemDestinationAvailability objects returned
if (item.DestinationAvailabilities != null)
{
foreach (var availability in item.DestinationAvailabilities)
{
Console.WriteLine("ItemDestinationAvailability: ");
Console.WriteLine("\tId: " + availability.Id);
Console.WriteLine("\tDestinationId: " + availability.DestinationId);
Console.WriteLine("\tIsAvailable: " + availability.IsAvailable);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("ModifierGroups:");
//Loop through collection of ItemModifierGroup objects returned
if (item.ModifierGroups != null)
{
foreach (var change in item.ModifierGroups)
{
Console.WriteLine("ItemModifierGroup: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tModifierGroupId: " + change.ModifierGroupId);
Console.WriteLine("\tPosition: " + change.Position);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("ModifyPanels:");
//Loop through collection of ItemModifyPanel objects returned
if (item.ModifyPanels != null)
{
foreach (var change in item.ModifyPanels)
{
Console.WriteLine("ItemModifyPanel: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tPanelId: " + change.PanelId);
Console.WriteLine("\tScreenId: " + change.ScreenId);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("SelectionPanels:");
//Loop through collection of ItemSelectionPanel objects returned
if (item.SelectionPanels != null)
{
foreach (var change in item.SelectionPanels)
{
Console.WriteLine("ItemSelectionPanel: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tPanelId: " + change.PanelId);
Console.WriteLine("\tScreenId: " + change.ScreenId);
Console.WriteLine("\t-----------------------");
}
}
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.GetItemsResult.ResultCode);
Console.WriteLine("Message: " + response.GetItemsResult.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetItems
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 request = new GetItemsRequest();
var response = client.GetItemsAsync(request);
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of Item objects returned
if (response.Result.Collection != null)
{
foreach (var item in response.Result.Collection)
{
Console.WriteLine("Item #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AllowAutoCombo: " + item.AllowAutoCombo);
Console.WriteLine("AlternateId: " + item.AlternateId);
Console.WriteLine("AlternateKitchenName: " + item.AlternateKitchenName);
Console.WriteLine("AskName: " + item.AskName);
Console.WriteLine("AskPrice: " + item.AskPrice);
Console.WriteLine("AvailableEndDate: " + item.AvailableEndDate);
Console.WriteLine("AvailableSelectDates: " + item.AvailableSelectDates);
Console.WriteLine("AvailableSelectDays: " + item.AvailableSelectDays);
Console.WriteLine("AvailableStartDate: " + item.AvailableStartDate);
Console.WriteLine("BlinkInKitchen: " + item.BlinkInKitchen);
Console.WriteLine("ClearsAllOtherModifiers: " + item.ClearsAllOtherModifiers);
Console.WriteLine("Cost: " + item.Cost);
if (item.CustomFields != null)
{
foreach (var customfield in item.CustomFields)
{
Console.WriteLine("customfield: ");
Console.WriteLine("\tId: " + customfield.Id);
Console.WriteLine("\tFieldName: " + customfield.FieldName);
Console.WriteLine("\tValue: " + customfield.Value);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("DaysAvailable: " + item.DaysAvailable);
Console.WriteLine("Description: " + item.Description);
Console.WriteLine("DiscountId: " + item.DiscountId);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("IsQuantityCounted: " + item.IsQuantityCounted);
Console.WriteLine("ItemGroups: " + item.ItemGroups);
Console.WriteLine("ModifierTierId: " + item.ModifierTierId);
Console.WriteLine("ModifierWeight: " + item.ModifierWeight);
Console.WriteLine("Plu: " + item.Plu);
Console.WriteLine("Price: " + item.Price);
Console.WriteLine("PricePer: " + item.PricePer);
Console.WriteLine("PrinterGroupId: " + item.PrinterGroupId);
Console.WriteLine("RevenueCenterId: " + item.RevenueCenterId);
Console.WriteLine("Skus: " + item.Skus);
Console.WriteLine("SortPriority: " + item.SortPriority);
Console.WriteLine("TareId: " + item.TareId);
Console.WriteLine("Taxes: " + item.Taxes);
Console.WriteLine("Type: " + item.Type);
Console.WriteLine("UnitName: " + item.UnitName);
Console.WriteLine("UnitPrecision: " + item.UnitPrecision);
Console.WriteLine("VideoGroupId: " + item.VideoGroupId);
Console.WriteLine("BrandAllocations:");
//Loop through collection of ItemBrandAllocations objects returned
if (item.BrandAllocations != null)
{
foreach (var change in item.BrandAllocations)
{
Console.WriteLine("ItemBrandAllocations: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tBrandId: " + change.BrandId);
Console.WriteLine("\tWeight: " + change.Weight);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("Components:");
//Loop through collection of ItemCompositeComponent objects returned
if (item.Components != null)
{
foreach (var change in item.Components)
{
Console.WriteLine("ItemCompositeComponent: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tName: " + change.Name);
Console.WriteLine("\tItemGroupId: " + change.ItemGroupId);
Console.WriteLine("\tOverridePrice: " + change.OverridePrice);
Console.WriteLine("\tPrice: " + change.Price);
Console.WriteLine("\tRollupPrice: " + change.RollupPrice);
Console.WriteLine("\tItems:");
//Loop through collection of ItemCompositeComponentItem objects returned
if (change.Items != null)
{
foreach (var compChange in change.Items)
{
Console.WriteLine("ItemCompositeComponentItem: ");
Console.WriteLine("\t\tId: " + compChange.Id);
Console.WriteLine("\t\tIsDefault: " + compChange.IsDefault);
Console.WriteLine("\t\tItemId: " + compChange.ItemId);
Console.WriteLine("\t\tOverridePrice: " + compChange.OverridePrice);
Console.WriteLine("\t\tPrice: " + compChange.Price);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\tPanels:");
//Loop through collection of ItemCompositeComponentPanel objects returned
if (change.Panels != null)
{
foreach (var compChange in change.Panels)
{
Console.WriteLine("ItemCompositeComponentPanel: ");
Console.WriteLine("\t\tId: " + compChange.Id);
Console.WriteLine("\t\tPanelId: " + compChange.PanelId);
Console.WriteLine("\t\tScreenId: " + compChange.ScreenId);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("Ingredients:");
//Loop through collection of ItemIngredients objects returned
if (item.Ingredients != null)
{
foreach (var change in item.Ingredients)
{
Console.WriteLine("ItemIngredients: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tItemId: " + change.ItemId);
Console.WriteLine("\tPosition: " + change.Position);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("IncludedModifiers:");
//Loop through collection of ItemIncludedModifier objects returned
if (item.IncludedModifiers != null)
{
foreach (var change in item.IncludedModifiers)
{
Console.WriteLine("ItemIncludedModifier: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tAutomaticallyAdd: " + change.AutomaticallyAdd);
Console.WriteLine("\tIsIncluded: " + change.IsIncluded);
Console.WriteLine("\tItemId: " + change.ItemId);
Console.WriteLine("\tModifierGroupId: " + change.ModifierGroupId);
Console.WriteLine("\tPosition: " + change.Position);
Console.WriteLine("\tPrintInKitchen: " + change.PrintInKitchen);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("DestinationAvailabilities:");
//Loop through collection of ItemDestinationAvailability objects returned
if (item.DestinationAvailabilities != null)
{
foreach (var availability in item.DestinationAvailabilities)
{
Console.WriteLine("ItemDestinationAvailability: ");
Console.WriteLine("\tId: " + availability.Id);
Console.WriteLine("\tDestinationId: " + availability.DestinationId);
Console.WriteLine("\tIsAvailable: " + availability.IsAvailable);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("ModifierGroups:");
//Loop through collection of ItemModifierGroup objects returned
if (item.ModifierGroups != null)
{
foreach (var change in item.ModifierGroups)
{
Console.WriteLine("ItemModifierGroup: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tModifierGroupId: " + change.ModifierGroupId);
Console.WriteLine("\tPosition: " + change.Position);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("ModifyPanels:");
//Loop through collection of ItemModifyPanel objects returned
if (item.ModifyPanels != null)
{
foreach (var change in item.ModifyPanels)
{
Console.WriteLine("ItemModifyPanel: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tPanelId: " + change.PanelId);
Console.WriteLine("\tScreenId: " + change.ScreenId);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("SelectionPanels:");
//Loop through collection of ItemSelectionPanel objects returned
if (item.SelectionPanels != null)
{
foreach (var change in item.SelectionPanels)
{
Console.WriteLine("ItemSelectionPanel: ");
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tPanelId: " + change.PanelId);
Console.WriteLine("\tScreenId: " + change.ScreenId);
Console.WriteLine("\t-----------------------");
}
}
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetItems operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:GetItems><!--Optional:-->
<v2:request>
<!--Optional:-->
<v2:ItemIds>
<!--Zero or more repetitions:-->
<arr:int>101</arr:int>
</v2:ItemIds>
</v2:request>
</v2:GetItems>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetItems call
res = service.GetItems()
#If call is successful
if(res.ResultCode == 0):
if(res.Collection != None):
#Loop through collection of Item objects returned
for item in res.Collection.Item:
print('Item #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('AllowAutoCombo: ' + str(item.AllowAutoCombo))
print('AlternateId: ' + str(item.AlternateId))
print('AlternateKitchenName: ' + str(item.AlternateKitchenName))
print('AskName: ' + str(item.AskName))
print('AskPrice: ' + str(item.AskPrice))
print('AvailableEndDate: ' + str(item.AvailableEndDate))
print('AvailableSelectDates: ' + str(item.AvailableSelectDates))
print('AvailableSelectDays: ' + str(item.AvailableSelectDays))
print('AvailableStartDate: ' + str(item.AvailableStartDate))
print('BlinkInKitchen: ' + str(item.BlinkInKitchen))
print('ClearsAllOtherModifiers: ' + str(item.ClearsAllOtherModifiers))
print('Cost: ' + str(item.Cost))
if(item.CustomFields != None):
#Loop through collection of ItemCustomFields objects returned
for change in item.CustomFields:
print('\tId: ' + str(change.Id))
print('\tFieldName: ' + str(change.FieldName))
print('\tValue: ' + str(change.Value))
print('---------------------------')
print('DaysAvailable: ' + str(item.DaysAvailable))
print('Description: ' + str(item.Description))
print('DiscountId: ' + str(item.DiscountId))
print('IsActive: ' + str(item.IsActive))
print('IsQuantityCounted: ' + str(item.IsQuantityCounted))
print('ItemGroups: ' + str(item.ItemGroups))
print('ModifierTierId: ' + str(item.ModifierTierId))
print('ModifierWeight: ' + str(item.ModifierWeight))
print('Plu: ' + str(item.Plu))
print('Price: ' + str(item.Price))
print('PricePer: ' + str(item.PricePer))
print('PrinterGroupId: ' + str(item.PrinterGroupId))
print('RevenueCenterId: ' + str(item.RevenueCenterId))
print('Skus: ' + str(item.Skus))
print('SortPriority: ' + str(item.SortPriority))
print('TareId: ' + str(item.TareId))
print('VideoGroupId: ' + str(item.VideoGroupId))
print('BrandAllocations:')
if(item.BrandAllocations != None):
#Loop through collection of ItemBrandAllocations objects returned
for change in item.BrandAllocations:
print('\tId: ' + str(change.Id))
print('\tName: ' + str(change.Name))
print('\tBrandId: ' + str(change.BrandId))
print('\tWeight: ' + str(change.Weight))
print('---------------------------')
print('DestinationAvailabilities:')
if(item.DestinationAvailabilities != None):
#Loop through collection of ItemDestinationAvailability objects returned
for availability in item.DestinationAvailabilities:
print('\tId: ' + str(availability.Id))
print('\tDestinationId: ' + str(availability.DestinationId))
print('\tIsAvailable: ' + str(availability.IsAvailable))
print('---------------------------')
else:
print('DestinationAvailabilities: None')
print('Components:')
if(item.Components != None):
#Loop through collection of ItemCompositeComponent objects returned
for change in item.Components:
print('\tId: ' + str(change.Id))
print('\tName: ' + str(change.Name))
print('\tItemGroupId: ' + str(change.ItemGroupId))
print('\tOverridePrice: ' + str(change.OverridePrice))
print('\tPrice: ' + str(change.Price))
print('\tRollupPrice: ' + str(change.RollupPrice))
print('---------------------------')
print('Ingredients:')
if(item.Ingredients != None):
#Loop through collection of ItemIngredients objects returned
for change in item.Ingredients:
print('\tId: ' + str(change.Id))
print('\tItemId: ' + str(change.ItemId))
print('\tPosition: ' + str(change.Position))
print('---------------------------')
print('SelectionPanels:')
if(item.SelectionPanels != None):
#Loop through collection of ItemSelectionPanel objects returned
for change in item.SelectionPanels:
print('\tId: ' + str(change.Id))
print('\tName: ' + str(change.Name))
print('\tPanelId: ' + str(change.PanelId))
print('\tScreenId: ' + str(change.ScreenId))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetJobs.Settings2ServiceReference;
namespace Settings2_GetJobs
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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"] = @"AccessToken";
//Make GetJobs call
var response = client.GetJobs();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Job objects returned
foreach (var item in response.Collection)
{
Console.WriteLine("Job #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AllowAddItem: " + item.AllowAddItem);
Console.WriteLine("AlternateId: " + item.AlternateId);
Console.WriteLine("CanOpenAnyOrder: " + item.CanOpenAnyOrder);
Console.WriteLine("CannotClose: " + item.CannotClose);
Console.WriteLine("CashDrawer: " + item.CashDrawer);
Console.WriteLine("CheckoutRequiresApproval: " + item.CheckoutRequiresApproval);
Console.WriteLine("ClockInRequiresApproval: " + item.ClockInRequiresApproval);
Console.WriteLine("ClockOutRequiresApproval: " + item.ClockOutRequiresApproval);
Console.WriteLine("DeclareTips: " + item.DeclareTips);
Console.WriteLine("DefaultScreenId: " + item.DefaultScreenId);
Console.WriteLine("DefaultSecurityLevelId: " + item.DefaultSecurityLevelId);
Console.WriteLine("DefaultSecurityLevelUniqueId: " + item.DefaultSecurityLevelUniqueId);
Console.WriteLine("DisplayColor: " + item.DisplayColor);
Console.WriteLine("ExcludeOnSalesAndLaborReports: " + item.ExcludeOnSalesAndLaborReports);
Console.WriteLine("ExemptFromLaborSchedule: " + item.ExemptFromLaborSchedule);
Console.WriteLine("ExportCode: " + item.ExportCode);
Console.WriteLine("GroupItemsBySeat: " + item.GroupItemsBySeat);
Console.WriteLine("IsBartender: " + item.IsBartender);
Console.WriteLine("IsDeliveryDispatcher: " + item.IsDeliveryDispatcher);
Console.WriteLine("IsDeliveryDriver: " + item.IsDeliveryDriver);
Console.WriteLine("IsHostess: " + item.IsHostess);
Console.WriteLine("ItemLookup: " + item.ItemLookup);
Console.WriteLine("JobUniqueId: " + item.JobUniqueId);
Console.WriteLine("LaneId: " + item.LaneId);
Console.WriteLine("LimitShiftBreakTypes: " + item.LimitShiftBreakTypes);
Console.WriteLine("LimitedDestinationId: " + item.LimitedDestinationId);
Console.WriteLine("LocationType: " + item.LocationType);
Console.WriteLine("Menus:");
//Loop through collection of JobMenu objects returned
if (item.Menus != null)
{
foreach (var menu in item.Menus)
{
Console.WriteLine("\tDays: " + menu.Days);
Console.WriteLine("\tMenuId: " + menu.MenuId);
Console.WriteLine("\tStartTime: " + menu.StartTime);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("NoCashTransactions: " + item.NoCashTransactions);
Console.WriteLine("OrderEntry: " + item.OrderEntry);
Console.WriteLine("OrderScreenId: " + item.OrderScreenId);
Console.WriteLine("SectionId: " + item.SectionId);
Console.WriteLine("SelfBanking: " + item.SelfBanking);
Console.WriteLine("SelfVoid: " + item.SelfVoid);
Console.WriteLine("ShiftBreakTypes:");
//Loop through collection of JobShiftBreakType objects returned
if (item.ShiftBreakTypes != null)
{
foreach (var breakType in item.ShiftBreakTypes)
{
Console.WriteLine("\tShiftBreakTypeId: " + breakType.ShiftBreakTypeId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Tabs: " + item.Tabs);
Console.WriteLine("Training: " + item.Training);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetJobs
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetJobsAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of Job objects returned
foreach (var item in response.Result.Collection)
{
Console.WriteLine("Job #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AllowAddItem: " + item.AllowAddItem);
Console.WriteLine("AlternateId: " + item.AlternateId);
Console.WriteLine("CanOpenAnyOrder: " + item.CanOpenAnyOrder);
Console.WriteLine("CannotClose: " + item.CannotClose);
Console.WriteLine("CashDrawer: " + item.CashDrawer);
Console.WriteLine("CheckoutRequiresApproval: " + item.CheckoutRequiresApproval);
Console.WriteLine("ClockInRequiresApproval: " + item.ClockInRequiresApproval);
Console.WriteLine("ClockOutRequiresApproval: " + item.ClockOutRequiresApproval);
Console.WriteLine("DeclareTips: " + item.DeclareTips);
Console.WriteLine("DefaultScreenId: " + item.DefaultScreenId);
Console.WriteLine("DefaultSecurityLevelId: " + item.DefaultSecurityLevelId);
Console.WriteLine("DefaultSecurityLevelUniqueId: " + item.DefaultSecurityLevelUniqueId);
Console.WriteLine("DisplayColor: " + item.DisplayColor);
Console.WriteLine("ExcludeOnSalesAndLaborReports: " + item.ExcludeOnSalesAndLaborReports);
Console.WriteLine("ExemptFromLaborSchedule: " + item.ExemptFromLaborSchedule);
Console.WriteLine("ExportCode: " + item.ExportCode);
Console.WriteLine("GroupItemsBySeat: " + item.GroupItemsBySeat);
Console.WriteLine("IsBartender: " + item.IsBartender);
Console.WriteLine("IsDeliveryDispatcher: " + item.IsDeliveryDispatcher);
Console.WriteLine("IsDeliveryDriver: " + item.IsDeliveryDriver);
Console.WriteLine("IsHostess: " + item.IsHostess);
Console.WriteLine("ItemLookup: " + item.ItemLookup);
Console.WriteLine("JobUniqueId: " + item.JobUniqueId);
Console.WriteLine("LaneId: " + item.LaneId);
Console.WriteLine("LimitShiftBreakTypes: " + item.LimitShiftBreakTypes);
Console.WriteLine("LimitedDestinationId: " + item.LimitedDestinationId);
Console.WriteLine("LocationType: " + item.LocationType);
Console.WriteLine("Menus:");
//Loop through collection of JobMenu objects returned
if (item.Menus != null)
{
foreach (var menu in item.Menus)
{
Console.WriteLine("\tDays: " + menu.Days);
Console.WriteLine("\tMenuId: " + menu.MenuId);
Console.WriteLine("\tStartTime: " + menu.StartTime);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("NoCashTransactions: " + item.NoCashTransactions);
Console.WriteLine("OrderEntry: " + item.OrderEntry);
Console.WriteLine("OrderScreenId: " + item.OrderScreenId);
Console.WriteLine("SectionId: " + item.SectionId);
Console.WriteLine("SelfBanking: " + item.SelfBanking);
Console.WriteLine("SelfVoid: " + item.SelfVoid);
Console.WriteLine("ShiftBreakTypes:");
//Loop through collection of JobShiftBreakType objects returned
if (item.ShiftBreakTypes != null)
{
foreach (var breakType in item.ShiftBreakTypes)
{
Console.WriteLine("\tShiftBreakTypeId: " + breakType.ShiftBreakTypeId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Tabs: " + item.Tabs);
Console.WriteLine("Training: " + item.Training);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetJobs operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetJobs/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetJobs call
res = service.GetJobs()
#If call is successful
if(res.ResultCode == 0):
#Loop through collection of Job objects returned
for item in res.Collection.Job:
print('Job # ' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('AllowAddItem: ' + str(item.AllowAddItem))
print('AlternateId: ' + str(item.AlternateId))
print('CanOpenAnyOrder: ' + str(item.CanOpenAnyOrder))
print('CannotClose: ' + str(item.CannotClose))
print('CashDrawer: ' + str(item.CashDrawer))
print('CheckoutRequiresApproval: ' + str(item.CheckoutRequiresApproval))
print('ClockInRequiresApproval: ' + str(item.ClockInRequiresApproval))
print('ClockOutRequiresApproval: ' + str(item.ClockOutRequiresApproval))
print('DeclareTips: ' + str(item.DeclareTips))
print('DefaultScreenId: ' + str(item.DefaultScreenId))
print('DisplayColor: ' + str(item.DisplayColor))
print('ExcludeOnSalesAndLaborReports: ' + str(item.ExcludeOnSalesAndLaborReports))
print('ExemptFromLaborSchedule: ' + str(item.ExemptFromLaborSchedule))
print('ExportCode: ' + str(item.ExportCode))
print('GroupItemsBySeat: ' + str(item.GroupItemsBySeat))
print('IsBartender: ' + str(item.IsBartender))
print('IsDeliveryDispatcher: ' + str(item.IsDeliveryDispatcher))
print('IsHostess: ' + str(item.IsHostess))
print('ItemLookup: ' + str(item.ItemLookup))
print('LaneId: ' + str(item.LaneId))
print('LimitShiftBreakTypes: ' + str(item.LimitShiftBreakTypes))
print('LocationType: ' + str(item.LocationType))
if(item.Menus != None):
print('Menus:')
#Loop through collection of JobMenu objects returned
for menu in item.Menus.JobMenu:
print('\tDays: ' + str(menu.Days))
print('\tMenuId: ' + str(menu.MenuId))
print('\tStartTime: ' + str(menu.StartTime))
print('\t------------')
else:
print('Menus: None')
print('NoCashTransactions: ' + str(item.NoCashTransactions))
print('OrderEntry: ' + str(item.OrderEntry))
print('OrderScreenId: ' + str(item.OrderScreenId))
print('SectionId: ' + str(item.SectionId))
print('SelfBanking: ' + str(item.SelfBanking))
print('SelfVoid: ' + str(item.SelfVoid))
if(item.ShiftBreakTypes != None):
print('ShiftBreakTypes:')
#Loop through collection of JobShiftBreakType objects returned
for breakType in item.ShiftBreakTypes.JobShiftBreakType:
print('\tShiftBreakTypeId: ' + str(breakType.ShiftBreakTypeId))
print('\t------------')
else:
print('ShiftBreakTypes: None')
print('Tabs: ' + str(item.Tabs))
print('Training: ' + str(item.Training))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetKitchenQueues.Settings2ServiceReference;
namespace Settings2_GetKitchenQueues
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
//Make GetKitchenQueues call
var response = client.GetKitchenQueues();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of KitchenQueue objects returned
foreach (var item in response.Collection)
{
Console.WriteLine("KitchenQueue #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + reply.ResultCode);
Console.WriteLine("Message: " + reply.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetKitchenQueues
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetKitchenQueuesAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of KitchenQueue objects returned
foreach (var item in response.Result.Collection)
{
Console.WriteLine("KitchenQueue #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetKitchenQueues operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetKitchenQueues/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetKitchenQueues call
res = service.GetKitchenQueues()
#If call is successful
if (res.ResultCode == 0):
#Loop through collection of KitchenQueue objects returned
for item in res.Collection.KitchenQueue:
print('KitchenQueue # ' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetLastModifiedTime.Settings2ServiceReference;
namespace Settings2_GetLastModifiedTime
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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 GetLastModifiedTime call
var response = client.GetLastModifiedTime();
//If call is successful
if (response.ResultCode == 0)
{
Console.WriteLine("EmployeesOnlyLastModifiedTime: " + response.EmployeesOnlyLastModifiedTime);
Console.WriteLine("SettingsLastModified: " + response.SettingsLastModified);
Console.WriteLine("SettingsOnlyLastModifiedTime: " + response.SettingsOnlyLastModifiedTime);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetLastModifiedTime
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetLastModifiedTimeAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
Console.WriteLine("EmployeesOnlyLastModifiedTime: " + response.Result.EmployeesOnlyLastModifiedTime);
Console.WriteLine("SettingsLastModified: " + response.Result.SettingsLastModified);
Console.WriteLine("SettingsOnlyLastModifiedTime: " + response.Result.SettingsOnlyLastModifiedTime);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetLastModifiedTime operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetLastModifiedTime/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
try:
#Make GetLastModifiedTime call
res = service.GetLastModifiedTime()
#If call is successful
if (res.ResultCode == 0):
print('EmployeesOnlyLastModifiedTime:')
print('\tDateTime: ' + str(res.EmployeesOnlyLastModifiedTime.DateTime))
print('\tOffsetMinutes: ' + str(res.EmployeesOnlyLastModifiedTime.OffsetMinutes))
print('\nSettingsLastModified:')
print('\tDateTime: ' + str(res.SettingsLastModified.DateTime))
print('\tOffsetMinutes: ' + str(res.SettingsLastModified.OffsetMinutes))
print('\nSettingsOnlyLastModifiedTime:')
print('\tDateTime: ' + str(res.SettingsOnlyLastModifiedTime.DateTime))
print('\tOffsetMinutes: ' + str(res.SettingsOnlyLastModifiedTime.OffsetMinutes))
print('---------------------------')
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetMenu.Settings2ServiceReference;
namespace Settings2_GetMenu
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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 menuId = 1;
//Include the MenuId parameter in request body
var request = new GetMenuRequest()
{
MenuId = menuId,
};
//Make GetMenu call
var response = client.GetMenu(request);
//If call is successful
if (response.ResultCode == 0)
{
var item = response.Menu;
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Categories:");
//Loop through collection of MenuCategory objects returned
if (item.Categories != null)
{
foreach (var category in item.Categories)
{
Console.WriteLine("\tCategory #" + count);
Console.WriteLine("\t-----------------------");
Console.WriteLine("\tId: " + category.Id);
Console.WriteLine("\tName: " + category.Name);
Console.WriteLine("\tDescription: " + category.Description);
Console.WriteLine("\tItems:");
//Loop through collection of MenuItem objects returned
if (category.Items != null)
{
foreach (var menuItem in category.Items)
{
Console.WriteLine("\t\tId: " + menuItem.Id);
Console.WriteLine("\t\tName: " + menuItem.Name);
Console.WriteLine("\t\tDescription: " + menuItem.Description);
Console.WriteLine("\t\tImageId: " + menuItem.ImageId);
Console.WriteLine("\t\tItemId: " + menuItem.ItemId);
Console.WriteLine("\t\tModifierMethod: " + menuItem.ModifierMethod);
Console.WriteLine("\t\tPrice: " + menuItem.Price);
Console.WriteLine("\t\tPriceMethod: " + menuItem.PriceMethod);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\t-----------------------");
count++;
}
}
Console.WriteLine("Description: " + item.Description);
Console.WriteLine("ImageId: " + item.ImageId);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetMenu
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 request = new GetMenuRequest()
{
MenuId = 1,
};
//Make GetMenu call
var response = client.GetMenuAsync(request);
//If call is successful
if (response.Result.ResultCode == 0)
{
var item = response.Result.Menu;
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Categories:");
//Loop through collection of MenuCategory objects returned
if (item.Categories != null)
{
foreach (var category in item.Categories)
{
Console.WriteLine("\tCategory #" + count);
Console.WriteLine("\t-----------------------");
Console.WriteLine("\tId: " + category.Id);
Console.WriteLine("\tName: " + category.Name);
Console.WriteLine("\tDescription: " + category.Description);
Console.WriteLine("\tItems:");
//Loop through collection of MenuItem objects returned
if (category.Items != null)
{
foreach (var menuItem in category.Items)
{
Console.WriteLine("\t\tId: " + menuItem.Id);
Console.WriteLine("\t\tName: " + menuItem.Name);
Console.WriteLine("\t\tDescription: " + menuItem.Description);
Console.WriteLine("\t\tImageId: " + menuItem.ImageId);
Console.WriteLine("\t\tItemId: " + menuItem.ItemId);
Console.WriteLine("\t\tModifierMethod: " + menuItem.ModifierMethod);
Console.WriteLine("\t\tPrice: " + menuItem.Price);
Console.WriteLine("\t\tPriceMethod: " + menuItem.PriceMethod);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\t-----------------------");
count++;
}
}
Console.WriteLine("Description: " + item.Description);
Console.WriteLine("ImageId: " + item.ImageId);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetMenu operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetMenu>
<v2:request>
<v2:MenuId>1</v2:MenuId>
</v2:request>
</v2:GetMenu>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the MenuId parameter in request body
menuId = 1
reqType = client.get_type('ns1:GetMenuRequest')
req = reqType(MenuId = menuId)
count = 1
try:
#Make GetMenu call
res = service.GetMenu(req)
#If call is successful
if(res.ResultCode == 0):
item = res.Menu
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
if(item.Categories != None):
print('Categories:')
#Loop through collection of MenuCategory objects returned
for category in item.Categories.MenuCategory:
print('\tCategory #' + str(count))
print('\t-----------------------')
print('\tId: ' + str(category.Id))
print('\tName: ' + str(category.Name))
print('\tDescription: ' + str(category.Description))
if(category.Items != None):
print('\tItems:')
#Loop through collection of MenuItem objects returned
for menuItem in category.Items.MenuItem:
print('\t\tId: ' + str(menuItem.Id))
print('\t\tName: ' + str(menuItem.Name))
print('\t\tDescription: ' + str(menuItem.Description))
print('\t\tImageId: ' + str(menuItem.ImageId))
print('\t\tItemId: ' + str(menuItem.ItemId))
print('\t\tModifierMethod: ' + str(menuItem.ModifierMethod))
print('\t\tPrice: ' + str(menuItem.Price))
print('\t\tPriceMethod: ' + str(menuItem.PriceMethod))
print('\t\t------------')
else:
print('Items: None')
print('\t-----------------------')
count += 1
else:
print('Categories: None')
print('Description: ' + str(item.Description))
print('ImageId: ' + str(item.ImageId))
print('---------------------------')
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetModifierGroups.Settings2ServiceReference;
namespace Settings2_GetModifierGroups
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
//Make GetModifierGroups call
var response = client.GetModifierGroups();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of ModifierGroups objects returned
if (response.Collection != null)
{
foreach (var item in response.Collection)
{
Console.WriteLine("Modifier Group #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Description: " + item.Description);
Console.WriteLine("DisplayName: " + item.DisplayName);
Console.WriteLine("Items:");
//Loop through collection of ModifierGroupItem objects returned
if (item.Items != null)
{
foreach (var modifierGroupItem in item.Items)
{
Console.WriteLine("\tPosition: " + modifierGroupItem.Position);
Console.WriteLine("\tItemId: " + modifierGroupItem.ItemId);
Console.WriteLine("\tPrice: " + modifierGroupItem.Price);
Console.WriteLine("\tPriceMethod: " + modifierGroupItem.PriceMethod);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Minimum: " + item.Minimum);
Console.WriteLine("Maximum: " + item.Maximum);
Console.WriteLine("Free: " + item.Free);
Console.WriteLine("PanelId: " + item.PanelId);
Console.WriteLine("FlowRequired: " + item.FlowRequired);
Console.WriteLine("IsDeleted: " + item.IsDeleted);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetModifierGroups
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetModifierGroupsAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of ModifierGroup objects returned
if (response.Result.Collection != null)
{
foreach (var item in response.Result.Collection)
{
Console.WriteLine("Modifier Group #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Description: " + item.Description);
Console.WriteLine("DisplayName: " + item.DisplayName);
Console.WriteLine("Items:");
//Loop through collection of ModifierGroupItem objects returned
if (item.Items != null)
{
foreach (var modifierGroupItem in item.Items)
{
Console.WriteLine("\tPosition: " + modifierGroupItem.Position);
Console.WriteLine("\tItemId: " + modifierGroupItem.ItemId);
Console.WriteLine("\tPrice: " + modifierGroupItem.Price);
Console.WriteLine("\tPriceMethod: " + modifierGroupItem.PriceMethod);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Minimum: " + item.Minimum);
Console.WriteLine("Maximum: " + item.Maximum);
Console.WriteLine("Free: " + item.Free);
Console.WriteLine("PanelId: " + item.PanelId);
Console.WriteLine("FlowRequired: " + item.FlowRequired);
Console.WriteLine("IsDeleted: " + item.IsDeleted);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetModifierGroups operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetModifierGroups/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetModifierGroups call
res = service.GetModifierGroups()
#If call is successful
if(res.ResultCode == 0):
if(res.Collection != None):
#Loop through collection of ModifierGroup objects returned
for item in res.Collection.ModifierGroup:
print('Modifier Group #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('Description: ' + str(item.Description))
print('DisplayName: ' + str(item.DisplayName))
if(item.Items != None):
print('Items:')
#Loop through collection of ModifierGroupItem objects returned
for modifierGroupItem in item.Items.ModifierGroupItem:
print('\tPosition: ' + str(modifierGroupItem.Position))
print('\tItemId: ' + str(modifierGroupItem.ItemId))
print('\tPrice: ' + str(modifierGroupItem.Price))
print('\tPriceMethod: ' + str(modifierGroupItem.PriceMethod))
print('\t------------')
else:
print('Items: None')
print('Minimum: ' + str(item.Minimum))
print('Maximum: ' + str(item.Maximum))
print('Free: ' + str(item.Free))
print('PanelId: ' + str(item.PanelId))
print('FlowRequired: ' + str(item.FlowRequired))
print('IsDeleted: ' + str(item.IsDeleted))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetOnlineOrderingMenuOptions.Settings2ServiceReference;
namespace Settings2_GetOnlineOrderingMenuOptions
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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 GetOnlineOrderingMenuOptions call
var response = client.GetOnlineOrderingMenuOptions();
//If call is successful
if (response.ResultCode == 0)
{
Console.WriteLine("OnlineOrderingMenuId: " + response.OnlineOrderingMenuId);
Console.WriteLine("---------------------------");
Console.WriteLine("End");
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetOnlineOrderingMenuOptions
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetOnlineOrderingMenuOptionsAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
Console.WriteLine("OnlineOrderingMenuId: " + response.Result.OnlineOrderingMenuId);
Console.WriteLine("---------------------------");
Console.WriteLine("AlternateMenus:");
//Loop through collection of AlternateMenu objects returned
if (response.Result.AlternateMenus != null)
{
foreach (var menu in response.Result.AlternateMenus)
{
Console.WriteLine("\tAlternateMenu #" + count);
Console.WriteLine("\t------------");
Console.WriteLine("\tId: " + menu.Id);
Console.WriteLine("\tDays: " + menu.Days);
Console.WriteLine("\tEndTime: " + menu.EndTime);
Console.WriteLine("\tMenuId: " + menu.MenuId);
Console.WriteLine("\tStartTime: " + menu.StartTime);
Console.WriteLine("\tTimeType: " + menu.TimeType);
Console.WriteLine("\t------------");
count++;
}
}
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetOnlineOrderingMenuOptions operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetOnlineOrderingMenuOptions/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
try:
#Make GetOnlineOrderingMenuOptions call
res = service.GetOnlineOrderingMenuOptions()
#If call is successful
if(res.ResultCode == 0):
print('OnlineOrderingMenuId: ' + str(res.OnlineOrderingMenuId))
print('---------------------------')
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetPermissions.Settings2ServiceReference;
namespace Settings2_GetPermissions
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
//Make GetPermissions call
var response = client.GetPermissions();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Permission objects returned
if (response.Collection != null)
{
foreach (var item in response.Collection)
{
Console.WriteLine("Permission #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetPermissions
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetPermissionsAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of Permission objects returned
if (response.Result.Collection != null)
{
foreach (var item in response.Result.Collection)
{
Console.WriteLine("Permission #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetPermissions operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetPermissions/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetPermissions call
res = service.GetPermissions()
#If call is successful
if (res.ResultCode == 0):
#Loop through collection of Permission objects returned
for item in res.Collection.Permission:
print('Permission # ' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('IsActive: ' + str(item.IsActive))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetPriceChanges.Settings2ServiceReference;
namespace Settings2_GetPriceChanges
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
//Make GetPriceChanges call
var response = client.GetPriceChanges();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of PriceChange objects returned
if (response.Collection != null)
{
foreach (var item in response.Collection)
{
Console.WriteLine("PriceChange #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Days: " + item.Days);
Console.WriteLine("EndDate: " + item.EndDate);
Console.WriteLine("EndTime: " + item.EndTime);
Console.WriteLine("EnforceDateRanges: " + item.EnforceDateRanges);
Console.WriteLine("EnforceDays: " + item.EnforceDays);
Console.WriteLine("EnforceTimeRanges: " + item.EnforceTimeRanges);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("ItemPriceChanges:");
//Loop through collection of ItemPriceChange objects returned
if (item.ItemPriceChanges != null)
{
foreach (var change in item.ItemPriceChanges)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tComponentPriceChanges:");
//Loop through collection of ComponentPriceChange objects returned
if (change.ComponentPriceChanges != null)
{
foreach (var compChange in change.ComponentPriceChanges)
{
Console.WriteLine("\t\tId: " + compChange.Id);
Console.WriteLine("\t\tComponentItemPriceChanges:");
//Loop through collection of ComponentItemPriceChange objects returned
if (compChange.ComponentItemPriceChanges != null)
{
foreach (var compItemChange in compChange.ComponentItemPriceChanges)
{
Console.WriteLine("\t\t\tId: " + compItemChange.Id);
Console.WriteLine("\t\t\tItemId: " + compItemChange.ItemId);
Console.WriteLine("\t\t\tPrice: " + compItemChange.Price);
Console.WriteLine("\t\t\t---------");
}
}
Console.WriteLine("\t\tComponentId: " + compChange.ComponentId);
Console.WriteLine("\t\tPrice: " + compChange.Price);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\tItemId: " + change.ItemId);
Console.WriteLine("\tName: " + change.Name);
Console.WriteLine("\tOriginalPrice: " + change.OriginalPrice);
Console.WriteLine("\tPrice: " + change.Price);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("PriceChangeDestinations:");
//Loop through collection of PriceChangeDestination objects returned
foreach (var destination in item.PriceChangeDestinations)
{
Console.WriteLine("\tId: " + destination.Id);
Console.WriteLine("\tDestinationId: " + destination.DestinationId);
Console.WriteLine("\tDestinationName: " + destination.DestinationName);
Console.WriteLine("\t-----------------------");
}
Console.WriteLine("StartDate:" + item.StartDate);
Console.WriteLine("StartTime: " + item.StartTime);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetPriceChanges
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetPriceChangesAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of PriceChange objects returned
if (response.Result.Collection != null)
{
foreach (var item in response.Result.Collection)
{
Console.WriteLine("PriceChange #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Days: " + item.Days);
Console.WriteLine("EndDate: " + item.EndDate);
Console.WriteLine("EndTime: " + item.EndTime);
Console.WriteLine("EnforceDateRanges: " + item.EnforceDateRanges);
Console.WriteLine("EnforceDays: " + item.EnforceDays);
Console.WriteLine("EnforceTimeRanges: " + item.EnforceTimeRanges);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("ItemPriceChanges:");
//Loop through collection of ItemPriceChange objects returned
if (item.ItemPriceChanges != null)
{
foreach (var change in item.ItemPriceChanges)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tComponentPriceChanges:");
//Loop through collection of ComponentPriceChange objects returned
if (change.ComponentPriceChanges != null)
{
foreach (var compChange in change.ComponentPriceChanges)
{
Console.WriteLine("\t\tId: " + compChange.Id);
Console.WriteLine("\t\tComponentItemPriceChanges:");
//Loop through collection of ComponentItemPriceChange objects returned
if (compChange.ComponentItemPriceChanges != null)
{
foreach (var compItemChange in compChange.ComponentItemPriceChanges)
{
Console.WriteLine("\t\t\tId: " + compItemChange.Id);
Console.WriteLine("\t\t\tItemId: " + compItemChange.ItemId);
Console.WriteLine("\t\t\tPrice: " + compItemChange.Price);
Console.WriteLine("\t\t\t---------");
}
}
Console.WriteLine("\t\tComponentId: " + compChange.ComponentId);
Console.WriteLine("\t\tPrice: " + compChange.Price);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\tItemId: " + change.ItemId);
Console.WriteLine("\tName: " + change.Name);
Console.WriteLine("\tOriginalPrice: " + change.OriginalPrice);
Console.WriteLine("\tPrice: " + change.Price);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("PriceChangeDestinations:");
//Loop through collection of PriceChangeDestination objects returned
foreach (var destination in item.PriceChangeDestinations)
{
Console.WriteLine("\tId: " + destination.Id);
Console.WriteLine("\tDestinationId: " + destination.DestinationId);
Console.WriteLine("\tDestinationName: " + destination.DestinationName);
Console.WriteLine("\t-----------------------");
}
Console.WriteLine("StartDate:" + item.StartDate);
Console.WriteLine("StartTime: " + item.StartTime);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetPriceChanges operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetPriceChanges/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetPriceChanges call
res = service.GetPriceChanges()
#If call is successful
if(res.ResultCode == 0):
if(res.Collection != None):
#Loop through collection of PriceChange objects returned
for item in res.Collection.PriceChange:
print('PriceChange #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('Days: ' + str(item.Days))
print('EndDate: ' + str(item.EndDate))
print('EndTime: ' + str(item.EndTime))
print('EnforceDateRanges: ' + str(item.EnforceDateRanges))
print('EnforceDays: ' + str(item.EnforceDays))
print('IsActive: ' + str(item.IsActive))
if(item.ItemPriceChanges != None):
print('ItemPriceChanges:')
#Loop through collection of ItemPriceChange objects returned
for change in item.ItemPriceChanges.ItemPriceChange:
print('\tId: ' + str(change.Id))
if(change.ComponentPriceChanges != None):
print('\tComponentPriceChanges:')
#Loop through collection of ComponentPriceChange objects returned
for compChange in change.ComponentPriceChanges.ComponentPriceChange:
print('\t\tId: ' + str(compChange.Id))
if(compChange.ComponentItemPriceChanges != None):
print('\t\tComponentItemPriceChanges:')
#Loop through collection of ComponentItemPriceChange objects returned
for compItemChange in compChange.ComponentItemPriceChanges.ComponentItemPriceChange:
print('\t\t\tId: ' + str(compItemChange.Id))
print('\t\t\tItemId: ' + str(compItemChange.ItemId))
print('\t\t\tPrice: ' + str(compItemChange.Price))
print('\t\t\t---------')
print('\t\tComponentId: ' + str(compChange.ComponentId))
print('\t\tPrice: ' + str(compChange.Price))
print('\t\t------------')
else:
print('\t\tComponentItemPriceChanges: None')
else:
print('\tComponentPriceChanges: None')
print('\tItemId: ' + str(change.ItemId))
print('\tName: ' + str(change.Name))
print('\tOriginalPrice: ' + str(change.OriginalPrice))
print('\tPrice: ' + str(change.Price))
print('\t-----------------------')
else:
print('ItemPriceChanges: None')
if(item.PriceChangeDestinations != None):
print('PriceChangeDestinations:')
#Loop through collection of PriceChangeDestination objects returned
for destination in item.PriceChangeDestinations.PriceChangeDestination:
print('\tId: ' + str(destination.Id))
print('\tDestinationId: ' + str(destination.DestinationId))
print('\tDestinationName: ' + str(destination.DestinationName))
print('\t-----------------------')
else:
print('PriceChangeDestinations: None')
print('StartDate: ' + str(item.StartDate))
print('StartTime: ' + str(item.StartTime))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using ServiceReference;
using System;
using System.ServiceModel;
using System.ServiceModel.Web;
namespace Settings2_GetPromotions
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
var request = new GetPromotionsRequest();
//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";
//Make GetPromotions call
var response = client.GetPromotions(request);
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Promotion objects returned
if (response.Collection != null)
{
foreach (var promotion in response.Collection)
{
Console.WriteLine("Promotion #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + promotion.Id);
Console.WriteLine("Name: " + promotion.Name);
Console.WriteLine("AllowLaterOrderReductions: " + promotion.AllowLaterOrderReductions);
Console.WriteLine("AllowPriorItemPromotions: " + promotion.AllowPriorItemPromotions);
Console.WriteLine("AllowPriorModifierPromotions: " + promotion.AllowPriorModifierPromotions);
Console.WriteLine("AllowPriorOrderReductions: " + promotion.AllowPriorOrderReductions);
Console.WriteLine("AlternateId: " + promotion.AlternateId);
Console.WriteLine("BarCode: " + promotion.BarCode);
Console.WriteLine("Code: " + promotion.Code);
if (promotion.CustomFields != null)
{
foreach (var customfield in promotion.CustomFields)
{
Console.WriteLine("customfield: ");
Console.WriteLine("\tId: " + customfield.Id);
Console.WriteLine("\tFieldName: " + customfield.FieldName);
Console.WriteLine("\tValue: " + customfield.Value);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("Days: " + promotion.Days);
Console.WriteLine("EndDate: " + promotion.EndDate);
Console.WriteLine("EndTime: " + promotion.EndTime);
Console.WriteLine("EnforceDateRange: " + promotion.EnforceDateRange);
Console.WriteLine("EnforceDays: " + promotion.EnforceDays);
Console.WriteLine("EnforceMaximumAmount: " + promotion.EnforceMaximumAmount);
Console.WriteLine("EnforceMaximumPerOrder: " + promotion.EnforceMaximumPerOrder);
Console.WriteLine("EnforceTimeRange: " + promotion.EnforceTimeRange);
Console.WriteLine("IsActive: " + promotion.IsActive);
Console.WriteLine("IsApprovalNeeded: " + promotion.IsApprovalNeeded);
Console.WriteLine("IsCodeRequired: " + promotion.IsCodeRequired);
Console.WriteLine("LimitDestinations: " + promotion.LimitDestinations);
Console.WriteLine("LimitSections: " + promotion.LimitSections);
Console.WriteLine("LimitTerminals: " + promotion.LimitTerminals);
Console.WriteLine("MarketingCampaignId: " + promotion.MarketingCampaignId);
Console.WriteLine("MaximumAmount: " + promotion.MaximumAmount);
Console.WriteLine("MaximumPerOrder: " + promotion.MaximumPerOrder);
Console.WriteLine("PrintedName: " + promotion.PrintedName);
Console.WriteLine("Priority: " + promotion.Priority);
if (promotion.Qualifications != null)
{
//Loop through collection of PromotionQualification objects returned
foreach (var qualification in promotion.Qualifications)
{
Console.WriteLine("Qualification: ");
Console.WriteLine("\tId: " + qualification.Id);
Console.WriteLine("\tAmount: " + qualification.Amount);
Console.WriteLine("\tItemGroupId: " + qualification.ItemGroupId);
//Loop through collection of PromotionQualificationItem objects returned
if (qualification.Items != null)
{
foreach (var item in qualification.Items)
{
Console.WriteLine("PromotionQualificationItem: ");
Console.WriteLine("\t\tId: " + item.Id);
Console.WriteLine("\t\tItemId: " + item.ItemId);
Console.WriteLine("\t\t---------");
}
}
Console.WriteLine("\tItemGroupId: " + qualification.ItemGroupId);
Console.WriteLine("\tType: " + qualification.Type);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("Qualify: " + promotion.Qualify);
Console.WriteLine("RequireSingleUseCode: " + promotion.RequireSingleUseCode);
Console.WriteLine("StartDate: " + promotion.StartDate);
Console.WriteLine("StartTime: " + promotion.StartTime);
Console.WriteLine("Type: " + promotion.Type);
if (promotion.ValidDestinations != null)
{
//Loop through collection of PromotionDestinations objects returned
foreach (var promotionDestination in promotion.ValidDestinations)
{
Console.WriteLine("PromotionDestination: ");
Console.WriteLine("\tId: " + promotionDestination.Id);
Console.WriteLine("\tDestinationId: " + promotionDestination.DestinationId);
Console.WriteLine("\t-----------------------");
}
}
if (promotion.ValidSections != null)
{
//Loop through collection of PromotionSections objects returned
foreach (var promotionSection in promotion.ValidSections)
{
Console.WriteLine("PromotionSection: ");
Console.WriteLine("\tId: " + promotionSection.Id);
Console.WriteLine("\tDestinationId: " + promotionSection.SectionId);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("ValidTerminalTypes: " + promotion.ValidTerminalTypes);
//If Returned Promotion is BogoPromotion
if (promotion.Type == PromotionType.Bogo)
{
var bogoPromotion = (BogoPromotion)promotion;
Console.WriteLine("Amount: " + bogoPromotion.Amount);
Console.WriteLine("AutomaticallyApply: " + bogoPromotion.AutomaticallyApply);
Console.WriteLine("CanSpanMultipleSeats: " + bogoPromotion.CanSpanMultipleSeats);
Console.WriteLine("DiscountedItemGroupId: " + bogoPromotion.DiscountedItemGroupId);
if (bogoPromotion.DiscountedItemIds != null)
{
//Loop through collection of PromotionEligibleItems objects returned
foreach (var promotionEligibleItem in bogoPromotion.DiscountedItemIds)
{
Console.WriteLine("PromotionEligibleItem: ");
Console.WriteLine("\tId: " + promotionEligibleItem.Id);
Console.WriteLine("\tItemId: " + promotionEligibleItem.ItemId);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("FreeItemType: " + bogoPromotion.FreeItemType);
Console.WriteLine("PricingMethod: " + bogoPromotion.PricingMethod);
}
if (promotion.Type == PromotionType.Coupon)
{
var coupon = (CouponPromotion)promotion;
Console.WriteLine("Amount: " + coupon.Amount);
Console.WriteLine("Application: " + coupon.Application);
Console.WriteLine("AppliesToModifiers: " + coupon.AppliesToModifiers);
Console.WriteLine("CouponType: " + coupon.CouponType);
Console.WriteLine("DiscountedItemGroupId: " + coupon.DiscountedItemGroupId);
if (coupon.DiscountedItemGroups != null)
{
//Loop through collection of PromotionEligibleItemGroups objects returned
foreach (var promotionEligibleItemGroup in coupon.DiscountedItemGroups)
{
Console.WriteLine("PromotionEligibleItemGroup: ");
Console.WriteLine("\tId: " + promotionEligibleItemGroup.Id);
Console.WriteLine("\tItemGroupId: " + promotionEligibleItemGroup.ItemGroupId);
Console.WriteLine("\tLimit: " + promotionEligibleItemGroup.Limit);
if (promotionEligibleItemGroup.EligibleItems != null)
{
//Loop through collection of PromotionEligibleItems objects returned
foreach (var promotionEligibleItem in promotionEligibleItemGroup.EligibleItems)
{
Console.WriteLine("PromotionEligibleItem: ");
Console.WriteLine("\t\tId: " + promotionEligibleItem.Id);
Console.WriteLine("\t\tItemId: " + promotionEligibleItem.ItemId);
Console.WriteLine("\t\t-----------------------");
}
}
Console.WriteLine("\t-----------------------");
}
}
if (coupon.DiscountedItemIds != null)
{
//Loop through collection of PromotionEligibleItems objects returned
foreach (var promotionEligibleItem in coupon.DiscountedItemIds)
{
Console.WriteLine("PromotionEligibleItem: ");
Console.WriteLine("\tId: " + promotionEligibleItem.Id);
Console.WriteLine("\tItemId: " + promotionEligibleItem.ItemId);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("DiscountedItemLimit: " + coupon.DiscountedItemLimit);
Console.WriteLine("Distribution: " + coupon.Distribution);
}
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using Microsoft.Extensions.DependencyInjection;
using ServiceReference;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetPromotions
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 request = new GetPromotionsRequest();
var response = client.GetPromotionsAsync(request);
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of Promotion objects returned
if (response.Result.Collection != null)
{
foreach (var promotion in response.Result.Collection)
{
Console.WriteLine("Promotion #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + promotion.Id);
Console.WriteLine("Name: " + promotion.Name);
Console.WriteLine("AllowLaterOrderReductions: " + promotion.AllowLaterOrderReductions);
Console.WriteLine("AllowPriorItemPromotions: " + promotion.AllowPriorItemPromotions);
Console.WriteLine("AllowPriorModifierPromotions: " + promotion.AllowPriorModifierPromotions);
Console.WriteLine("AllowPriorOrderReductions: " + promotion.AllowPriorOrderReductions);
Console.WriteLine("AlternateId: " + promotion.AlternateId);
Console.WriteLine("BarCode: " + promotion.BarCode);
Console.WriteLine("Code: " + promotion.Code);
if (promotion.CustomFields != null)
{
foreach (var customfield in promotion.CustomFields)
{
Console.WriteLine("customfield: ");
Console.WriteLine("\tId: " + customfield.Id);
Console.WriteLine("\tFieldName: " + customfield.FieldName);
Console.WriteLine("\tValue: " + customfield.Value);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("Days: " + promotion.Days);
Console.WriteLine("EndDate: " + promotion.EndDate);
Console.WriteLine("EndTime: " + promotion.EndTime);
Console.WriteLine("EnforceDateRange: " + promotion.EnforceDateRange);
Console.WriteLine("EnforceDays: " + promotion.EnforceDays);
Console.WriteLine("EnforceMaximumAmount: " + promotion.EnforceMaximumAmount);
Console.WriteLine("EnforceMaximumPerOrder: " + promotion.EnforceMaximumPerOrder);
Console.WriteLine("EnforceTimeRange: " + promotion.EnforceTimeRange);
Console.WriteLine("IsActive: " + promotion.IsActive);
Console.WriteLine("IsApprovalNeeded: " + promotion.IsApprovalNeeded);
Console.WriteLine("IsCodeRequired: " + promotion.IsCodeRequired );
Console.WriteLine("LimitDestinations: " + promotion.LimitDestinations);
Console.WriteLine("LimitSections: " + promotion.LimitSections);
Console.WriteLine("LimitTerminals: " + promotion.LimitTerminals);
Console.WriteLine("MarketingCampaignId: " + promotion.MarketingCampaignId);
Console.WriteLine("MaximumAmount: " + promotion.MaximumAmount);
Console.WriteLine("MaximumPerOrder: " + promotion.MaximumPerOrder);
Console.WriteLine("PrintedName: " + promotion.PrintedName);
Console.WriteLine("Priority: " + promotion.Priority);
if (promotion.Qualifications != null)
{
//Loop through collection of PromotionQualification objects returned
foreach (var qualification in promotion.Qualifications)
{
Console.WriteLine("Qualification: ");
Console.WriteLine("\tId: " + qualification.Id);
Console.WriteLine("\tAmount: " + qualification.Amount);
Console.WriteLine("\tItemGroupId: " + qualification.ItemGroupId);
//Loop through collection of PromotionQualificationItem objects returned
if (qualification.Items != null)
{
foreach (var item in qualification.Items)
{
Console.WriteLine("PromotionQualificationItem: ");
Console.WriteLine("\t\tId: " + item.Id);
Console.WriteLine("\t\tItemId: " + item.ItemId);
Console.WriteLine("\t\t---------");
}
}
Console.WriteLine("\tItemGroupId: " + qualification.ItemGroupId);
Console.WriteLine("\tType: " + qualification.Type);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("Qualify: " + promotion.Qualify);
Console.WriteLine("RequireSingleUseCode: " + promotion.RequireSingleUseCode);
Console.WriteLine("StartDate: " + promotion.StartDate);
Console.WriteLine("StartTime: " + promotion.StartTime);
Console.WriteLine("Type: " + promotion.Type);
if (promotion.ValidDestinations != null)
{
//Loop through collection of PromotionDestinations objects returned
foreach (var promotionDestination in promotion.ValidDestinations)
{
Console.WriteLine("PromotionDestination: ");
Console.WriteLine("\tId: " + promotionDestination.Id);
Console.WriteLine("\tDestinationId: " + promotionDestination.DestinationId);
Console.WriteLine("\t-----------------------");
}
}
if (promotion.ValidSections != null)
{
//Loop through collection of PromotionSections objects returned
foreach (var promotionSection in promotion.ValidSections)
{
Console.WriteLine("PromotionSection: ");
Console.WriteLine("\tId: " + promotionSection.Id);
Console.WriteLine("\tDestinationId: " + promotionSection.SectionId);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("ValidTerminalTypes: " + promotion.ValidTerminalTypes);
//If Returned Promotion is BogoPromotion
if(promotion.Type == PromotionType.Bogo)
{
var bogoPromotion = (BogoPromotion) promotion;
Console.WriteLine("Amount: " + bogoPromotion.Amount);
Console.WriteLine("AutomaticallyApply: " + bogoPromotion.AutomaticallyApply);
Console.WriteLine("CanSpanMultipleSeats: " + bogoPromotion.CanSpanMultipleSeats);
Console.WriteLine("DiscountedItemGroupId: " + bogoPromotion.DiscountedItemGroupId);
if (bogoPromotion.DiscountedItemIds != null)
{
//Loop through collection of PromotionEligibleItems objects returned
foreach (var promotionEligibleItem in bogoPromotion.DiscountedItemIds)
{
Console.WriteLine("PromotionEligibleItem: ");
Console.WriteLine("\tId: " + promotionEligibleItem.Id);
Console.WriteLine("\tItemId: " + promotionEligibleItem.ItemId);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("FreeItemType: " + bogoPromotion.FreeItemType);
Console.WriteLine("PricingMethod: " + bogoPromotion.PricingMethod);
}
if (promotion.Type == PromotionType.Coupon)
{
var coupon = (CouponPromotion)promotion;
Console.WriteLine("Amount: " + coupon.Amount);
Console.WriteLine("Application: " + coupon.Application);
Console.WriteLine("AppliesToModifiers: " + coupon.AppliesToModifiers);
Console.WriteLine("CouponType: " + coupon.CouponType);
Console.WriteLine("DiscountedItemGroupId: " + coupon.DiscountedItemGroupId);
if (coupon.DiscountedItemGroups != null)
{
//Loop through collection of PromotionEligibleItemGroups objects returned
foreach (var promotionEligibleItemGroup in coupon.DiscountedItemGroups)
{
Console.WriteLine("PromotionEligibleItemGroup: ");
Console.WriteLine("\tId: " + promotionEligibleItemGroup.Id);
Console.WriteLine("\tItemGroupId: " + promotionEligibleItemGroup.ItemGroupId);
Console.WriteLine("\tLimit: " + promotionEligibleItemGroup.Limit);
if(promotionEligibleItemGroup.EligibleItems != null)
{
//Loop through collection of PromotionEligibleItems objects returned
foreach (var promotionEligibleItem in promotionEligibleItemGroup.EligibleItems)
{
Console.WriteLine("PromotionEligibleItem: ");
Console.WriteLine("\t\tId: " + promotionEligibleItem.Id);
Console.WriteLine("\t\tItemId: " + promotionEligibleItem.ItemId);
Console.WriteLine("\t\t-----------------------");
}
}
Console.WriteLine("\t-----------------------");
}
}
if (coupon.DiscountedItemIds != null)
{
//Loop through collection of PromotionEligibleItems objects returned
foreach (var promotionEligibleItem in coupon.DiscountedItemIds)
{
Console.WriteLine("PromotionEligibleItem: ");
Console.WriteLine("\tId: " + promotionEligibleItem.Id);
Console.WriteLine("\tItemId: " + promotionEligibleItem.ItemId);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("DiscountedItemLimit: " + coupon.DiscountedItemLimit);
Console.WriteLine("Distribution: " + coupon.Distribution);
}
Console.WriteLine("---------------------------");
count++;
}
}
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetPromotions operation: " + ex.Message);
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:GetPromotions>
<!--Optional:-->
<v2:request>
<!--Optional:-->
<v2:PromotionIds>
<!--Zero or more repetitions:-->
<arr:int>1</arr:int>
</v2:PromotionIds>
</v2:request>
</v2:GetPromotions>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetPromotions call
res = service.GetPromotions()
#If call is successful
if(res.ResultCode == 0):
if(res.Collection != None):
#Loop through collection of Promotion objects returned
for promotion in res.Collection.Promotions:
print('Promotion #' + str(count))
print('---------------------------')
print('Id: ' + str(promotion.Id))
print('Name: ' + str(promotion.Name))
print("AllowLaterOrderReductions: " + str(promotion.AllowLaterOrderReductions))
print("AllowPriorItemPromotions: " + str(promotion.AllowPriorItemPromotions))
print("AllowPriorModifierPromotions: " + str(promotion.AllowPriorModifierPromotions))
print("AllowPriorOrderReductions: " + str(promotion.AllowPriorOrderReductions))
print("AlternateId: " + str(promotion.AlternateId))
print("BarCode: " + str(promotion.BarCode))
print("Code: " + str(promotion.Code))
if promotion.CustomFields != None:
print("customfield: " + str(promotion.CustomFields))
print("Days: " + str(promotion.Days))
print("EndDate: " + str(promotion.EndDate))
print("EndTime: " + str(promotion.EndTime))
print("EnforceDateRange: " + str(promotion.EnforceDateRange))
print("EnforceDays: " + str(promotion.EnforceDays))
print("EnforceMaximumAmount: " + str(promotion.EnforceMaximumAmount))
print("EnforceMaximumPerOrder: " + str(promotion.EnforceMaximumPerOrder))
print("EnforceTimeRange: " + str(promotion.EnforceTimeRange))
print("IsActive: " + str(promotion.IsActive))
print("Type: " + str(promotion.Type))
if (promotion.ValidDestinations != None):
#Loop through collection of PromotionDestinations objects returned
print("PromotionDestination: " + str(promotion.ValidDestinations))
if (promotion.ValidSections != None):
#Loop through collection of PromotionValidSections objects returned
print("PromotionValidSection: " + str(promotion.ValidSections))
print("ValidTerminalTypes: " + str(promotion.ValidTerminalTypes))
print("Qualify:", str(promotion.Qualify))
print("RequireSingleUseCode:", str(promotion.RequireSingleUseCode))
print("StartDate:", str(promotion.StartDate))
print("StartTime:", str(promotion.StartTime))
#If Returned Promotion is BogoPromotion
promotionType = promotion.Type
if (promotionType == 'Bogo'):
bogoPromotion = promotion
print("Amount: " + str(bogoPromotion.Amount))
print("AutomaticallyApply: " + str(bogoPromotion.AutomaticallyApply))
print("CanSpanMultipleSeats: " + str(bogoPromotion.CanSpanMultipleSeats))
print("DiscountedItemGroupId: " + str(bogoPromotion.DiscountedItemGroupId))
if (bogoPromotion.DiscountedItemIds != None):
print("PromotionEligibleItem: " + str(bogoPromotion.DiscountedItemIds))
print("FreeItemType: " + str(bogoPromotion.FreeItemType))
print("PricingMethod: " + str(bogoPromotion.PricingMethod))
#If Returned Promotion is CouponPromotion
if (promotionType == 'Coupon'):
coupon = promotion
print("Amount: " + str(coupon.Amount))
print("Application: " + str(coupon.Application))
print("AppliesToModifiers: " + str(coupon.AppliesToModifiers))
print("CouponType: " + str(coupon.CouponType))
print("DiscountedItemGroupId: " + str(coupon.DiscountedItemGroupId))
if (coupon.DiscountedItemGroups != None):
#Loop through collection of PromotionEligibleItemGroups objects returned
print("PromotionEligibleItemGroup: " + str(coupon.DiscountedItemGroups))
if (coupon.DiscountedItemIds != None):
#Loop through collection of PromotionEligibleItems objects returned
print("PromotionEligibleItems: " + str(coupon.DiscountedItemIds))
print("DiscountedItemLimit: " + str(coupon.DiscountedItemLimit))
print("Distribution: " + str(coupon.Distribution))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetRefundReasons.Settings2ServiceReference;
namespace Settings2_GetRefundReasons
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
//Make GetRefundReasons call
var response = client.GetRefundReasons();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of RefundReason objects returned
if (response.Collection != null)
{
foreach (var item in response.Collection)
{
Console.WriteLine("RefundReason #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetRefundReasons
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetRefundReasonsAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of RefundReason objects returned
if (response.Result.Collection != null)
{
foreach (var item in response.Result.Collection)
{
Console.WriteLine("RefundReason #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetRefundReasons operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetRefundReasons/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetRefundReasons call
res = service.GetRefundReasons()
#If call is successful
if(res.ResultCode == 0):
if(res.Collection != None):
#Loop through collection of RefundReason objects returned
for item in res.Collection.RefundReason:
print('RefundReason #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetSecurityLevels.Settings2ServiceReference;
namespace Settings2_GetSecurityLevels
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
//Make GetSecurityLevels call
var response = client.GetSecurityLevels();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of SecurityLevel objects returned
if (response.Collection != null)
{
foreach (var item in response.Collection)
{
Console.WriteLine("SecurityLevel #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AddSurcharges: " + item.AddSurcharges);
Console.WriteLine("AllowExcessEmployeeCardUsage: " + item.AllowExcessEmployeeCardUsage);
Console.WriteLine("ApproveCheckout: " + item.ApproveCheckout);
Console.WriteLine("ApproveClockIn: " + item.ApproveClockIn);
Console.WriteLine("ApproveClockOut: " + item.ApproveClockOut);
Console.WriteLine("ApproveDiscounts: " + item.ApproveDiscounts);
Console.WriteLine("ApproveLoyaltyCards: " + item.ApproveLoyaltyCards);
Console.WriteLine("ApproveOrderRequestTime: " + item.ApproveOrderRequestTime);
Console.WriteLine("ApprovePromotions: " + item.ApprovePromotions);
Console.WriteLine("AssignCharity: " + item.AssignCharity);
Console.WriteLine("CanAdjustTipsFromAnyTill: " + item.CanAdjustTipsFromAnyTill);
Console.WriteLine("CanCloseOrderAssignedToDeliveryDrivers: " + item.CanCloseOrdersAssignedToDeliveryDrivers);
Console.WriteLine("CanOpenAnyDrawer: " + item.CanOpenAnyDrawer);
Console.WriteLine("DeleteDeposits: " + item.DeleteDeposits);
Console.WriteLine("DeleteDiscounts: " + item.DeleteDiscounts);
Console.WriteLine("DeleteDonations: " + item.DeleteDonations);
Console.WriteLine("DeletePayments: " + item.DeletePayments);
Console.WriteLine("DeletePromotions: " + item.DeletePromotions);
Console.WriteLine("DeleteSurcharges: " + item.DeleteSurcharges);
Console.WriteLine("ForceAuthorization: " + item.ForceAuthorization);
Console.WriteLine("ForceReconciliation: " + item.ForceReconciliation);
Console.WriteLine("ManageCashDrawers: " + item.ManageCashDrawers);
Console.WriteLine("OverrideDailyLoyaltyCardLimit: " + item.OverrideDailyLoyaltyCardLimit);
Console.WriteLine("OverrideMaximumTipPercent: " + item.OverrideMaximumTipPercent);
Console.WriteLine("Permissions:");
//Loop through collection of Permission objects returned
if (item.Permissions != null)
{
foreach (var permission in item.Permissions)
{
Console.WriteLine("\tId: " + permission.Id);
Console.WriteLine("\tPermissionId: " + permission.PermissionId);
Console.WriteLine("PermissionUniqueId: " + item.PermissionUniqueId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("ReopenOrders: " + item.ReopenOrders);
Console.WriteLine("SecurityLevelUniqueId: " + item.SecurityLevelUniqueId);
Console.WriteLine("SplitCheck: " + item.SplitCheck);
Console.WriteLine("VoidItems: " + item.VoidItems);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetSecurityLevels
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetSecurityLevelsAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of SecurityLevel objects returned
if (response.Result.Collection != null)
{
foreach (var item in response.Result.Collection)
{
Console.WriteLine("SecurityLevel #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AddSurcharges: " + item.AddSurcharges);
Console.WriteLine("AllowExcessEmployeeCardUsage: " + item.AllowExcessEmployeeCardUsage);
Console.WriteLine("ApproveCheckout: " + item.ApproveCheckout);
Console.WriteLine("ApproveClockIn: " + item.ApproveClockIn);
Console.WriteLine("ApproveClockOut: " + item.ApproveClockOut);
Console.WriteLine("ApproveDiscounts: " + item.ApproveDiscounts);
Console.WriteLine("ApproveLoyaltyCards: " + item.ApproveLoyaltyCards);
Console.WriteLine("ApproveOrderRequestTime: " + item.ApproveOrderRequestTime);
Console.WriteLine("ApprovePromotions: " + item.ApprovePromotions);
Console.WriteLine("AssignCharity: " + item.AssignCharity);
Console.WriteLine("CanAdjustTipsFromAnyTill: " + item.CanAdjustTipsFromAnyTill);
Console.WriteLine("CanCloseOrderAssignedToDeliveryDrivers: " + item.CanCloseOrdersAssignedToDeliveryDrivers);
Console.WriteLine("CanOpenAnyDrawer: " + item.CanOpenAnyDrawer);
Console.WriteLine("DeleteDeposits: " + item.DeleteDeposits);
Console.WriteLine("DeleteDiscounts: " + item.DeleteDiscounts);
Console.WriteLine("DeleteDonations: " + item.DeleteDonations);
Console.WriteLine("DeletePayments: " + item.DeletePayments);
Console.WriteLine("DeletePromotions: " + item.DeletePromotions);
Console.WriteLine("DeleteSurcharges: " + item.DeleteSurcharges);
Console.WriteLine("ForceAuthorization: " + item.ForceAuthorization);
Console.WriteLine("ForceReconciliation: " + item.ForceReconciliation);
Console.WriteLine("ManageCashDrawers: " + item.ManageCashDrawers);
Console.WriteLine("OverrideDailyLoyaltyCardLimit: " + item.OverrideDailyLoyaltyCardLimit);
Console.WriteLine("OverrideMaximumTipPercent: " + item.OverrideMaximumTipPercent);
Console.WriteLine("Permissions:");
//Loop through collection of Permission objects returned
if (item.Permissions != null)
{
foreach (var permission in item.Permissions)
{
Console.WriteLine("\tId: " + permission.Id);
Console.WriteLine("\tPermissionId: " + permission.PermissionId);
Console.WriteLine("PermissionUniqueId: " + permission.PermissionUniqueId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("ReopenOrders: " + item.ReopenOrders);
Console.WriteLine("SecurityLevelUniqueId: " + item.SecurityLevelUniqueId);
Console.WriteLine("SplitCheck: " + item.SplitCheck);
Console.WriteLine("VoidItems: " + item.VoidItems);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetSecurityLevels operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetSecurityLevels/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetSecurityLevels call
res = service.GetSecurityLevels()
#If call is successful
if (res.ResultCode == 0):
if(res.Collection != None):
#Loop through collection of SecurityLevel objects returned
for item in res.Collection.SecurityLevel:
print('SecurityLevel #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('AddSurcharges: ' + str(item.AddSurcharges))
print('AllowExcessEmployeeCardUsage: ' + str(item.AllowExcessEmployeeCardUsage))
print('ApproveCheckout: ' + str(item.ApproveCheckout))
print('ApproveClockIn: ' + str(item.ApproveClockIn))
print('ApproveClockOut: ' + str(item.ApproveClockOut))
print('ApproveDiscounts: ' + str(item.ApproveDiscounts))
print('ApproveLoyaltyCards: ' + str(item.ApproveLoyaltyCards))
print('ApproveOrderRequestTime: ' + str(item.ApproveOrderRequestTime))
print('ApprovePromotions: ' + str(item.ApprovePromotions))
print('AssignCharity: ' + str(item.AssignCharity))
print('CanAdjustTipsFromAnyTill: ' + str(item.CanAdjustTipsFromAnyTill))
print('CanCloseOrderAssignedToDeliveryDrivers: ' + str(item.CanCloseOrdersAssignedToDeliveryDrivers))
print('CanOpenAnyDrawer: ' + str(item.CanOpenAnyDrawer))
print('DeleteDeposits: ' + str(item.DeleteDeposits))
print('DeleteDiscounts: ' + str(item.DeleteDiscounts))
print('DeleteDonations: ' + str(item.DeleteDonations))
print('DeletePayments: ' + str(item.DeletePayments))
print('DeletePromotions: ' + str(item.DeletePromotions))
print('DeleteSurcharges: ' + str(item.DeleteSurcharges))
print('ForceAuthorization: ' + str(item.ForceAuthorization))
print('ForceReconciliation: ' + str(item.ForceReconciliation))
print('ManageCashDrawers: ' + str(item.ManageCashDrawers))
print('OverrideDailyLoyaltyCardLimit: ' + str(item.OverrideDailyLoyaltyCardLimit))
print('OverrideMaximumTipPercent: ' + str(item.OverrideMaximumTipPercent))
if(item.Permissions != None):
print('Permissions:')
#Loop through collection of SecurityLevelPermission objects returned
for permission in item.Permissions.SecurityLevelPermission:
print('\tId: ' + str(permission.Id))
print('\tPermissionId: ' + str(permission.PermissionId))
print('\t------------')
else:
print('Permissions: None')
print('ReopenOrders: ' + str(item.ReopenOrders))
print('SplitCheck: ' + str(item.SplitCheck))
print('VoidItems: ' + str(item.VoidItems))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Settings2_GetSettings.Settings2ServiceReference;
using System.ServiceModel.Web;
using System.ServiceModel;
namespace Settings2_GetSettings
{
class Program
{
static void PrintEmployees(Employee[] employees)
{
int count = 1;
//Loop through collection of Employee objects returned
foreach (var item in employees)
{
Console.WriteLine("Employee #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("AlternateId: " + item.AlternateId);
Console.WriteLine("DisplayName: " + item.DisplayName);
Console.WriteLine("FirstName: " + item.FirstName);
Console.WriteLine("LastName: " + item.LastName);
Console.WriteLine("Address1: " + item.Address1);
Console.WriteLine("Address2: " + item.Address2);
Console.WriteLine("City: " + item.City);
Console.WriteLine("State: " + item.State);
Console.WriteLine("Zip: " + item.Zip);
Console.WriteLine("CellPhone: " + item.CellPhone);
Console.WriteLine("HomePhone: " + item.HomePhone);
Console.WriteLine("EmailAddress: " + item.EmailAddress);
Console.WriteLine("MaritalStatus: " + item.MaritalStatus);
Console.WriteLine("BirthDate: " + item.BirthDate);
Console.WriteLine("HireDate: " + item.HireDate);
Console.WriteLine("TerminationDate: " + item.TerminationDate);
Console.WriteLine("Terminated: " + item.Terminated);
Console.WriteLine("Jobs:");
//Loop through collection of EmployeeJob objects returned
if (item.Jobs.Length > 0)
{
foreach (var job in item.Jobs)
{
Console.WriteLine("\tId: " + job.Id);
Console.WriteLine("\tJobId: " + job.JobId);
Console.WriteLine("\tPayRate: " + job.PayRate);
Console.WriteLine("\tSecurityLevelId: " + job.SecurityLevelId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("CanLoginWithCard: " + item.CanLoginWithCard);
Console.WriteLine("CanLoginWithFinger: " + item.CanLoginWithFinger);
Console.WriteLine("CanLoginWithPin: " + item.CanLoginWithPin);
Console.WriteLine("CardNumber: " + item.CardNumber);
Console.WriteLine("ClockedInDiscountId: " + item.ClockedInDiscountId);
Console.WriteLine("ClockedOutDiscountId: " + item.ClockedOutDiscountId);
Console.WriteLine("ExportToPayroll: " + item.ExportToPayroll);
Console.WriteLine("HealthCardExpirationDate: " + item.HealthCardExpirationDate);
Console.WriteLine("HomeLocationId: " + item.HomeLocationId);
Console.WriteLine("IdentificationVerified: " + item.IdentificationVerified);
Console.WriteLine("IsExempt: " + item.IsExempt);
Console.WriteLine("IsSalaried: " + item.IsSalaried);
Console.WriteLine("LimitLocations: " + item.LimitLocations);
Console.WriteLine("MaximumDailyDiscountAmount: " + item.MaximumDailyDiscountAmount);
Console.WriteLine("MaximumDailyDiscountCount: " + item.MaximumDailyDiscountCount);
Console.WriteLine("PayrollId: " + item.PayrollId);
Console.WriteLine("Permissions:");
//Loop through collection of EmployeePermission objects returned
if (item.Permissions.Length > 0)
{
foreach (var permission in item.Permissions)
{
Console.WriteLine("\tId: " + permission.Id);
Console.WriteLine("\tPermissionId: " + permission.PermissionId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Pin: " + item.Pin);
Console.WriteLine("TaxWitholdingAllowance: " + item.TaxWithholdingAllowance);
Console.WriteLine("ValidLocations:");
//Loop through collection of EmployeeLocation objects returned
if (item.ValidLocations.Length > 0)
{
foreach (var location in item.ValidLocations)
{
Console.WriteLine("\tId: " + location.Id);
Console.WriteLine("\tLocationId: " + location.LocationId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Notes: " + item.Notes);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Employees End");
}
static void PrintJobs(Job[] jobs)
{
int count = 1;
//Loop through collection of Job objects returned
foreach (var item in jobs)
{
Console.WriteLine("Job #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AllowAddItem: " + item.AllowAddItem);
Console.WriteLine("AlternateId: " + item.AlternateId);
Console.WriteLine("CanOpenAnyOrder: " + item.CanOpenAnyOrder);
Console.WriteLine("CannotClose: " + item.CannotClose);
Console.WriteLine("CashDrawer: " + item.CashDrawer);
Console.WriteLine("CheckoutRequiresApproval: " + item.CheckoutRequiresApproval);
Console.WriteLine("ClockInRequiresApproval: " + item.ClockInRequiresApproval);
Console.WriteLine("ClockOutRequiresApproval: " + item.ClockOutRequiresApproval);
Console.WriteLine("DeclareTips: " + item.DeclareTips);
Console.WriteLine("DefaultScreenId: " + item.DefaultScreenId);
Console.WriteLine("DisplayColor: " + item.DisplayColor);
Console.WriteLine("ExcludeOnSalesAndLaborReports: " + item.ExcludeOnSalesAndLaborReports);
Console.WriteLine("ExemptFromLaborSchedule: " + item.ExemptFromLaborSchedule);
Console.WriteLine("ExportCode: " + item.ExportCode);
Console.WriteLine("GroupItemsBySeat: " + item.GroupItemsBySeat);
Console.WriteLine("IsBartender: " + item.IsBartender);
Console.WriteLine("IsDeliveryDispatcher: " + item.IsDeliveryDispatcher);
Console.WriteLine("IsDeliveryDriver: " + item.IsDeliveryDriver);
Console.WriteLine("IsHostess: " + item.IsHostess);
Console.WriteLine("ItemLookup: " + item.ItemLookup);
Console.WriteLine("LaneId: " + item.LaneId);
Console.WriteLine("LimitShiftBreakTypes: " + item.LimitShiftBreakTypes);
Console.WriteLine("LimitedDestinationId: " + item.LimitedDestinationId);
Console.WriteLine("LocationType: " + item.LocationType);
Console.WriteLine("Menus:");
//Loop through collection of JobMenu objects returned
if (item.Menus != null)
{
foreach (var menu in item.Menus)
{
Console.WriteLine("\tDays: " + menu.Days);
Console.WriteLine("\tMenuId: " + menu.MenuId);
Console.WriteLine("\tStartTime: " + menu.StartTime);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("NoCashTransactions: " + item.NoCashTransactions);
Console.WriteLine("OrderEntry: " + item.OrderEntry);
Console.WriteLine("OrderScreenId: " + item.OrderScreenId);
Console.WriteLine("SectionId: " + item.SectionId);
Console.WriteLine("SelfBanking: " + item.SelfBanking);
Console.WriteLine("SelfVoid: " + item.SelfVoid);
Console.WriteLine("ShiftBreakTypes:");
//Loop through collection of JobShiftBreakType objects returned
if (item.ShiftBreakTypes != null)
{
foreach (var breakType in item.ShiftBreakTypes)
{
Console.WriteLine("\tShiftBreakTypeId: " + breakType.ShiftBreakTypeId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Tabs: " + item.Tabs);
Console.WriteLine("Training: " + item.Training);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Jobs End");
}
static void PrintPermissions(Permission[] permissions)
{
int count = 1;
//Loop through collection of Permission objects returned
foreach (var item in permissions)
{
Console.WriteLine("Permission #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Permissions End");
}
static void PrintSecurityLevels(SecurityLevel[] securityLevels)
{
int count = 1;
//Loop through collection of SecurityLevel objects returned
foreach (var item in securityLevels)
{
Console.WriteLine("SecurityLevel #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AddSurcharges: " + item.AddSurcharges);
Console.WriteLine("AllowExcessEmployeeCardUsage: " + item.AllowExcessEmployeeCardUsage);
Console.WriteLine("ApproveCheckout: " + item.ApproveCheckout);
Console.WriteLine("ApproveClockIn: " + item.ApproveClockIn);
Console.WriteLine("ApproveClockOut: " + item.ApproveClockOut);
Console.WriteLine("ApproveDiscounts: " + item.ApproveDiscounts);
Console.WriteLine("ApproveLoyaltyCards: " + item.ApproveLoyaltyCards);
Console.WriteLine("ApproveOrderRequestTime: " + item.ApproveOrderRequestTime);
Console.WriteLine("ApprovePromotions: " + item.ApprovePromotions);
Console.WriteLine("AssignCharity: " + item.AssignCharity);
Console.WriteLine("CanAdjustTipsFromAnyTill: " + item.CanAdjustTipsFromAnyTill);
Console.WriteLine("CanCloseOrderAssignedToDeliveryDrivers: " + item.CanCloseOrdersAssignedToDeliveryDrivers);
Console.WriteLine("CanOpenAnyDrawer: " + item.CanOpenAnyDrawer);
Console.WriteLine("DeleteDeposits: " + item.DeleteDeposits);
Console.WriteLine("DeleteDiscounts: " + item.DeleteDiscounts);
Console.WriteLine("DeleteDonations: " + item.DeleteDonations);
Console.WriteLine("DeletePayments: " + item.DeletePayments);
Console.WriteLine("DeletePromotions: " + item.DeletePromotions);
Console.WriteLine("DeleteSurcharges: " + item.DeleteSurcharges);
Console.WriteLine("ForceAuthorization: " + item.ForceAuthorization);
Console.WriteLine("ForceReconciliation: " + item.ForceReconciliation);
Console.WriteLine("ManageCashDrawers: " + item.ManageCashDrawers);
Console.WriteLine("OverrideDailyLoyaltyCardLimit: " + item.OverrideDailyLoyaltyCardLimit);
Console.WriteLine("OverrideMaximumTipPercent: " + item.OverrideMaximumTipPercent);
Console.WriteLine("Permissions:");
//Loop through collection of Permission objects returned
if (item.Permissions != null)
{
foreach (var permission in item.Permissions)
{
Console.WriteLine("\tId: " + permission.Id);
Console.WriteLine("\tPermissionId: " + permission.PermissionId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("ReopenOrders: " + item.ReopenOrders);
Console.WriteLine("SplitCheck: " + item.SplitCheck);
Console.WriteLine("VoidItems: " + item.VoidItems);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Security Levels End");
}
static void PrintKitchenQueues(KitchenQueue[] kitchenQueues)
{
int count = 1;
//Loop through collection of KitchenQueue objects returned
foreach (var item in kitchenQueues)
{
Console.WriteLine("KitchenQueue #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
}
static void PrintFutureOrderingOptions(FutureOrderingOptions futureOrderingOptions)
{
Console.WriteLine("AllowFutureDateOrdering: " + futureOrderingOptions.AllowFutureDateOrdering);
Console.WriteLine("Destinations:");
//Loop through collection of OnlineOrderingDestination objects returned
if (futureOrderingOptions.Destinations != null)
{
foreach (var destination in futureOrderingOptions.Destinations)
{
Console.WriteLine("\tDestinationId: " + destination.DestinationId);
Console.WriteLine("\tInstructions: " + destination.Instructions);
Console.WriteLine("\tIsDefault: " + destination.IsDefault);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("IsEnabled: " + futureOrderingOptions.IsEnabled);
Console.WriteLine("LeadTimeThresholds:");
//Loop through collection of LeadTimeThreshold objects returned
if (futureOrderingOptions.LeadTimeThresholds != null)
{
foreach (var threshold in futureOrderingOptions.LeadTimeThresholds)
{
Console.WriteLine("\tLeadMinutes: " + threshold.LeadMinutes);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("MaximumDaysInAdvance: " + futureOrderingOptions.MaximumDaysInAdvance);
Console.WriteLine("MinimumLeadMinutes: " + futureOrderingOptions.MinimumLeadMinutes);
Console.WriteLine("MinimumPrepMinutes: " + futureOrderingOptions.MinimumPrepMinutes);
Console.WriteLine("PrepTimeThresholds:");
//Loop through collection of PrepTimeThreshold objects returned
if (futureOrderingOptions.PrepTimeThresholds != null)
{
foreach (var threshold in futureOrderingOptions.PrepTimeThresholds)
{
Console.WriteLine("\tPrepMinutes: " + threshold.PrepMinutes);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("RequiredDepositPercent: " + futureOrderingOptions.RequiredDepositPercent);
Console.WriteLine("---------------------------");
Console.WriteLine("Future Ordering Options End");
}
static void PrintMenu(Menu item)
{
int count = 1;
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Categories:");
//Loop through collection of MenuCategory objects returned
if (item.Categories != null)
{
foreach (var category in item.Categories)
{
Console.WriteLine("\tCategory #" + count);
Console.WriteLine("\t-----------------------");
Console.WriteLine("\tId: " + category.Id);
Console.WriteLine("\tName: " + category.Name);
Console.WriteLine("\tDescription: " + category.Description);
//Loop through collection of MenuItem objects returned
if (category.Items != null)
{
Console.WriteLine("\tItems:");
foreach (var menuItem in category.Items)
{
Console.WriteLine("\t\tId: " + menuItem.Id);
Console.WriteLine("\t\tName: " + menuItem.Name);
Console.WriteLine("\t\tDescription: " + menuItem.Description);
Console.WriteLine("\t\tImageId: " + menuItem.ImageId);
Console.WriteLine("\t\tItemId: " + menuItem.ItemId);
if (menuItem.ItemOptions != null)
{
Console.WriteLine("\t\tItemOptions:");
//Loop through collection of MenuItemOption objects returned
foreach (var menuItemOption in menuItem.ItemOptions)
{
Console.WriteLine("\t\t\tId: " + menuItemOption.Id);
Console.WriteLine("\t\t\tDisplayName: " + menuItemOption.DisplayName);
Console.WriteLine("\t\t\tItemId: " + menuItemOption.ItemId);
Console.WriteLine("\t\t\tSortOrderId: " + menuItemOption.SortOrderId);
}
}
else
{
Console.WriteLine("\t\tItemOptions: None");
}
if (menuItem.ModifierGroups != null)
{
Console.WriteLine("\t\tModifierGroups:");
//Loop through collection of MenuItemModifierGroup objects returned
foreach (var menuItemModifierGroup in menuItem.ModifierGroups)
{
Console.WriteLine("\t\t\tId: " + menuItemModifierGroup.Id);
Console.WriteLine("\t\t\tModifierGroupId: " + menuItemModifierGroup.ModifierGroupId);
Console.WriteLine("\t\t\tSortOrderId: " + menuItemModifierGroup.SortOrderId);
}
}
else
{
Console.WriteLine("\t\tModifierGroups: None");
}
Console.WriteLine("\t\tModifierMethod: " + menuItem.ModifierMethod);
Console.WriteLine("\t\tPrice: " + menuItem.Price);
Console.WriteLine("\t\tPriceMethod: " + menuItem.PriceMethod);
Console.WriteLine("\t\tSortOrderId: " + menuItem.SortOrderId);
Console.WriteLine("\t\t------------");
}
}
else
{
Console.WriteLine("\tItems: None");
}
Console.WriteLine("\tSortOrderId: " + category.SortOrderId);
Console.WriteLine("\t-----------------------");
count++;
}
}
else
{
Console.WriteLine("Category: None");
}
Console.WriteLine("Description: " + item.Description);
Console.WriteLine("ImageId: " + item.ImageId);
Console.WriteLine("---------------------------");
Console.WriteLine($"Menu {item.Name} End");
}
static void PrintOnlineOrderingMenuOptions(OnlineOrderingMenuOptions onlineOrderingMenuOptions)
{
int count = 1;
Console.WriteLine("OnlineOrderingMenuId: " + onlineOrderingMenuOptions.OnlineOrderingMenuId);
Console.WriteLine("---------------------------");
Console.WriteLine("AlternateMenus:");
//Loop through collection of AlternateMenu objects returned
if (onlineOrderingMenuOptions.AlternateMenus != null)
{
foreach (var menu in onlineOrderingMenuOptions.AlternateMenus)
{
Console.WriteLine("\tAlternateMenu #" + count);
Console.WriteLine("\t------------");
Console.WriteLine("\tId: " + menu.Id);
Console.WriteLine("\tDays: " + menu.Days);
Console.WriteLine("\tEndTime: " + menu.EndTime);
Console.WriteLine("\tMenuId: " + menu.MenuId);
Console.WriteLine("\tStartTime: " + menu.StartTime);
Console.WriteLine("\tTimeType: " + menu.TimeType);
Console.WriteLine("\t------------");
count++;
}
}
Console.WriteLine("Online Ordering Menu Options End");
}
static void PrintPriceChanges(PriceChange[] priceChanges)
{
int count = 1;
//Loop through collection of PriceChange objects returned
foreach (var item in priceChanges)
{
Console.WriteLine("PriceChange #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Days: " + item.Days);
Console.WriteLine("EndDate: " + item.EndDate);
Console.WriteLine("EndTime: " + item.EndTime);
Console.WriteLine("EnforceDateRanges: " + item.EnforceDateRanges);
Console.WriteLine("EnforceDays: " + item.EnforceDays);
Console.WriteLine("EnforceTimeRanges: " + item.EnforceTimeRanges);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("ItemPriceChanges:");
//Loop through collection of ItemPriceChange objects returned
if (item.ItemPriceChanges != null)
{
foreach (var change in item.ItemPriceChanges)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tComponentPriceChanges:");
//Loop through collection of ComponentPriceChange objects returned
if (change.ComponentPriceChanges != null)
{
foreach (var compChange in change.ComponentPriceChanges)
{
Console.WriteLine("\t\tId: " + compChange.Id);
Console.WriteLine("\t\tComponentItemPriceChanges:");
//Loop through collection of ComponentItemPriceChange objects returned
if (compChange.ComponentItemPriceChanges != null)
{
foreach (var compItemChange in compChange.ComponentItemPriceChanges)
{
Console.WriteLine("\t\t\tId: " + compItemChange.Id);
Console.WriteLine("\t\t\tItemId: " + compItemChange.ItemId);
Console.WriteLine("\t\t\tPrice: " + compItemChange.Price);
Console.WriteLine("\t\t\t---------");
}
}
Console.WriteLine("\t\tComponentId: " + compChange.ComponentId);
Console.WriteLine("\t\tPrice: " + compChange.Price);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\tItemId: " + change.ItemId);
Console.WriteLine("\tName: " + change.Name);
Console.WriteLine("\tOriginalPrice: " + change.OriginalPrice);
Console.WriteLine("\tPrice: " + change.Price);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("PriceChangeDestinations:");
//Loop through collection of PriceChangeDestination objects returned
foreach (var destination in item.PriceChangeDestinations)
{
Console.WriteLine("\tId: " + destination.Id);
Console.WriteLine("\tDestinationId: " + destination.DestinationId);
Console.WriteLine("\tDestinationName: " + destination.DestinationName);
Console.WriteLine("\t-----------------------");
}
Console.WriteLine("StartDate:" + item.StartDate);
Console.WriteLine("StartTime: " + item.StartTime);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Price Changes End");
}
static void PrintPromotions(Promotion[] promotions)
{
int count = 1;
foreach (var item in promotions)
{
Console.WriteLine("Promotion #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("BarCode: " + item.BarCode);
Console.WriteLine("Code: " + item.Code);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("IsCodeRequired: " + item.IsCodeRequired);
Console.WriteLine("RequireSingleUseCode: " + item.RequireSingleUseCode);
Console.WriteLine("Type: " + item.Type);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Promotions End");
}
static void PrintTables(Table[] tables)
{
int count = 1;
//Loop through collection of Table objects returned
foreach (var item in tables)
{
Console.WriteLine("Table #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Capacity: " + item.Capacity);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Tables End");
}
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
var request = new GetSettingsRequest()
{
DataTypes = new DataType[]
{
DataType.Employee,
DataType.Job,
DataType.Permission,
DataType.SecurityLevel,
DataType.KitchenQueue,
DataType.FutureOrderingOptions,
DataType.Menu,
DataType.OnlineOrderingMenuOptions,
DataType.PriceChange,
DataType.Promotion,
DataType.Table
}
};
//Make GetSettings call
var response = client.GetSettings(request);
//If call is successful
if (response.ResultCode == 0)
{
var employees = response.Settings.Employees;
var jobs = response.Settings.Jobs;
var permissions = response.Settings.Permissions;
var securityLevels = response.Settings.SecurityLevels;
var kitchenQueues = response.Settings.KitchenQueues;
var futureOrderingOptions = response.Settings.FutureOrderingOptions;
var menus = response.Settings.Menus;
var onlineOrderingMenuOptions = response.Settings.OnlineOrderingMenuOptions;
var priceChanges = response.Settings.PriceChanges;
var promotions = response.Settings.Promotions;
var tables = response.Settings.Tables;
if (employees != null)
{
Console.WriteLine("Employees:");
PrintEmployees(employees);
}
else
{
Console.WriteLine("Employees: None");
}
if (jobs != null)
{
Console.WriteLine("Jobs:");
PrintJobs(jobs);
}
else
{
Console.WriteLine("Jobs: None");
}
if (permissions != null)
{
Console.WriteLine("Permissions:");
PrintPermissions(permissions);
}
else
{
Console.WriteLine("Permissions: None");
}
if (securityLevels != null)
{
Console.WriteLine("Security Levels:");
PrintSecurityLevels(securityLevels);
}
else
{
Console.WriteLine("Security Levels: None");
}
if (kitchenQueues != null)
{
Console.WriteLine("Kitchen Queues:");
PrintKitchenQueues(kitchenQueues);
}
else
{
Console.WriteLine("Kitchen Queues: None");
}
if (futureOrderingOptions != null)
{
Console.WriteLine("Future Ordering Options:");
PrintFutureOrderingOptions(futureOrderingOptions);
}
else
{
Console.WriteLine("Future Ordering Options: None");
}
if (menus != null)
{
Console.WriteLine("Menus:");
foreach (var menu in menus)
{
Console.WriteLine($"Menu {menu.Name}: ");
PrintMenu(menu);
}
Console.WriteLine("Menus End");
}
else
{
Console.WriteLine("Menus: None");
}
if (onlineOrderingMenuOptions != null)
{
Console.WriteLine("Online Ordering Menu Options:");
PrintOnlineOrderingMenuOptions(onlineOrderingMenuOptions);
}
else
{
Console.WriteLine("Online Ordering Menu Options: None");
}
if(priceChanges != null)
{
Console.WriteLine("Price Changes:");
PrintPriceChanges(priceChanges);
}
else
{
Console.WriteLine("Price Changes: None");
}
if (promotions != null)
{
Console.WriteLine("Promotions:");
PrintPromotions(promotions);
}
else
{
Console.WriteLine("Promotions: None");
}
if (tables != null)
{
Console.WriteLine("Tables:");
PrintTables(tables);
}
else
{
Console.WriteLine("Tables: None");
}
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
}
}
Console.ReadKey();
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetSettings
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void PrintEmployees(Employee[] employees)
{
int count = 1;
//Loop through collection of Employee objects returned
foreach (var item in employees)
{
Console.WriteLine("Employee #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("AlternateId: " + item.AlternateId);
Console.WriteLine("DisplayName: " + item.DisplayName);
Console.WriteLine("FirstName: " + item.FirstName);
Console.WriteLine("LastName: " + item.LastName);
Console.WriteLine("Address1: " + item.Address1);
Console.WriteLine("Address2: " + item.Address2);
Console.WriteLine("City: " + item.City);
Console.WriteLine("State: " + item.State);
Console.WriteLine("Zip: " + item.Zip);
Console.WriteLine("CellPhone: " + item.CellPhone);
Console.WriteLine("HomePhone: " + item.HomePhone);
Console.WriteLine("EmailAddress: " + item.EmailAddress);
Console.WriteLine("MaritalStatus: " + item.MaritalStatus);
Console.WriteLine("BirthDate: " + item.BirthDate);
Console.WriteLine("HireDate: " + item.HireDate);
Console.WriteLine("TerminationDate: " + item.TerminationDate);
Console.WriteLine("Terminated: " + item.Terminated);
Console.WriteLine("Jobs:");
//Loop through collection of EmployeeJob objects returned
if (item.Jobs.Length > 0)
{
foreach (var job in item.Jobs)
{
Console.WriteLine("\tId: " + job.Id);
Console.WriteLine("\tJobId: " + job.JobId);
Console.WriteLine("\tPayRate: " + job.PayRate);
Console.WriteLine("\tSecurityLevelId: " + job.SecurityLevelId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("CanLoginWithCard: " + item.CanLoginWithCard);
Console.WriteLine("CanLoginWithFinger: " + item.CanLoginWithFinger);
Console.WriteLine("CanLoginWithPin: " + item.CanLoginWithPin);
Console.WriteLine("CardNumber: " + item.CardNumber);
Console.WriteLine("ClockedInDiscountId: " + item.ClockedInDiscountId);
Console.WriteLine("ClockedOutDiscountId: " + item.ClockedOutDiscountId);
Console.WriteLine("ExportToPayroll: " + item.ExportToPayroll);
Console.WriteLine("HealthCardExpirationDate: " + item.HealthCardExpirationDate);
Console.WriteLine("HomeLocationId: " + item.HomeLocationId);
Console.WriteLine("IdentificationVerified: " + item.IdentificationVerified);
Console.WriteLine("IsExempt: " + item.IsExempt);
Console.WriteLine("IsSalaried: " + item.IsSalaried);
Console.WriteLine("LimitLocations: " + item.LimitLocations);
Console.WriteLine("MaximumDailyDiscountAmount: " + item.MaximumDailyDiscountAmount);
Console.WriteLine("MaximumDailyDiscountCount: " + item.MaximumDailyDiscountCount);
Console.WriteLine("PayrollId: " + item.PayrollId);
Console.WriteLine("Permissions:");
//Loop through collection of EmployeePermission objects returned
if (item.Permissions.Length > 0)
{
foreach (var permission in item.Permissions)
{
Console.WriteLine("\tId: " + permission.Id);
Console.WriteLine("\tPermissionId: " + permission.PermissionId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Pin: " + item.Pin);
Console.WriteLine("TaxWitholdingAllowance: " + item.TaxWithholdingAllowance);
Console.WriteLine("ValidLocations:");
//Loop through collection of EmployeeLocation objects returned
if (item.ValidLocations.Length > 0)
{
foreach (var location in item.ValidLocations)
{
Console.WriteLine("\tId: " + location.Id);
Console.WriteLine("\tLocationId: " + location.LocationId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Notes: " + item.Notes);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Employees End");
}
static void PrintJobs(Job[] jobs)
{
int count = 1;
//Loop through collection of Job objects returned
foreach (var item in jobs)
{
Console.WriteLine("Job #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AllowAddItem: " + item.AllowAddItem);
Console.WriteLine("AlternateId: " + item.AlternateId);
Console.WriteLine("CanOpenAnyOrder: " + item.CanOpenAnyOrder);
Console.WriteLine("CannotClose: " + item.CannotClose);
Console.WriteLine("CashDrawer: " + item.CashDrawer);
Console.WriteLine("CheckoutRequiresApproval: " + item.CheckoutRequiresApproval);
Console.WriteLine("ClockInRequiresApproval: " + item.ClockInRequiresApproval);
Console.WriteLine("ClockOutRequiresApproval: " + item.ClockOutRequiresApproval);
Console.WriteLine("DeclareTips: " + item.DeclareTips);
Console.WriteLine("DefaultScreenId: " + item.DefaultScreenId);
Console.WriteLine("DisplayColor: " + item.DisplayColor);
Console.WriteLine("ExcludeOnSalesAndLaborReports: " + item.ExcludeOnSalesAndLaborReports);
Console.WriteLine("ExemptFromLaborSchedule: " + item.ExemptFromLaborSchedule);
Console.WriteLine("ExportCode: " + item.ExportCode);
Console.WriteLine("GroupItemsBySeat: " + item.GroupItemsBySeat);
Console.WriteLine("IsBartender: " + item.IsBartender);
Console.WriteLine("IsDeliveryDispatcher: " + item.IsDeliveryDispatcher);
Console.WriteLine("IsDeliveryDriver: " + item.IsDeliveryDriver);
Console.WriteLine("IsHostess: " + item.IsHostess);
Console.WriteLine("ItemLookup: " + item.ItemLookup);
Console.WriteLine("LaneId: " + item.LaneId);
Console.WriteLine("LimitShiftBreakTypes: " + item.LimitShiftBreakTypes);
Console.WriteLine("LimitedDestinationId: " + item.LimitedDestinationId);
Console.WriteLine("LocationType: " + item.LocationType);
Console.WriteLine("Menus:");
//Loop through collection of JobMenu objects returned
if (item.Menus != null)
{
foreach (var menu in item.Menus)
{
Console.WriteLine("\tDays: " + menu.Days);
Console.WriteLine("\tMenuId: " + menu.MenuId);
Console.WriteLine("\tStartTime: " + menu.StartTime);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("NoCashTransactions: " + item.NoCashTransactions);
Console.WriteLine("OrderEntry: " + item.OrderEntry);
Console.WriteLine("OrderScreenId: " + item.OrderScreenId);
Console.WriteLine("SectionId: " + item.SectionId);
Console.WriteLine("SelfBanking: " + item.SelfBanking);
Console.WriteLine("SelfVoid: " + item.SelfVoid);
Console.WriteLine("ShiftBreakTypes:");
//Loop through collection of JobShiftBreakType objects returned
if (item.ShiftBreakTypes != null)
{
foreach (var breakType in item.ShiftBreakTypes)
{
Console.WriteLine("\tShiftBreakTypeId: " + breakType.ShiftBreakTypeId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("Tabs: " + item.Tabs);
Console.WriteLine("Training: " + item.Training);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Jobs End");
}
static void PrintPermissions(Permission[] permissions)
{
int count = 1;
//Loop through collection of Permission objects returned
foreach (var item in permissions)
{
Console.WriteLine("Permission #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Permissions End");
}
static void PrintSecurityLevels(SecurityLevel[] securityLevels)
{
int count = 1;
//Loop through collection of SecurityLevel objects returned
foreach (var item in securityLevels)
{
Console.WriteLine("SecurityLevel #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("AddSurcharges: " + item.AddSurcharges);
Console.WriteLine("AllowExcessEmployeeCardUsage: " + item.AllowExcessEmployeeCardUsage);
Console.WriteLine("ApproveCheckout: " + item.ApproveCheckout);
Console.WriteLine("ApproveClockIn: " + item.ApproveClockIn);
Console.WriteLine("ApproveClockOut: " + item.ApproveClockOut);
Console.WriteLine("ApproveDiscounts: " + item.ApproveDiscounts);
Console.WriteLine("ApproveLoyaltyCards: " + item.ApproveLoyaltyCards);
Console.WriteLine("ApproveOrderRequestTime: " + item.ApproveOrderRequestTime);
Console.WriteLine("ApprovePromotions: " + item.ApprovePromotions);
Console.WriteLine("AssignCharity: " + item.AssignCharity);
Console.WriteLine("CanAdjustTipsFromAnyTill: " + item.CanAdjustTipsFromAnyTill);
Console.WriteLine("CanCloseOrderAssignedToDeliveryDrivers: " + item.CanCloseOrdersAssignedToDeliveryDrivers);
Console.WriteLine("CanOpenAnyDrawer: " + item.CanOpenAnyDrawer);
Console.WriteLine("DeleteDeposits: " + item.DeleteDeposits);
Console.WriteLine("DeleteDiscounts: " + item.DeleteDiscounts);
Console.WriteLine("DeleteDonations: " + item.DeleteDonations);
Console.WriteLine("DeletePayments: " + item.DeletePayments);
Console.WriteLine("DeletePromotions: " + item.DeletePromotions);
Console.WriteLine("DeleteSurcharges: " + item.DeleteSurcharges);
Console.WriteLine("ForceAuthorization: " + item.ForceAuthorization);
Console.WriteLine("ForceReconciliation: " + item.ForceReconciliation);
Console.WriteLine("ManageCashDrawers: " + item.ManageCashDrawers);
Console.WriteLine("OverrideDailyLoyaltyCardLimit: " + item.OverrideDailyLoyaltyCardLimit);
Console.WriteLine("OverrideMaximumTipPercent: " + item.OverrideMaximumTipPercent);
Console.WriteLine("Permissions:");
//Loop through collection of Permission objects returned
if (item.Permissions != null)
{
foreach (var permission in item.Permissions)
{
Console.WriteLine("\tId: " + permission.Id);
Console.WriteLine("\tPermissionId: " + permission.PermissionId);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("ReopenOrders: " + item.ReopenOrders);
Console.WriteLine("SplitCheck: " + item.SplitCheck);
Console.WriteLine("VoidItems: " + item.VoidItems);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Security Levels End");
}
static void PrintKitchenQueues(KitchenQueue[] kitchenQueues)
{
int count = 1;
//Loop through collection of KitchenQueue objects returned
foreach (var item in kitchenQueues)
{
Console.WriteLine("KitchenQueue #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
}
static void PrintFutureOrderingOptions(FutureOrderingOptions futureOrderingOptions)
{
Console.WriteLine("AllowFutureDateOrdering: " + futureOrderingOptions.AllowFutureDateOrdering);
Console.WriteLine("Destinations:");
//Loop through collection of OnlineOrderingDestination objects returned
if (futureOrderingOptions.Destinations != null)
{
foreach (var destination in futureOrderingOptions.Destinations)
{
Console.WriteLine("\tDestinationId: " + destination.DestinationId);
Console.WriteLine("\tInstructions: " + destination.Instructions);
Console.WriteLine("\tIsDefault: " + destination.IsDefault);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("IsEnabled: " + futureOrderingOptions.IsEnabled);
Console.WriteLine("LeadTimeThresholds:");
//Loop through collection of LeadTimeThreshold objects returned
if (futureOrderingOptions.LeadTimeThresholds != null)
{
foreach (var threshold in futureOrderingOptions.LeadTimeThresholds)
{
Console.WriteLine("\tLeadMinutes: " + threshold.LeadMinutes);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("MaximumDaysInAdvance: " + futureOrderingOptions.MaximumDaysInAdvance);
Console.WriteLine("MinimumLeadMinutes: " + futureOrderingOptions.MinimumLeadMinutes);
Console.WriteLine("MinimumPrepMinutes: " + futureOrderingOptions.MinimumPrepMinutes);
Console.WriteLine("PrepTimeThresholds:");
//Loop through collection of PrepTimeThreshold objects returned
if (futureOrderingOptions.PrepTimeThresholds != null)
{
foreach (var threshold in futureOrderingOptions.PrepTimeThresholds)
{
Console.WriteLine("\tPrepMinutes: " + threshold.PrepMinutes);
Console.WriteLine("\t------------");
}
}
Console.WriteLine("RequiredDepositPercent: " + futureOrderingOptions.RequiredDepositPercent);
Console.WriteLine("---------------------------");
Console.WriteLine("Future Ordering Options End");
}
static void PrintMenu(Menu item)
{
int count = 1;
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Categories:");
//Loop through collection of MenuCategory objects returned
if (item.Categories != null)
{
foreach (var category in item.Categories)
{
Console.WriteLine("\tCategory #" + count);
Console.WriteLine("\t-----------------------");
Console.WriteLine("\tId: " + category.Id);
Console.WriteLine("\tName: " + category.Name);
Console.WriteLine("\tDescription: " + category.Description);
//Loop through collection of MenuItem objects returned
if (category.Items != null)
{
Console.WriteLine("\tItems:");
foreach (var menuItem in category.Items)
{
Console.WriteLine("\t\tId: " + menuItem.Id);
Console.WriteLine("\t\tName: " + menuItem.Name);
Console.WriteLine("\t\tDescription: " + menuItem.Description);
Console.WriteLine("\t\tImageId: " + menuItem.ImageId);
Console.WriteLine("\t\tItemId: " + menuItem.ItemId);
if (menuItem.ItemOptions != null)
{
Console.WriteLine("\t\tItemOptions:");
//Loop through collection of MenuItemOption objects returned
foreach (var menuItemOption in menuItem.ItemOptions)
{
Console.WriteLine("\t\t\tId: " + menuItemOption.Id);
Console.WriteLine("\t\t\tDisplayName: " + menuItemOption.DisplayName);
Console.WriteLine("\t\t\tItemId: " + menuItemOption.ItemId);
Console.WriteLine("\t\t\tSortOrderId: " + menuItemOption.SortOrderId);
}
}
else
{
Console.WriteLine("\t\tItemOptions: None");
}
if (menuItem.ModifierGroups != null)
{
Console.WriteLine("\t\tModifierGroups:");
//Loop through collection of MenuItemModifierGroup objects returned
foreach (var menuItemModifierGroup in menuItem.ModifierGroups)
{
Console.WriteLine("\t\t\tId: " + menuItemModifierGroup.Id);
Console.WriteLine("\t\t\tModifierGroupId: " + menuItemModifierGroup.ModifierGroupId);
Console.WriteLine("\t\t\tSortOrderId: " + menuItemModifierGroup.SortOrderId);
}
}
else
{
Console.WriteLine("\t\tModifierGroups: None");
}
Console.WriteLine("\t\tModifierMethod: " + menuItem.ModifierMethod);
Console.WriteLine("\t\tPrice: " + menuItem.Price);
Console.WriteLine("\t\tPriceMethod: " + menuItem.PriceMethod);
Console.WriteLine("\t\tSortOrderId: " + menuItem.SortOrderId);
Console.WriteLine("\t\t------------");
}
}
else
{
Console.WriteLine("\tItems: None");
}
Console.WriteLine("\tSortOrderId: " + category.SortOrderId);
Console.WriteLine("\t-----------------------");
count++;
}
}
else
{
Console.WriteLine("Category: None");
}
Console.WriteLine("Description: " + item.Description);
Console.WriteLine("ImageId: " + item.ImageId);
Console.WriteLine("---------------------------");
Console.WriteLine($"Menu {item.Name} End");
}
static void PrintOnlineOrderingMenuOptions(OnlineOrderingMenuOptions onlineOrderingMenuOptions)
{
int count = 1;
Console.WriteLine("OnlineOrderingMenuId: " + onlineOrderingMenuOptions.OnlineOrderingMenuId);
Console.WriteLine("---------------------------");
Console.WriteLine("AlternateMenus:");
//Loop through collection of AlternateMenu objects returned
if (onlineOrderingMenuOptions.AlternateMenus != null)
{
foreach (var menu in onlineOrderingMenuOptions.AlternateMenus)
{
Console.WriteLine("\tAlternateMenu #" + count);
Console.WriteLine("\t------------");
Console.WriteLine("\tId: " + menu.Id);
Console.WriteLine("\tDays: " + menu.Days);
Console.WriteLine("\tEndTime: " + menu.EndTime);
Console.WriteLine("\tMenuId: " + menu.MenuId);
Console.WriteLine("\tStartTime: " + menu.StartTime);
Console.WriteLine("\tTimeType: " + menu.TimeType);
Console.WriteLine("\t------------");
count++;
}
}
Console.WriteLine("Online Ordering Menu Options End");
}
static void PrintPriceChanges(PriceChange[] priceChanges)
{
int count = 1;
//Loop through collection of PriceChange objects returned
foreach (var item in priceChanges)
{
Console.WriteLine("PriceChange #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Days: " + item.Days);
Console.WriteLine("EndDate: " + item.EndDate);
Console.WriteLine("EndTime: " + item.EndTime);
Console.WriteLine("EnforceDateRanges: " + item.EnforceDateRanges);
Console.WriteLine("EnforceDays: " + item.EnforceDays);
Console.WriteLine("EnforceTimeRanges: " + item.EnforceTimeRanges);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("ItemPriceChanges:");
//Loop through collection of ItemPriceChange objects returned
if (item.ItemPriceChanges != null)
{
foreach (var change in item.ItemPriceChanges)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tComponentPriceChanges:");
//Loop through collection of ComponentPriceChange objects returned
if (change.ComponentPriceChanges != null)
{
foreach (var compChange in change.ComponentPriceChanges)
{
Console.WriteLine("\t\tId: " + compChange.Id);
Console.WriteLine("\t\tComponentItemPriceChanges:");
//Loop through collection of ComponentItemPriceChange objects returned
if (compChange.ComponentItemPriceChanges != null)
{
foreach (var compItemChange in compChange.ComponentItemPriceChanges)
{
Console.WriteLine("\t\t\tId: " + compItemChange.Id);
Console.WriteLine("\t\t\tItemId: " + compItemChange.ItemId);
Console.WriteLine("\t\t\tPrice: " + compItemChange.Price);
Console.WriteLine("\t\t\t---------");
}
}
Console.WriteLine("\t\tComponentId: " + compChange.ComponentId);
Console.WriteLine("\t\tPrice: " + compChange.Price);
Console.WriteLine("\t\t------------");
}
}
Console.WriteLine("\tItemId: " + change.ItemId);
Console.WriteLine("\tName: " + change.Name);
Console.WriteLine("\tOriginalPrice: " + change.OriginalPrice);
Console.WriteLine("\tPrice: " + change.Price);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("PriceChangeDestinations:");
//Loop through collection of PriceChangeDestination objects returned
foreach (var destination in item.PriceChangeDestinations)
{
Console.WriteLine("\tId: " + destination.Id);
Console.WriteLine("\tDestinationId: " + destination.DestinationId);
Console.WriteLine("\tDestinationName: " + destination.DestinationName);
Console.WriteLine("\t-----------------------");
}
Console.WriteLine("StartDate:" + item.StartDate);
Console.WriteLine("StartTime: " + item.StartTime);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Price Changes End");
}
static void PrintPromotions(Promotion[] promotions)
{
int count = 1;
foreach (var item in promotions)
{
Console.WriteLine("Promotion #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("BarCode: " + item.BarCode);
Console.WriteLine("Code: " + item.Code);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("IsCodeRequired: " + item.IsCodeRequired);
Console.WriteLine("RequireSingleUseCode: " + item.RequireSingleUseCode);
Console.WriteLine("Type: " + item.Type);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Promotions End");
}
static void PrintTables(Table[] tables)
{
int count = 1;
//Loop through collection of Table objects returned
foreach (var item in tables)
{
Console.WriteLine("Table #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Capacity: " + item.Capacity);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("Tables End");
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 request = new GetSettingsRequest()
{
DataTypes = new DataType[]
{
DataType.Employee,
DataType.Job,
DataType.Permission,
DataType.SecurityLevel,
DataType.KitchenQueue,
DataType.FutureOrderingOptions,
DataType.Menu,
DataType.OnlineOrderingMenuOptions,
DataType.PriceChange,
DataType.Promotion,
DataType.Table
}
};
//Make GetSettings call
var response = client.GetSettingsAsync(request);
//If call is successful
if (response.Result.ResultCode == 0)
{
var employees = response.Result.Settings.Employees;
var jobs = response.Result.Settings.Jobs;
var permissions = response.Result.Settings.Permissions;
var securityLevels = response.Result.Settings.SecurityLevels;
var kitchenQueues = response.Result.Settings.KitchenQueues;
var futureOrderingOptions = response.Result.Settings.FutureOrderingOptions;
var menus = response.Result.Settings.Menus;
var onlineOrderingMenuOptions = response.Result.Settings.OnlineOrderingMenuOptions;
var priceChanges = response.Result.Settings.PriceChanges;
var promotions = response.Result.Settings.Promotions;
var tables = response.Result.Settings.Tables;
if (employees != null)
{
Console.WriteLine("Employees:");
PrintEmployees(employees);
}
else
{
Console.WriteLine("Employees: None");
}
if (jobs != null)
{
Console.WriteLine("Jobs:");
PrintJobs(jobs);
}
else
{
Console.WriteLine("Jobs: None");
}
if (permissions != null)
{
Console.WriteLine("Permissions:");
PrintPermissions(permissions);
}
else
{
Console.WriteLine("Permissions: None");
}
if (securityLevels != null)
{
Console.WriteLine("Security Levels:");
PrintSecurityLevels(securityLevels);
}
else
{
Console.WriteLine("Security Levels: None");
}
if (kitchenQueues != null)
{
Console.WriteLine("Kitchen Queues:");
PrintKitchenQueues(kitchenQueues);
}
else
{
Console.WriteLine("Kitchen Queues: None");
}
if (futureOrderingOptions != null)
{
Console.WriteLine("Future Ordering Options:");
PrintFutureOrderingOptions(futureOrderingOptions);
}
else
{
Console.WriteLine("Future Ordering Options: None");
}
if (menus != null)
{
Console.WriteLine("Menus:");
foreach (var menu in menus)
{
Console.WriteLine($"Menu {menu.Name}: ");
PrintMenu(menu);
}
Console.WriteLine("Menus End");
}
else
{
Console.WriteLine("Menus: None");
}
if (onlineOrderingMenuOptions != null)
{
Console.WriteLine("Online Ordering Menu Options:");
PrintOnlineOrderingMenuOptions(onlineOrderingMenuOptions);
}
else
{
Console.WriteLine("Online Ordering Menu Options: None");
}
if (priceChanges != null)
{
Console.WriteLine("Price Changes:");
PrintPriceChanges(priceChanges);
}
else
{
Console.WriteLine("Price Changes: None");
}
if (promotions != null)
{
Console.WriteLine("Promotions:");
PrintPromotions(promotions);
}
else
{
Console.WriteLine("Promotions: None");
}
if (tables != null)
{
Console.WriteLine("Tables:");
PrintTables(tables);
}
else
{
Console.WriteLine("Tables: None");
}
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
Console.WriteLine("Message: " + response.Result.Message);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetSettings operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<v2:GetSettings>
<v2:request>
<v2:DataTypes>
<v2:DataType>Employee</v2:DataType>
<v2:DataType>Job</v2:DataType>
<v2:DataType>Permission</v2:DataType>
<v2:DataType>SecurityLevel</v2:DataType>
<v2:DataType>KitchenQueue</v2:DataType>
<v2:DataType>FutureOrderingOptions</v2:DataType>
<v2:DataType>Menu</v2:DataType>
<v2:DataType>OnlineOrderingMenuOptions</v2:DataType>
<v2:DataType>PriceChange</v2:DataType>
<v2:DataType>Promotion</v2:DataType>
<v2:DataType>Table</v2:DataType>
</v2:DataTypes>
</v2:request>
</v2:GetSettings>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
def PrintEmployees(employees):
count = 1
#Loop through collection of Employee objects returned
for item in employees:
print('Employee # ' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('AlternateId: ' + str(item.AlternateId))
print('DisplayName: ' + item.DisplayName)
print('FirstName: ' + str(item.FirstName))
print('LastName: ' + str(item.LastName))
print('Address1: ' + str(item.Address1))
print('Address2: ' + str(item.Address2))
print('City: ' + str(item.City))
print('State: ' + str(item.State))
print('CellPhone: ' + str(item.CellPhone))
print('HomePhone: ' + str(item.HomePhone))
print('EmailAddress: ' + str(item.EmailAddress))
print('MaritalStatus: ' + str(item.MaritalStatus))
print('BirthDate: ' + str(item.BirthDate))
print('HireDate: ' + str(item.HireDate))
print('TerminationDate: ' + str(item.TerminationDate))
print('Terminated: ' + str(item.Terminated))
if(item.Jobs != None):
print('Jobs:')
#Loop through collection of EmployeeJob objects returned
for job in item.Jobs.EmployeeJob:
print('\tId: ' + str(job.Id))
print('\tJobId: ' + str(job.JobId))
print('\tPayRate: ' + str(job.PayRate))
print('\tSecurityLevelId: ' + str(job.SecurityLevelId))
print('\t------------')
else:
print('Jobs: None')
print('CanLoginWithCard: ' + str(item.CanLoginWithCard))
print('CanLoginWithFinger: ' + str(item.CanLoginWithFinger))
print('CanLoginWithPin: ' + str(item.CanLoginWithPin))
print('CardNumber: ' + str(item.CardNumber))
print('ClockedInDiscountId: ' + str(item.ClockedInDiscountId))
print('ClockedOutiscountId: ' + str(item.ClockedOutDiscountId))
print('ExportToPayroll: ' + str(item.ExportToPayroll))
print('HealthCardExpirationDate: ' + str(item.HealthCardExpirationDate))
print('HomeLocationId: ' + str(item.HomeLocationId))
print('IdentificationVerified: ' + str(item.IdentificationVerified))
print('IsExempt: ' + str(item.IsExempt))
print('IsSalaried: ' + str(item.IsSalaried))
print('LimitLocations: ' + str(item.LimitLocations))
print('MaximumDailyDiscountAmount: ' + str(item.MaximumDailyDiscountAmount))
print('MaximumDailyDiscountCount: ' + str(item.MaximumDailyDiscountCount))
print('PayrollId: ' + str(item.PayrollId))
if(item.Permissions != None):
print('Permissions:')
#Loop through collection of EmployeePermission objects returned
for permission in item.Permissions.EmployeePermission:
print('\tId: ' + str(permission.Id))
print('\tPermissionId: ' + str(permission.PermissionId))
print('\t------------')
else:
print('Permissions: None')
print('Pin: ' + str(item.Pin))
print('TaxWithholdingAllowance: ' + str(item.TaxWithholdingAllowance))
if (item.ValidLocations != None):
print('ValidLocations:')
#Loop through collection of EmployeeLocation objects returned
for location in item.ValidLocations.EmployeeLocation:
print('\tId: ' + str(location.Id))
print('\tLocationId: ' + str(location.LocationId))
print('\t------------')
else:
print('ValidLocations: None')
print('Notes: ' + str(item.Notes))
print('---------------------------')
count += 1
print('Employees End')
def PrintJobs(jobs):
count = 1
#Loop through collection of Job objects returned
for item in jobs:
print('Job# ' + str(count))
print('-----------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('AllowAddItem: ' + str(item.AllowAddItem))
print('AlternateId: ' + str(item.AlternateId))
print('CanOpenAnyOrder: ' + str(item.CanOpenAnyOrder))
print('CannotClose: ' + str(item.CannotClose))
print('CashDrawer: ' + str(item.CashDrawer))
print('CheckoutRequiresApproval: ' + str(item.CheckoutRequiresApproval))
print('ClockInRequiresApproval: ' + str(item.ClockInRequiresApproval))
print('ClockOutRequiresApproval: ' + str(item.ClockOutRequiresApproval))
print('DeclareTips: ' + str(item.DeclareTips))
print('DefaultScreenId: ' + str(item.DefaultScreenId))
print('DisplayColor: ' + str(item.DisplayColor))
print('ExcludeOnSalesAndLaborReports: ' + str(item.ExcludeOnSalesAndLaborReports))
print('ExemptFromLaborSchedule: ' + str(item.ExemptFromLaborSchedule))
print('ExportCode: ' + str(item.ExportCode))
print('GroupItemsBySeat: ' + str(item.GroupItemsBySeat))
print('IsBartender: ' + str(item.IsBartender))
print('IsDeliveryDispatcher: ' + str(item.IsDeliveryDispatcher))
print('IsHostess: ' + str(item.IsHostess))
print('ItemLookup: ' + str(item.ItemLookup))
print('LaneId: ' + str(item.LaneId))
print('LimitShiftBreakTypes: ' + str(item.LimitShiftBreakTypes))
print('LocationType: ' + str(item.LocationType))
if(item.Menus != None):
print('Menus:')
#Loop through collection of JobMenu objects returned
for menu in item.Menus.JobMenu:
print('\tDays: ' + str(menu.Days))
print('\tMenuId: ' + str(menu.MenuId))
print('\tStartTime: ' + str(menu.StartTime))
print('\t------------')
else:
print('Menus: None')
print('NoCashTransactions: ' + str(item.NoCashTransactions))
print('OrderEntry: ' + str(item.OrderEntry))
print('OrderScreenId: ' + str(item.OrderScreenId))
print('SectionId: ' + str(item.SectionId))
print('SelfBanking: ' + str(item.SelfBanking))
print('SelfVoid: ' + str(item.SelfVoid))
if(item.ShiftBreakTypes != None):
print('ShiftBreakTypes:')
#Loop through collection of JobShiftBreakType objects returned
for breakType in item.ShiftBreakTypes.JobShiftBreakType:
print('\tShiftBreakTypeId: ' + str(breakType.ShiftBreakTypeId))
print('\t------------')
else:
print('ShiftBreakTypes: None')
print('Tabs: ' + str(item.Tabs))
print('Training: ' + str(item.Training))
print('---------------------------')
count += 1
print('Jobs End')
def PrintPermissions(permissions):
count = 1
#Loop through collection of Permission objects returned
for item in permissions:
print('Permission # ' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('IsActive: ' + str(item.IsActive))
print('---------------------------')
count += 1
print('Permissions End')
def PrintSecurityLevels(securityLevels):
count = 1
#Loop through collection of SecurityLevel objects returned
for item in securityLevels:
print('SecurityLevel #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('AddSurcharges: ' + str(item.AddSurcharges))
print('AllowExcessEmployeeCardUsage: ' + str(item.AllowExcessEmployeeCardUsage))
print('ApproveCheckout: ' + str(item.ApproveCheckout))
print('ApproveClockIn: ' + str(item.ApproveClockIn))
print('ApproveClockOut: ' + str(item.ApproveClockOut))
print('ApproveDiscounts: ' + str(item.ApproveDiscounts))
print('ApproveLoyaltyCards: ' + str(item.ApproveLoyaltyCards))
print('ApproveOrderRequestTime: ' + str(item.ApproveOrderRequestTime))
print('ApprovePromotions: ' + str(item.ApprovePromotions))
print('AssignCharity: ' + str(item.AssignCharity))
print('CanAdjustTipsFromAnyTill: ' + str(item.CanAdjustTipsFromAnyTill))
print('CanCloseOrderAssignedToDeliveryDrivers: ' + str(item.CanCloseOrdersAssignedToDeliveryDrivers))
print('CanOpenAnyDrawer: ' + str(item.CanOpenAnyDrawer))
print('DeleteDeposits: ' + str(item.DeleteDeposits))
print('DeleteDiscounts: ' + str(item.DeleteDiscounts))
print('DeleteDonations: ' + str(item.DeleteDonations))
print('DeletePayments: ' + str(item.DeletePayments))
print('DeletePromotions: ' + str(item.DeletePromotions))
print('DeleteSurcharges: ' + str(item.DeleteSurcharges))
print('ForceAuthorization: ' + str(item.ForceAuthorization))
print('ForceReconciliation: ' + str(item.ForceReconciliation))
print('ManageCashDrawers: ' + str(item.ManageCashDrawers))
print('OverrideDailyLoyaltyCardLimit: ' + str(item.OverrideDailyLoyaltyCardLimit))
print('OverrideMaximumTipPercent: ' + str(item.OverrideMaximumTipPercent))
if(item.Permissions != None):
print('Permissions:')
#Loop through collection of SecurityLevelPermission objects returned
for permission in item.Permissions.SecurityLevelPermission:
print('\tId: ' + str(permission.Id))
print('\tPermissionId: ' + str(permission.PermissionId))
print('\t------------')
else:
print('Permissions: None')
print('ReopenOrders: ' + str(item.ReopenOrders))
print('SplitCheck: ' + str(item.SplitCheck))
print('VoidItems: ' + str(item.VoidItems))
print('---------------------------')
count += 1
print('Security Levels End')
def PrintKitchenQueues(kitchenQueues):
count = 1
#Loop through collection of KitchenQueue objects returned
for item in kitchenQueues:
print('KitchenQueue # ' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('---------------------------')
count += 1
print('Kitchen Queue End')
def PrintFutureOrderingOptions(item):
print('AllowFutureDateOrdering: ' + str(item.AllowFutureDateOrdering))
if(item.Destinations != None):
print('Destinations:')
#Loop through collection of OnlineOrderingDestination objects returned
for destination in item.Destinations.OnlineOrderingDestination:
print('\tDestinationId: ' + str(destination.DestinationId))
print('\tInstructions: ' + str(destination.Instructions))
print('\tIsDefault: ' + str(destination.IsDefault))
print('\t------------')
else:
print('Destinations: None')
print('IsEnabled: ' + str(item.IsEnabled))
if(item.LeadTimeThresholds != None):
print('LeadTimeThresholds:')
#Loop through collection of LeadTimeThreshold objects returned
for threshold in item.LeadTimeThresholds.LeadTimeThreshold:
print('\tLeadMinutes: ' + str(threshold.LeadMinutes))
print('\t------------')
else:
print('LeadTimeThresholds: None')
print('MaximumDaysInAdvance: ' + str(item.MaximumDaysInAdvance))
print('MinimumLeadMinutes: ' + str(item.MinimumLeadMinutes))
print('MinimumPrepMinutes: ' + str(item.MinimumPrepMinutes))
if(item.PrepTimeThresholds != None):
print('PrepTimeThresholds:')
#Loop through collection of PrepTimeThreshold objects returned
for threshold in item.PrepTimeThresholds.PrepTimeThreshold:
print('\tPrepMinutes: ' + Str(threshold.PrepMinutes))
print('\t------------')
else:
print('LeadTimeThresholds: None')
print('RequiredDepositPercent: ' + str(item.RequiredDepositPercent))
print('---------------------------')
print('Future Ordering Options End')
def PrintMenu(item):
count = 1
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
if(item.Categories != None):
print('Categories:')
#Loop through collection of MenuCategory objects returned
for category in item.Categories.MenuCategory:
print('\tCategory #' + str(count))
print('\t-----------------------')
print('\tId: ' + str(category.Id))
print('\tName: ' + str(category.Name))
print('\tDescription: ' + str(category.Description))
if(category.Items != None):
print('\tItems:')
#Loop through collection of MenuItem objects returned
for menuItem in category.Items.MenuItem:
print('\t\tId: ' + str(menuItem.Id))
print('\t\tName: ' + str(menuItem.Name))
print('\t\tDescription: ' + str(menuItem.Description))
print('\t\tImageId: ' + str(menuItem.ImageId))
print('\t\tItemId: ' + str(menuItem.ItemId))
if(menuItem.ItemOptions != None):
print('\t\tItemOptions:')
#Loop through collection of MenuItemOption objects returned
for menuItemOption in menuItem.ItemOptions.MenuItemOption:
print('\t\t\tId: ' + str(menuItemOption.Id))
print('\t\t\tDisplayName: ' + menuItemOption.DisplayName)
print('\t\t\tItemId: ' + str(menuItemOption.ItemId))
print('\t\t\tSortOrderId: ' + str(menuItemOption.SortOrderId))
else:
print('\t\tItemOptions: None')
if(menuItem.ModifierGroups != None):
print('\t\tModifierGroups:')
#Loop through collection of MenuItemModifierGroup objects returned
for menuItemModifierGroup in menuItem.ModifierGroups.MenuItemModifierGroup:
print('\t\t\tId: ' + str(menuItemModifierGroup.Id))
print('\t\t\tModifierGroupId: ' + str(menuItemModifierGroup.ModifierGroupId))
print('\t\t\tSortOrderId: ' + str(menuItemModifierGroup.SortOrderId))
else:
print('\t\tModifierGroups: None')
print('\t\tModifierMethod: ' + str(menuItem.ModifierMethod))
print('\t\tPrice: ' + str(menuItem.Price))
print('\t\tPriceMethod: ' + str(menuItem.PriceMethod))
print('\t\tSortOrderId: ' + str(menuItem.SortOrderId))
print('\t\t------------')
else:
print('Items: None')
print('\tSortOrderId: ' + str(category.SortOrderId))
print('\t-----------------------')
count += 1
else:
print('Categories: None')
print('Description: ' + str(item.Description))
print('ImageId: ' + str(item.ImageId))
print('---------------------------')
print('Menu ' + str(item.Name) + ' End')
def PrintOnlineOrderingMenuOptions(item):
count = 1
print('OnlineOrderingMenuId: ' + str(item.OnlineOrderingMenuId))
print('---------------------------')
if(item.AlternateMenus != None):
print('AlternateMenus:')
#Loop through collection of AlternateMenu objects returned
for menu in res.AlternateMenus.AlternateMenu:
print('\tAlternateMenu #' + str(count))
print('\t------------')
print('\tId: ' + str(menu.Id))
print('\tDays: ' + str(menu.Days))
print('\tEndTIme: ' + str(menu.Days))
print('\tMenuId: ' + str(menu.MenuId))
print('\tStartTime: ' + str(menu.StartTime))
print('\tTimeType: ' + str(menu.TimeType))
print('\t------------')
count += 1
else:
print('AlternateMenus: None')
print('Online Ordering Menu Options End')
def PrintPriceChanges(priceChanges):
count = 1
#Loop through collection of PriceChange objects returned
for item in priceChanges:
print('PriceChange #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('Days: ' + str(item.Days))
print('EndDate: ' + str(item.EndDate))
print('EndTime: ' + str(item.EndTime))
print('EnforceDateRanges: ' + str(item.EnforceDateRanges))
print('EnforceDays: ' + str(item.EnforceDays))
print('IsActive: ' + str(item.IsActive))
if(item.ItemPriceChanges != None):
print('ItemPriceChanges:')
#Loop through collection of ItemPriceChange objects returned
for change in item.ItemPriceChanges.ItemPriceChange:
print('\tId: ' + str(change.Id))
if(change.ComponentPriceChanges != None):
print('\tComponentPriceChanges:')
#Loop through collection of ComponentPriceChange objects returned
for compChange in change.ComponentPriceChanges.ComponentPriceChange:
print('\t\tId: ' + str(compChange.Id))
if(compChange.ComponentItemPriceChanges != None):
print('\t\tComponentItemPriceChanges:')
#Loop through collection of ComponentItemPriceChange objects returned
for compItemChange in compChange.ComponentItemPriceChanges.ComponentItemPriceChange:
print('\t\t\tId: ' + str(compItemChange.Id))
print('\t\t\tItemId: ' + str(compItemChange.ItemId))
print('\t\t\tPrice: ' + str(compItemChange.Price))
print('\t\t\t---------')
print('\t\tComponentId: ' + str(compChange.ComponentId))
print('\t\tPrice: ' + str(compChange.Price))
print('\t\t------------')
else:
print('\t\tComponentItemPriceChanges: None')
else:
print('\tComponentPriceChanges: None')
print('\tItemId: ' + str(change.ItemId))
print('\tName: ' + str(change.Name))
print('\tOriginalPrice: ' + str(change.OriginalPrice))
print('\tPrice: ' + str(change.Price))
print('\t-----------------------')
else:
print('ItemPriceChanges: None')
if(item.PriceChangeDestinations != None):
print('PriceChangeDestinations:')
#Loop through collection of PriceChangeDestination objects returned
for destination in item.PriceChangeDestinations.PriceChangeDestination:
print('\tId: ' + str(destination.Id))
print('\tDestinationId: ' + str(destination.DestinationId))
print('\tDestinationName: ' + str(destination.DestinationName))
print('\t-----------------------')
else:
print('PriceChangeDestinations: None')
print('StartDate: ' + str(item.StartDate))
print('StartTime: ' + str(item.StartTime))
print('---------------------------')
count += 1
print('End')
def PrintPromotions(promotions):
count = 1
for item in promotions:
print('Promotion #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('BarCode: ' + str(item.BarCode))
print('Code: ' + str(item.Code))
print('IsActive: ' + str(item.IsActive))
print('IsCodeRequired: ' + str(item.IsCodeRequired))
print('RequireSingleUseCode: ' + str(item.RequireSingleUseCode))
print('Type: ' + str(item.Type))
print('---------------------------')
count += 1
print('Promotions End')
def PrintTables(tables):
count = 1
for item in tables:
print('Table #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('Capacity: ' + str(item.Capacity))
print('IsActive: ' + str(item.IsActive))
print('---------------------------')
count += 1
print('Tables End')
accessToken = 'AccessToken'
locationToken = 'LocationToken'
#Include tokens in HTTP Web Request Headers
session = requests.Session()
session.headers.update({'AccessToken': access_token, 'LocationToken': location_token})
transport = Transport(session=session)
#Connect to Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/Settings2.svc'
)
factory = client.type_factory('ns1')
dataTypes = []
#Specify the data type of the settings you want to retrieve
employeeDataType = factory.DataType(value='Employee')
jobDataType = factory.DataType(value='Job')
permissionDataType = factory.DataType(value='Permission')
securityLevelDataType = factory.DataType(value='SecurityLevel')
kitchenQueueDataType = factory.DataType(value='KitchenQueue')
futureOrderingOptionsDataType = factory.DataType(value='FutureOrderingOptions')
menuDataType = factory.DataType(value='Menu')
onlineOrderingMenuOptionsDataType = factory.DataType(value='OnlineOrderingMenuOptions')
priceChangeDataType = factory.DataType(value='PriceChange')
promotionDataType = factory.DataType(value='Promotion')
tableDataType = factory.DataType(value='Table')
# Add data types into request body
dataTypes.append(employeeDataType)
dataTypes.append(jobDataType)
dataTypes.append(permissionDataType)
dataTypes.append(securityLevelDataType)
dataTypes.append(kitchenQueueDataType)
dataTypes.append(futureOrderingOptionsDataType)
dataTypes.append(menuDataType)
dataTypes.append(onlineOrderingMenuOptionsDataType)
dataTypes.append(priceChangeDataType)
dataTypes.append(promotionDataType)
dataTypes.append(tableDataType)
dataTypeArray = factory.ArrayOfDataType(DataType=dataTypes)
req = factory.GetSettingsRequest(DataTypes=dataTypeArray)
try:
#Make GetSettings call
res = service.GetSettings(req)
#If call is successful
if (res.ResultCode == 0):
if(res.Settings.Employees != None):
print('Employees:')
PrintEmployees(res.Settings.Employees.Employee)
else:
print('Employees: None')
if(res.Settings.Jobs != None):
print('Jobs:')
PrintJobs(res.Settings.Jobs.Job)
else:
print('Jobs: None')
if(res.Settings.Permissions != None):
print('Permissions:')
PrintPermissions(res.Settings.Permissions.Permission)
else:
print('Permissions: None')
if(res.Settings.SecurityLevels != None):
print('Security Levels:')
PrintSecurityLevels(res.Settings.SecurityLevels.SecurityLevel)
else:
print('Security Levels: None')
if(res.Settings.KitchenQueues != None):
print('Kitchen Queues:')
PrintKitchenQueues(res.Settings.KitchenQueues.KitchenQueue)
else:
print('Kitchen Queues: None')
if(res.Settings.FutureOrderingOptions != None):
print('Future Ordering Options:')
PrintFutureOrderingOptions(res.Settings.FutureOrderingOptions)
else:
print('Future Ordering Options: None')
if(res.Settings.Menus != None):
print('Menus:')
for menu in res.Settings.Menus.Menu:
print('Menu ' + str(menu.Name) + ' :')
PrintMenu(menu)
print('Menus End')
else:
print('Menus: None')
if(res.Settings.OnlineOrderingMenuOptions != None):
print('Online Ordering Menu Options:')
PrintOnlineOrderingMenuOptions(res.Settings.OnlineOrderingMenuOptions)
else:
print('Online Ordering Menu Options: None')
if(res.Settings.PriceChanges != None):
print('Price Changes:')
PrintPriceChanges(res.Settings.PriceChanges.PriceChange)
else:
print('Price Changes: None')
if(res.Settings.Promotions != None):
print('Promotions:')
PrintPromotions(res.Settings.Promotions.Promotion)
else:
print('Promotions: None')
if(res.Settings.Tables != None):
print('Tables:')
PrintTables(res.Settings.Tables.Table)
else:
print('Tables: None')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetTables.Settings2ServiceReference;
namespace Settings2_GetTables
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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";
//Make GetTables call
var response = client.GetTables();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Table objects returned
if (response.Collection != null)
{
foreach (var item in response.Collection)
{
Console.WriteLine("Table #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Capacity: " + item.Capacity);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
}
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
}
}
Console.ReadKey();
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetTables
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetTablesAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of Table objects returned
if (response.Result.Collection != null)
{
foreach (var item in response.Result.Collection)
{
Console.WriteLine("Table #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Capacity: " + item.Capacity);
Console.WriteLine("IsActive: " + item.IsActive);
Console.WriteLine("---------------------------");
count++;
}
Console.WriteLine("End");
}
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetTables operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetTables/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetTables call
res = service.GetTables()
#If call is successful
if(res.ResultCode == 0):
#Loop through collection of Table objects returned
for item in res.Collection.Table:
print('Table # ' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('Capacity: ' + str(item.Capacity))
print('IsActive: ' + str(item.IsActive))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_GetTaxes.Settings2ServiceReference;
namespace Settings2_GetTaxes
{
class Program
{
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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"] = @"";
headers["LocationToken"] = @"";
//Make GetTaxes call
var response = client.GetTaxes();
//If call is successful
if (response.ResultCode == 0)
{
//Loop through collection of Tax objects returned
if (response.Collection != null)
{
foreach (var item in response.Collection)
{
Console.WriteLine("Tax #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Type: " + item.Type);
Console.WriteLine("Amount: " + item.Amount);
Console.WriteLine("MinimumAmount: " + item.MinimumAmount);
Console.WriteLine("DisplayName: " + item.DisplayName);
Console.WriteLine("IsInclusive: " + item.IsInclusive);
Console.WriteLine("UseLocationRules: " + item.UseLocationRules);
Console.WriteLine("CompoundTax: " + item.CompoundTax);
Console.WriteLine("CompoundTaxPriority: " + item.CompoundTaxPriority);
Console.WriteLine("ExemptionEnabled: " + item.ExemptionEnabled);
Console.WriteLine("RoundingMethod: " + item.RoundingMethod);
Console.WriteLine("OrderTotalType: " + item.OrderTotalType);
Console.WriteLine("ExemptionOrderAmount: " + item.ExemptionOrderAmount);
Console.WriteLine("ExemptionItemGroupId: " + item.ExemptionItemGroupId);
Console.WriteLine("LimitDestinations: " + item.LimitDestinations);
Console.WriteLine("Destinations:");
//Loop through collection of TaxDestination objects returned
if (item.Destinations != null)
{
foreach (var change in item.Destinations)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tDestinationId: " + change.DestinationId);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("ModifierItems:" + item.ModifierItems);
Console.WriteLine("NonRepeatingTaxBrackets:");
//Loop through collection of TaxBracket objects returned
if (item.NonRepeatingTaxBrackets != null)
{
foreach (var change in item.NonRepeatingTaxBrackets)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tFrom: " + change.From);
Console.WriteLine("\tTaxAmount: " + change.TaxAmount);
Console.WriteLine("\tTo: " + change.To);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("RepeatingTaxBrackets:");
//Loop through collection of TaxBracket objects returned
if (item.RepeatingTaxBrackets != null)
{
foreach (var change in item.RepeatingTaxBrackets)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tFrom: " + change.From);
Console.WriteLine("\tTaxAmount: " + change.TaxAmount);
Console.WriteLine("\tTo: " + change.To);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("AppliesTo:" + item.AppliesTo);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
Console.WriteLine("Message: " + response.Message);
Console.ReadKey();
}
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_GetTaxes
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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.GetTaxesAsync();
//If call is successful
if (response.Result.ResultCode == 0)
{
//Loop through collection of Tax objects returned
if (response.Result.Collection != null)
{
foreach (var item in response.Result.Collection)
{
Console.WriteLine("Tax #" + count);
Console.WriteLine("---------------------------");
Console.WriteLine("Id: " + item.Id);
Console.WriteLine("Name: " + item.Name);
Console.WriteLine("Type: " + item.Type);
Console.WriteLine("Amount: " + item.Amount);
Console.WriteLine("MinimumAmount: " + item.MinimumAmount);
Console.WriteLine("DisplayName: " + item.DisplayName);
Console.WriteLine("IsInclusive: " + item.IsInclusive);
Console.WriteLine("UseLocationRules: " + item.UseLocationRules);
Console.WriteLine("CompoundTax: " + item.CompoundTax);
Console.WriteLine("CompoundTaxPriority: " + item.CompoundTaxPriority);
Console.WriteLine("ExemptionEnabled: " + item.ExemptionEnabled);
Console.WriteLine("RoundingMethod: " + item.RoundingMethod);
Console.WriteLine("OrderTotalType: " + item.OrderTotalType);
Console.WriteLine("ExemptionOrderAmount: " + item.ExemptionOrderAmount);
Console.WriteLine("ExemptionItemGroupId: " + item.ExemptionItemGroupId);
Console.WriteLine("LimitDestinations: " + item.LimitDestinations);
Console.WriteLine("Destinations:");
//Loop through collection of TaxDestination objects returned
if (item.Destinations != null)
{
foreach (var change in item.Destinations)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tDestinationId: " + change.DestinationId);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("ModifierItems:" + item.ModifierItems);
Console.WriteLine("NonRepeatingTaxBrackets:");
//Loop through collection of TaxBracket objects returned
if (item.NonRepeatingTaxBrackets != null)
{
foreach (var change in item.NonRepeatingTaxBrackets)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tFrom: " + change.From);
Console.WriteLine("\tTaxAmount: " + change.TaxAmount);
Console.WriteLine("\tTo: " + change.To);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("RepeatingTaxBrackets:");
//Loop through collection of TaxBracket objects returned
if (item.RepeatingTaxBrackets != null)
{
foreach (var change in item.RepeatingTaxBrackets)
{
Console.WriteLine("\tId: " + change.Id);
Console.WriteLine("\tFrom: " + change.From);
Console.WriteLine("\tTaxAmount: " + change.TaxAmount);
Console.WriteLine("\tTo: " + change.To);
Console.WriteLine("\t-----------------------");
}
}
Console.WriteLine("AppliesTo:" + item.AppliesTo);
Console.WriteLine("---------------------------");
count++;
}
}
Console.WriteLine("End");
Console.ReadKey();
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling GetTaxes operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:GetTaxes/>
</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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
count = 1
try:
#Make GetTaxes call
res = service.GetTaxes()
#If call is successful
if(res.ResultCode == 0):
if(res.Collection != None):
#Loop through collection of Tax objects returned
for item in res.Collection.Tax:
print('Tax #' + str(count))
print('---------------------------')
print('Id: ' + str(item.Id))
print('Name: ' + str(item.Name))
print('Type: ' + str(item.Type))
print('Amount: ' + str(item.Amount))
print('MinimumAmount: ' + str(item.MinimumAmount))
print('DisplayName: ' + str(item.DisplayName))
print('IsInclusive: ' + str(item.IsInclusive))
print('UseLocationRules: ' + str(item.UseLocationRules))
print('CompoundTax: ' + str(item.CompoundTax))
print('CompoundTaxPriority: ' + str(item.CompoundTaxPriority))
print('ExemptionEnabled: ' + str(item.ExemptionEnabled))
print('RoundingMethod: ' + str(item.RoundingMethod))
print('OrderTotalType: ' + str(item.OrderTotalType))
print('ExemptionOrderAmount: ' + str(item.ExemptionOrderAmount))
print('ExemptionItemGroupId: ' + str(item.ExemptionItemGroupId))
print('LimitDestinations: ' + str(item.LimitDestinations))
print('Destinations:')
if(item.TaxDestination != None):
#Loop through collection of DestinationDeliveryZone objects returned
for change in item.TaxDestination:
print('\tId: ' + str(change.Id))
print('\tDestinationId: ' + str(change.DestinationId))
print('\t-----------------------')
print('ModifierItems: ' + str(item.ModifierItems))
print('NonRepeatingTaxBrackets:')
if(item.TaxBracket != None):
#Loop through collection of DestinationDeliveryZoneCoordinates objects returned
for change in item.TaxBracket:
print('\tId: ' + str(change.Id))
print('\tFrom: ' + str(change.From))
print('\tTaxAmount: ' + str(change.TaxAmount))
print('\tTo: ' + str(change.To))
print('\t-----------------------')
print('RepeatingTaxBrackets:')
if(item.TaxBracket != None):
#Loop through collection of DestinationDeliveryZoneCoordinates objects returned
for change in item.TaxBracket:
print('\tId: ' + str(change.Id))
print('\tFrom: ' + str(change.From))
print('\tTaxAmount: ' + str(change.TaxAmount))
print('\tTo: ' + str(change.To))
print('\t-----------------------')
print('\t-----------------------')
print('AppliesTo: ' + str(item.AppliesTo))
print('---------------------------')
count += 1
print('End')
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + res.Message)
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_SaveBusinessHours.ServiceReference1;
using K = ExternalApi.SettingsServiceClient.Contracts;
using SettingsApi.V2.Data.LocationOptions;
using ExternalApi.Common.Utilities;
namespace API_Settings2_SaveBusinessHours
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
List<K.BusinessHourRange> businesshour=new List<K.BusinessHourRange>()
{
new K.BusinessHourRange(){Id = 1, OpenTime = new TimeSpan(7,00,00), CloseTime = new TimeSpan(22, 00, 00),DayOfWeek = DayOfWeek.Wednesday},
new K.BusinessHourRange(){Id = 2, OpenTime = new TimeSpan(7,00,00), CloseTime = new TimeSpan(22, 00, 00),DayOfWeek = DayOfWeek.Thursday},
new K.BusinessHourRange(){Id = 3, OpenTime = new TimeSpan(22,00,00), CloseTime = new TimeSpan(04, 00, 00),DayOfWeek = DayOfWeek.Thursday}
};
var saveBusinessHoursRequest = new SaveBusinessHoursRequest()
{
BusinessDate = new DateTime(2023, 1, 1),
ChangesetName = "SaveBusinessHours",
IsImmediatePublish = false,
BusinessHours = businesshour
};
var saveBusinessHoursResponse = clientSettingsWebService2Client.SaveBusinessHours(saveBusinessHoursRequest);
if (saveBusinessHoursResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveBusinessHoursResponse.SaveResult)
{
Console.WriteLine($"\tId: {saveResult.Id}");
Console.WriteLine($"\tOriginalBusinessHourId: {saveResult.OriginalId}");
}
}
else
{
Console.WriteLine($"Error Code: {saveBusinessHoursResponse.ResultCode}");
Console.WriteLine($"Message: {saveBusinessHoursResponse.Message}");
foreach (var saveResult in saveBusinessHoursResponse.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.Xml.Linq;
namespace Settings2_SaveBusinessHours
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
try
{
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 businesshour = new []
{
new BusinessHour(){Id = -1, OpenTime = new TimeSpan(23,00,00), CloseTime = new TimeSpan(00, 00, 00),DayOfWeek = DayOfWeek.Wednesday}
};
var saveBusinessHoursRequest = new SaveBusinessHoursRequest()
{
BusinessDate = new DateTime(2024, 3, 30),
ChangesetName = "SaveBusinessHours",
IsImmediatePublish = false,
BusinessHours = businesshour
};
var saveBusinessHoursResponse = client.SaveBusinessHoursAsync(saveBusinessHoursRequest);
Console.WriteLine("SaveBusinessHours");
Console.WriteLine("---------------------------");
if (saveBusinessHoursResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveBusinessHoursResponse.Result.SaveResult)
{
Console.WriteLine($"\tId: {saveResult.Id}");
Console.WriteLine($"\tOriginalBusinessHourId: {saveResult.OriginalId}");
}
}
else
{
Console.WriteLine($"Error Code: {saveBusinessHoursResponse.Result.ResultCode}");
Console.WriteLine($"Message: {saveBusinessHoursResponse.Result.Message}");
foreach (var saveResult in saveBusinessHoursResponse.Result.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling SaveBusinessHours operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:SaveBusinessHours>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>SaveBusinessHours</v2:ChangesetName>
<v2:IsImmediatePublish>0</v2:IsImmediatePublish>
<v2:BusinessHours>
<!--Zero or more repetitions:-->
<v2:BusinessHour>
<v2:Id>-1</v2:Id>
<v2:CloseTime>PT22H</v2:CloseTime>
<v2:DayOfWeek>Friday</v2:DayOfWeek>
<v2:OpenTime>PT7H</v2:OpenTime>
</v2:BusinessHour>
</v2:BusinessHours>
</v2:request>
</v2:SaveBusinessHours>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
from datetime import datetime
from datetime import time
#Helper function for negative index generator
num = 0
def NextNegativeId():
global num
num = num - 1
return num
#Helper function for creating a new BusinessHours
def CreateNewBusinessHours(factory):
BusinessHours = []
newBusinessHour = factory.BusinessHourRange(
Id = 1,
OpenTime = time(7,00,00),
CloseTime = time(22, 00, 00),
DayOfWeek = DayOfWeek.Wednesday
)
BusinessHours.append(newBusinessHour)
newBusinessHours = factory.ArrayOfBusinessHours(BusinessHours=BusinessHours)
return newBusinessHours
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the at least one BusinessHour in the BusinessHours parameter in request body
factory = client.type_factory('ns1')
businessdate = datetime.today()
changesetname = "SaveBusinessHours"
isimmediatepublish = 0
req = factory.SaveBusinessHoursRequest(BusinessDate=businessdate, IsImmediatePublish=isimmediatepublish, BusinessHours=CreateNewBusinessHours(factory))
try:
#Make SaveBusinessHours call
res = service.SaveBusinessHours(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + str(res.Message))
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_SaveDestinations.ServiceReference1;
namespace API_Settings2_SaveDestinations
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var saveDestinationsRequest = new SaveDestinationsRequest()
{
BusinessDate = new DateTime(2023, 02, 22),
ChangesetName = "SaveDestinations",
IsImmediatePublish = false,
Destinations = new Destination[]
{
new Destination()
{
Id = -1,
Name = "abc",
AllItems = true,
AutoCloseFutureOrders = true,
AutoPrintType = AutoPrintType.Never,
AutoPrintCreditVouchers = true,
Description = "Destination description",
Indicator = "Indicator",
IsActive = true,
IsDelivery = true,
KitchenChitHeader = "kitchen",
KitchenDescription = "kitchen description",
//KitchenVideoColor = R,
LimitByDeliveryZone = false,
LimitByPostalCode = true,
PartyLabelOverride = "party",
SeatLabelOverride = "seat",
SuppressBarcode = true,
TipAndSignatureDialogEnabled = false,
ValidDeliveryZones = new DestinationDeliveryZone[]
{
new DestinationDeliveryZone()
{
Id = -2,
Coordinates = new DestinationDeliveryZoneCoordinate []
{
new DestinationDeliveryZoneCoordinate()
{
Id = 123,
Latitude = 26.922070,
Longitude = 75.778885
}
},
Name = "DeliveryZone Description",
SurchargeId = 321
}
},
ValidPostalCodes = new []{"000000","111111" }
}
}
};
var saveDestinationsResponse = clientSettingsWebService2Client.SaveDestinations(saveDestinationsRequest);
if (saveDestinationsResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveDestinationsResponse.SaveResult)
{
Console.WriteLine($"\tNewDestinationId: {saveResult.Id}");
Console.WriteLine($"\tOriginalDestinationId: {saveResult.OriginalId}");
}
}
else
{
Console.WriteLine($"Error Code: {saveDestinationsResponse.ResultCode}");
Console.WriteLine($"Message: {saveDestinationsResponse.Message}");
foreach (var saveResult in saveDestinationsResponse.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_SaveDestinations
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 saveDestinationsRequest = new SaveDestinationsRequest()
{
BusinessDate = new DateTime(2024, 03, 30),
ChangesetName = "SaveDestinations",
IsImmediatePublish = false,
Destinations = new Destination[]
{
new Destination()
{
Id = -1,
Name = "abc",
AllItems = true,
AutoCloseFutureOrders = true,
AutoPrintType = AutoPrintType.Never,
AutoPrintCreditVouchers = true,
Description = "Destination description",
Indicator = "Indicator",
IsActive = true,
IsDelivery = true,
KitchenChitHeader = "kitchen",
KitchenDescription = "kitchen description",
LimitByDeliveryZone = false,
LimitByPostalCode = true,
PartyLabelOverride = "party",
SeatLabelOverride = "seat",
SuppressBarcode = true,
TipAndSignatureDialogEnabled = false,
ValidDeliveryZones = new DestinationDeliveryZone[]
{
new DestinationDeliveryZone()
{
Id = -2,
Coordinates = new DestinationDeliveryZoneCoordinate []
{
new DestinationDeliveryZoneCoordinate()
{
Id = 123,
Latitude = 26.922070,
Longitude = 75.778885
}
},
Name = "DeliveryZone Description",
SurchargeId = 321
}
},
ValidPostalCodes = new []{"000000","111111" }
}
}
};
var saveDestinationsResponse = client.SaveDestinationsAsync(saveDestinationsRequest);
Console.WriteLine("SaveDestinations");
Console.WriteLine("------------------");
if (saveDestinationsResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveDestinationsResponse.Result.SaveResult)
{
Console.WriteLine($"\tNewDestinationId: {saveResult.Id}");
Console.WriteLine($"\tOriginalDestinationId: {saveResult.OriginalId}");
}
}
else
{
Console.WriteLine($"Error Code: {saveDestinationsResponse.Result.ResultCode}");
Console.WriteLine($"Message: {saveDestinationsResponse.Result.Message}");
foreach (var saveResult in saveDestinationsResponse.Result.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling SaveDestinations operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:SaveDestinations>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>SaveDestinations</v2:ChangesetName>
<v2:IsImmediatePublish>1</v2:IsImmediatePublish>
<v2:Destinations>
<!--Zero or more repetitions:-->
<v2:Destination>
<v2:Id>-1</v2:Id>
<v2:Name>New Destination </v2:Name>
<v2:AllItems>false</v2:AllItems>
<v2:AutoCloseFutureOrders>true</v2:AutoCloseFutureOrders>
<v2:AutoPrintCreditVouchers>true</v2:AutoPrintCreditVouchers>
<v2:AutoPrintPrinterId>4</v2:AutoPrintPrinterId>
<v2:AutoPrintType>Immediate</v2:AutoPrintType>
<v2:DeliveryMinutes>2</v2:DeliveryMinutes>
<v2:Description>Description</v2:Description>
<v2:Indicator>Indicator</v2:Indicator>
<v2:IsActive>true</v2:IsActive>
<v2:IsDelivery>true</v2:IsDelivery>
<v2:KitchenChitHeader>KitchenChitHeader</v2:KitchenChitHeader>
<v2:KitchenDescription>KitchenDescription</v2:KitchenDescription>
<v2:KitchenVideoColor>
<v2:A>255</v2:A>
<v2:B>255</v2:B>
<v2:G>255</v2:G>
<v2:R>255</v2:R>
</v2:KitchenVideoColor>
<v2:LimitByDeliveryZone>true</v2:LimitByDeliveryZone>
<v2:LimitByPostalCode>true</v2:LimitByPostalCode>
<v2:OrderMinimum>1</v2:OrderMinimum>
<v2:PartyLabelOverride>PartyLabel</v2:PartyLabelOverride>
<v2:SeatLabelOverride>SeatLabel</v2:SeatLabelOverride>
<v2:SuppressBarcode>true</v2:SuppressBarcode>
<v2:ValidDeliveryZones>
<!--Zero or more repetitions:-->
<v2:DestinationDeliveryZone>
<v2:Id>-1</v2:Id>
<v2:Name>New Destination Delivery one</v2:Name>
<v2:Coordinates>
<!--Zero or more repetitions:-->
<v2:DestinationDeliveryZoneCoordinate>
<v2:Id>-1</v2:Id>
<v2:Latitude>32.900585597015</v2:Latitude>
<v2:Longitude>-117.060989379883</v2:Longitude>
</v2:DestinationDeliveryZoneCoordinate>
</v2:Coordinates>
<v2:SurchargeId>4003613</v2:SurchargeId>
</v2:DestinationDeliveryZone>
</v2:ValidDeliveryZones>
<v2:ValidPostalCodes>
<!--Zero or more repetitions:-->
<v2:DestinationPostalCode>
<v2:PostalCode>10001</v2:PostalCode>
</v2:DestinationPostalCode>
</v2:ValidPostalCodes>
</v2:Destination>
</v2:Destinations>
</v2:request>
</v2:SaveDestinations>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
from datetime import datetime
from decimal import Decimal
#Helper function for negative index generator
num = 0
def NextNegativeId():
global num
num = num - 1
return num
#Helper function for creating a new destinations
def CreateNewDestinations(factory):
destinations = []
newDestination = factory.Destination(
Id=NextNegativeId(),
Name='New Destination',
IsActive=True,
IsDelivery=True
)
destinations.append(newDestination)
newDestinations = factory.ArrayOfDestination(Destination=destinations)
return newDestinations
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the at least one Destination in the Destinations parameter in request body
factory = client.type_factory('ns1')
businessdate = datetime.today()
changesetname = "SaveDestinations"
isimmediatepublish=0
req = factory.SaveDestinationsRequest(BusinessDate=businessdate, IsImmediatePublish=isimmediatepublish, Destinations=CreateNewDestinations(factory))
try:
#Make SaveDestinations call
res = service.SaveDestinations(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + str(res.Message))
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using Settings2_SaveEmployees.Settings2ServiceReference;
namespace Settings2_SaveEmployees
{
class Program
{
public static Employee[] CreateEmployee()
{
int negativeId = -1;
var employee = new Employee()
{
Id = negativeId,
Address1 = "Address1",
Address2 = "Address2",
AlternateId = "1234",
BirthDate = new DateTime(1985, 01, 01),
CanLoginWithCard = true,
CanLoginWithFinger = true,
CanLoginWithPin = true,
CardNumber = "1234",
CellPhone = "555-555-5555",
City = "City",
ClockedInDiscountId = 1234,
ClockedOutDiscountId = 1234,
DisplayName = "John Doe",
EmailAddress = "johndoe@email.com",
ExportToPayroll = true,
FirstName = "John",
HealthCardExpirationDate = new DateTime(2050, 01, 01),
HireDate = new DateTime(2010, 01, 01),
HomeLocationId = Guid.Empty,
HomePhone = "555-555-5555",
IdentificationVerified = true,
IsExempt = true,
IsSalaried = true,
Jobs = new EmployeeJob[]
{
new EmployeeJob()
{
Id = negativeId--,
JobId = 1,
PayRate = 10,
SecurityLevelId = 1,
}
},
LastName = "Doe",
LimitLocations = false,
MaritalStatus = 0,
MaximumDailyDiscountAmount = 0,
MaximumDailyDiscountCount = 0,
Notes = "Notes",
PayrollId = "1234",
Permissions = new EmployeePermission[]
{
new EmployeePermission()
{
Id = negativeId--,
PermissionId = 1,
}
},
Pin = "1234",
SecondaryAuthPin = "5678",
State = "State",
TaxWithholdingAllowance = 0,
Terminated = false,
TerminationDate = null,
ValidLocations = new EmployeeLocation[]
{
new EmployeeLocation()
{
Id = negativeId--,
LocationId = new Guid(),
}
},
Zip = "Zip",
};
Employee[] employees = new Employee[]
{
employee
};
return employees;
}
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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 the at least one Employee in the Employees parameter in request body
var request = new SaveEmployeesRequest()
{
Employees = CreateEmployee(),
};
//Make SaveEmployees call
var response = client.SaveEmployees(request);
//If call is successful
if (response.ResultCode == 0)
{
Console.WriteLine("Success! Result Code: " + response.ResultCode);
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
}
if (response.SaveResults != null)
{
foreach (var saveResult in response.SaveResults)
{
Console.WriteLine("Id: " + saveResult.Id);
Console.WriteLine("OriginalId: " + saveResult.OriginalId);
if (saveResult.ValidationMessages != null)
{
foreach (var message in saveResult.ValidationMessages)
{
Console.WriteLine("Message: " + message);
}
}
}
}
if (response.ValidationMessages != null)
{
foreach (var message in response.ValidationMessages)
{
Console.WriteLine("Message: " + message);
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_SaveEmployees
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
public static Employee[] CreateEmployee()
{
var employee = new Employee()
{
Id = -1,
Address1 = "Address1",
Address2 = "Address2",
AlternateId = "1234",
BirthDate = new DateTime(1985, 01, 01),
CanLoginWithCard = true,
CanLoginWithFinger = true,
CanLoginWithPin = true,
CardNumber = "1234",
CellPhone = "555-555-5555",
City = "City",
ClockedInDiscountId = 1234,
ClockedOutDiscountId = 1234,
DisplayName = "John Doe",
EmailAddress = "johndoe@email.com",
ExportToPayroll = true,
FirstName = "John",
HealthCardExpirationDate = new DateTime(2050, 01, 01),
HireDate = new DateTime(2010, 01, 01),
HomeLocationId = Guid.Empty,
HomePhone = "555-555-5555",
IdentificationVerified = true,
IsExempt = true,
IsSalaried = true,
Jobs = new EmployeeJob[]
{
new EmployeeJob()
{
Id = -2,
JobId = 1,
PayRate = 10,
SecurityLevelId = 1,
}
},
LastName = "Doe",
LimitLocations = false,
MaritalStatus = 0,
MaximumDailyDiscountAmount = 0,
MaximumDailyDiscountCount = 0,
Notes = "Notes",
PayrollId = "1234",
Permissions = new EmployeePermission[]
{
new EmployeePermission()
{
Id = -3,
PermissionId = 1,
}
},
Pin = "1234",
SecondaryAuthPin = "5678",
State = "State",
TaxWithholdingAllowance = 0,
Terminated = false,
TerminationDate = null,
Zip = "Zip",
};
Employee[] employees = new Employee[]
{
employee
};
return employees;
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 request = new SaveEmployeesRequest()
{
Employees = CreateEmployee(),
};
//Make SaveEmployees call
var response = client.SaveEmployeesAsync(request);
//If call is successful
Console.WriteLine("SaveEmployees");
Console.WriteLine("--------------");
if (response.Result.ResultCode == 0)
{
Console.WriteLine("Success! Result Code: " + response.Result.ResultCode);
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
if (response.Result.SaveResults != null)
{
foreach (var saveResult in response.Result.SaveResults)
{
Console.WriteLine("Id: " + saveResult.Id);
Console.WriteLine("OriginalId: " + saveResult.OriginalId);
if (saveResult.ValidationMessages != null)
{
foreach (var message in saveResult.ValidationMessages)
{
Console.WriteLine("Message: " + message);
}
}
}
}
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling SaveEmployees operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:SaveEmployees>
<v2:request>
<v2:Employees>
<!--Zero or more repetitions:-->
<v2:Employee>
<v2:Id>-1</v2:Id>
<v2:Address1>Address1</v2:Address1>
<v2:Address2>Address2</v2:Address2>
<v2:AlternateId>1234</v2:AlternateId>
<v2:BirthDate>1985-01-01</v2:BirthDate>
<v2:CanLoginWithCard>true</v2:CanLoginWithCard>
<v2:CanLoginWithFinger>true</v2:CanLoginWithFinger>
<v2:CanLoginWithPin>true</v2:CanLoginWithPin>
<v2:CardNumber>1234</v2:CardNumber>
<v2:CellPhone>555-555-5555</v2:CellPhone>
<v2:City>City</v2:City>
<v2:ClockedInDiscountId>1234</v2:ClockedInDiscountId>
<v2:ClockedOutDiscountId>1234</v2:ClockedOutDiscountId>
<v2:DisplayName>John Doe</v2:DisplayName>
<v2:EmailAddress>johndoe@email.com</v2:EmailAddress>
<v2:ExportToPayroll>true</v2:ExportToPayroll>
<v2:FirstName>John</v2:FirstName>
<v2:HealthCardExpirationDate>2050-01-01</v2:HealthCardExpirationDate>
<v2:HireDate>2010-01-01</v2:HireDate>
<v2:HomeLocationId>00000000-0000-0000-0000-000000000000</v2:HomeLocationId>
<v2:HomePhone>555-555-5555</v2:HomePhone>
<v2:IdentificationVerified>true</v2:IdentificationVerified>
<v2:IsExempt>true</v2:IsExempt>
<v2:IsSalaried>true</v2:IsSalaried>
<v2:Jobs>
<!--Zero or more repetitions:-->
<v2:EmployeeJob>
<v2:Id>-2</v2:Id>
<v2:JobId>1</v2:JobId>
<v2:PayRate>10</v2:PayRate>
<v2:SecurityLevelId>1</v2:SecurityLevelId>
</v2:EmployeeJob>
</v2:Jobs>
<v2:LastName>Doe</v2:LastName>
<v2:LimitLocations>false</v2:LimitLocations>
<v2:MaritalStatus>0</v2:MaritalStatus>
<v2:MaximumDailyDiscountAmount>0</v2:MaximumDailyDiscountAmount>
<v2:MaximumDailyDiscountCount>0</v2:MaximumDailyDiscountCount>
<v2:Notes>Notes</v2:Notes>
<v2:PayrollId>1234</v2:PayrollId>
<v2:Permissions>
<!--Zero or more repetitions:-->
<v2:EmployeePermission>
<v2:Id>-3</v2:Id>
<v2:PermissionId>1</v2:PermissionId>
</v2:EmployeePermission>
</v2:Permissions>
<v2:Pin>1234</v2:Pin>
<v2:State>State</v2:State>
<v2:TaxWithholdingAllowance>0</v2:TaxWithholdingAllowance>
<v2:Terminated>false</v2:Terminated>
<v2:TerminationDate>null</v2:TerminationDate>
<v2:ValidLocations>
<!--Zero or more repetitions:-->
<v2:EmployeeLocation>
<v2:Id>-4</v2:Id>
<v2:LocationId>00000000-0000-0000-0000-000000000000</v2:LocationId>
</v2:EmployeeLocation>
</v2:ValidLocations>
<v2:Zip>Zip</v2:Zip>
</v2:Employee>
</v2:Employees>
</v2:request>
</v2:SaveEmployees>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
from datetime import datetime
from decimal import Decimal
#Helper function for negative index generator
num = 0
def NextNegativeId():
global num
num = num - 1
return num
def CreateEmployeeJob(factory):
employeeJobs = []
newEmployeeJob = factory.EmployeeJob(
Id=NextNegativeId(),
JobId=1,
PayRate=Decimal(10),
SecurityLevelId=1,
)
employeeJobs.append(newEmployeeJob)
newEmployeeJobs = factory.ArrayOfEmployeeJob(EmployeeJob=employeeJobs)
return newEmployeeJobs
def CreateEmployeeLocation(factory):
employeeLocations = []
newEmployeeLocation = factory.EmployeeLocation(
Id=NextNegativeId(),
LocationId=uuid.uuid4(),
)
employeeLocations.append(newEmployeeLocation)
newEmployeeLocations = factory.ArrayOfEmployeeLocation(EmployeeLocation=employeeLocations)
return newEmployeeLocations
def CreateEmployeePermission(factory):
employeePermissions = []
newEmployeePermission = factory.EmployeePermission(
Id=NextNegativeId(),
PermissionId=1,
)
employeePermissions.append(newEmployeePermission)
newEmployeePermissions = factory.ArrayOfEmployeePermission(EmployeePermission=employeePermissions)
return newEmployeePermissions
#Helper function for creating a new employee
def CreateNewEmployees(factory):
employees = []
newEmployee = factory.Employee(
Id=NextNegativeId(),
Address1='Address1',
Address2='Address2',
AlternateId='1234',
BirthDate=datetime(1985, 1, 1),
CanLoginWithCard=True,
CanLoginWithFinger=True,
CanLoginWithPin=True,
CardNumber='1234',
CellPhone='555-555-5555',
City='City',
ClockedInDiscountId=1234,
ClockedOutDiscountId=1234,
DisplayName='John Doe',
EmailAddress='johndoe@email.com',
ExportToPayroll=True,
FirstName='John',
HealthCardExpirationDate=datetime(2050, 1, 1),
HireDate=datetime(2010, 1, 1),
HomeLocationId=uuid.UUID('{00000000-0000-0000-0000-000000000000}'),
HomePhone='555-555-5555',
IdentificationVerified=True,
IsExempt=True,
IsSalaried=True,
Jobs=CreateEmployeeJob(factory),
LastName='Doe',
LimitLocations=False,
MaritalStatus=0,
MaximumDailyDiscountAmount=0,
MaximumDailyDiscountCount=0,
Notes='Notes',
PayrollId='1234',
Permissions=CreateEmployeePermission(factory),
Pin='1234',
SecondaryAuthPin='5678',
State='State',
TaxWithholdingAllowance=0,
Terminated=False,
TerminationDate=None,
ValidLocations=CreateEmployeeLocation(factory),
Zip='Zip',
)
employees.append(newEmployee)
newEmployees = factory.ArrayOfEmployee(Employee=employees)
return newEmployees
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the at least one Employee in the Employees parameter in request body
factory = client.type_factory('ns1')
req = factory.SaveEmployeesRequest(Employees=CreateNewEmployees(factory))
try:
#Make SaveEmployees call
res = service.SaveEmployees(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print('Error Code: ' + str(res.ResultCode))
if(res.SaveResults != None):
for saveResult in res.SaveResults.KeyedSettingsObjectSaveResult:
print('Id: ' + str(saveResult.Id))
print('OriginalId: ' + str(saveResult.OriginalId))
if(saveResult.ValidationMessages != None):
for message in saveResult.ValidationMessages.string:
print('Message: ' + str(message))
if(res.ValidationMessages != None):
for message in res.ValidationMessages.string:
print('Message: ' + str(message))
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_SaveExceptionDates.ServiceReference1;
namespace API_Settings2_SaveExceptionDates
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var saveExceptionDatesRequest = new SaveExceptionDatesRequest()
{
BusinessDate = new DateTime(2023, 1, 1),
ChangesetName = "SaveExceptionDates",
IsImmediatePublish = false,
ExceptionDates = new List<ExceptionDate>()
{
new ExceptionDate() { Id = -1, Name = "ExceptionDateName", IsOpen = true, OpenTime = new TimeSpan(0,1,0), CloseTime = new TimeSpan(0,3,0) },
}
};
var saveExceptionDatesResponse = clientSettingsWebService2Client.SaveExceptionDates(saveExceptionDatesRequest);
if (saveExceptionDatesResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveExceptionDatesResponse.SaveResult)
{
Console.WriteLine($"\Id: {saveResult.Id}");
Console.WriteLine($"\tOriginalExceptionDateId: {saveResult.OriginalId}");
}
}
else
{
Console.WriteLine($"Error Code: {saveExceptionDatesResponse.ResultCode}");
Console.WriteLine($"Message: {saveExceptionDatesResponse.Message}");
foreach (var saveResult in saveExceptionDatesResponse.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_SaveExceptionDates
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
try
{
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 saveExceptionDatesRequest = new SaveExceptionDatesRequest()
{
BusinessDate = new DateTime(2024, 3, 30),
ChangesetName = "SaveExceptionDates",
IsImmediatePublish = false,
ExceptionDates = new []
{
new ExceptionDate() { Id = -1, Name = "ExceptionDateName", IsOpen = true, OpenTime = new TimeSpan(0,1,0), CloseTime = new TimeSpan(0,3,0) },
}
};
var saveExceptionDatesResponse = client.SaveExceptionDatesAsync(saveExceptionDatesRequest);
Console.WriteLine("SaveExceptionDates");
Console.WriteLine("---------------------------");
if (saveExceptionDatesResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveExceptionDatesResponse.Result.SaveResult)
{
Console.WriteLine($"\tId: {saveResult.Id}");
Console.WriteLine($"\tOriginalExceptionDateId: {saveResult.OriginalId}");
}
}
else
{
Console.WriteLine($"Error Code: {saveExceptionDatesResponse.Result.ResultCode}");
Console.WriteLine($"Message: {saveExceptionDatesResponse.Result.Message}");
foreach (var saveResult in saveExceptionDatesResponse.Result.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling SaveExceptionDates operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:SaveExceptionDates>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>SaveExceptionDates</v2:ChangesetName>
<v2:IsImmediatePublish>0</v2:IsImmediatePublish>
<v2:ExceptionDates>
<!--Zero or more repetitions:-->
<v2:ExceptionDate>
<v2:Id>-1</v2:Id>
<v2:Name>ExceptionDateName</v2:Name>
<v2:CloseTime>PT3H</v2:CloseTime>
<v2:Date>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:Date>
<v2:IsOpen>true</v2:IsOpen>
<v2:OpenTime>PT1H</v2:OpenTime>
</v2:ExceptionDate>
</v2:ExceptionDates>
</v2:request>
</v2:SaveExceptionDates>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
from datetime import datetime
from datetime import time
#Helper function for negative index generator
num = 0
def NextNegativeId():
global num
num = num - 1
return num
#Helper function for creating a new ExceptionDates
def CreateNewExceptionDates(factory):
ExceptionDates = []
newExceptionDate = factory.ExceptionDate(
Id=NextNegativeId(),
Name='ExceptionDateName',
IsOpen = true,
OpenTime = time(0,1,0),
CloseTime = time(0,3,0),
)
ExceptionDates.append(newExceptionDate)
newExceptionDates = factory.ArrayOfExceptionDates(ExceptionDates=ExceptionDates)
return newExceptionDates
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the at least one ExceptionDate in the ExceptionDates parameter in request body
factory = client.type_factory('ns1')
businessdate = datetime.today()
changesetname = "SaveExceptionDates"
isimmediatepublish = 0
req = factory.SaveExceptionDatesRequest(BusinessDate=businessdate, IsImmediatePublish=isimmediatepublish, ExceptionDates=CreateNewExceptionDates(factory))
try:
#Make SaveExceptionDates call
res = service.SaveExceptionDates(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + str(res.Message))
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_SaveItems.ServiceReference1;
namespace API_Settings2_SaveItems
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var saveItemsRequest = new SaveItemsRequest()
{
BusinessDate = new DateTime(2023, 07, 28),
ChangesetName = "SaveItems",
IsImmediatePublish = false,
Items = new Item[]
{
new Item()
{
Id = -1,
Name = "New Item9999",
AllowAutoCombo = true,
AlternateId = "alternateid",
AlternateKitchenName = "AlternateKitchenName",
AskName = false,
AskPrice = false,
AvailableSelectDates = false,
AvailableSelectDays = false,
Cost = 25.34M,
Description = "Description",
IsActive = true,
RevenueCenterId=4001281,
BrandAllocations = new ItemBrandAllocation[]
{
new ItemBrandAllocation()
{
Id = -2,
BrandId = 1,
Weight = 5.00M
}
},
Ingredients = new ItemIngredient[]
{
new ItemIngredient()
{
Id = -3,
ItemId = 1,
Position = 5
}
},
ModifyPanels = new ItemModifyPanel[]
{
new ItemModifyPanel()
{
Id = -4,
PanelId = 1,
ScreenId = 5
}
}
}
}
};
SaveItemsRequest1 request1 = new SaveItemsRequest1();
request1.request = saveItemsRequest;
var saveItemsResponse = clientSettingsWebService2Client.SaveItems(request1);
if (saveItemsResponse.SaveItemsResult.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveItemsResponse.SaveItemsResult.SaveResult)
{
Console.WriteLine($"\tNewItemId: {saveResult.Id}");
Console.WriteLine($"\tOriginalItemId: {saveResult.OriginalId}");
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
else
{
Console.WriteLine($"Error Code:{saveItemsResponse.SaveItemsResult.ResultCode}");
Console.WriteLine($"Message: {saveItemsResponse.SaveItemsResult.Message}");
foreach (var error in saveItemsResponse.SaveItemsResult.Errors)
{
Console.WriteLine($"\tError: {error}");
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_SaveItems
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 saveItemsRequest = new SaveItemsRequest()
{
BusinessDate = new DateTime(2024, 03, 30),
ChangesetName = "SaveItems",
IsImmediatePublish = false,
Items = new Item[]
{
new Item()
{
Id = -1,
Name = "New Item9999",
AllowAutoCombo = true,
AlternateId = "alternateid",
AlternateKitchenName = "AlternateKitchenName",
AskName = false,
AskPrice = false,
AvailableSelectDates = false,
AvailableSelectDays = false,
Cost = 25.34M,
Description = "Description",
IsActive = true,
RevenueCenterId=4001281,
BrandAllocations = new ItemBrandAllocation[]
{
new ItemBrandAllocation()
{
Id = -2,
BrandId = 4003425,
Weight = 100.00M
}
},
Ingredients = new ItemIngredient[]
{
new ItemIngredient()
{
Id = -3,
ItemId = 640223867,
Position = 5
}
},
ModifyPanels = new ItemModifyPanel[]
{
new ItemModifyPanel()
{
Id = -4,
PanelId = 4005375,
ScreenId = 4006043
}
}
}
}
};
var saveItemsResponse = client.SaveItemsAsync(saveItemsRequest);
Console.WriteLine("SaveItems");
Console.WriteLine("-------------");
if (saveItemsResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveItemsResponse.Result.SaveResult)
{
Console.WriteLine($"\tNewItemId: {saveResult.Id}");
Console.WriteLine($"\tOriginalItemId: {saveResult.OriginalId}");
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
else
{
Console.WriteLine($"Error Code:{saveItemsResponse.Result.ResultCode}");
Console.WriteLine($"Message: {saveItemsResponse.Result.Message}");
foreach (var error in saveItemsResponse.Result.Errors)
{
Console.WriteLine($"\tError: {error}");
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling SaveItems operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:SaveItems>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>SaveItems</v2:ChangesetName>
<v2:IsImmediatePublish>0</v2:IsImmediatePublish>
<v2:Items>
<!--Zero or more repetitions:-->
<v2:Item>
<v2:Id>-1</v2:Id>
<v2:Name>New Item ${=System.currentTimeMillis()}</v2:Name>
<v2:AllowAutoCombo>true</v2:AllowAutoCombo>
<!--Optional:-->
<v2:AlternateId>alternateid</v2:AlternateId>
<v2:AlternateKitchenName>Test</v2:AlternateKitchenName>
<v2:AskName>true</v2:AskName>
<v2:AskPrice>true</v2:AskPrice>
<v2:AvailableEndDate>2023-01-01</v2:AvailableEndDate>
<v2:AvailableSelectDates>1</v2:AvailableSelectDates>
<v2:AvailableSelectDays>1</v2:AvailableSelectDays>
<!--Optional:-->
<v2:AvailableStartDate>0001-01-02</v2:AvailableStartDate>
<!--Optional:-->
<v2:BlinkInKitchen>0</v2:BlinkInKitchen>
<!--Optional:-->
<v2:BrandAllocations>
<!--Zero or more repetitions:-->
<v2:ItemBrandAllocation>
<!--Optional:-->
<v2:Id>-1</v2:Id>
<!--Optional:-->
<v2:BrandId>4003425</v2:BrandId>
<!--Optional:-->
<v2:Weight>100</v2:Weight>
</v2:ItemBrandAllocation>
</v2:BrandAllocations>
<v2:ClearsAllOtherModifiers>0</v2:ClearsAllOtherModifiers>
<v2:Cost>1</v2:Cost>
<v2:DaysAvailable>40</v2:DaysAvailable>
<v2:Description>test</v2:Description>
<v2:DiscountId>1</v2:DiscountId>
<v2:FreeModifierSubstitutionLimit>4</v2:FreeModifierSubstitutionLimit>
<v2:GiftCardItemType>None</v2:GiftCardItemType>
<v2:IncludedModifiers>
<!--Zero or more repetitions:-->
<v2:ItemIncludedModifier>
<!--Optional:-->
<v2:Id>-1</v2:Id>
<!--Optional:-->
<v2:AutomaticallyAdd>1</v2:AutomaticallyAdd>
<!--Optional:-->
<v2:IsIncluded>1</v2:IsIncluded>
<!--Optional:-->
<v2:ItemId>4003468</v2:ItemId>
<!--Optional:-->
<v2:ModifierGroupId>4003860</v2:ModifierGroupId>
<!--Optional:-->
<v2:Position>1</v2:Position>
<!--Optional:-->
<v2:PrintInKitchen>1</v2:PrintInKitchen>
</v2:ItemIncludedModifier>
</v2:IncludedModifiers>
<!--Optional:-->
<v2:Ingredients>
<!--Zero or more repetitions:-->
<v2:ItemIngredient>
<!--Optional:-->
<v2:Id>-1</v2:Id>
<!--Optional:-->
<v2:ItemId>4003467</v2:ItemId>
<!--Optional:-->
<v2:Position>1</v2:Position>
</v2:ItemIngredient>
</v2:Ingredients>
<!--Optional:-->
<v2:IsActive>1</v2:IsActive>
<!--Optional:-->
<v2:IsExceptionMod>1</v2:IsExceptionMod>
<!--Optional:-->
<v2:IsQuantityCounted>1</v2:IsQuantityCounted>
<!--Optional:-->
<v2:ItemGroups>
<!--Zero or more repetitions:-->
</v2:ItemGroups>
<!--Optional:-->
<v2:KitchenBackgroundColor>
<!--Optional:-->
<v2:A>1</v2:A>
<!--Optional:-->
<v2:B>255</v2:B>
<!--Optional:-->
<v2:G>255</v2:G>
<!--Optional:-->
<v2:R>255</v2:R>
</v2:KitchenBackgroundColor>
<!--Optional:-->
<v2:KitchenColor>
<!--Optional:-->
<v2:A>1</v2:A>
<!--Optional:-->
<v2:B>255</v2:B>
<!--Optional:-->
<v2:G>255</v2:G>
<!--Optional:-->
<v2:R>255</v2:R>
</v2:KitchenColor>
<!--Optional:-->
<v2:ModifierGroups>
<!--Zero or more repetitions:-->
<v2:ItemModifierGroup>
<!--Optional:-->
<v2:Id>-1</v2:Id>
<!--Optional:-->
<v2:ModifierGroupId>4003860</v2:ModifierGroupId>
<!--Optional:-->
<v2:Position>1</v2:Position>
</v2:ItemModifierGroup>
</v2:ModifierGroups>
<!--Optional:-->
<v2:ModifierRouting>FollowParentItem</v2:ModifierRouting>
<!--Optional:-->
<v2:ModifierTierId>4006466</v2:ModifierTierId>
<!--Optional:-->
<v2:ModifierWeight>1</v2:ModifierWeight>
<!--Optional:-->
<v2:ModifyPanels>
<!--Zero or more repetitions:-->
<v2:ItemModifyPanel>
<!--Optional:-->
<v2:Id>-1</v2:Id>
<!--Optional:-->
<v2:PanelId>4004666</v2:PanelId>
<!--Optional:-->
<v2:ScreenId>1</v2:ScreenId>
</v2:ItemModifyPanel>
</v2:ModifyPanels>
<!--Optional:-->
<v2:NonRevenueItem>0</v2:NonRevenueItem>
<!--Optional:-->
<v2:Plu>ABC</v2:Plu>
<!--Optional:-->
<v2:PrepaidItemType>Code</v2:PrepaidItemType>
<!--Optional:-->
<v2:Price>10</v2:Price>
<!--Optional:-->
<v2:PriceLevelId>4006514</v2:PriceLevelId>
<!--Optional:-->
<v2:PricePer>Ounce</v2:PricePer>
<!--Optional:-->
<v2:PrinterGroupId>640223785</v2:PrinterGroupId>
<!--Optional:-->
<v2:RestrictComboBreak>1</v2:RestrictComboBreak>
<!--Optional:-->
<v2:RevenueCenterId>4001281</v2:RevenueCenterId>
<!--Optional:-->
<v2:SelectionPanels>
<!--Zero or more repetitions:-->
<v2:ItemSelectionPanel>
<!--Optional:-->
<v2:Id>-1</v2:Id>
<!--Optional:-->
<v2:PanelId>4004666</v2:PanelId>
<!--Optional:-->
<v2:ScreenId>1</v2:ScreenId>
</v2:ItemSelectionPanel>
</v2:SelectionPanels>
<!--Optional:-->
<v2:Skus>
<!--Zero or more repetitions:-->
<arr:string>ABC</arr:string>
</v2:Skus>
<!--Optional:-->
<v2:SortPriority>1</v2:SortPriority>
<!--Optional:-->
<v2:TareId>4004845</v2:TareId>
<!--Optional:-->
<v2:Taxes>
<!--Zero or more repetitions:-->
<arr:int>4007408</arr:int>
</v2:Taxes>
<!--Optional:-->
<v2:Type>Normal</v2:Type>
<!--Optional:-->
<v2:UnitName>Test</v2:UnitName>
<!--Optional:-->
<v2:UnitPrecision>2</v2:UnitPrecision>
<!--Optional:-->
<v2:VideoGroupId>4004629</v2:VideoGroupId>
</v2:Item>
</v2:Items>
</v2:request>
</v2:SaveItems>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
from datetime import datetime
from decimal import Decimal
#Helper function for negative index generator
num = 0
def NextNegativeId():
global num
num = num - 1
return num
#Helper function for creating a new items
def CreateNewItems(factory):
items = []
newItem = factory.Item(
Id=NextNegativeId(),
Name='New Item99',
IsActive=True,
RevenueCenterId=1
)
items.append(newItem)
newItems = factory.ArrayOfItem(Item=items)
return newItems
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the at least one Item in the Items parameter in request body
factory = client.type_factory('ns1')
businessdate = datetime.today()
changesetname = "SaveItems"
isimmediatepublish=0
req = factory.SaveItemsRequest(BusinessDate=businessdate, IsImmediatePublish=isimmediatepublish, Items=CreateNewItems(factory))
try:
#Make SaveItems call
res = service.SaveItems(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + str(res.Message))
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_SaveModifierGroups.ServiceReference1;
namespace API_Settings2_SaveModifierGroups
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var saveModifierGroupsRequest = new SaveModifierGroupsRequest()
{
BusinessDate = new DateTime(2023, 01, 01),
ChangesetName = "SaveModifierGroups",
IsImmediatePublish = false,
ModifierGroups = new ModifierGroup[]
{
new ModifierGroup()
{
Id = -1,
Name = "Test Modifier Group",
AllowSubstitutionAcrossGroups = true,
Free = 1,
IsFlowRequired = true,
Items = new ModifierGroupItem[]
{
new ModifierGroupItem()
{
Id = -2,
ItemId = 4003478,
Price = 10,
PriceMethod = ModifierPriceMethod.ModifierPrice
}
},
Maximum = 2,
Minimum = 1
}
}
};
var saveModifierGroupsResponse = clientSettingsWebService2Client.SaveModifierGroups(saveModifierGroupsRequest);
if (saveModifierGroupsResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveModifierGroupsResponse.SaveResult)
{
Console.WriteLine($"\tNewModifierGroupId: {saveResult.Id}");
Console.WriteLine($"\tOriginalModifierGroupId: {saveResult.OriginalId}");
foreach (var error in saveResult.Errors)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
else
{
Console.WriteLine($"Error Code:{saveModifierGroupsResponse.ResultCode}");
Console.WriteLine($"Message: {saveModifierGroupsResponse.Message}");
foreach (var error in saveResult.Errors)
{
Console.WriteLine($"\tError: {error}");
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_SaveModifierGroups
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 saveModifierGroupsRequest = new SaveModifierGroupsRequest()
{
BusinessDate = new DateTime(2024, 03, 30),
ChangesetName = "SaveModifierGroups",
IsImmediatePublish = false,
ModifierGroups = new ModifierGroup[]
{
new ModifierGroup()
{
Id = -1,
Name = "New ModifierGroup",
AllowSubstitutionAcrossGroups = true,
Free = 1,
IsFlowRequired = true,
Items = new ModifierGroupItem[]
{
new ModifierGroupItem()
{
Id = -2,
ItemId = 4003478,
Price = 10,
PriceMethod = ModifierPriceMethod.ModifierPrice
}
},
Maximum = 2,
Minimum = 1
}
}
};
var saveModifierGroupsResponse = client.SaveModifierGroupsAsync(saveModifierGroupsRequest);
Console.WriteLine("SaveModifierGroups");
Console.WriteLine("-------------");
if (saveModifierGroupsResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveModifierGroupsResponse.Result.SaveResult)
{
Console.WriteLine($"\tNewModifierGroupId: {saveResult.Id}");
Console.WriteLine($"\tOriginalModifierGroupId: {saveResult.OriginalId}");
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
else
{
Console.WriteLine($"Error Code:{saveModifierGroupsResponse.Result.ResultCode}");
Console.WriteLine($"Message: {saveModifierGroupsResponse.Result.Message}");
foreach (var error in saveModifierGroupsResponse.Result.Errors)
{
Console.WriteLine($"\tError: {error}");
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling SaveModifierGroups operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:SaveModifierGroups>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>SaveModifierGroups</v2:ChangesetName>
<v2:IsImmediatePublish>0</v2:IsImmediatePublish>
<v2:ModifierGroups>
<!--Zero or more repetitions:-->
<v2:ModifierGroup>
<v2:Id>-1</v2:Id>
<v2:Name>Test ModifierGroup ${=System.currentTimeMillis()}</v2:Name>
<v2:AllowSubstitutionAcrossGroups>true</v2:AllowSubstitutionAcrossGroups>
<v2:Free>1</v2:Free>
<v2:IsFlowRequired>true</v2:IsFlowRequired>
<v2:Items>
<!--Zero or more repetitions:-->
<v2:ModifierGroupItem>
<v2:Id>-1</v2:Id>
<v2:ItemId>4003478</v2:ItemId>
<v2:Price>10</v2:Price>
<v2:PriceMethod>ModifierPrice</v2:PriceMethod>
</v2:ModifierGroupItem>
</v2:Items>
<v2:Maximum>2</v2:Maximum>
<v2:Minimum>1</v2:Minimum>
</v2:ModifierGroup>
</v2:ModifierGroups>
</v2:request>
</v2:SaveModifierGroups>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
from datetime import datetime
#Helper function for negative index generator
num = 0
def NextNegativeId():
global num
num = num - 1
return num
#Helper function for creating a new modifiergroup
def CreateNewModifierGroups(factory):
modifiergroups = []
newModifierGroup = factory.ModifierGroup(
Id=NextNegativeId(),
Name='New ModifierGroup',
AllowSubstitutionAcrossGroups = true,
Free = 1,
IsFlowRequired = true,
Maximum = 2,
Minimum = 1
)
modifiergroups.append(newModifierGroup)
newModifierGroups = factory.ArrayOfModifierGroup(ModifierGroup=modifiergroups)
return newModifierGroups
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the at least one ModifierGroup in the ModifierGroups parameter in request body
factory = client.type_factory('ns1')
businessdate = datetime.today()
changesetname = "SaveModifierGroups"
isimmediatepublish = 0
req = factory.SaveModifierGroupsRequest(BusinessDate=businessdate, IsImmediatePublish = isimmediatepublish, ModifierGroups=CreateNewModifierGroups(factory))
try:
#Make SaveModifierGroups call
res = service.SaveModifierGroups(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_SavePriceChanges.ServiceReference1;
namespace API_Settings2_SavePriceChanges
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var savePriceChangesRequest = new SavePriceChangesRequest()
{
BusinessDate = new DateTime(2023, 01, 01),
ChangesetName = "SavePriceChanges",
IsImmediatePublish = false,
PriceChanges = new PriceChange[]
{
new PriceChange()
{
Id = -1,
Days = 63,
EndDate = new DateTime(2023, 12, 21),
EndTime = new TimeSpan(11, 59, 59),
EnforceDateRanges = true,
EnforceDays = true,
EnforceTimeRanges = true,
IsActive = true,
ItemPriceChanges = new ItemPriceChange[]
{
new ItemPriceChange()
{
Id = -2,
ComponentPriceChanges = new ComponentPriceChange[]
{
new ComponentPriceChange()
{
ComponentId = 1,
ComponentItemPriceChanges = new ComponentItemPriceChange[]
{
new ComponentItemPriceChange()
{
Id = -3,
ItemId = 12345,
Price = 5.0M
}
}
}
},
ItemId = 123,
Name = "Item Description",
OriginalPrice = 2.0M,
Price = 10.0M
}
},
PriceChangeDestinations = new PriceChangeDestination[]
{
new PriceChangeDestination()
{
DestinationId = 2222,
DestinationName = "Destination Name",
Id = -4
}
}
}
}
};
var savePriceChangesResponse = clientSettingsWebService2Client.SavePriceChanges(savePriceChangesRequest);
if (savePriceChangesResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in savePriceChangesResponse.SaveResult)
{
Console.WriteLine($"\tNewPriceChangeId: {saveResult.Id}");
Console.WriteLine($"\tOriginalPriceChangeId: {saveResult.OriginalId}");
foreach (var error in saveResult.Errors)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
else
{
Console.WriteLine($"Error Code:{savePriceChangesResponse.ResultCode}");
Console.WriteLine($"Message: {savePriceChangesResponse.Message}");
foreach (var error in saveResult.Errors)
{
Console.WriteLine($"\tError: {error}");
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_SavePriceChanges
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 savePriceChangesRequest = new SavePriceChangesRequest()
{
BusinessDate = new DateTime(2024, 03, 30),
ChangesetName = "SavePriceChanges",
IsImmediatePublish = false,
PriceChanges = new PriceChange[]
{
new PriceChange()
{
Id = -1,
Name = "New Price Change",
Days = 63,
EnforceDateRanges = false,
EnforceDays = true,
EnforceTimeRanges = false,
IsActive = true,
ItemPriceChanges = new ItemPriceChange[]
{
new ItemPriceChange()
{
Id = -1,
ItemId = 4003511,
Name = "Alcohol - Margarita",
OriginalPrice = 16.0M,
Price = 14.4M
}
},
PriceChangeDestinations = new PriceChangeDestination[]
{
new PriceChangeDestination()
{
DestinationId = 4,
DestinationName = "Destination Name",
Id = -4
}
}
}
}
};
var savePriceChangesResponse = client.SavePriceChangesAsync(savePriceChangesRequest);
Console.WriteLine("SavePriceChanges");
Console.WriteLine("-------------");
if (savePriceChangesResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in savePriceChangesResponse.Result.SaveResult)
{
Console.WriteLine($"\tNewPriceChangeId: {saveResult.Id}");
Console.WriteLine($"\tOriginalPriceChangeId: {saveResult.OriginalId}");
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
else
{
Console.WriteLine($"Error Code:{savePriceChangesResponse.Result.ResultCode}");
Console.WriteLine($"Message: {savePriceChangesResponse.Result.Message}");
foreach (var error in savePriceChangesResponse.Result.Errors)
{
Console.WriteLine($"\tError: {error}");
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling SavePriceChanges operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:SavePriceChanges>
<v2:request>
<v2:BusinessDate>1995-12-21</v2:BusinessDate>
<v2:ChangesetName>SavePriceChanges</v2:ChangesetName>
<v2:IsImmediatePublish>false</v2:IsImmediatePublish>
<v2:PriceChanges>
<!--Zero or more repetitions:-->
<v2:PriceChange>
<v2:Id>-1</v2:Id>
<v2:Name>MyPriceChange</v2:Name>
<v2:Days>1</v2:Days>
<v2:EndDate>2023-01-01</v2:EndDate>
<v2:EndTime>P23T59</v2:EndTime>
<v2:EnforceDateRanges>true</v2:EnforceDateRanges>
<v2:EnforceDays>true</v2:EnforceDays>
<v2:EnforceTimeRanges>true</v2:EnforceTimeRanges>
<v2:IsActive>true</v2:IsActive>
<v2:ItemPriceChanges>
<!--Zero or more repetitions:-->
<v2:ItemPriceChange>
<v2:Id>-2</v2:Id>
<v2:ComponentPriceChanges>
<!--Zero or more repetitions:-->
<v2:ComponentPriceChange>
<v2:Id>-3</v2:Id>
<v2:ComponentId>1</v2:ComponentId>
<v2:ComponentItemPriceChanges>
<!--Zero or more repetitions:-->
<v2:ComponentItemPriceChange>
<v2:Id>-4</v2:Id>
<v2:ItemId>123</v2:ItemId>
<v2:Price>1</v2:Price>
</v2:ComponentItemPriceChange>
</v2:ComponentItemPriceChanges>
<v2:Price>20</v2:Price>
</v2:ComponentPriceChange>
</v2:ComponentPriceChanges>
<v2:ItemId>456</v2:ItemId>
<v2:Name>ItemDescription</v2:Name>
<v2:OriginalPrice>19</v2:OriginalPrice>
<v2:Price>50</v2:Price>
</v2:ItemPriceChange>
</v2:ItemPriceChanges>
<v2:PriceChangeDestinations>
<!--Zero or more repetitions:-->
<v2:PriceChangeDestination>
<v2:Id>-5</v2:Id>
<v2:DestinationId>222</v2:DestinationId>
<v2:DestinationName>DestinationName</v2:DestinationName>
</v2:PriceChangeDestination>
</v2:PriceChangeDestinations>
<v2:StartDate>2022-01-01</v2:StartDate>
<v2:StartTime>P08T00</v2:StartTime>
</v2:PriceChange>
</v2:PriceChanges>
</v2:request>
</v2:SavePriceChanges>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
from datetime import datetime
#Helper function for negative index generator
num = 0
def NextNegativeId():
global num
num = num - 1
return num
#Helper function for creating a new pricechange
def CreateNewPriceChanges(factory):
pricechanges = []
newPriceChange = factory.PriceChange(
Id=NextNegativeId(),
Name='New Price Change',
EnforceDateRanges=False,
EnforceDays=False,
EnforceTimeRanges=False,
IsActive=True,
)
pricechanges.append(newPriceChange)
newPriceChanges = factory.ArrayOfPriceChange(PriceChange=pricechanges)
return newPriceChanges
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the at least one PriceChange in the PriceChanges parameter in request body
factory = client.type_factory('ns1')
businessdate = datetime.today()
changesetname = "SavePriceChanges"
isimmediatepublish = 0
req = factory.SavePriceChangesRequest(BusinessDate=businessdate, IsImmediatePublish = isimmediatepublish, PriceChanges=CreateNewPriceChanges(factory))
try:
#Make SavePriceChanges call
res = service.SavePriceChanges(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using API_Settings2_SaveTaxes.ServiceReference1;
namespace API_Settings2_SaveTaxes
{
class Program
{
static void Main(string[] args)
{
var clientSettingsWebService2Client = new SettingsWebService2Client();
var accessToken = @"";
var locationToken = @"";
using (var scope = new OperationContextScope(clientSettingsWebService2Client.InnerChannel))
{
var headers = WebOperationContext.Current.OutgoingRequest.Headers;
headers["AccessToken"] = accessToken;
headers["LocationToken"] = locationToken;
var saveTaxesRequest = new SaveTaxesRequest()
{
BusinessDate = new DateTime(2023, 1, 1),
ChangesetName = "SaveTaxes",
IsImmediatePublish = false,
Taxes = new Tax[]
{
new Tax()
{
Id = -1,
Name = "abc",
Type = TaxType.None,
Amount = 10.0M,
MinimumAmount = 5.0M,
DisplayName = "New Tax",
IsInclusive = true,
UseLocationRules = true,
CompoundTax = true,
CompoundTaxPriority = 2,
ExemptionEnabled = false,
RoundingMethod = RoundingMethod.Nearest,
OrderTotalType = OrderTotalType.OrderTotal,
ExemptionOrderAmount = 5000.0M,
ExemptionItemGroupId = 123,
LimitDestinations = true,
Destinations = new TaxDestination[]
{
new TaxDestination()
{
Id = -2,
DestinationId = 1
}
},
ModifierItems = new []{12345},
NonRepeatingTaxBrackets = new TaxBracket[]
{
new TaxBracket()
{
Id = -2,
To = 5.0M,
From = 1.0M,
TaxAmount = 10.0M
}
},
RepeatingTaxBrackets = new TaxBracket[]
{
new TaxBracket()
{
Id = -2,
To = 5.0M,
From = 1.0M,
TaxAmount = 10.0M
}
},
AppliesTo = new []{123,456 }
}
}
};
var saveTaxesResponse = clientSettingsWebService2Client.SaveTaxes(saveTaxesRequest);
if (saveTaxesResponse.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveTaxesResponse.SaveResult)
{
Console.WriteLine($"\tNewTaxId: {saveResult.Id}");
Console.WriteLine($"\tOriginalTaxId: {saveResult.OriginalId}");
}
}
else
{
Console.WriteLine($"Error Code: {saveTaxesResponse.ResultCode}");
Console.WriteLine($"Message: {saveTaxesResponse.Message}");
foreach (var saveResult in saveTaxesResponse.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_SaveTaxes
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 saveTaxesRequest = new SaveTaxesRequest()
{
BusinessDate = new DateTime(2024, 3, 30),
ChangesetName = "SaveTaxes",
IsImmediatePublish = false,
Taxes = new Tax[]
{
new Tax()
{
Id = -1,
Name = "abc",
Type = TaxType.None,
Amount = 10.0M,
MinimumAmount = 5.0M,
DisplayName = "New Tax",
IsInclusive = true,
UseLocationRules = true,
CompoundTax = true,
CompoundTaxPriority = 2,
ExemptionEnabled = false,
RoundingMethod = RoundingMethod.Nearest,
OrderTotalType = OrderTotalType.OrderTotal,
ExemptionOrderAmount = 5000.0M,
ExemptionItemGroupId = 123,
LimitDestinations = true,
Destinations = new TaxDestination[]
{
new TaxDestination()
{
Id = -2,
DestinationId = 1
}
},
ModifierItems = new []{4007467},
NonRepeatingTaxBrackets = new TaxBracket[]
{
new TaxBracket()
{
Id = -2,
To = 5.0M,
From = 1.0M,
TaxAmount = 10.0M
}
},
RepeatingTaxBrackets = new TaxBracket[]
{
new TaxBracket()
{
Id = -2,
To = 5.0M,
From = 1.0M,
TaxAmount = 10.0M
}
},
AppliesTo = new []{ 4007426, 4007468}
}
}
};
var saveTaxesResponse = client.SaveTaxesAsync(saveTaxesRequest);
Console.WriteLine("SaveTaxes");
Console.WriteLine("-----------");
if (saveTaxesResponse.Result.ResultCode == 0)
{
Console.WriteLine("Success!");
foreach (var saveResult in saveTaxesResponse.Result.SaveResult)
{
Console.WriteLine($"\tNewTaxId: {saveResult.Id}");
Console.WriteLine($"\tOriginalTaxId: {saveResult.OriginalId}");
}
}
else
{
Console.WriteLine($"Error Code: {saveTaxesResponse.Result.ResultCode}");
Console.WriteLine($"Message: {saveTaxesResponse.Result.Message}");
foreach (var saveResult in saveTaxesResponse.Result.SaveResult)
{
foreach (var error in saveResult.ValidationMessages)
{
Console.WriteLine($"\t\tError: {error}");
}
}
}
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling SaveTaxes operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<v2:SaveTaxes>
<v2:request>
<v2:BusinessDate>${=def now = new Date();now.format("yyyy-MM-dd")}</v2:BusinessDate>
<v2:ChangesetName>SaveTaxes</v2:ChangesetName>
<v2:IsImmediatePublish>1</v2:IsImmediatePublish>
<v2:Taxes>
<!--Zero or more repetitions:-->
<v2:Tax>
<v2:Id>-1</v2:Id>
<v2:Name>Test Tax </v2:Name>
<v2:Amount>10</v2:Amount>
<v2:AppliesTo>
<!--Zero or more repetitions:-->
<arr:int>1</arr:int>
</v2:AppliesTo>
<v2:CompoundTax>0</v2:CompoundTax>
<v2:CompoundTaxPriority>0</v2:CompoundTaxPriority>
<v2:Destinations>
<!--Zero or more repetitions:-->
<v2:TaxDestination>
<v2:Id>-1</v2:Id>
<v2:DestinationId>1</v2:DestinationId>
</v2:TaxDestination>
</v2:Destinations>
<v2:DisplayName>Test Tax ${=System.currentTimeMillis()}</v2:DisplayName>
<v2:ExemptionEnabled>0</v2:ExemptionEnabled>
<v2:ExemptionItemGroupId>0</v2:ExemptionItemGroupId>
<v2:ExemptionOrderAmount>0</v2:ExemptionOrderAmount>
<v2:IsInclusive>0</v2:IsInclusive>
<v2:LimitDestinations>0</v2:LimitDestinations>
<v2:MinimumAmount>10</v2:MinimumAmount>
<v2:ModifierItems>
<!--Zero or more repetitions:-->
<arr:int>2</arr:int>
</v2:ModifierItems>
<v2:NonRepeatingTaxBrackets>
<!--Zero or more repetitions:-->
<v2:TaxBracket>
<v2:Id>-3</v2:Id>
<v2:From>.00</v2:From>
<v2:TaxAmount>0</v2:TaxAmount>
<v2:To>.001</v2:To>
</v2:TaxBracket>
</v2:NonRepeatingTaxBrackets>
<v2:OrderTotalType>None</v2:OrderTotalType>
<v2:RepeatingTaxBrackets>
<!--Zero or more repetitions:-->
<v2:TaxBracket>
<v2:Id>-4</v2:Id>
<v2:From>.00</v2:From>
<v2:TaxAmount>0</v2:TaxAmount>
<v2:To>.001</v2:To>
</v2:TaxBracket>
</v2:RepeatingTaxBrackets>
<v2:RoundingMethod>TowardZero</v2:RoundingMethod>
<v2:Type>Percentage</v2:Type>
<v2:UseLocationRules>0</v2:UseLocationRules>
</v2:Tax>
</v2:Taxes>
</v2:request>
</v2:SaveTaxes>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
from datetime import datetime
#Helper function for negative index generator
num = 0
def NextNegativeId():
global num
num = num - 1
return num
#Helper function for creating a new taxes
def CreateNewTaxes(factory):
taxes = []
newTax = factory.Tax(
Id=NextNegativeId(),
Name='New Tax',
Amount=10,
Type='Percentage',
AppliesTo=(
1
),
ModifierItems=(
2
),
)
taxes.append(newTax)
newTaxes = factory.ArrayOfTax(Tax=taxes)
return newTaxes
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the at least one Tax in the Taxes parameter in request body
factory = client.type_factory('ns1')
businessdate = datetime.today()
changesetname = "SaveTaxes"
isimmediatepublish = 0
req = factory.SaveTaxesRequest(BusinessDate=businessdate, IsImmediatePublish=isimmediatepublish, Taxes=CreateNewTaxes(factory))
try:
#Make SaveTaxes call
res = service.SaveTaxes(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print("Error Code: " + str(res.ResultCode))
print("Message: " + str(res.Message))
except Exception as e:
print(e)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.ServiceModel.Web;
using UpdateItemPriceSample.Settings2ServiceReference;
namespace UpdateItemPriceSample
{
class Program
{
public static ItemPriceUpdate[] CreateUpdates()
{
var priceUpdate = new ItemPriceUpdate()
{
ComponentId = 4004919,
ComponentItemId = 4004898,
ItemId = 4004912,
Price = 10
};
ItemPriceUpdate[] updates = new ItemPriceUpdate[]
{
priceUpdate
};
return updates;
}
static void Main(string[] args)
{
//Connect to Settings2 service client
var client = new SettingsWebService2Client();
//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 at least one ItemPriceUpdate parameter in request body
var request = new UpdateItemPriceRequest()
{
BusinessDate = DateTime.Today,
ChangesetName = "UpdateItemPrices",
ItemPriceUpdates = CreateUpdates()
};
//Make UpdateItemPrice call
var response = client.UpdateItemPrice(request);
//If call is successful
if (response.ResultCode == 0)
{
Console.WriteLine("Success! Result Code: " + response.ResultCode);
}
else
{
Console.WriteLine("Error Code: " + response.ResultCode);
foreach (var error in response.Errors)
{
Console.WriteLine("Error: " + error.ErrorCode);
}
}
Console.ReadKey();
}
}
}
}
using ServiceReference1;
using System.Diagnostics.Contracts;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace Settings2_UpdateItemPrice
{
class Program
{
public static ServiceCollection services = new ServiceCollection();
public static void AddSettingServiceClient()
{
services.AddTransient<ISettingsWebService2>((provider) =>
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress(" {YOUR_WSDL_URL_GOES_HERE}");
ChannelFactory<ISettingsWebService2> factory = new ChannelFactory<ISettingsWebService2>(binding, endpointAddress);
return factory.CreateChannel();
});
}
public static ItemPriceUpdate[] CreateUpdates()
{
var priceUpdate = new ItemPriceUpdate()
{
ComponentId = 4004919,
ComponentItemId = 4004898,
ItemId = 4004912,
Price = 10
};
ItemPriceUpdate[] updates = new ItemPriceUpdate[]
{
priceUpdate
};
return updates;
}
static void Main(string[] args)
{
AddSettingServiceClient();
ISettingsWebService2 client = services.BuildServiceProvider().GetRequiredService<ISettingsWebService2>();
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 request = new UpdateItemPriceRequest()
{
BusinessDate = DateTime.Today,
ChangesetName = "UpdateItemPrices",
ItemPriceUpdates = CreateUpdates()
};
//Make UpdateItemPrice call
var response = client.UpdateItemPriceAsync(request);
//If call is successful
Console.WriteLine("UpdateItemPrices");
Console.WriteLine("----------------");
if (response.Result.ResultCode == 0)
{
Console.WriteLine("Success! Result Code: " + response.Result.ResultCode);
}
else
{
Console.WriteLine("Error Code: " + response.Result.ResultCode);
foreach (var error in response.Result.Errors)
{
Console.WriteLine("Error: " + error.ErrorCode);
}
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error calling UpdateItemPrice operation: " + ex.Message);
}
finally
{
}
}
}
}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://www.brinksoftware.com/webservices/settings/v2">
<soapenv:Header/>
<soapenv:Body>
<v2:UpdateItemPrice>
<v2:request>
<!--Optional:-->
<v2:BusinessDate>2022-02-07T00:00:00Z</v2:BusinessDate>
<v2:ChangesetName>UpdateItemPrices</v2:ChangesetName>
<v2:ItemPriceUpdates>
<!--Zero or more repetitions:-->
<v2:ItemPriceUpdate>
<!--Optional:-->
<v2:ComponentId>4004919</v2:ComponentId>
<!--Optional:-->
<v2:ComponentItemId>4004898</v2:ComponentItemId>
<v2:ItemId>4004912</v2:ItemId>
<v2:Price>10</v2:Price>
</v2:ItemPriceUpdate>
</v2:ItemPriceUpdates>
</v2:request>
</v2:UpdateItemPrice>
</soapenv:Body>
</soapenv:Envelope>
from zeep import Client
from zeep.transports import Transport
import requests
from datetime import datetime
from decimal import Decimal
#Helper function for creating a new ItemPriceUpdates
def CreateNewItemPriceUpdates(factory):
updates = []
priceUpdate = factory.ItemPriceUpdate(
ComponentId = 4004919,
ComponentItemId = 4004898,
ItemId = 4004912,
Price = 10.00
)
updates.append(priceUpdate)
newUpdates= factory.ArrayOfItemPriceUpdate(ItemPriceUpdate=updates)
return newUpdates
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 Settings2 service client
client = Client(wsdl='{YOUR_WSDL_URL_GOES_HERE}', transport=transport)
service = client.create_service(
'{http://www.brinksoftware.com/webservices/settings/v2}BasicHttpBinding_ISettingsWebService2',
'https://{YourStack}.brinkpos.net/settings2.svc'
)
#Include the at least one Employee in the Employees parameter in request body
factory = client.type_factory('ns1')
businessdate = datetime.today()
changesetname = "UpdateItemPrices"
req = factory.UpdateItemPriceRequest(BusinessDate=businessdate, ItemPriceUpdates=CreateNewItemPriceUpdates(factory))
try:
#Make UpdateItemPrice call
res = service.UpdateItemPrice(req)
#If call is successful
if(res.ResultCode == 0):
print('Success! Result Code: ' + str(res.ResultCode))
else:
print('Error Code: ' + str(res.ResultCode))
for error in res.Errors:
print('Error: ' + error)
except Exception as e:
print(e)