listProductVariants

get

/ccagent/v1/variants

List Product Variants. Returns a list of variants available for a given Product. A similar endpoint exists for Storefront, that is not implemented currently. Takes X-CCAgentContext header which is a JSON object with 'shopperProfileId' as a property. If 'shopperProfileId' is not provided, it is considered as an anonymous profile.Additonally takes x-ccsite header to return the data specific to the site.

Request

Supported Media Types
Query Parameters
Header Parameters
Back to Top

Response

Supported Media Types

200 Response

Following model is returned when operation succeeds.
Body ()
Root Schema : listProductVariants_response
Type: object
Show Source
Nested Schema : items
Type: array
Variants of the product.
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : optionValueMap
Type: object
Variant option information.
Show Source
Nested Schema : items
Type: array
Variant value map.
Show Source
Nested Schema : items
Type: object
Show Source
Example Response (application/json)
[
    {
        "optionValueMap":{
            "Silver":1,
            "Neon":2,
            "Black":0
        },
        "mapKeyPropertyAttribute":"sku-camcorder_color",
        "optionName":"color"
    },
    {
        "optionValueMap":{
            "27x optical/320x digital":4,
            "20x optical/320x digital":3,
            "2x optical/130x digital":0
        },
        "mapKeyPropertyAttribute":"sku-camcorder_zoom",
        "optionName":"zoom"
    }
]

Default Response

The error response. The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud: |Error Code|Description| |------------------|------------------| |30015|SiteId passed in x-ccsite header is currently inactive| |30014|SiteId passed in x-ccsite header is invalid or the site was deleted| |20032|Product Id passed is null or empty| |20031|Product Id '12' is invalid or non-existent|
Body ()
Root Schema : errorModel
Type: object
Show Source
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top