Sunteți pe pagina 1din 46

iVend Retail

Extensibility
Integration
using Web API

New York |

Toronto

| Mexico | Nairobi | London | Dublin | Dubai | New Delhi | Singapore | Sydney

Agenda

Overview

iVend Business Object structure

iVend Retail Web API functions

REST Call

Using SoapUI and Visual Studio for


development

Sample code

How to Debug iVend Retail Web API

Third party integration using APIs

Sample window service based


integration project

Artifacts: Developer Guide, Samples &


KB Articles

Q&A

Overview
iVend Retail provides a rich bundle of API functions that can be leveraged to
integrate with any standard ERP without hassle of platform dependency.
The iVend Retail Web Service API is a collection of functions for updating, retrieving,
and manipulating data in the iVend Retail.
Discoverability : iVend Retail Web APIs are discoverable endpoints that allow third
party systems to interact with the underlying components directly.
Web Service Protocol : iVend Retail Web API conforms to the industry standard
WS*1.1 protocol thereby guaranteeing interoperability with all platforms that
understand the SOAP (Simple Object Access Protocol) payload.
SOAP Support : The API fully supports SOAP (Simple Object Access Protocol)
payloads in the universal XML web services protocol.

Confidential 2016 CitiXsys. All Rights Reserved.

iVend Retail Business Object Structure

iVend Retail has two types of business objects:


Master type business object (e.g. Customer, Product , etc)
Transaction type business object (e.g. TransactionDTO, PaymentDTO,
PurchaseOrderDTO etc)

Sample Master business object

Confidential 2016 CitiXsys. All Rights Reserved.

Sample Transactional Business object

Confidential 2016 CitiXsys. All Rights Reserved.

Sample Transactional Business object

Confidential 2016 CitiXsys. All Rights Reserved.

iVend Retail Web API Functions

iVend Retail Web API Functions


Few important iVend Retail Web API methods are as follow:
1. public bool Authenticate(string deviceId, string apiToken)
2. public CustomerDTO GetCustomer( string Id)
3. public PriceListDTO GetPriceList( string id, bool getMatrixList)
4. public ProductDTO GetProduct( string Id)
5. public TransactionDTO GetTransaction(long TransactionKey)
6. public PostTransactionDTO SaveTransaction(PostTransactionDTO transaction)
7. public VendorDTO SaveVendor(VendorDTO vendor)
8. public GiftCertificateDTO UpdateGiftCertificateBalance( GiftCertificateDTO giftCertificate)
9. Public IntegrationQueue[] GetQueue(int getTopNRecords, int clientTimeOut)

Note: Refer iVend Retail API guide for complete list of iVend Retail Web API
methods.
Confidential 2016 CitiXsys. All Rights Reserved.

iVend Retail Web API Functions


Refer the list of API methods(Web)
http://localhost/iVendAPI/iVendAPI.svc/WebAPI/help

Note: If API is configured on machine with Static IP address then replace localhost
with IP address of machine

Confidential 2016 CitiXsys. All Rights Reserved.

iVend Retail Web API Functions


GetQueue Function
Public IntegrationQueue[] GetQueue(int getTopNRecords, int clientTimeOut)
public IntegrationQueue[] GetQueueWithoutStatusUpdate(int getTopNRecords,
int clientTimeOut, bool UpdateStatus)
From integration point of view ,Its one of the important iVend Retail Web API method.
It gives the list of object data (any iVend business objects) which are not yet processed by iVend
replication engine.

Method Parameters:
getTopNRecords :- No of records to be fetched from queue.
clientTimeOut :- Session time out for iVend Retail Web API method.
UpdateStatus: Pass true if you want to mark as record processed otherwise pass false
Confidential 2016 CitiXsys. All Rights Reserved.

iVend Retail Web API Functions


GetQueueByWarehouse Function
public List<IntegrationQueueDTO> GetQueueByWarehouse(string WarehouseId,int
getTopNRecords, int clientTimeOut)
public List<IntegrationQueueDTO>
GetQueueByWarehouseWithoutStatusUpdate ( string WarehouseId, int
getTopNRecords, int clientTimeOut, bool UpdateStatus)
Gives the list of object data (any iVend business objects ) for a warehouse which
are not yet processed by iVend replication engine.
Method Parameters:
getTopNRecords: No of records to be fetched from queue.
clientTimeOut: Session time out for iVend Retail Web API method.
WarehouseId: Warehouse Id
UpdateStatus: Pass true if youConfidential
2016 as
CitiXsys.
All Rights
Reserved.
want to mark
record
processed
otherwise pass false

iVend Retail Web API Functions


GetQueueOfEnterprise Function
public List<IntegrationQueueDTO> GetQueueOfEnterprise( int getTopNRecords, int
clientTimeOut)
public List<IntegrationQueueDTO> GetQueueOfEnterpriseWithoutStatusUpdate (int
getTopNRecords, int clientTimeOut, bool UpdateStatus)
Gives the list of object data (any iVend business objects) as integration queue objects for enterprise
which are not yet processed by iVend replication engine.

Method Parameters:
getTopNRecords: No of records to be fetched from queue.
clientTimeOut: Session time out for iVend Retail Web API method.
UpdateStatus: Pass true if you want to marks as record processed otherwise pass false

Confidential 2016 CitiXsys. All Rights Reserved.

iVend Retail Web API Functions


UpdateRecordsStatus Function
public void UpdateRecordsStatus(long[] IntegrationKeysList)
Updates the status of the record as processed

Method Parameters:
IntegrationKeysList : pass the list of IntegrationKeys as array for which the status is required to
be updated.

Confidential 2016 CitiXsys. All Rights Reserved.

Integration Queue Object

Confidential 2016 CitiXsys. All Rights Reserved.

REST Call to iVend Retail Web API

REST Call to iVend Retail Web API


With WebHttpBinding endpoint iVend Retail Web API is exposed through HTTP
requests which can be accessible simply by URL.
Following are the steps for consuming iVend Retail Web API using Rest call
1. Define the Rest Service URL
//Declare Rest service URL
private const string URL =
@"http://localhost/iVendAPI/iVendAPI.svc/WebAPI/SaveTransaction";
2. Create aHTTPWebRequestobject with the provided REST service URL
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
Confidential 2016 CitiXsys. All Rights Reserved.

REST Call to iVend Retail Web API


3.

Provide the method type and Content Type to the request.


request.Method = "POST";
request.ContentType = "application/xml";

4.

Pass the header value(s) to the request.


In header pass username and password of API Authenticated User's
request.Headers.Add("username", "APIUser");
request.Headers.Add("password", "Pass@123");

5.

Initiate the request and get response from iVend Retail Web API
WebResponse response = request.GetResponse();

6. Check the StatusCode from WebResponse .

Confidential 2016 CitiXsys. All Rights Reserved.

Testing iVend Retail API using SoapUI

One of the easiest way to test and validate iVend Retail Web API call is using SoapUI
SoapUI is designed to simplify testing of Web services
Useful for interacting with third-party Web services
Shows XML payload of the Response
Define XML for the Request

Testing iVend Retail API using SoapUI

Confidential 2016 CitiXsys. All Rights Reserved.

Testing iVend Retail API using SoapUI

Confidential 2016 CitiXsys. All Rights Reserved.

Testing iVend Retail API using SoapUI

Confidential 2016 CitiXsys. All Rights Reserved.

Testing iVend Retail API using SoapUI

Confidential 2016 CitiXsys. All Rights Reserved.

Testing iVend Retail API using SoapUI

Confidential 2016 CitiXsys. All Rights Reserved.

Calling Web service using API Reference

Calling Web service using API Reference

Confidential 2016 CitiXsys. All Rights Reserved.

Calling Web service using API Reference

Confidential 2016 CitiXsys. All Rights Reserved.

Calling Web service using API Reference


Provide the iVend Web API address and click Go. This would list down iVendAPI
under Services section. Rename theNamespace to iVendAPI and thenclick
on "Ok" button.

Confidential 2016 CitiXsys. All Rights Reserved.

Calling Web service using API Reference

Confidential 2016 CitiXsys. All Rights Reserved.

Samples

Sample - Calling iVend Retail Web API using


RestCall

Confidential 2016 CitiXsys. All Rights Reserved.

Sample - Calling iVend Retail Web API using


RestCall

Confidential 2016 CitiXsys. All Rights Reserved.

Sample - Create UserDefinedTable using


iVend Retail Web API service reference

Confidential 2016 CitiXsys. All Rights Reserved.

How to Debug iVend Retail Web API

iVend Retail Web API provides a mechanism to test and debug the code using fault exception concept of API.

How to Debug iVend Retail Web API

Try/Catch in code for checking Result


message from API

Confidential 2016 CitiXsys. All Rights Reserved.

How to Debug iVend Retail Web API


Check the message and fault code in response

Confidential 2016 CitiXsys. All Rights Reserved.

How to Debug iVend Retail Web API


Debug/Test iVend Retail Web API response using SoapUI

Confidential 2016 CitiXsys. All Rights Reserved.

d party integration using iVend Retail Web APIs

Third party integration using iVend Retail


Web APIs

Confidential 2016 CitiXsys. All Rights Reserved.

Third party integration using iVend Retail


Web
APIs
Any third party application can integrate with iVend Retail using iVend Retail API
exposed functions.
Useful iVend Retail Web API functions for integration point of view:
1. GetQueue provides the list of object data (any iVend business objects) which are
not yet processed by
iVend replication engine. Any third party application
can call this method for getting list of new or updated object data.
2. GetQueryResult extends the ability to execute any SQL SELECT query on iVend
Retail Database.

Confidential 2016 CitiXsys. All Rights Reserved.

Third party integration using iVend Retail


Web APIs

Confidential 2016 CitiXsys. All Rights Reserved.

Sample window service based integration


project

Confidential 2016 CitiXsys. All Rights Reserved.

Artifacts

Artifacts
Citixsys Knowledge Portal
CKP -> iVend Extensibility Landing page
iVend Web API developer guide:
CKP -> Document Store -> Product Documentation -> iVend Retail -> iVend Retail
6.5 ->iVend Retail 6.5
Web API Help
Sample Projects:
CKP -> Extensibility -> Add On Development -> Sample project for 6.5
Web based guide:
iVend Web API developer guide(Web)
Confidential 2016 CitiXsys. All Rights Reserved.

Question & Answers

Thank You

S-ar putea să vă placă și