고객 API
스토어의 고객을 생성, 조회, 수정, 삭제합니다.
엔드포인트
GET
/customers
customers:read
페이지네이션된 고객 목록을 조회합니다.
GET
/customers/:id
customers:read
ID로 단일 고객을 조회합니다.
POST
/customers
customers:write
새 고객을 생성합니다.
PUT
/customers/:id
customers:write
기존 고객을 수정합니다. 부분 업데이트가 지원됩니다.
DELETE
/customers/:id
customers:write
고객을 소프트 삭제합니다. 30일 이내에 복구할 수 있습니다.
필드 참조
| 필드 | 유형 | 필수 | 설명 |
|---|---|---|---|
id | string | 아니오 | 고유 고객 식별자 (읽기 전용) |
name | string | 예 | 고객 이름 |
string | 예 | 고객 이메일 주소 | |
phone | string | 아니오 | 국가 코드 포함 전화번호 |
createdAt | datetime | 아니오 | ISO 8601 타임스탬프 (읽기 전용) |
updatedAt | datetime | 아니오 | ISO 8601 타임스탬프 (읽기 전용) |
쿼리 매개변수 (목록)
| 필드 | 유형 | 필수 | 설명 |
|---|---|---|---|
page | integer | 아니오 | 페이지 번호 (기본값: 1) |
limit | integer | 아니오 | 페이지당 항목 수 (기본값: 20, 최대: 100) |
q | string | 아니오 | 고객 이름 또는 이메일로 검색 |
예시
페이지네이션으로 고객 목록 조회
bash
curl "https://api.mercozy.com/api/v1/external/customers?page=1&limit=20" \
-H "X-API-Key: mk_live_xxxxx"고객 생성
bash
curl -X POST "https://api.mercozy.com/api/v1/external/customers" \
-H "X-API-Key: mk_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890"
}'응답 예시
json
{
"data": {
"id": "cust_abc123",
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890",
"createdAt": "2025-12-15T10:30:00Z",
"updatedAt": "2025-12-15T10:30:00Z"
}
}