주문 API
주문 조회, 상태 업데이트, 배송 관리를 수행합니다.
엔드포인트
/orders
페이지네이션이 적용된 주문 목록을 조회합니다. 상태와 날짜 범위로 필터링할 수 있습니다.
/orders/:id
모든 항목과 배송 상세 정보가 포함된 단일 주문을 조회합니다.
/orders/:id/status
주문 상태를 업데이트합니다 (예: 배송됨으로 표시).
/orders/:id/shipment
주문에 배송 추적 정보를 첨부합니다.
필드 참조
| 필드 | 유형 | 필수 | 설명 |
|---|---|---|---|
id | string | 아니오 | 고유 주문 식별자 (읽기 전용) |
orderNumber | string | 아니오 | 읽기 쉬운 주문 번호 (읽기 전용) |
customerId | string | 아니오 | 고객 ID (비회원 주문에는 없음) |
status | string | 아니오 | PENDING, CONFIRMED, PROCESSING, SHIPPED, DELIVERED, CANCELLED, REFUNDED |
paymentStatus | string | 아니오 | pending, paid, refunded, failed |
paymentMethod | string | 아니오 | 사용된 결제 수단 (예: stripe, cod) |
total | integer | 아니오 | 총액 (센트 단위, 읽기 전용) |
items | OrderLine[] | 아니오 | 항목 배열 (읽기 전용) |
shippingAddress | Address | 아니오 | 배송 주소 객체 |
fulfillmentType | string | 아니오 | shipping, pickup, delivery 또는 digital |
createdAt | datetime | 아니오 | ISO 8601 타임스탬프 (읽기 전용) |
updatedAt | datetime | 아니오 | ISO 8601 타임스탬프 (읽기 전용) |
쿼리 매개변수 (목록)
| 필드 | 유형 | 필수 | 설명 |
|---|---|---|---|
page | integer | 아니오 | 페이지 번호 (기본값: 1) |
limit | integer | 아니오 | 페이지당 항목 수 (기본값: 20, 최대: 100) |
예시
최근 주문 목록 조회
curl "https://api.mercozy.com/api/v1/external/orders?page=1&limit=10" \
-H "X-API-Key: mk_live_your_key_here"주문 상태 업데이트
curl -X PUT "https://api.mercozy.com/api/v1/external/orders/ord_abc123/status" \
-H "X-API-Key: mk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"status": "shipped"
}'배송 추적 생성
curl -X POST "https://api.mercozy.com/api/v1/external/orders/ord_abc123/shipment" \
-H "X-API-Key: mk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"carrier": "fedex",
"trackingNumber": "7489236401",
"trackingUrl": "https://www.fedex.com/track?id=7489236401"
}'