# 링크페이 상세 조회

원문: https://commerce.bootpay.ai/api/link-payment/detail

> 링크페이 ID 로 링크페이 한 건을 조회합니다. 고객 정보 · 결제 금액 · 담긴 상품과 함께 결제 가능 · 주문 완료 · 만료 같은 상태가 옵니다.

링크페이 ID로 링크페이 한 건의 상세 정보를 조회합니다. 고객 정보, 결제 금액, 상품 구성, 결제 상태가 함께 옵니다.

## API 엔드포인트

::: endpoint
method: GET
url: https://api.bootapi.com/v1/invoices/:invoice_id
auth: [Basic Auth](https://commerce.bootpay.ai/api/server/authentication)
:::

## 요청 파라미터

::: parameters

| 파라미터 | 타입 | 필수 | 설명 |
|---------|------|------|------|
| invoice_id | String | Y | 링크페이 ID (URL 파라미터) |

:::

## 코드 예제

::: code-group

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

```javascript [Node.js]
import { BootpayCommerce } from '@bootpay/backend-js';

const commerce = new BootpayCommerce({
    client_key: '{client_key}',
    secret_key: '{secret_key}'
});

const response = await commerce.invoice.detail('687a1b2c3d4e5f6789012345');
console.log(response);
```

```python [Python]
from bootpay_backend.commerce import BootpayCommerce

commerce = BootpayCommerce('{client_key}', '{secret_key}')
response = commerce.invoice.detail('687a1b2c3d4e5f6789012345')
print(response)
```

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

$commerce = new BootpayCommerceApi("{client_key}", "{secret_key}");
$response = $commerce->invoice->detail('687a1b2c3d4e5f6789012345');
print_r($response);
```

```java [Java]
import kr.co.bootpay.store.BootpayStore;
import kr.co.bootpay.store.model.request.TokenPayload;

TokenPayload tokenPayload = new TokenPayload("{client_key}", "{secret_key}");
BootpayStore commerce = new BootpayStore(tokenPayload).withToken();
var response = commerce.invoice.detail("687a1b2c3d4e5f6789012345");
System.out.println(response.getData());
```

```ruby [Ruby]
require 'bootpay'

commerce = BootpayStore::RestClient.new(client_key: '{client_key}', secret_key: '{secret_key}')
response = commerce.invoice_detail(
  invoice_id: '687a1b2c3d4e5f6789012345'
)
puts response.data
```

```go [Go]
commerce := bootpay.NewCommerceAPI("{client_key}", "{secret_key}", nil, "production")
response, err := commerce.Invoice.Detail("687a1b2c3d4e5f6789012345")
fmt.Println(response, err)
```

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

var commerce = new BootpayCommerceApi("{client_key}", "{secret_key}");
var response = await commerce.InvoiceDetail("687a1b2c3d4e5f6789012345");
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

:::

## 응답

#### 성공 응답

주요 필드만 추린 예시입니다. 이 밖에 `user`(고객 정보)·`invoice_items`(담긴 상품)·`order_number`(결제된 경우) 가 함께 옵니다.

```json
{
  "invoice_id": "687a1b2c3d4e5f6789012345",
  "name": "프리미엄 서비스 결제",
  "price": 50000,
  "status": "invoice_available",
  "user_id": "68707c59b0eacea5cd974efd",
  "invoice_url": "https://i.bootpay.co.kr/i/{client_key}/687a1b2c3d4e5f6789012345",
  "expired_at": "2025-07-18T23:59:59+09:00"
}
```

## 링크페이 상태 (`status`)

| 키 | 값 | 설명 |
|----|----|------|
| `invoice_available` | `1` | 결제 가능 (링크 생성 후 결제 대기) |
| `invoice_order_completed` | `2` | 주문 완료 (고객이 결제를 완료) |
| `invoice_order_cancelled` | `3` | 주문 취소 |
| `invoice_deleted` | `-1` | 판매자가 삭제 |
| `invoice_expired` | `-2` | 유효기간이 지난 링크 |
| `invoice_product_unavailable` | `-3` | 판매 불가 상품이 포함됨 |
| `invoice_abandoned` | `-10` | 고객이 결제하지 않고 이탈 |

## 에러 코드

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

::: error-codes

| 코드 | 메시지 | 대처 방법 |
|------|--------|-----------|
| `INVOICE_NOT_FOUND` | 링크페이 정보가 없습니다 | invoice_id를 확인합니다 |
| `INVOICE_DENIED` | 링크페이 정보에 조회권한이 없는 회원세션입니다 | 올바른 API 키를 사용하고 있는지 확인합니다 |

:::
