Full Product

Full Product

The Full Product API lets you view or modify product data with a single API call.
The API allows the caller to modify the base product information, product properties and price all in a single call.
data operations on the core detail only.

  • Method: GET
  • URL: https://madic-esl.markethubpulse.com/api/FullProduct/GetSingle/

The method takes a 2 parameters via the url. Products are filtered at a store & level so the
store id needs to be passed in the last part of the url in addition to the product id. So for example if the store is 'SampleStore'
and the product unique ID is 'Prod001' then the url for the request would be as follows:
https://madic-esl.markethubpulse.com/api/Product/GetSingle?StoreID=SampleID&ProductID=PROD001

If the product does not exist then a 204 status code (No Content) is return otherwise a 200 code will be returned
along with the product details as described below.

Request Headers

Header Field Name Value
Accept application/json or application/xml
Authorisation Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information.

Once the request is successful the response will return a single product. This product will contain the following fields:

Name Type Description
OID GUID The unique system id for the product in the database,
Name String The short product name
Description String The brief derscription of the product
EanNumber String The barcode for this product
GTIN String The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified.
LastUpdated Datetime The date and time that the product was last changed.
LastUpdatedBy string The user id of the last account to change the product.
IsDeleted boolean A flag that indicates that the product has been deleted.
StoreID string The unique client id of the store the product is assigned to.
StoreOID GUID The unique system id of the store the product is assigned to.
Price Object The current price of the product along with the price start and end dates.
ProductProperties Object Array The list of properties for the product which are a set of Key value pairs.

Example Response

HTTP/1.1 200 OK
Content-Type: application/json

{
"OID": "941577B0-60B8-4BA9-AF7C-CEA4147151CE",
"StoreOID": "D21116DD-7584-428F-9BD2-C552DA3F56FA",
"ProductID": "Prod001",
"StoreID": "DemoStore",
"Name": "Test Product Name",
"Description": "Test Product Description.",
"EANNumber": "1234567654321",
"GTIN": "1234567654321",
"LastUpdated": "2017-10-24T18:29:11.297",
"LastUpdatedBy": "",
"IsDeleted": false,
"Price": {
"OID": "55FD8334-667C-42AE-BABA-F4BF834B02A7",
"PriceID": null,
"Price": 2.99,
"Unit": "300g",
"PricePerUnit": 2.99,
"StartDate": "2017-11-20T00:00:00",
"EndDate": "2099-12-31T00:00:00",
"LastUpdated": "2017-11-24T18:29:11.31"
},
"ProductProperties": [
{
"Name": "COO",
"Value": "UK",
"TypeCategory": "General"
},
{
"Name": "UOM",
"Value": "g",
"TypeCategory": "General"
},
{
"Name": "Weight_Or_Volume",
"Value": "200",
"TypeCategory": "General"
}
]
}

Sample Code

HttpClient client = new HttpClient();
client.BaseAddress = new Uri("https://madic-esl.markethubpulse.com/api/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await client.GetAsync("FullProduct/GetSingle?StoreId=DemoStore&ProductId=Prod001");
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
// Do something with the json data
}
else
{
// Handle the failure in here
}

  • Method: POST
  • URL: https://madic-esl.markethubpulse.com/api/FullProduct/Update/

The method takes a single product object and updates it in the database.
The product must at the very least have a valid product id and store id specified in order for the product to be
added to the database. The store and product id pair must have an existing match in the database.
In addition to the base product details, a price can also be supplied and any associated properties to be updated.
If an existing property needs to be cleared then it will need to be supplied with a empty value as the omission of a property is not considered to be an instruction to clear the existing one.

Request Headers

Header Field Name Value
Accept application/json or application/xml
Authorisation Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information.

Body Format

Name Type Description
ProductID String The unique product id for the product within the system.
Name String The brief product name
Description String The brief derscription of the store
EanNumber String The unqiue barcode for this product
GTIN String The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified.
StoreID string The unique client id of the store the product is assigned to.
IsDeleted boolean A flag to indicate if the product should be marked as deleted or active.
Price Object The current price for the product along with the start and end dates.
ProductProperties Object Array The set of properties which require updating which is an array of key value pair objects. See Json Example below.

Response

Name Type Description
ProductID String The unique product id for the product within the system.
StoreID String The unique store id.
Error boolean A flag indicating if an error occur during the request.
ErrorMessage string If an error has occurred then the error message will be populated in this field.

Example Data Posted

Content-Type: application/json

{
"ProductID": "Prod001",
"StoreID": "DemoStore",
"Name": "A test product name",
"Description": "A test product Description.",
"EANNumber": "1234567654321",
"GTIN": "1234567654321",
"IsDeleted": false,
"Price": {
"PriceID": null,
"Price": 3.99,
"Unit": "300g",
"PricePerUnit": 3.99,
"StartDate": "2016-11-20T00:00:00",
"EndDate": "2099-12-31T00:00:00",
},
"ProductProperties": [
{
"Name": "COO",
"Value": "UK",
},
{
"Name": "UOM",
"Value": "kg",
},
{
"Name": "Weight_Or_Volume",
"Value": "200",
}
]
}

Example Response

HTTP/1.1 200 OK
Content-Type: application/json

{
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Error":false,
"ErrorMessage":null
}
  • Method: POST
  • URL: https://madic-esl.markethubpulse.com/api/FullProduct/UpdateMultiple/

The method takes an array of product object and updates each one individually in the ESL database.
Each product must at the very least have a valid product id and store id specified in order for the product to be
added to the database. The store and product id pair must have an existing match in the database.
In addition to the base product details, a price can also be supplied and any associated properties to be updated.
If an existing property needs to be cleared then it will need to be supplied with a empty value as the omission of a property is not considered to be an instruction to clear the existing one.

The UpdateMultiple method is eseentially the same as the Update method except multiple products can be supplied and a result is return for each product update.

Request Headers

Header Field Name Value
Accept application/json or application/xml
Authorisation Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information.

Body Format (An array of objects with the following format)

Name Type Description
ProductID String The unique product id for the product within the system.
Name String The brief product name
Description String The brief derscription of the store
EanNumber String The unqiue barcode for this product
GTIN String The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified.
StoreID string The unique client id of the store the product is assigned to.
IsDeleted boolean A flag to indicate if the product should be marked as deleted or active.
Price Object The current price for the product along with the start and end dates.
ProductProperties Object Array The set of properties which require updating which is an array of key value pair objects. See Json Example below.

Response

Name Type Description
ProductID String The unique product id for the product within the system.
StoreID String The unique store id.
Error boolean A flag indicating if an error occur during the request.
ErrorMessage string If an error has occurred then the error message will be populated in this field.

Example Data Posted

Content-Type: application/json

[
{
"ProductID": "Prod001",
"StoreID": "DemoStore",
"Name": "A test product name",
"Description": "A test product Description.",
"EANNumber": "1234567654321",
"GTIN": "1234567654321",
"IsDeleted": false,
"Price": {
"PriceID": null,
"Price": 3.99,
"Unit": "300g",
"PricePerUnit": 3.99,
"StartDate": "2016-11-20T00:00:00",
"EndDate": "2099-12-31T00:00:00",
},
"ProductProperties": [
{
"Name": "COO",
"Value": "UK",
},
{
"Name": "UOM",
"Value": "kg",
},
{
"Name": "Weight_Or_Volume",
"Value": "200",
}
]
},
{
"ProductID": "Prod002",
"StoreID": "DemoStore",
"Name": "Another test product name",
"Description": "A nothertest product Description.",
"EANNumber": "1234567654329",
"GTIN": "1234567654329",
"IsDeleted": false,
"Price": {
"PriceID": null,
"Price": 5.45,
"Unit": "354ml",
"PricePerUnit": 5.45,
"StartDate": "2016-11-20T00:00:00",
"EndDate": "2099-12-31T00:00:00",
},
"ProductProperties": [
{
"Name": "COO",
"Value": "UK",
},
{
"Name": "UOM",
"Value": "ml",
},
{
"Name": "Weight_Or_Volume",
"Value": "354",
}
]
}
]

Example Response

HTTP/1.1 200 OK
Content-Type: application/json

[
{
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Error":false,
"ErrorMessage":null
},
{
"ProductID":"ProdID002",
"StoreID":"DemoStore",
"Error":true,
"ErrorMessage":"Sample error message"
}
]
;