Stores API

Overview

This document outlines the purpose, technology, use cases, methods, objects and examples for using the Stores API.

This particular document focuses on the SOAP interface to this API.

Purpose

This API provides programmatic access to the Store database, and allows for maintenance and control of the stores within the database.

The Stores API exposes 2 primary native interfaces via .NET and SOAP.

Limitations

Customised data formats, business rules and/or extended store functions are not automatically covered by the Stores API.

Note: It is not recommended to use this API if you have customisations around store integrations without first understanding how the use of this API may impact these.

Stores API Definition (.NET)

Full documentation for this interface is available in the API Reference.

Stores API Definition (SOAP)

This section documents the SOAP interface to the API.

Endpoint

The SOAP API endpoint for any site is located at https://[siteurl]/global/api/stores.asmx

This endpoint is enabled for access via SOAP as well as HTTP GET & POST. The Service Description is also available directly via this endpoint.

Note: For systems with satellite sites, the API will be available only under the primary site URL.

Security (SOAP Interface Only)

The Stores API via SOAP uses the Permissions System to allow and deny access to certain users. Use of the API requires a user to be granted the various actions (under iSAMS / API / Stores) to be able to authenticate, and perform the various actions available under this API.

Error Handling

Error handling is primarily left to the caller, however any methods that return an ApiResponse object will provide additional details that can be used to assist when debugging problems.

Where a "Call Identifier" is returned in the Message field of the ApiResponse, then a full exception trace will be available from [website url]/logs/api/{Call Identifier}.txt

Methods

The available methods are listed below, and link to the relevant details for which arguments are required, and the responses each method provides;

Objects

The available objects are listed below, and link to the relevant details for each;

Methods

Authenticate

See Authenticate.

ListCountries

Lists all unique store countries.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
Response

Returns an array of strings containing the all unique countries listed against stores.

SearchCountries

Lists all countries with a name matching the provided search term.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
searchTermStringSearch term to search for among store countries.
Response

Returns an array of strings containing the all unique countries matching the search term.

ListAreas

Lists all Areas against stores in the database.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
Response

Returns an array of Area objects containing the all unique areas among stores in the database.

ListAreasByCountry

Lists all Areas against stores in the database within a particular country.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
countryStringThe country within which to list areas.
Response

Returns an array of Area objects containing the all unique areas among stores in the database that are within a country.

ListAreasByName

Lists all Areas against stores in the database with the provided name.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
areaNameStringThe name to list matching areas for.
Response

Returns an array of Area objects with a name matching the requested name.

AddStore

Adds or updates a store in the database.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
newStoreStoreThe store to add or update.
Response

Returns a ApiResponse indicating the outcome of the call.

UpdateStore

Adds or updates a store in the database.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
updatedStoreStoreThe store to add or update.
Response

Returns a ApiResponse indicating the outcome of the call.

UpdateStores

Adds or updates multiple stores in the database.

Note: This is a delta update, and updates only the stores corresponding to the provided entries.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
updatedStoresStore[]The stores to add or update.
Response

Returns a ApiResponse indicating the outcome of the call.

DeleteStore

Deletes a store in the database.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
IDintThe ID of the store to delete.
Response

Returns a ApiResponse indicating the outcome of the call.

SearchStores

Searches for stores based on a provided search term.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
searchTermStringThe search term to search for.
Response

Returns a StoresApiResponse containing the located stores.

GetStoreByID

Retrieves a store matching the provided store ID.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
IDStringThe ID of the store to retrieve.
Response

Returns a StoresApiResponse containing the located store.

GetStoreByBranchCode

Retrieves a store with the provided branch code.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
branchCodeStringThe branch code of the store to retrieve.
Response

Returns a StoresApiResponse containing the located store.

ListStores

Lists all stores present in the database.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
Response

Returns a StoresApiResponse containing the list of stores.

ListStoresBySatellite

Lists all stores present in the database belonging to a particular satellite.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
wsIDintID of the satellite.
Response

Returns a StoresApiResponse containing the list of stores.

ListStoresByCountry

Lists all stores present in the database within a particular country.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
countryStringThe country to search for stores in.
Response

Returns a StoresApiResponse containing the list of stores.

ListStoresByArea

Lists all stores present in the database within a particular area.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
areaAreaThe area to search for stores in.
Response

Returns a StoresApiResponse containing the list of stores.

ListStoresByPostcode

Lists all stores located within a particular radius from a postcode.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
countryStringThe country to search for stores in.
postcodeStringThe postcode to search for stores near to.
radiusintThe radius (in metres) within which to find stores.
Response

Returns a StoresApiResponse containing the list of stores.

ListStoresByPosition

Lists all stores located within a particular radius from a geographical location.

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
latitudeintThe latitude of the geographical location.
longitudeintThe longitude of the geographical location.
radiusintThe radius (in metres) within which to find stores.
Response

Returns a StoresApiResponse containing the list of stores.

ExportAllXml

Triggers the bulk export of store data to a set of XML files that can be retrieved via HTTP.

Note: Files generated will be retrievable via https://[siteurl]/data/stores/[filename]
(Where [filename] is provided in the API call response.)

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
Response

Returns an StringArrayApiResponse indicating both the outcome of the call, as well as the list of the files generated.

Sample

A sample of an XML-formatted store export is available here.

ExportXml

Triggers the bulk export of store data belonging to a satellite to a set of XML files that can be retrieved via HTTP.

Note: Files generated will be retrievable via https://[siteurl]/data/stores/[filename]
(Where [filename] is provided in the API call response.)

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
websiteintThe website ID of the satellite.
Response

Returns an StringArrayApiResponse indicating both the outcome of the call, as well as the list of the files generated.

Sample

A sample of an XML-formatted store export is available here.

ExportAllCsv

Triggers the bulk export of store data to a set of Csv files that can be retrieved via HTTP.

Note: Files generated will be retrievable via https://[siteurl]/data/stores/[filename]
(Where [filename] is provided in the API call response.)

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
Response

Returns an StringArrayApiResponse indicating both the outcome of the call, as well as the list of the files generated.

Sample

A sample of an Csv-formatted store export is available here.

ExportCsv

Triggers the bulk export of store data belonging to a satellite to a set of Csv files that can be retrieved via HTTP.

Note: Files generated will be retrievable via https://[siteurl]/data/stores/[filename]
(Where [filename] is provided in the API call response.)

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
websiteintThe website ID of the satellite.
Response

Returns an StringArrayApiResponse indicating both the outcome of the call, as well as the list of the files generated.

Sample

A sample of an Csv-formatted store export is available here.

ExportAllJson

Triggers the bulk export of store data to a set of JSON-formatted files that can be retrieved via HTTP.

Note: Files generated will be retrievable via https://[siteurl]/data/stores/[filename]
(Where [filename] is provided in the API call response.)

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
Response

Returns an StringArrayApiResponse indicating both the outcome of the call, as well as the list of the files generated.

Sample

A sample of an JSON-formatted store export is available here.

ExportJson

Triggers the bulk export of store data belonging to a satellite to a set of JSON-formatted files that can be retrieved via HTTP.

Note: Files generated will be retrievable via https://[siteurl]/data/stores/[filename]
(Where [filename] is provided in the API call response.)

Parameters
Name Type Description
authenticationTokenStringAuthentication token to use for this session.
websiteintThe website ID of the satellite.
Response

Returns an StringArrayApiResponse indicating both the outcome of the call, as well as the list of the files generated.

Sample

A sample of an JSON-formatted store export is available here.

Objects

StoresApiResponse

Contains basic information about the result of a method call, along with an array of Store objects.

Fields/Properties
Field NameTypeDescriptionNotes
SuccessBooleanIndicates the success or failure of an API method call.A failure (false) response should contain a failure Code and Message in the respective fields.
CodeIntegerA response code for the method call.
MessageStringMessage or output from the method call.
DataStore[]Array of Store objects returned for this method call.

AreaApiResponse

Contains basic information about the result of a method call, along with an array of Area objects.

Fields/Properties
Field NameTypeDescriptionNotes
SuccessBooleanIndicates the success or failure of an API method call.A failure (false) response should contain a failure Code and Message in the respective fields.
CodeIntegerA response code for the method call.
MessageStringMessage or output from the method call.
DataArea[]Array of Area objects returned for this method call.

Store

Represents a Store.

Fields/Properties
Field NameTypeDescriptionNotes
IDintThe ID of the store.
ActiveboolThe store active status.
BranchCodestringThe store branch code.
NamestringThe store name.
ManagerstringThe store manager.
AreaAreaThe store area.
LatitudestringThe store latitude position.
LongitudestringThe store longitude position.
AddressstringThe store address.
AddressDetailsAddressDetailsThe store address details.
DetailsstringThe store details.
TypestringThe store type.
EmailstringThe store email.
StoreLocatorboolThe store locator status.
StoreAvailabilityboolThe store availability status.
ClickAndCollectboolThe store is avilable for click and collect status.

Area

Represents an Area.

Fields/Properties
Field NameTypeDescriptionNotes
NamestringThe area name.
CountrystringThe area country.

AddressDetails

Represents Address of the store.

Fields/Properties
Field NameTypeDescriptionNotes
CompanystringCompany.
StreetstringStreet.
SuburbstringSuburb.
CitystringCity.
StatestringState.
PostcodestringPostcode.
ContactPhonestringContact phone number.

Appendices

Response Codes

The Stores API returns standard API response codes.