Get the Product #
Service URL: POST /products/lookup
Request Body:
ProductLookupRequest
- productCode – The code entered for the product
- productCodeScanned – A product code scanned
- embeddedProductCode – A product code extracted from an embedded product price
- 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:
ProductLookupResponse
- product –
IProduct
– The product itself - productDetails –
IProductDetail
– The details of the specified product
Remarks:
This service behaves equivalently to the product lookup done locally by a POS. As such the service needs to send more than just the product code so it can also simulate the transaction held by the client. It is also why the service sends back the full product since the POS uses that in the functions that follow the product lookup.
The product details are equivalent to the details returned by the product catalogue service. They are included for completeness, but this service doesn’t guarantee that it will have all the information that can be provided by the product catalogue service.
Scenarios
Scenario | Outcome | Expected behaviour | Status Code | Response | |
---|---|---|---|---|---|
1 | The product catalogue service receieves a valid product code | Success | The requested product should be returned. | 200 | |
2 | The product catalogue service receieves an invalid product code | Fail | The requested product 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 product 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/lookup
{
"productCode" : "EXTERNAL1",
"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:
{
"productDetail":{
"description":"External Product 1",
"price":0,
"productId":"EXTERNAL1",
"productMediaSet":{
"productId":"EXTERNAL1"
},
"productExtendedInformation":{
"productId":"EXTERNAL1"
}
},
"product":{
"productId":"EXTERNAL1",
"type":"merchandiseProduct",
"productDescription":{
"string":[
{
"string":"External Product 1"
}
]
},
"productLongDescription":{
},
"localisedProductInfo":{
},
"posDetails":{
"productOptionSetDetails":{
"isTemplate":false
},
"isTemplate":false
},
"isTemplate":false,
"status":"LIVE",
"lastUpdated":1624962225551,
"taxExemptProhibited":false,
"exportDetails":{
"isTemplate":false
},
"inventoryDetails":{
"allowCustomerOrder":false,
"customerOrderOnly":false,
"isTemplate":false
},
"productDimensions":{
"isTemplate":false
},
"warrantyDetails":{
"localisedWarrantyInformation":{
},
"isTemplate":false
},
"standardCostPrice":0.0,
"standardMargin":0.0,
"fasciaId":{
},
"mmGroupId":{
},
"brandId":{
},
"rangeId":{
},
"seasonId":{
}
}
}