Webshop API Interface Specification
Version 0.1
Table of Contents
- Introduction
- Overview
- Audience
- Document Overview
- Getting Started
- How to Send Request
- Basic Concepts
- Message Transport
- Authentication
- Message Structure
- XML Message
- WS_AuthenticationRQ/RS
- Support Operations
- Business Rules
- WS_AuthenticationRQ
- Sample Message Request
- WS_AuthenticationRS
- Simple Message Response Success
- WS_CategroySetRQ/RS
- Support Operations
- Business Rules
- WS_CategroySetRQ
- Sample Message Request
- WS_CategroySetRS
- Simple Message Response Success
- WS_UpdateCategoryRQ/RS
- Support Operations
- Business Rules
- WS_UpdateCategoryRQ
- Sample Message Request
- WS_UpdateCategoryRS
- Simple Message Response Success
- WS_UpdateProductRQ/RS
- Support Operations
- Business Rules
- WS_UpdateProductRQ
- Sample Message Request
- WS_UpdateProductRS
- Simple Message Response Success
- WS API ‘Status’ Values List
1 Introduction
1.1 Overview
The use of this interface for communication with the exPub Service Providers using OTA compliant XML messaging over an HTTP protocol. The interface supports the exchange of:- Authentication
- Get Category Set
- Add/Update Category
- Add/Update Product
The purpose of this interface is to facilitate dynamic data synchronization such as category name, product name, product variant name, description
1.2 Audience
This document is intended for technical staff at the webshop portal development company. The reader should be familiar with the underlying technologies used, including XML and HTTPS.1.3 Document Overview
This document is divided into chapters covering background information, business rules, use cases, error and warning messages. The chapter detailing each of the messages describes some or all of the following:- An overview of the message format
- The XML and business rules that apply to the message
- A tabular listing of the elements and attributes in the message
- Sample XML messages
1.4 Getting started
Our XML Web Service cannot be accessed by unauthorized requests. You will first need to contact us to get the Application Token before you can make requests. Your usage of our XML Web Service will be monitored by our staff: we reserve the right to close an XML account if its number of requests is huge.1.5 How to send requests
The addresses to which to send requests are the following:https://api.expubwebsites.net/WebshopApi/Authentication
https://api.expubwebsites.net/WebshopApi/GetCategorySet
https://api.expubwebsites.net/WebshopApi/UpdateCategory
https://api.expubwebsites.net/WebshopApi/UpdateProduct
You must send your XML with POST request. This can be achieved through various programming methods, which will vary according to the programming language you're using. For example, in PHP the simplest way to send this kind of requests is using the CURL extension.
2 Basic Concepts
2.1 Message Transport
All messages are transported via HTTP POST.2.2 Authentication
The WebShopAPI provides the credentials necessary for consuming the WebServices being offered to the receiving system. Security credentials consist of: Token – A login for authentication that is provided by the WebShopAPI at the time of the order e.g. The requesting system should have the ability to connect to different URLs. Connections to the different servers may use the same account information2.3 Message Structure
Version - This decimal value identifies the specific version of the WebShop API XML schema associated with an XML instance document. Our system does not block requests that are earlier or later than the version we are supporting, and will try to reply to them if possible.Token - The value of this attribute is assigned by a requesting system and serves as a reference for messages that may follow an initial request. When a request message includes an echo token, the corresponding response message must include an echo token with an identical value. This makes it possible for two or more messages to be correlated together as part of a single transaction.
Message - This element indicates that the recipient of a message identified one or more warnings. A warning is a business-level error. The XML content might be syntactically valid, but the receiving application cannot fulfill the request.
Status - Message Code.
Request - This date and time value specifies the creation date and time of a message. This value is UTC format specified by ISO 8601—YYYY-MM-DDThh:mm:ssZ—with time values using the 24-hour clock (e.g., 20 May 2014, 1:59:38 p.m. UTC becomes 2013-05- 20T13:59:38).
3 XML Messages
3.1 WS_AuthenticationRQ/RS
This message identifies the initial request for checking authentication.3.1.1 Support Operations
Portal requests information about the authentication.3.1.2 Business Rules
This message is only sent from the portal to the Service Providers. Only requests received via POST method will be accepted.3.1.3 WS_AuthenticationRQ
This message identifies the initial request for order data. Using this message the requester may retrieve status authentication.
Parameter | Element(E) Attribute(A) | Required(R) Optional(O) | Notes | Data Type/ Possible values |
WS_AuthenticationRQ | E | R | Root Element | |
WS_AuthenticationRQ/Token | A | R | A reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message include an echo token with the identical value | String Length:1 -128 |
3.1.4 Sample Message Request
Post on url https://api.expup.net/WebshopApi/Authentication<WS_AuthenticationRQ Token=”99999999999999999999999999999999999999999999999”> </WS_AuthenticationRQ>
3.1.5 WS_AuthenticationRS
The WS_AuthenticationRS is the message used to indicate the status of processing the WS_AuthenticationRQ message. This message returns ''json'' that meets the requested criteria and/or Warnings, or Errors if the request did not succeed.
Element(E) Attribute(A) | Name | Notes | Data Type/ Possible values |
E | WS_AuthenticationRS | Root Element | |
A | WS_AuthenticationRS/API | API Name | String Length:1 -20 |
A | WS_AuthenticationRS/Version | The message version indicated by a decimal value. | Decimal |
A | WS_AuthenticationRS/Token | A reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message includes an echo token with the identical value | String Length:1 -128 |
A | WS_AuthenticationRS/Status | Identifies the status of the call url request. | Integer |
A | WS_AuthenticationRS/Message | Message call url request of status | String Length: 1 - 500 |
A | WS_AuthenticationRS/Request | Date Request | TimeStamp |
3.1.6 Simple Message Response Success
<WS_AuthenticationRS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" API="WSP_Authentication" Version="0.1" Token="340FDFAE958CD5335A8CD22B390A6F76497ED23BFBAC877467" Status="2" Message="Success Authentication" Request="2015-07-02T09:58:41.8418681+07:00"/>
3.2 WS_CategorySetRQ/RS
This message identifies the initial request to get information category set.3.2.1 Support Operations
Portal requests information about the authentication.3.2.2 Business Rules
This message is only sent from the portal to the Service Providers. Only requests received via POST method will be accepted.3.2.3 WS_CategorySetRQ
This message identifies the initial request for category set data. Using this message the requester may retrieve information category set
Parameter | Element(E) Attribute(A) | Required(R) Optional(O) | Notes | Data Type/ Possible values |
WS_CategorySetRQ | E | R | Root Element | |
WS_CategorySetRQ/Token | A | R | A reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message include an echo token with the identical value | String Length:1 -128 |
WS_CategorySetRQ/LanguageId | A | R | The primary language preference for the message encoded as ISO 639 | String Length:2 |
3.2.4 Sample Message Request
Post on url https://api.expub.net/WebshopApi/GetCategorySet
<WS_CategorySetRQ Token=340FDFAE958CD5335A8CD22B390A6F76497ED23BFBAC877467" LanguageId="en"></WS_CategorySetRQ>
3.2.5 WS_CategorySetRS
The WS_CategorySetRS is the message used to indicate the status of processing the WS_CategorySetRQ message. This message returns xml that meets the requested criteria and/or Warnings, or Errors if the request did not succeed.Element(E) Attribute(A) | Name | Notes | Data Type/Possible values |
E | WS_CategorySetRS | Root Element | |
A | WS_CategorySetRS/API | API Name | String Length:1 -20 |
A | WS_CategorySetRS/Version | The message version indicated by a decimal value. | Decimal |
A | WS_CategorySetRS/Token | A reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message includes an echo token with the identical value | String Length:1 -128 |
A | WS_CategorySetRS/Status | Identifies the status of the call url request. | Integer |
A | WS_CategorySetRS/Message | Message call url request of status | String Length: 1 - 500 |
A | WS_CategorySetRS/Request | Date Request | TimeStamp |
E | WS_CategorySetRS.CategorySets | ||
E | WS_CategorySetRS.CategorySets.CategorySet | ||
E | WS_CategorySetRS.CategorySets.CategorySet.CategorySetId | Category Set Id | Integer |
E | WS_CategorySetRS.CategorySets.CategorySet.Name | Category Set Name | String Length: 1 - 500 |
3.2.6 Simple Message Response Success
<WS_CategorySetRS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="0.1" Token="340FDFAE958CD5335A8CD22B390A6F76497ED23BFBAC877467" Status="3" Message="Success Get CateogrySet" Request="2015-07-02T10:33:28.4720242+07:00"> <CategorySets> <CategorySet> <CategorySetId>249</CategorySetId> <Name>Foo</Name> </CategorySet> <CategorySet> <CategorySetId>257</CategorySetId> <Name>Article category</Name> </CategorySet> <CategorySet> <CategorySetId>268</CategorySetId> <Name>Product Cateory</Name> </CategorySet> <CategorySet> <CategorySetId>270</CategorySetId> <Name>List Product</Name> </CategorySet> </CategorySets> </WS_CategorySetRS>
3.3 WS_UpdateCategoryRQ/RS
This message identifies the initial request for updating category.3.3.1 Support Operations
Portal requests update about a category.3.3.2 Business Rules
This message is only sent from the portal to the Service Providers. Only requests received via POST method will be accepted.3.3.3 WS_UpdateCategoryRQ
This message identifies the initial request update for categories. Using this message the requester may update a categoryParameter | Element(E) Attribute(A) | Required(R) Optional(O) | Notes | Data Type/ Possible values |
WS_UpdateCategoryRQ | E | R | Root Element | |
WS_UpdateCategoryRQ/Token | A | R | A reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message includes an echo token with the identical value | String Length:1 -128 |
WS_UpdateCategoryRQ/LanguageId | A | R | The primary language preference for the message encoded as ISO 639 | String Length:2 |
WS_UpdateCategoryRQ.Categorys | E | |||
WS_UpdateCategoryRQ.Categorys.Category | E | |||
WS_UpdateCategoryRQ.Categorys.Category.LegacyId | E | R | External Id | Integer |
WS_UpdateCategoryRQ.Categorys.Category.CategorySetId | E | R | The Category Set that uniquely identifies from WS_CategorySetRS | Integer |
WS_UpdateCategoryRQ.Categorys.Category.Name | E | R | Category Name | String Length:1 - 200 |
WS_UpdateCategoryRQ.Categorys.Category.Description | E | O | Category Description | String Length:1 - 999,999 |
WS_UpdateCategoryRQ.Categorys.Category.TopLevelCategory | E | O | Category Setting About Top Level Category | Boolean |
WS_UpdateCategoryRQ.Categorys.Category.IsActive | E | O | Category Setting About Available | Boolean |
3.3.4 Sample Message Request
Post to url https://api.expupwebsites.net/WebshopApi/UpdateCategory<WS_UpdateCategoryRQ LanguageId="en" Token="340FDFAE958CD5335A8CD22B390A6F76497ED23BFBAC877467"> <Categorys> <Category> <LegacyId>20</LegacyId> <CategorySetId>268</CategorySetId> <Name>Sofa</Name> <Description>All types of sofas</Description> <TopLevelCategory>true</TopLevelCategory> <IsActive>true</IsActive> </Category> <Category> <LegacyId>21</LegacyId> <CategorySetId>268</CategorySetId> <Name>Table</Name> <Description>All types of tables</Description> <TopLevelCategory>true</TopLevelCategory> <IsActive>true</IsActive> </Category> </Categorys> </WS_UpdateCategoryRQ>
3.3.5 WS_UpdateCategoryRS
The WS_UpdatCategoryRS is the message used to indicate the status of processing the WS_UpdateCategoryRQ message. This message returns xml that meet the requested criteria and/or Warnings, or Errors if the request did not succeed.Element(E) Attribute(A) | Name | Notes | Data Type/ Possible values |
E | WS_UpdateCategoryRS | Root Element | |
A | WS_UpdateCategoryRS/API | API Name | String Length:1 -20 |
A | WS_UpdateCategoryRS/Version | The message version indicated by a decimal value. | Decimal |
A | WS_UpdateCategoryRS/Token | A reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message includes an echo token with the identical value | String Length:1 -128 |
A | WS_UpdateCategoryRS/Status | Identifies the status of the call url request. | Integer |
A | WS_UpdateCategoryRS/Message | Message call url request of status | String Length: 1 - 500 |
A | WS_UpdateCategoryRS/Request | Date Request | TimeStamp |
3.2.6 Simple Message Response Success
<WS_UpdateProductRS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" API="WSP_UpdateCategory" Version="0.1" Token="340FDFAE958CD5335A8CD22B390A6F76497ED23BFBAC877467" Status="4" Message="Success Updating Category" Request="2015-07-02T11:09:16.5481186+07:00"/>
3.4 WS_UpdateProductRQ/RS
This message identifies the initial request for update a product.3.4.1 Support Operations
Portal requests update about a product.3.4.2 Business Rules
This message is only sent from the portal to the Service Providers. Only requests received via POST method will be accepted.3.4.3 WS_UpdateProductRQ
This message identifies the initial request update for products. Using this message the requester may update products.Parameter | Element(E) Attribute(A) | Required(R) Optional(O) | Notes | Data Type/ Possible values |
WS_UpdateProductRQ | E | R | Root Element | |
WS_UpdateProductRQ /Token | A | R | A reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message include an echo token with the identical value | String Length:1 -128 |
WS_UpdateProductRQ /LanguageId | A | R | The primary language preference for the message encoded as ISO 639 | String Length:2 |
WS_UpdateProductRQ.Products | E | R | ||
WS_UpdateProductRQ.Products.Prouduct | E | R | ||
WS_UpdateProductRQ.Products.Prouduct.ProductId | E | O | Update Product LecacyId | Integer |
WS_UpdateProductRQ.Products.Prouduct.CateogryLegacyId | E | O | Integer | |
Products.Prouduct.CateogryLegacyId.LegacyId | E | O | External Category Id | Integer |
Products.Prouduct.LegacyId | E | R | External Product Id | Integer |
Products.Prouduct.WebShopId | E | R | From Admin Area | Integer |
Products.Prouduct.Code | E | O | Product Code | String Length:1 - 50 |
Products.Prouduct.IsActive | E | O | Available | Boolean / Default False |
Products.Prouduct.IsDeleted | E | O | Delete | Boolean / Default False |
Products.Prouduct.Price | E | O | Price For Product | Decimal / Default 0 |
Products.Prouduct.ProductName | E | R | Product Name | String Length:1 - 500 |
Products.Prouduct.ShortDescription | E | O | Product Description | String Length:1 - 999,999 |
Products.Prouduct.FullDescription | E | O | Product Full Description | String Length:1 - 999,999 |
Products.Prouduct.MetaKeyWord | E | O | Product Meta Keyword | String Length:1 - 400 |
Products.Prouduct.MetaDescription | E | O | Product Meta Description | String Length:1 - 4000 |
Products.Prouduct.MetaTitle | E | O | Product Meta Title | String Length:1 - 400 |
Products.Prouduct.SEName | E | O | Product SEName | String Length:1 - 100 |
Products.Prouduct.Tag | E | O | Product Tag | String Length:1 - 999,999 |
Products.Prouduct.ProductVideo | E | O | Product Video | String Length:1 - 200 |
Products.Prouduct.FeatureProductStartDate | E | O | Product Feature Start Date | String / (yyyy-MM-dd) |
Products.Prouduct.FeatureProductEndDate | E | O | Product Feature End Date | String / (yyyy-MM-dd) |
Products.Prouduct.FeatureMessage | E | O | Product Feature Message | String Length:1 - 500 |
Products.Prouduct.Images | E | O | ||
Products.Prouduct.Images.Image | E | O | ||
Products.Prouduct.Images.Image.Title | E | O | Product Image Title | String Length:1 - 999,999 |
Products.Prouduct.Images.Image.Description | E | O | Product Image Description | String Length:1 - 999,999 |
Products.Prouduct.Images.Image.Url | E | R | Product Image Url | String Length:1 - 999,999 |
Products.Prouduct.Variants | E | O | ||
Products.Prouduct.Variants.Variant | E | O | ||
Products.Prouduct.Variants.Variant.ProductVariantId | E | O | Update Variant LecacyId | Integer |
Products.Prouduct.Variants.Variant.LegacyId | E | R | External Product Variant Id | Integer |
Products.Prouduct.Variants.Variant.Height | E | O | Product Variant Height | Double |
Products.Prouduct.Variants.Variant.Width | E | O | Product Variant Width | Double |
Products.Prouduct.Variants.Variant.Lenght | E | O | Product Variant Lenght | Double |
Products.Prouduct.Variants.Variant.Weight | E | O | Product Variant Weight (gram) | Integer |
Products.Prouduct.Variants.Variant.OrderMinimumQuantity | E | O | Product Variant Order Minimum Quantity | Integer |
Products.Prouduct.Variants.Variant.OrderMaximumQuantity | E | O | Product Variant Order Maximum Quantity | Integer |
Products.Prouduct.Variants.Variant.CallForPrice | E | O | Product Variant Call For Price | Boolean / Default is False |
Products.Prouduct.Variants.Variant.Price | E | O | Product Variant Price | Double |
Products.Prouduct.Variants.Variant.SKU | E | O | Product Variant SKU | String Length:1 - 50 |
Products.Prouduct.Variants.Variant.Stock | E | O | Product Variant Stock | Integer |
Products.Prouduct.Variants.Variant.BackOrderPermitted | E | O | Product Variant BackOrder Permitted | Boolean / Default is False |
Products.Prouduct.Variants.Variant.ProductVariantTypeId | E | O | Product Variant Type | Integer / Default = 1, CustomForm = 2, PostCard = 3, Calendar = 4, Picture = 5, File = 6, Attribute = 7, ProductAttribute = 8 |
Products.Prouduct.Variants.Variant.ProductUnitTypeId | E | O | Product Variant Unit Type | Integer |
Products.Prouduct.Variants.Variant.ProductPackageId | E | O | Product Variant Package | Integer |
Products.Prouduct.Variants.Variant.IncludedTax | E | O | Product Variant Included Tax | Boolean / Default is False |
Products.Prouduct.Variants.Variant.TaxCategoryId | E | O | Product Variant Tax Category Id | Integer |
Products.Prouduct.Variants.Variant.TaxExempt | E | O | Product Variant Tax Exempt | Boolean / Default is False |
Products.Prouduct.Variants.Variant.Volume | E | O | Product Variant Volume | Double |
Products.Prouduct.Variants.Variant.FeatureVariantStartDate | E | O | Product Feature Start Date | String / (yyyy-MM-dd) |
Products.Prouduct.Variants.Variant.FeatureVariantEndDate | E | O | Product Feature EndDate | String / (yyyy-MM-dd) |
Products.Prouduct.Variants.Variant.Name | E | R | Product Variant Name | String Length:1 - 500 |
Products.Prouduct.Variants.Variant.Description | E | O | Product Variant Description | String Length:1 - 999,999 |
Products.Prouduct.Variants.Variant.Image | E | O | ||
Products.Prouduct.Variants.Variant.Image.Url | E | O | Product Variant Image Url | String Length:1 - 999,999 |
3.4.4 Sample Message Request
Post to url https://api.expupwebsites.net/WebshopApi/UpdateProduct<WS_UpdateProductRQ LanguageId="en" Token="340FDFAE958CD5335A8CD22B390A6F76497ED23BFBAC877467"> <Products> <Product> <CateogryLegacyId> <LegacyId>20</LegacyId> <LegacyId>21</LegacyId> </CateogryLegacyId> <LegacyId>39</LegacyId> <WebShopId>59</WebShopId> <Code>003</Code> <IsActive>true</IsActive> <Price>10000.00</Price> <EAN>8888888888</EAN> <ProductName>Leather sofa</ProductName> <ShortDescription>L-shaped sofa</ShortDescription> <FullDescription>5 seat L-shaped sofa</FullDescription> <MetaKeyWord></MetaKeyWord> <MetaDescription></MetaDescription> <MetaTitle></MetaTitle> <SEName></SEName> <Tag></Tag> <ProductVideo></ProductVideo> <FeatureProductStartDate>2015-06-01</FeatureProductStartDate> <FeatureProductEndDate>2015-06-25</FeatureProductEndDate> <FeatureMessage></FeatureMessage> <Permalink></Permalink> <Images> <Image> <Title>Brown Sofa</Title> <Description>Brown leather sofa</Description> <Url>https://www.domain.com/images/brown-sofa1.png</Url> </Image> <Image> <Title>Black Sofa</Title> <Description>Black leather sofa</Description> <Url>https://www.domain.com/images/black-sofa.png</Url> </Image> </Images> <Variants> <Variant> <LegacyId>47</LegacyId> <Height>123</Height> <Width>12</Width> <Lenght>2</Lenght> <Weight>0</Weight> <OrderMinimumQuantity>0</OrderMinimumQuantity> <OrderMaximumQuantity>5</OrderMaximumQuantity> <CallForPrice>false</CallForPrice> <Price>10000.0000</Price> <SKU>033</SKU> <Stock>0</Stock> <BackOrderPermitted>false</BackOrderPermitted> <ProductVariantTypeId>0</ProductVariantTypeId> <ProductUnitTypeId>0</ProductUnitTypeId> <EAN>88888888</EAN> <ProductUnitTypeId>0</ProductUnitTypeId> <ProductPackageId>0</ProductPackageId> <IncludedTax>true</IncludedTax> <TaxCategoryId>0</TaxCategoryId> <TaxExempt>false</TaxExempt> <Volume>045</Volume> <FeatureVariantStartDate>2015-06-02</FeatureVariantStartDate> <FeatureVariantEndDate>2015-06-25</FeatureVariantEndDate> <Name>Brown Sofa</Name> <Description>L-shaped brown leather sofa</Description> <PackageSize></PackageSize> <Image> <Url>https://www.domain.com/images/brown-sofa2.png</Url> </Image> </Variant> </Variants> </Product> </Products> </WS_UpdateProductRQ>
3.4.5 WS_UpdateProductRS
The WS_UpdatProductRS is the message used to indicate the status of processing the WS_UpdateProductRQ message. This message returns xml that meets the requested criteria and/or Warnings, or Errors if the request did not succeed.Element(E) Attribute(A) | Name | Notes | Data Type/ Possible values |
E | WS_UpdateProductRS | Root Element | |
A | WS_UpdateProductRS/API | API Name | String Length:1 -20 |
A | WS_UpdateProductRS/Version | The message version indicated by a decimal value. | Decimal |
A | WS_UpdateProductRS/Token | A reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message includes an echo token with the identical value | String Length:1 -128 |
A | WS_UpdateProductRS/Status | Identifies the status of the call url request. | Integer |
A | WS_UpdateProductRS/Message | Message call url request of status | String Length: 1 - 500 |
A | WS_UpdateProductRS/Request | Date Request | TimeStamp |
3.4.6 Simple Message Response Success
<WS_UpdateProductRS xmlns:xsi="{{{http://www.w3.org/2001/XMLSchema-instance}}}" xmlns:xsd="[[[http://www.w3.org/2001/XMLSchema}}}" API="WSP_UpdateProduct" Version="0.1" Token="340FDFAE958CD5335G8CD22B390A6F76497ED23BFBAC877467" Status="5" Message="Success Update Product" Request="2015-07-03T13:43:07.5944621+07:00"/>
3.5 WS API 'Status' Values List
Status Value | Description |
1 | Success |
2 | Success Authentication |
3 | Success Get Category Set |
4 | Success Update Category |
5 | Success Update Product |
6 | WebshopAPIError |
7 | WebshopAPIErrorAuthentication |