# 결제 상세내역 조회 API

{% hint style="warning" %}
**Deprecated**

이 문서는 더 이상 관리되지 않습니다.

[PortOne 개발자센터](https://developers.portone.io/)를 이용해주세요.
{% endhint %}

### 복합결제거래 상세정보를 조회합니다.

## 복수의 결제수단으로 거래가 발생된 거래의 상세 금액정보를 확인합니다.

<mark style="color:blue;">`GET`</mark> `https://api.iamport.kr/payments/{imp_uid}/balance`

현재 PAYCO 결제수단에 한해 제공되고 있습니다

#### Path Parameters

| Name                                       | Type   | Description                                  |
| ------------------------------------------ | ------ | -------------------------------------------- |
| imp\_uid<mark style="color:red;">\*</mark> | String | <mark style="color:red;">**포트원 거래번호**</mark> |

{% tabs %}
{% tab title="200: OK 성공" %}
{% tabs %}
{% tab title="PaymentBalanceResponse" %}
**`code`** <mark style="color:red;">**\***</mark> <mark style="color:purple;">**integer**</mark>

**응답코드**

0이면 정상적인 조회, 0 이 아닌 값이면 message를 확인해봐야 합니다

**`message`** <mark style="color:red;">**\***</mark> <mark style="color:green;">**string**</mark>

**응답메세지**

code 값이 0이 아닐 때, '존재하지 않는 결제정보입니다'와 같은 오류 메세지를 포함합니다

**`response`** <mark style="color:red;">**`(PaymentBalanceResponseAnnotation, optional)`**</mark>
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PaymentBalanceResponseAnnotation" %}
**`amount`** <mark style="color:purple;">**`Integer`**</mark>

**`총 결제금액`**

**`cash_receipt`** <mark style="color:red;">**`(PaymentBalanceAnnotation):`**</mark>

**`현금영수증 발급된 금액 상세`**

**`primary`** <mark style="color:red;">**`(PaymentBalanceAnnotation):`**</mark>

**`1차 결제수단`**(신용카드, 계좌이체, 가상계좌, 휴대폰소액결제) 금액 상세

**`secondary`** <mark style="color:red;">**`(PaymentBalanceAnnotation):`**</mark>

**`2차 결제수단`**(PG사포인트, 카드사포인트) 금액 상세

**`discount`** <mark style="color:red;">**`(PaymentBalanceAnnotation):`**</mark>

**`PG사/카드사 자체 할인 금액 상세`**

**`histories`** <mark style="color:red;">**`(Array[PaymentBalanceBaseAnnotation], optional)`**</mark>

**`PaymentBalance 이력`**
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PaymentBalanceAnnotation" %}
**`tax_free`** <mark style="color:purple;">**`integer`**</mark>

**`면세 공급가액`** (환불시 마이너스 차감된 최종 금액 반환)

**`supply`** <mark style="color:purple;">**`integer`**</mark>

**`과세 공급가액`** (환불시 마이너스 차감된 최종 금액 반환)

**`vat`** <mark style="color:purple;">**`integer`**</mark>

**`부가세액`** (환불시 마이너스 차감된 최종 금액 반환)

**`service`** <mark style="color:purple;">**`integer`**</mark>

**`봉사료`** (환불시 마이너스 차감된 최종 금액 반환)
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PaymentBalanceBaseAnnotation" %}
**`cash_receipt`** <mark style="color:red;">**(PaymentBalanceAnnotation):**</mark>

**`현금영수증 발급된 금액 상세`**

**`primary`** <mark style="color:red;">**`(PaymentBalanceAnnotation)`**</mark>

**`1차 결제수단`**(신용카드, 계좌이체, 가상계좌, 휴대폰소액결제) 금액 상세

**`secondary`** <mark style="color:red;">**`(PaymentBalanceAnnotation):`**</mark>

**`2차 결제수단`**(PG사포인트, 카드사포인트) 금액 상세

**`discount`** <mark style="color:red;">**`(PaymentBalanceAnnotation)`**</mark>

**`PG사/카드사 자체 할인 금액 상세`**

**`created`** <mark style="color:purple;">**`integer`**</mark>

**`Balance정보가 등록된 시각 UNIX timestamp`**
{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="401: Unauthorized 인증 Token이 전달되지 않았거나 유효하지 않은 경우" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="404: Not Found 유효하지 않은 imp\_uid" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Response Model Schema</summary>

```json
{
  "code": 0,
  "message": "string",
  "response": {
    "amount": 0,
    "cash_receipt": {
      "tax_free": 0,
      "supply": 0,
      "vat": 0,
      "service": 0
    },
    "primary": {
      "tax_free": 0,
      "supply": 0,
      "vat": 0,
      "service": 0
    },
    "secondary": {
      "tax_free": 0,
      "supply": 0,
      "vat": 0,
      "service": 0
    },
    "discount": {
      "tax_free": 0,
      "supply": 0,
      "vat": 0,
      "service": 0
    },
    "histories": [
      {
        "cash_receipt": {
          "tax_free": 0,
          "supply": 0,
          "vat": 0,
          "service": 0
        },
        "primary": {
          "tax_free": 0,
          "supply": 0,
          "vat": 0,
          "service": 0
        },
        "secondary": {
          "tax_free": 0,
          "supply": 0,
          "vat": 0,
          "service": 0
        },
        "discount": {
          "tax_free": 0,
          "supply": 0,
          "vat": 0,
          "service": 0
        },
        "created": 0
      }
    ]
  }
}
```

</details>

{% hint style="success" %}
**Swagger Test Link**

[**https://api.iamport.kr/#!/payments/balanceByImpUid**](https://api.iamport.kr/#!/payments/balanceByImpUid)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://portone.gitbook.io/docs/api/api-1/api-7.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
