product

product.option.add

Add product option from store.

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

Request body

namestring 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_idstring

Defines product id where the option should be added

default_option_valuestring

Defines default option value that has to be added

option_valuesstring

Defines option values that has to be added

descriptionstring

Defines option's description

availboolean

Defines whether the option is available

sort_orderinteger

Sort number in the list

requiredboolean

Defines if the option is required

clear_cacheboolean

Is cache clear required

idempotency_keystring

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>

Example request

{
  "name": "Color",
  "type": "option_type_select",
  "default_option_value": "green",
  "option_values": "green,black,yellow",
  "description": "Product option",
  "sort_order": 2,
  "required": true,
  "idempotency_key": "098f6bcd4621d373cade4e832627b4f6"
}

Response

successful operation

return_codeinteger
return_messagestring

Changes

No recorded changes to this operation across all 1 revision of this API.