상품
상품 옵션 전체 교체
PUT
accessTokenheader
AuthorizationBearer <JWT>Sayren 계정 토큰(로그인 토큰 또는 개인 액세스 토큰, RFC 9068 JWT)
productId*stringX-Store-Id*string대상 상점 id. 토큰의 상점 범위 밖이면 403 STORE_NOT_GRANTED, 없으면 400 STORE_ID_REQUIRED다
application/json- body
optionGroups?array<>Items
items <= 3Default
[]variants*array<>Items
1 <= items <= 500addonGroups?array<>추가 선택 옵션명 전체(이슈 #59). 주면 통째로 바꾸고, 생략하면 등록은 없음·수정은 현재 값을 그대로 둔다. 끄려면 빈 배열을 보낸다
Items
items <= 5customInputs?array<>직접 입력 항목 전체(이슈 #59). 배열 순서가 표시 순서다. 주면 통째로 바꾸고, 생략하면 등록은 없음·수정은 현재 값을 그대로 둔다. 항목명에 개인정보성 단어(CUSTOM_INPUT_FORBIDDEN_WORDS)가 있으면 400 CUSTOM_INPUT_LABEL_FORBIDDEN이다
Items
items <= 5optionSort?string옵션 값 정렬 순서(이슈 #59). 서버가 이 순서로 값의 sortOrder를 다시 매긴다. 생략하면 등록은 REGISTERED, 수정은 현재 값이다
Value in
"REGISTERED""NAME""PRICE_ASC""PRICE_DESC"성공
application/json- response
meta*data*error*|nullcurl -X PUT 'https://api.sayren.io/v1/products/string/options' \
-H 'X-Store-Id: string' \
-H 'Content-Type: application/json' \
-d '{
"variants": [
{}
]
}'Example Response
{
"meta": {
"status": 200,
"code": "OK",
"message": "OK",
"isSuccess": true
},
"data": {
"optionGroups": [
{
"groupId": "string",
"name": "string",
"sortOrder": 0,
"values": [
{
"valueId": "string",
"name": "string",
"sortOrder": 0
}
]
}
],
"variants": [
{
"variantId": "string",
"variantNo": null,
"valueIds": [
"string"
],
"name": "string",
"additionalPrice": 0,
"prices": [
{
"currency": "string",
"additionalPrice": 0
}
],
"stockQuantity": 0,
"sku": "string",
"barcode": "string",
"costPrice": 0,
"weightGram": 0,
"sellerCode": "string",
"usable": true,
"attributes": {
"property1": "string",
"property2": "string"
},
"hasOrders": true
}
],
"addonGroups": [],
"customInputs": [],
"optionSort": "REGISTERED"
},
"error": null
}