Get custom option for a specific product

GET /V1/products/{sku}/options/{optionId}

Get custom option for a specific product

Path parameters

  • sku string Required
  • optionId integer Required

Responses

  • 200

    200 Success.

    Hide response attributes Show response attributes object
    • product_sku string Required

      Product SKU

    • option_id integer

      Option id

    • title string Required

      Option title

    • type string Required

      Option type

    • sort_order integer Required

      Sort order

    • is_require boolean Required

      Is require

    • price number

      Price

    • price_type string

      Price type

    • sku string

      Sku

    • file_extension string
    • max_characters integer
    • image_size_x integer
    • image_size_y integer
    • values array[object]
      Hide values attributes Show values attributes object
      • title string Required

        Option title

      • sort_order integer Required

        Sort order

      • price number Required

        Price

      • price_type string Required

        Price type

      • sku string

        Sku

      • option_type_id integer

        Option type id

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Catalog\Api\Data\ProductCustomOptionInterface

  • default

    Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

GET /V1/products/{sku}/options/{optionId}
curl \
 --request GET 'https://magento2.winkelstraat.mac/rest/all/V1/products/{sku}/options/{optionId}'
Response examples (200)
{
  "product_sku": "string",
  "option_id": 42,
  "title": "string",
  "type": "string",
  "sort_order": 42,
  "is_require": true,
  "price": 42.0,
  "price_type": "string",
  "sku": "string",
  "file_extension": "string",
  "max_characters": 42,
  "image_size_x": 42,
  "image_size_y": 42,
  "values": [
    {
      "title": "string",
      "sort_order": 42,
      "price": 42.0,
      "price_type": "string",
      "sku": "string",
      "option_type_id": 42
    }
  ],
  "extension_attributes": {}
}
Response examples (default)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}