Prices

Prices

The Prices API lets you modify prices stored in the MarketHub data store.
A standard basic price record is used to set up a price between 2 dates and runs for that period.
When using the API, you should also provide a price ID if you wish to make further modifications to a price.
It is suggested that the PriceID is the unique id for a price on any external ERP/POS system which is responsible for
price ownership.

  • Method: GET
  • URL: https://madic-esl.markethubpulse.com/api/Price/GetByStore/

The method takes a single parameter via the url. Prices are filtered at a store level so the
store id needs to be passed in the last part of the url. So for example if the store is 'SampleStore'
then the url for the request would be as follows: https://madic-esl.markethubpulse.com/api/Price/GetByStore/SampleStore

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 an array/list of Prices. Each price will contain the following fields:

Name Type Description
OID GUID The unique system id for the product in the database,
ProductID String The unique client ID for the product. Important: Consider this the external reference for the price when making future changes to the price.
StoreOID Guid The unique system ID of the Store that the associated product is assigned to.
StoreID String The unique client id of the store of the product that the price is assigned to.
ProductOID GUID The unique system ID of the product that the price refers to.
ProductID String The unique client ID of the product associated with the price.
PriceID String The unique client ID of the price (!Important).
Price Decimal The price value.
Unit String The unit of measure for the price.
PricePerUnit Decimal The price per product unit.
StartDate Date The starting date of the price
EndDate Date The ending date of the price.
OnPromotion bool Inidcates that this is a promotional price
OriginalPrice decimal The original selling price for the product if this is a promotional price
LastUpdated datetime The date and time that the price was last modfied.
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.
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 Response

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

[
{
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"PriceID":"PRT12201",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"StoreID":"DemoStore",
"ProductOID":"3EA0827F-822D-42A6-8846-42F6AFBEB9EB",
"ProductID":"ProdID001",
"PriceID":"UniqueClientPriceID",
"Price":"79.99",
"Unit":"Pair",
"PricePerUnit":"79.99",
"StartDate":"2014-01-01",
"EndDate":"2014-12-31",
"LastUpdated":"2014-02-10T16:31:12.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}
]

Sample Code

TODO
  • Method: POST
  • URL: https://madic-esl.markethubpulse.com/api/Price/GetByProduct/

The method takes a single product as a parameter via post. Prices are filtered at a product level so the
product information needs a valid store id and product id.

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. This is the clients unique ID.
StoreID String The unique store id that the label is assigned to.

Once the request is successful the response will return an array/list of Prices. Each price will contain the following fields:

Name Type Description
OID GUID The unique system id for the product in the database,
ProductID String The unique client ID for the product. Important: Consider this the external reference for the price when making future changes to the price.
StoreOID Guid The unique system ID of the Store that the associated product is assigned to.
StoreID String The unqiue client id of the store of the product that the price is assigned to.
ProductOID GUID The unique system ID of the product that the price refers to.
ProductID String The unique client ID of the product associated with the price.
PriceID String The unique client ID of the price (!Important).
Price Decimal The price value.
Unit String The unit of measure for the price.
PricePerUnit Decimal The price per product unit.
StartDate Date The starting date of the price
EndDate Date The ending date of the price.
OnPromotion bool Inidcates that this is a promotional price
OriginalPrice decimal The original selling price for the product if this is a promotional price
LastUpdated datetime The date and time that the price was last modfied.
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.
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 Response

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

[
{
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"PriceID":"PRT12201",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"StoreID":"DemoStore",
"ProductOID":"3EA0827F-822D-42A6-8846-42F6AFBEB9EB",
"ProductID":"ProdID001",
"PriceID":"UniqueClientPriceID",
"Price":"79.99",
"Unit":"Pair",
"PricePerUnit":"79.99",
"StartDate":"2014-01-01",
"EndDate":"2014-12-31",
"LastUpdated":"2014-02-10T16:31:12.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}
]

Sample Code

TODO
  • Method: POST
  • URL: https://madic-esl.markethubpulse.com/api/Price/Create/

The method takes a single price object and adds it to the database.

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.
StoreID String The unqiue id of the store that the price is to be active for.
PriceID String The unqiue client id of the price. This is required to uniquely identify a price for editing/deletion at some future point.
Price Decimal The effective unit price.
Unit String The standard product unit that this price pertains to.
PricePerUnit Decimal The price charge per base unit. This may not be the actual price bug should reflect the price per standised unit. e.g. 2.99 per KG, 79.99 per pair, 4.55 per Litre. Defaulted to the EanNumber if it is not specified.
StartDate Date The starting date of the price.
End Date The ending date of the price.
IsDeleted Bool A flag indicating if the price has been deleted.
OnPromotion bool Inidcates that this is a promotional price
OriginalPrice decimal The original selling price for the product if this is a promotional price

Response

Name Type Description
OID GUID The unique system id for the product in the database,
ProductID String The unique client ID for the product. Important: Consider this the external reference for the price when making future changes to the price.
StoreOID Guid The unique system ID of the Store that the associated product is assigned to.
StoreID String The unqiue client id of the store of the product that the price is assigned to.
ProductOID GUID The unique system ID of the product that the price refers to.
ProductID String The unique client ID of the product associated with the price.
PriceID String The unique client ID of the price (!Important).
Price Decimal The price value.
Unit String The unit of measure for the price.
PricePerUnit Decimal The price per product unit.
StartDate Date The starting date of the price
EndDate Date The ending date of the price.
OnPromotion bool Inidcates that this is a promotional price
OriginalPrice decimal The original selling price for the product if this is a promotional price
LastUpdated datetime The date and time that the price was last modfied.
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.
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 Response

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

[
{
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"PriceID":"PRT12201",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"StoreID":"DemoStore",
"ProductOID":"3EA0827F-822D-42A6-8846-42F6AFBEB9EB",
"ProductID":"ProdID001",
"PriceID":"UniqueClientPriceID",
"Price":"79.99",
"Unit":"Pair",
"PricePerUnit":"79.99",
"StartDate":"2014-01-01",
"EndDate":"2014-12-31",
OnPromotion": false,
"OriginalPrice":"79.99",
"LastUpdated":"2014-02-10T16:31:12.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}
]

Sample Code

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

The method takes a single price object and updates it in the database.

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.
StoreID String The unqiue id of the store that the price is to be active for.
PriceID String The unqiue client id of the price. This is required to uniquely identify the price being modified.
Price Decimal The effective unit price.
Unit String The standard product unit that this price pertains to.
PricePerUnit Decimal The price charge per base unit. This may not be the actual price bug should reflect the price per standised unit. e.g. 2.99 per KG, 79.99 per pair, 4.55 per Litre. Defaulted to the EanNumber if it is not specified.
StartDate Date The starting date of the price.
End Date The ending date of the price.
IsDeleted Bool A flag indicating if the price has been deleted.
OnPromotion bool Inidcates that this is a promotional price
OriginalPrice decimal The original selling price for the product if this is a promotional price

Response

Name Type Description
OID GUID The unique system id for the product in the database,
ProductID String The unique client ID for the product. Important: Consider this the external reference for the price when making future changes to the price.
StoreOID Guid The unique system ID of the Store that the associated product is assigned to.
StoreID String The unqiue client id of the store of the product that the price is assigned to.
ProductOID GUID The unique system ID of the product that the price refers to.
ProductID String The unique client ID of the product associated with the price.
PriceID String The unique client ID of the price (!Important).
Price Decimal The price value.
Unit String The unit of measure for the price.
PricePerUnit Decimal The price per product unit.
StartDate Date The starting date of the price
EndDate Date The ending date of the price.
OnPromotion bool Inidcates that this is a promotional price
OriginalPrice decimal The original selling price for the product if this is a promotional price
LastUpdated datetime The date and time that the price was last modfied.
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.
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 Response

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

[
{
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"PriceID":"PRT12201",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"StoreID":"DemoStore",
"ProductOID":"3EA0827F-822D-42A6-8846-42F6AFBEB9EB",
"ProductID":"ProdID001",
"PriceID":"UniqueClientPriceID",
"Price":"79.99",
"Unit":"Pair",
"PricePerUnit":"79.99",
"StartDate":"2014-01-01",
"EndDate":"2014-12-31",
"OnPromotion":"true",
"OriginalPrice": 85.00,
"LastUpdated":"2014-02-10T16:31:12.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}
]

Sample Code

TODO
;