# 상품 상세

원문: https://commerce.bootpay.ai/api/catalog/detail

> 상품 ID 로 상품 하나를 조회합니다. 상품 목록에는 담기지 않는 옵션 · 재고 · 구독 설정까지 함께 옵니다.

v1 API 상세: [상품](https://commerce.bootpay.ai/api/reference/v1/products)

**상품 ID**로 단일 상품의 상세 정보를 조회합니다. 옵션·재고·구독 설정처럼 [상품 목록](https://commerce.bootpay.ai/api/catalog/list)에는 담기지 않는 값까지 함께 옵니다.

## API 엔드포인트

::: endpoint
method: GET
url: https://api.bootapi.com/v1/products/:product_id
auth: [Basic Auth](https://commerce.bootpay.ai/api/server/authentication)
scope: user:product_detail
:::

## 요청 파라미터

::: parameters

| 파라미터 | 타입 | 필수 | 설명 |
|---------|------|------|------|
| product_id | String | Y | 상품 고유 ID (URL 경로) |

:::

## 코드 예제

::: code-group

```bash [cURL]
curl -X GET "https://api.bootapi.com/v1/products/67c95e64d01640bb9859c629" \
  -H "Authorization: Basic {base64(client_key:secret_key)}"
```

```javascript [Node.js]
import { BootpayCommerce } from '@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.product.productDetail('67c95e64d01640bb9859c629')
console.log(response)
```

```python [Python]
from bootpay_backend import BootpayCommerce

commerce = BootpayCommerce(
    client_key='your-commerce-client-key',
    secret_key='your-commerce-secret-key',
    mode='production'
)

response = commerce.product.product_detail('67c95e64d01640bb9859c629')
print(response)
```

```php [PHP]
use Bootpay\ServerPhp\BootpayCommerceApi;

$commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
$response = $commerce->product->productDetail('67c95e64d01640bb9859c629');
print_r($response);
```

```java [Java]
import 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.product.detail("67c95e64d01640bb9859c629");
System.out.println(response);
```

```ruby [Ruby]
require 'bootpay'

commerce = BootpayStore::RestClient.new(client_key: 'your-commerce-client-key', secret_key: 'your-commerce-secret-key')
response = commerce.product_detail(product_id: '67c95e64d01640bb9859c629')
puts response.data
```

```go [Go]
import "github.com/bootpay/backend-go/v2"

commerce := bootpay.NewCommerceAPI("your-commerce-client-key", "your-commerce-secret-key", nil, "production")
response, err := commerce.Product.Detail("67c95e64d01640bb9859c629")
fmt.Println(response, err)
```

```csharp [.NET]
using Bootpay.Commerce;

var commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
var response = await commerce.ProductDetail("67c95e64d01640bb9859c629");
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

:::

## 응답

```json
{
  "product_id": "67c95e64d01640bb9859c629",
  "name": "프리미엄 원두 1kg",
  "display_price": 29900,
  "status_sale": true,
  "status_display": true,
  "stock": 120
}
```

## 응답 파라미터

| 파라미터 | 타입 | 설명 |
|---------|------|------|
| product_id | String | 상품 고유 ID |
| name | String | 상품명 |
| display_price | Number | 판매가 (표시가) |
| status_sale | Boolean | 판매 중 여부 |
| status_display | Boolean | 쇼핑몰 전시 여부 |
| stock | Integer | 재고 수량 |

## 에러 코드

::: info 공통 에러
인증·권한 관련 에러는 [에러 코드표](https://commerce.bootpay.ai/api/reference/codes#커머스-api-인증-에러)를 참고합니다.
:::

::: error-codes

| 코드 | 메시지 | 대처 방법 |
|------|--------|-----------|
| `PRODUCT_NOT_FOUND` | 존재하지 않는 상품입니다 | `product_id`가 맞는지 확인합니다. 임시저장·판매금지·심사 대기 상품도 이 코드가 옵니다 |
| `MALL_INACTIVE` | 접근가능한 쇼핑몰이 아닙니다. 쇼핑몰 관리자에게 문의해주세요. | 쇼핑몰 운영 상태를 확인합니다 |

:::

## 함께 보기

- [상품 목록](https://commerce.bootpay.ai/api/catalog/list) — 목록에서 `product_id`를 얻습니다
- [상품 수정](https://commerce.bootpay.ai/api/catalog/update) — 조회한 값을 바탕으로 수정합니다
