Get Product Details

Service URL: GET /products/{productId}

Tokens:

productId – The id of the product to get details for

Response Body:

GetProductDetailResponse:

productDetails – IProductDetail – The details of the specified product

Remarks:

Given a product id, returns details about that product, including descriptions, sizes, stock levels and prices. This will return a new entity ‘IProductDetail’ which must include all the details we need to return.

To support location-based pricing, it is possible to include the location id in the request, e.g. http://ServerAddress:Port/WebRestApi/rest/products/03007103300?locationId=292

Adding the location id means the service will calculate and return the price effective at that location (based on location and/or group-level price data)

Query Params:

  • retrieveSkuProducts: When this query param is set to true then service will retrieve related sku products.

Scenarios

ScenarioOutcomeExpected behaviourStatus CodeResponse
1The product catalogue service receieves a valid product idSuccessThe requested product should be returned.200GetProductDetailResponse: productDetail
2The product catalogue service receieves a invalid product idFailThe requested product is not returned.500ErrorMessage: 500, Failed to retrieve product with id: <product-id> outcome: Fail
3The product catalogue service receieves a invalid location idFailThe requested product is not returned.500ErrorMessage: 500, Failed to retrieve product with id: <product-id> outcome: Fail

Example Request:

GET: http://localhost:8080/WebRestApi/rest/products/VV639JS-12
{
    "@entity": "retail:getProductDetailResponse",
    "productDetail": {
        "@entity": "retail:productStyleColourDetail",
        "size": "12",
        "colour": "RED",
        "sizeDescription": "12",
        "colourDescription": "Red",
        "description": "Vans Canvas Shoes",
        "price": 500,
        "productExtendedInformation": {
            "@entity": "retail:productExtendedInformation",
            "productId": "VV639JS-12",
            "informationURL": "",
            "informationText": "Length 39in/99cm. Sits on the knee.\nMachine washable.\nCotton.",
            "embeddedContents": [],
            "referenceDocuments": []
        },
        "productId": "VV639JS-12",
        "productImageURL": "",
        "productMediaSet": {
            "@entity": "retail:productMediaSet",
            "productId": "VV639JS-12",
            "productMediaSetItems": [
                {
                    "@entity": "retail:productMediaSetItem",
                    "productMediaId": "VV639JS-12",
                    "mediaType": "LARGE",
                    "mediaURL": "image://PRODUCT/VV639JS.jpg"
                },
                {
                    "@entity": "retail:productMediaSetItem",
                    "productMediaId": "VV639JS12",
                    "mediaType": "THUMB",
                    "mediaURL": "image://PRODUCT/VV639JS.jpg"
                }
            ]
        },
        "productSKUs": {
            "@entity": "retail:productSKUs",
            "styleId": "VV639JS",
            "skuProducts": [
                "VV639JS-10",
                "VV639JS-11",
                "VV639JS-12",
                "VV639JS-8",
                "VV639JS-9"
            ],
            "externalDataMap": {},
            "extendedSkuProducts": [
                {
                    "@entity": "retail:extendedSkuProductSearchDetail",
                    "skuProductId": "VV639JS-10",
                    "colourId": {
                        "@entity": "retail:colourKey",
                        "colourRangeId": "MENS_SHOES",
                        "id": "RED"
                    },
                    "colourDescription": "Red",
                    "sizeId": {
                        "@entity": "retail:sizeKey",
                        "id": "10",
                        "sizeRangeId": "MENS_SHOES"
                    },
                    "sizeDescription": "10",
                    "productMediaSetItems": [
                        {
                            "@entity": "retail:productMediaSetItem",
                            "productMediaId": "VV639JS",
                            "mediaType": "LARGE",
                            "mediaURL": "image://PRODUCT/VV639JS.jpg"
                        },
                        {
                            "@entity": "retail:productMediaSetItem",
                            "productMediaId": "VV639JS",
                            "mediaType": "THUMB",
                            "mediaURL": "image://PRODUCT/VV639JS.jpg"
                        }
                    ]
                },
                {
                    "@entity": "retail:extendedSkuProductSearchDetail",
                    "skuProductId": "VV639JS-11",
                    "colourId": {
                        "@entity": "retail:colourKey",
                        "colourRangeId": "MENS_SHOES",
                        "id": "RED"
                    },
                    "colourDescription": "Red",
                    "sizeId": {
                        "@entity": "retail:sizeKey",
                        "id": "11",
                        "sizeRangeId": "MENS_SHOES"
                    },
                    "sizeDescription": "11",
                    "productMediaSetItems": [
                        {
                            "@entity": "retail:productMediaSetItem",
                            "productMediaId": "VV639JS",
                            "mediaType": "LARGE",
                            "mediaURL": "image://PRODUCT/VV639JS.jpg"
                        },
                        {
                            "@entity": "retail:productMediaSetItem",
                            "productMediaId": "VV639JS",
                            "mediaType": "THUMB",
                            "mediaURL": "image://PRODUCT/VV639JS.jpg"
                        }
                    ]
                },
                {
                    "@entity": "retail:extendedSkuProductSearchDetail",
                    "skuProductId": "VV639JS-12",
                    "colourId": {
                        "@entity": "retail:colourKey",
                        "colourRangeId": "MENS_SHOES",
                        "id": "RED"
                    },
                    "colourDescription": "Red",
                    "sizeId": {
                        "@entity": "retail:sizeKey",
                        "id": "12",
                        "sizeRangeId": "MENS_SHOES"
                    },
                    "sizeDescription": "12",
                    "productMediaSetItems": [
                        {
                            "@entity": "retail:productMediaSetItem",
                            "productMediaId": "VV639JS",
                            "mediaType": "LARGE",
                            "mediaURL": "image://PRODUCT/VV639JS.jpg"
                        },
                        {
                            "@entity": "retail:productMediaSetItem",
                            "productMediaId": "VV639JS",
                            "mediaType": "THUMB",
                            "mediaURL": "image://PRODUCT/VV639JS.jpg"
                        }
                    ]
                },
                {
                    "@entity": "retail:extendedSkuProductSearchDetail",
                    "skuProductId": "VV639JS-8",
                    "colourId": {
                        "@entity": "retail:colourKey",
                        "colourRangeId": "MENS_SHOES",
                        "id": "RED"
                    },
                    "colourDescription": "Red",
                    "sizeId": {
                        "@entity": "retail:sizeKey",
                        "id": "8",
                        "sizeRangeId": "MENS_SHOES"
                    },
                    "sizeDescription": "8",
                    "productMediaSetItems": [
                        {
                            "@entity": "retail:productMediaSetItem",
                            "productMediaId": "VV639JS",
                            "mediaType": "LARGE",
                            "mediaURL": "image://PRODUCT/VV639JS.jpg"
                        },
                        {
                            "@entity": "retail:productMediaSetItem",
                            "productMediaId": "VV639JS",
                            "mediaType": "THUMB",
                            "mediaURL": "image://PRODUCT/VV639JS.jpg"
                        }
                    ]
                },
                {
                    "@entity": "retail:extendedSkuProductSearchDetail",
                    "skuProductId": "VV639JS-9",
                    "colourId": {
                        "@entity": "retail:colourKey",
                        "colourRangeId": "MENS_SHOES",
                        "id": "RED"
                    },
                    "colourDescription": "Red",
                    "sizeId": {
                        "@entity": "retail:sizeKey",
                        "id": "9",
                        "sizeRangeId": "MENS_SHOES"
                    },
                    "sizeDescription": "9",
                    "productMediaSetItems": [
                        {
                            "@entity": "retail:productMediaSetItem",
                            "productMediaId": "VV639JS",
                            "mediaType": "LARGE",
                            "mediaURL": "image://PRODUCT/VV639JS.jpg"
                        },
                        {
                            "@entity": "retail:productMediaSetItem",
                            "productMediaId": "VV639JS",
                            "mediaType": "THUMB",
                            "mediaURL": "image://PRODUCT/VV639JS.jpg"
                        }
                    ]
                }
            ]
        }
    }
}
Go to Top