How to consume an iVend API
This article provides an overview about how to consume and use an iVend API.
Overview
iVend APIs are used to help integrate iVend with third party ERP applications such as; SAP Business One, SAP R3, Microsoft Dynamics Navision, Sage 300, etc. Moreover, it is used to replicate data between iVend Enterprise (Head Office) and the iVend Stores. The iVend APIs is also used for performing transactions through the iVend Mobile POS.
Before creating any project to consume the iVend APIs, it is recommended to test the iVend API service with the SOAP UI tools (
http://www.soapui.org) for the request-response of each object method you wish to use.
The following outlines the steps required to create a sample application using the iVend APIs:
· Create a new application "iVendAPIClientTest" as shown in Figure
Figure
· Right-click on Reference and then click "Add Service Reference".
Figure
· In the Add Service Reference screen, input the address of the iVend service and then click the [Go] button. This lists down the iVend services under the 'Services' list of the Add Service Reference screen.
Figure
· Now type the name, iVend API in the Namespace field and click the [Ok] button.
Figure
· Right-click on the "iVendAPI" once the service reference is successfully added to the project.
Figure
· Then select "Configure Service Reference" from the list.
· Change the "Collection Type" to "System.Collection.Generic.List" and then click the [Ok] button.
· Below is the code written to create a couple of new country objects/records in iVend, you can use this as sample code:
iVendAPI.IntegrationServiceClient client = new iVendAPI.IntegrationServiceClient();
List<iVendAPI.Country> countryList = new List<iVendAPI.Country>();
iVendAPI.Country country = new iVendAPI.Country(); country.Id = "IND"; country.Description = "India"; countryList.Add(country);
country = new iVendAPI.Country(); country.Id = "USA"; country.Description = "United States"; countryList.Add(country);
country = new iVendAPI.Country(); country.Id = "AUS"; country.Description = "Australia"; countryList.Add(country);
client.SaveCountry(countryList);