카테고리
카테고리 목록 조회
쿼리에 따라 응답 형태가 다르다. 스코프 `category:r`. - 기본: `Category[]` — `parentId`의 직계 자식(생략하면 최상위). `flat=true`면 전체를 깊이·순서대로 평탄화한다. - `tree=true`: `CategoryTreeNode[]` — 최상위부터 `children`을 재귀로 채운 트리다. - `q` 지정: `CategorySearchResult[]` — 이름 검색 결과로 `fullPath`·`ancestors`가 붙는다. `q`가 `tree`보다 우선한다. 아래 응답 스키마는 기본 형태다.
GET
쿼리에 따라 응답 형태가 다르다. 스코프 category:r.
- 기본:
Category[]—parentId의 직계 자식(생략하면 최상위).flat=true면 전체를 깊이·순서대로 평탄화한다. tree=true:CategoryTreeNode[]— 최상위부터children을 재귀로 채운 트리다.q지정:CategorySearchResult[]— 이름 검색 결과로fullPath·ancestors가 붙는다.q가tree보다 우선한다.
아래 응답 스키마는 기본 형태다.
accessTokenheader
AuthorizationBearer <JWT>Sayren 계정 토큰(로그인 토큰 또는 개인 액세스 토큰, RFC 9068 JWT)
parentId?string이 카테고리의 직계 자식만. 생략하면 최상위 카테고리. flat=true면 무시
flat?stringtrue면 전체 카테고리를 깊이·순서대로 평탄화
Value in
"true""false"tree?stringtrue면 최상위부터 children을 채운 트리(CategoryTreeNode[])를 돌려준다
Value in
"true""false"q?string이름 검색(포함, 대소문자 무시). 주면 fullPath·ancestors가 붙은 검색 결과를 돌려준다
X-Store-Id*string대상 상점 id. 토큰의 상점 범위 밖이면 403 STORE_NOT_GRANTED, 없으면 400 STORE_ID_REQUIRED다
성공 — 기본(q·tree 없음) 응답 형태. 변형은 오퍼레이션 설명 참고
application/json- response
meta*data*array<>error*|nullcurl -X GET 'https://api.sayren.io/v1/categories' \
-H 'X-Store-Id: string'Example Response
{
"meta": {
"status": 200,
"code": "OK",
"message": "OK",
"isSuccess": true
},
"data": [
{
"categoryId": "string",
"storeId": "string",
"name": "string",
"parentId": "string",
"path": "string",
"depth": 1,
"leaf": true,
"sortOrder": 0,
"visible": true,
"showPc": true,
"showMobile": true,
"productSort": "RECENT",
"metaTitle": "string",
"metaDescription": "string",
"metaKeywords": "string",
"flowId": "string",
"createdAt": "string",
"updatedAt": "string"
}
],
"error": null
}