---
title: "product.option.add"
method: POST
path: "/product.option.add.json"
tags: ["product"]
---

# product.option.add

`POST /product.option.add.json`

## Request

- Base URL: `https://api.api2cart.com/v1.1`
- URL: `https://api.api2cart.com/v1.1/product.option.add.json`
- Auth: API key in header `x-api-key` and API key in header `x-store-key`

Add product option from store.

## Request body

- ProductOptionAdd
  - `name` string, required: Defines option's name
  - `type` 'option_type_select' | 'option_type_text' | 'option_type_radio' | 'option_type_checkbox' | 'option_type_textarea' | 'option_type_readonly' | 'option_type_multiselect' | 'option_type_multicheckbox' | 'option_type_file' | 'option_type_date' | 'option_type_datetime' | 'option_type_time', required: Defines option's type that has to be added
  - `product_id` string: Defines product id where the option should be added
  - `default_option_value` string: Defines default option value that has to be added
  - `option_values` string: Defines option values that has to be added
  - `description` string: Defines option's description
  - `avail` boolean: Defines whether the option is available
  - `sort_order` integer: Sort number in the list
  - `required` boolean: Defines if the option is required
  - `values` object[]: An array of option values.</b>
    - `value` string, required
    - `display_value` string
    - `is_default` boolean
  - `clear_cache` boolean: Is cache clear required
  - `idempotency_key` string: A unique identifier associated with a specific request. Repeated requests with the same <strong>idempotency_key</strong> return a cached response without re-executing the business logic. <strong>Please note that the cache lifetime is 15 minutes.</strong>

## Response `200`

successful operation

- object
  - `return_code` integer
  - `return_message` string
  - `result` object
    - `option_id` string, nullable
    - `product_option_id` string
    - `product_value_ids` string, nullable

---

[API](https://skmtc.dev/api2cart/apis/api2cart-openapi.md) · [All operations](https://skmtc.dev/api2cart/apis/api2cart-openapi/llms.txt) · [OpenAPI document](https://skmtc.dev/api2cart/apis/api2cart-openapi/revisions/c34440741693?raw)
