주문번호(order_number)로 단일 주문의 상세 정보를 조회해요.
API 엔드포인트
URL 경로에는 주문 목록 응답의 order_number(예: 25071182085082524116)를 넣어요. order_id(예: 68707c59b0eacea5cd974efd)를 넣으면 ORDER_NOT_FOUND가 돌아와요.
Bootpay-User-JWT 또는 secretKey 인증의 user_id를 보내면 그 회원의 주문만 조회하고 charge_key는 응답에서 제외돼요. 회원을 지정하지 않으면 가맹점 서버가 프로젝트 주문을 조회해요. 필드·오류 전체는 주문 API 원문을 확인해요.
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
order_number |
String | 필수 | 주문번호 (URL 경로) |
user_id |
String | 선택 | 구매자 조회에 사용할 회원 ID 또는 가맹점 회원 ID (쿼리) |
코드 예제
const { BootpayCommerce } = require('@bootpay/backend-js')
const commerce = new BootpayCommerce({
client_key: 'your-commerce-client-key',
secret_key: 'your-commerce-secret-key',
mode: 'production'
})
const response = await commerce.order.detail('25071182085082524116')
console.log(response)javascriptfrom bootpay_backend import BootpayCommerce
commerce = BootpayCommerce(
client_key='your-commerce-client-key',
secret_key='your-commerce-secret-key',
mode='production'
)
response = commerce.order.detail('25071182085082524116')
print(response)pythonuse Bootpay\ServerPhp\BootpayCommerceApi;
$commerce = new BootpayCommerceApi('your-commerce-client-key', 'your-commerce-secret-key');
$response = $commerce->order->detail('25071182085082524116');
print_r($response);phpimport kr.co.bootpay.store.BootpayStore;
import kr.co.bootpay.store.model.request.TokenPayload;
import kr.co.bootpay.store.model.response.BootpayStoreResponse;
TokenPayload tp = new TokenPayload("your-commerce-client-key", "your-commerce-secret-key");
BootpayStore commerce = new BootpayStore(tp).withToken();
BootpayStoreResponse response = commerce.order.detail("25071182085082524116");
System.out.println(response);javarequire 'bootpay'
commerce = BootpayStore::RestClient.new(client_key: 'your-commerce-client-key', secret_key: 'your-commerce-secret-key')
response = commerce.order_detail(
order_number: '25071182085082524116'
)
puts responserubyimport "github.com/bootpay/backend-go/v2"
commerce := bootpay.NewCommerceApi("your-commerce-client-key", "your-commerce-secret-key")
response, err := commerce.Order.Detail("25071182085082524116")
fmt.Println(response)gousing Bootpay.Commerce;
var commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
var response = await commerce.Order.Detail("25071182085082524116");
Console.WriteLine(response);csharp응답
성공 응답
{
"order_name": "Professional 플랜",
"order_number": "25071182085082524116",
"request_id": "your-order-draft-id",
"price": 29900,
"tax_free_price": 0,
"status": "payment_completed",
"receipt_status": "receipt_success",
"receipt_id": "68707c598bbe23d076af189c",
"purchased_at": "2025-07-11T10:30:00Z",
"user": {
"user_id": "67e4b4425ec892162491d0ec",
"name": "홍길동",
"email": "user@example.com",
"phone": "01012345678"
},
"result_data": {
"receipt_id": "receipt_abc123",
"method_name": "카드결제",
"card_name": "삼성카드",
"card_no": "9430-****-****-1234"
},
"products": [
{
"product_id": "67c95e64d01640bb9859c629",
"name": "Professional 플랜",
"quantity": 1,
"price": 29900
}
],
"order_purchases": [
{
"order_purchase_id": "6870824fb0eacea5cd974f12",
"order_purchase_number": "P25071182085082524116",
"status": 4,
"delivery_company_code": "CJGLS",
"tracking_number": "620148310301",
"d_ts": 3,
"sent_at": "2025-07-12T09:10:00Z",
"tracking_histories": [
{
"trakler_status": "in_transit",
"delivery_tracking_status": 3,
"location": "옥천HUB",
"description": "간선상차 · CJ대한통운",
"occurred_at": "2025-07-12T21:40:00Z",
"source": "webhook"
}
]
}
],
"created_at": "2025-07-11T10:25:00Z"
}json응답은 값이 없는(null) 필드를 지우고 보내요. 예를 들어 배송 완료 전 발주에는 delivered_at 키가 없고, 구독이 아닌 주문에는 order_subscriptions 키가 없어요.
에러 응답
HTTP 상태 코드(404)는 헤더로 오고, 본문에는 코드 이름이 문자열로 와요.
{
"error_code": "ORDER_NOT_FOUND",
"message": "주문내역을 찾지 못했습니다."
}json응답 필드 설명
| 필드 | 타입 | 설명 |
|---|---|---|
order_name |
String | 주문명 |
order_number |
String | 주문 번호 |
request_id |
String | 주문서 요청 때 넘긴 가맹점 식별자 |
price |
Integer | 결제 금액 |
status |
String | 주문 상태 — 아래 표 참고 |
receipt_status |
String | 결제(영수증) 상태 — 커머스 Enum 참고 |
receipt_id |
String | 결제 영수증 ID |
purchased_at |
String | 결제 완료 시각 |
user |
Object | 구매자 정보 (user_id·name·email·phone 등) |
result_data |
Object | 결제 결과 상세 (카드사, 카드번호 등) |
products |
Array | 주문 상품 목록 |
order_purchases |
Array | 발주(배송) 목록 — 아래 표 참고. 배송이 없는 주문이면 빈 배열 |
order_subscriptions |
Array | 구독 계약 목록 (구독 주문인 경우만. 아니면 키가 없어요) |
charge_key |
String | 수시결제 재결제 키. 회원을 지정하지 않은 가맹점 서버 조회에서만 올 수 있어요. 서버에만 보관해요 |
주문 문서 ID(order_id)는 주문 목록 응답에만 있어요. 상세·웹훅에서는 order_number 로 주문을 맞춰요.
발주(배송) 필드
한 주문이 여러 건으로 나뉘어 나가면 order_purchases도 그만큼 늘어요. 운송장은 발주 단위예요.
| 필드 | 타입 | 설명 |
|---|---|---|
order_purchase_id |
String | 발주 고유 ID |
order_purchase_number |
String | 발주 번호 |
status |
Integer | 발주 상태 — 커머스 Enum 참고 |
delivery_company_code |
String | 택배사 코드 |
tracking_number |
String | 운송장 번호 |
d_ts |
Integer | 배송추적 상태 — 커머스 Enum 참고 |
sent_at |
String | 발송 처리 시각 |
delivered_at |
String | 배송 완료 시각 |
tracking_histories |
Array | 추적 단계 이력 (최신 순) |
status는 가맹점이 처리한 단계(발주 확인·발송 처리)고, d_ts는 택배사가 알려준 단계(집화·배송 완료)예요.
운송장을 등록하기 전에는 d_ts가 0(추적 없음)이에요.
결제(영수증) 상태 (receipt_status)
자주 쓰는 값만 추렸어요. 전체 값은 결제(영수증) 상태에 있어요. 응답의 상태 값은 영문 enum 문자열이에요.
| 키 | 값 | 설명 |
|---|---|---|
receipt_ready |
0 |
결제 준비 (미결제) |
receipt_success |
1 |
결제 성공 |
receipt_issued |
5 |
발행 완료 (가상계좌 등) |
receipt_cancelled |
20 |
결제 취소 |
receipt_fail |
-1 |
결제 실패 |
주문 상태 코드 (status)
| 키 | 값 | 설명 |
|---|---|---|
order_pending |
0 |
주문 생성, 결제 대기 |
payment_pending |
1 |
결제 진행 중 |
payment_completed |
2 |
결제 완료 |
subscription_request_completed |
3 |
구독 요청 완료 |
subscription_pending |
4 |
구독 대기 |
payment_delayed |
5 |
결제 지연 |
payment_confirm_ready |
6 |
결제 승인 대기 |
purchase_confirmed |
8 |
구매 확정 |
cancellation_completed |
10 |
취소 완료 |
return_completed |
11 |
반품 완료 |
exchange_completed |
12 |
교환 완료 |
subscription_terminated |
13 |
구독 종료 |
order_expired |
-1 |
주문 만료 |
payment_failed |
-2 |
결제 실패 |
payment_authorization_failed |
-3 |
결제 승인 실패 |
subscription_error |
-4 |
구독 오류 |
subscription_server_error |
-5 |
구독 서버 오류 |
order_abandoned |
-100 |
주문 포기 |
에러 코드
인증·권한 관련 에러는 에러 코드표를 참고해요.
| 코드 | 메시지 | 대처 방법 |
|---|---|---|
ORDER_NOT_FOUND |
주문내역을 찾지 못했어요. | order_number를 넣었는지 확인해요 (order_id 아님) |
ORDER_DENIED |
주문 정보를 조회할 권한이 없어요. | API 인증 권한을 확인해요 |
