색상
옵션 색 칩에 쓰는 색상 목록을 관리합니다.
업데이트됨 10.13 — 목록 정렬 sort · order 를 받습니다무엇인가요
옵션의 색 칩에 쓰는 색상 목록입니다.
| 항목 | 내용 |
|---|---|
| 권한 | 읽기 products:read · 쓰기 products:write (소유자 토큰) |
| 상품에서 쓰는 곳 | 상품의 color_ids · 옵션 행의 color_hex |
| 관리자 화면 | 상품 > 템플릿 관리 — 같은 검증 · 같은 저장 |
| 요청 | 경로 | 바로가기 |
|---|---|---|
| GET | https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors | 목록 |
| GET | https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors/{color_unique} | 상세 |
| POST | https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors | 생성 |
| PATCH | https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors/{color_unique} | 수정 |
| DELETE | https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors/{color_unique} | 삭제 |
목록
GET
https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors이 쇼핑몰의 템플릿 전부입니다(쪽 나눔 없음). 줄마다 이 템플릿을 쓰는 상품 수 used_count 가 붙습니다 — 관리자 목록의 "적용상품" 칸과 같습니다.
| 쿼리 | 형식 | 설명 |
|---|---|---|
sort | string | 정렬 키 — 색상은 sort_order(노출순서)도 받습니다. 빼면 노출순서 → 이름순(관리자 목록의 기본과 같음) 코드값 |
order | string | 정렬 방향. 빼면 name · sort_order 는 오름차순, 시각은 최신순. sort 와 함께 보냅니다 코드값 |
bash요청
curl 'https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors' \
-H 'Authorization: Bearer msat_8Hk2wQ7...'json200 OK
{
"items": [
{
"color_unique": "6acca48fc2ca90eedea620fa",
"name": "샌드베이지",
"hex": "#D8C3A5",
"keywords": [],
"sort_order": 0,
"created": "2026-10-12T09:12:47.441Z",
"updated": "2026-10-12T09:12:47.441Z",
"used_count": 0
}
]
}상세
GET
https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors/{color_unique}bash요청
curl 'https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors/6acca48fc2ca90eedea620fa' \
-H 'Authorization: Bearer msat_8Hk2wQ7...'json200 OK
{
"color_unique": "6acca48fc2ca90eedea620fa",
"name": "샌드베이지",
"hex": "#D8C3A5",
"keywords": [],
"sort_order": 0,
"created": "2026-10-12T09:12:47.441Z",
"updated": "2026-10-12T09:12:47.441Z"
}응답 필드
| 필드 | 형식 | 설명 |
|---|---|---|
color_unique | string | 키. 상세 · 수정 · 삭제 경로에 넣습니다 |
items | array | 생성할 때만 — 한 번에 여러 개. 한 개는 {name, hex} |
name | string | 색 이름(같은 이름은 안 됨) |
hex | string | 색 값 #RRGGBB |
keywords | string[] | 함께 찾히는 말(검정색 · Black …) — 수정으로만 넣습니다 |
sort_order | number | 차례 — 수정으로만 |
created | ISO | 생성 시각 |
updated | ISO | 마지막 수정 시각 |
used_count | number | 이 템플릿을 쓰는 상품 수(목록에만) |
생성
POST
https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors생성은 items 로 여러 개를 한 번에 받습니다. 생성 때는 이름과 색 값만 쓰고, 키워드 · 차례는 수정으로 넣습니다.
요청 본문
| 필드 | 형식 | 설명 |
|---|---|---|
items필수 | array | 생성할 때만 — 한 번에 여러 개. 한 개는 {name, hex} |
name필수 | string | 색 이름(같은 이름은 안 됨) |
hex필수 | string | 색 값 #RRGGBB |
keywords | string[] | 함께 찾히는 말(검정색 · Black …) — 수정으로만 넣습니다 |
sort_order | number | 차례 — 수정으로만 |
bash요청
curl -X POST 'https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors' \
-H 'Authorization: Bearer msat_8Hk2wQ7...' \
-H 'Content-Type: application/json' \
-d '{"items":[{"name":"샌드베이지","hex":"#D8C3A5"}]}'json201 Created
{
"count": 1
}생성한 개수를 돌려줍니다. 새 키는 목록에서 이름으로 찾습니다.
수정
PATCH
https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors/{color_unique}보낸 필드만 바뀝니다. 나머지는 지금 값 그대로입니다. 필드는 생성과 같습니다. 키워드는 여기서 넣습니다.
bash요청
curl -X PATCH 'https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors/6acca48fc2ca90eedea620fa' \
-H 'Authorization: Bearer msat_8Hk2wQ7...' \
-H 'Content-Type: application/json' \
-d '{"hex":"#D2B48C","keywords":["베이지","모래색"]}'json200 OK
{
"ok": true
}json수정 뒤 상세
{
"color_unique": "6acca48fc2ca90eedea620fa",
"name": "샌드베이지",
"hex": "#D2B48C",
"keywords": [
"베이지",
"모래색"
],
"sort_order": 0,
"created": "2026-10-12T09:12:47.441Z",
"updated": "2026-10-12T09:12:47.499Z"
}삭제
DELETE
https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors/{color_unique}bash요청
curl -X DELETE 'https://api.mallstory.kr/v1/shop/{shop_unique}/templates/colors/6acca48fc2ca90eedea620fa' \
-H 'Authorization: Bearer msat_8Hk2wQ7...'json200 OK
{
"ok": true
}지운 색을 쓰던 상품 옵션에서는 색 표시가 빠집니다. 응답은 {ok: true} 입니다.
오류
| 상태 | code | 언제 |
|---|---|---|
| 409 | ProductColorNameDuplicate | 같은 이름의 색이 이미 있음 |
| 400 | InvalidParameterValue | 이름 · 색 값이 없거나 올바르지 않음 |
| 404 | ProductColorNotExist | 없는 키이거나 지운 색 |
| 401 | MissingLoginSession | Authorization 헤더에 Bearer 토큰이 없음 |
| 401 | InvalidAccessToken | 토큰이 틀리거나 만료 · 폐기됨 |
| 403 | InsufficientScope | 토큰에 products:read · products:write 가 없음 |
오류 본문은 {code, message, request_id} 이고, message 는 관리자 화면과 같은 문구라 사용자에게 그대로 보여 줄 수 있습니다.