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

Get custom option for a specific product

Path parameters

  • sku string Required
  • optionId integer Required

Responses

  • 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

    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

  • Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • 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 list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • 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 list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • 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 (200)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <product-sku>string</product-sku>
  <option-id type="integer">42</option-id>
  <title>string</title>
  <type>string</type>
  <sort-order type="integer">42</sort-order>
  <is-require type="boolean">true</is-require>
  <price type="float">42.0</price>
  <price-type>string</price-type>
  <sku>string</sku>
  <file-extension>string</file-extension>
  <max-characters type="integer">42</max-characters>
  <image-size-x type="integer">42</image-size-x>
  <image-size-y type="integer">42</image-size-y>
  <values type="array">
    <value>
      <title>string</title>
      <sort-order type="integer">42</sort-order>
      <price type="float">42.0</price>
      <price-type>string</price-type>
      <sku>string</sku>
      <option-type-id type="integer">42</option-type-id>
    </value>
  </values>
  <extension-attributes>
  </extension-attributes>
</root>
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"
}
Response examples (default)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <message>string</message>
  <errors type="array">
    <error>
      <message>string</message>
      <parameters type="array">
        <parameter>
          <resources>string</resources>
          <fieldName>string</fieldName>
          <fieldValue>string</fieldValue>
        </parameter>
      </parameters>
    </error>
  </errors>
  <code type="integer">42</code>
  <parameters type="array">
    <parameter>
      <resources>string</resources>
      <fieldName>string</fieldName>
      <fieldValue>string</fieldValue>
    </parameter>
  </parameters>
  <trace>string</trace>
</root>