POST /v1/commerce/products/{productID}/options
POST
/v1/commerce/products/{productID}/optionsAuthorization
bearerAuthbearerAuthrequiredor
apiKeyAuthapiKeyAuthrequiredPath parameters
productIDstringrequiredRequest body
requiredapplication/jsonchoicesstring[] | nullnamestringrequiredoption_typestringrequiredAllowed:
checkboxchoicetextdateuploadprice_delta_amountinteger<int64>requiredbooleanResponses
201Created
choicesstring[] | nullidstringrequirednamestringrequiredoption_typestringrequiredprice_delta_amountinteger<int64>requiredproduct_idstringrequiredrequiredbooleanrequireddefaultError
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstringRequest
curl -X POST "/v1/commerce/products/string/options" \
-H "Content-Type: application/json" \
-d '{
"choices": [
"string"
],
"name": "string",
"option_type": "checkbox",
"price_delta_amount": 0,
"required": true
}'const response = await fetch("/v1/commerce/products/string/options", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"choices": [
"string"
],
"name": "string",
"option_type": "checkbox",
"price_delta_amount": 0,
"required": true
})
});import requests
response = requests.post(
"/v1/commerce/products/string/options",
headers={
"Content-Type": "application/json"
},
json={
"choices": [
"string"
],
"name": "string",
"option_type": "checkbox",
"price_delta_amount": 0,
"required": True
},
)Response
{
"choices": [
"string"
],
"id": "string",
"name": "string",
"option_type": "string",
"price_delta_amount": 0,
"product_id": "string",
"required": true
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}