Service URLs:
POST /products/price/lookup
Request Body:
PriceLookupRequest
- productId – The id of the product to find a price for
- locationId – The id of the location requesting the details
- deviceId – The id of the device requesting the details
- customerRetailDetails – Transaction details about the customer
- flightDetailsItem – Transaction details about a flight. Only relevant for airport sales.
Response Body:
PriceLookupResponse
- price –
Long
– The value of the price - productPrice –
IProductPrice
– The details of the specified product
Remarks:
This service behaves equivalently to the price lookup done locally by a POS. As such the service needs to send more than just the product id so it can also simulate the transaction held by the client. It is also why the service sends back both a simple and full price since the POS uses that in the functions that follow the price lookup.
The product and the price lookups are handled separately by the POS, which is why they are provided as separate services.
Scenarios
Scenario | Outcome | Expected behaviour | Status Code | Response | |
---|---|---|---|---|---|
1 | The product catalogue service receieves a valid product code | Success | The requested price should be returned. | 200 | |
2 | The product catalogue service receieves an invalid product code | Fail | The requested price is not returned. | 500 | ErrorMessage: 500, Failed to retrieve product with id: <product-code> outcome: UnknownProduct |
3 | The product catalogue service receieves an invalid location id | Fail | The requested price is not returned. | 500 | ErrorMessage: 500, Failed to retrieve product with id: <product-id> outcome: UnknownClient |
Example Request
POST: http://localhost:8080/WebRestApi/rest/products/price/lookup
{
"productId" : "EXTERNAL1",
"priceType" : "R",
"locationId" : "Store1",
"deviceId" : "pos1.store1.enactor",
"terminalId" : "pos1.store1.enactor",
"transactionEntityQName" : "{http://www.enactor.com/retail}normalRetailSaleTransaction"
"customerRetailDetails" : {
"@type" : "customerRetailDetails",
"validatedOnline" : false,
"newCustomer" : false,
"marketingDetailsCaptured" : false
}
}
Example Response
{
"price":1000,
"productPrice":{
"productId":"EXTERNAL1",
"locationId":{
},
"priceGroupId":{
"groupTypeId":"priceGroup",
"groupHierarchyId":"ALL",
"variantGroupTypeId":"region",
"variantGroupId":"All",
"variantGroupHierarchyId":"All",
"id":"UK"
},
"currencyId":{
"id":"GBP"
},
"startDate":1624921200000,
"priceType":"R",
"price":1000,
"roundingRuleId":{
}
}
}