# 결제 URL 생성하기

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

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

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

### 1. 개요

본 문서는 포트원에서 제공하는 결제 URL 생성 API 명세를 기술합니다. 포트원 서비스를 이용중인 가맹점은 해당 서비스를 제약없이 이용 가능합니다.

### 2. API URI

해당 API는 REST 방식으로 구현되어 인터넷 웹 서비스의 형태로 제공됩니다.

> **HTTP Method : POST**
>
> **Content-Type : application/json;charset=UTF-8**

{% tabs %}
{% tab title="운영" %}
{% code title="URI" %}

```
https://api.iamport.co/api/supplements/v1/link/payment
```

{% endcode %}
{% endtab %}
{% endtabs %}

### 3. 설명

결제가 가능한 URL을 생성하여 고객이 해당 URL에 접근하여 결제를 진행 할 수 있습니다. PG사가 지원하는 모든 결제수단 지원이 가능하며 설정한 시간이 만료된 경우 해당 URL 접근시 결제를 진행할 수 없습니다.

### 4. 요청 메세시 상세

## 결제URL을 생성합니다.

<mark style="color:green;">`POST`</mark> `https://api.iamport.co/api/supplements/v1/link/payment`

HTTP Method : POST

Content-Type : Application.<mark style="color:red;">json</mark>;charset=UTF-8

#### Request Body

| Name                                            | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| title<mark style="color:red;">\*</mark>         | String  | <mark style="color:red;">브릿지 페이지 노출문구</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| user\_code<mark style="color:red;">\*</mark>    | String  | <mark style="color:red;">가맹점식별코드</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| amount<mark style="color:red;">\*</mark>        | integer | <mark style="color:red;">결제금액</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| merchant\_uid<mark style="color:red;">\*</mark> | String  | <mark style="color:red;">주문번호</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| name<mark style="color:red;">\*</mark>          | String  | <mark style="color:red;">제품명</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| tax\_free                                       | integer | 면세금액                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| currency<mark style="color:red;">\*</mark>      | String  | <mark style="color:red;">통화구분코드</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| language                                        | String  | <p>실 결제창 표기언어</p><p>-ko</p><p>-en</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| buyer\_name                                     | String  | 주문자명                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| buyer\_tel<mark style="color:red;">\*</mark>    | String  | <mark style="color:red;">주문자연락처</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| buyer\_addr                                     | String  | 주문자주소                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| buyer\_email                                    | String  | 주문자 이메일주                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| buyer\_postcode                                 | String  | 주문자 우편번호                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| custom\_data                                    | Object  | 에코항목                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| notice\_url                                     | String  | 결제결과(성공거래)를 수신받을 URL(웹훅)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| expire\_at<mark style="color:red;">\*</mark>    | String  | <mark style="color:red;">페이지 만료시각</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| display\_language                               | String  | <p>브릿지 페이지 표기언어</p><p>-ko : 한국어</p><p>-en : 영어</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| pay\_methods<mark style="color:red;">\*</mark>  | Object  | <p><strong>pg</strong> <mark style="color:green;"><strong>string</strong></mark></p><p>pg사 구분코드</p><p><a data-mention href="/pages/XgvfZ3VUkC5xP3cOykM9#undefined">/pages/XgvfZ3VUkC5xP3cOykM9#undefined</a></p><p><strong>pay\_method</strong> <mark style="color:green;"><strong>string</strong></mark></p><p>결제수단 구분코드</p><p><a data-mention href="/pages/XgvfZ3VUkC5xP3cOykM9#undefined">/pages/XgvfZ3VUkC5xP3cOykM9#undefined</a></p><p><strong>label</strong> <mark style="color:green;"><strong>string</strong></mark></p><p>브릿지페이지 결제수단 표현값</p> |

{% tabs %}
{% tab title="200: OK 성공" %}
{% code title="json" %}

```json
{
    "shortenedUrl": "https://dev.impay.link/4bdf239e"  //결제링크 생성 
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

**#요청 JSON 전문 예시**

{% code title="json" %}

```
{
    "payment_info": "{\"title\":\"테스트가맹점\",\"user_code\":\"imp68124833\",\"amount\":10000,\"merchant_uid\":\"merchant_1630665784552\",\"name\":\"결제링크 테스트\",\"tax_free\":\"면세공급가액\",\"currency\":\"KRW\",\"language\":\"ko\",\"buyer_name\":\"\",\"buyer_tel\":\"\",\"buyer_addr\":\"\",\"buyer_email\":\"\",\"buyer_postcode\":\"\",\"custom_data\":\"json_object\",\"notice_url\":\"결제 결과를 받을 url\",\"pay_methods\":[{\"pg\":\"INIpayTest\",\"pay_method\":\"card\",\"label\":\"신용/체크카드\"},{\"pg\":\"INIpayTest\",\"pay_method\":\"naverpay\",\"label\":\"네이버페이\"},{\"pg\":\"INIpayTest\",\"pay_method\":\"kakaopay\",\"label\":\"카카오페이\"},{\"pg\":\"INIpayTest\",\"pay_method\":\"phone\",\"label\":\"핸드폰 소액결제\"},{\"pg\":\"INIpayTest\",\"pay_method\":\"trans\",\"label\":\"계좌이체\"},{\"pg\":\"INIpayTest\",\"pay_method\":\"vbank\",\"label\":\"가상계좌\"}]}",
    "expired_at": 1634324016
}
```

{% endcode %}

**#결제(브릿지) 페이지 화면 예시**

{% tabs %}
{% tab title="결제(브릿지) 페이지" %}
**결제 URL API 요청이 성공한경우 응답 URL 렌더링 화면 예시입니다.**

![결제 URL 페이지 화면](/files/DGb0yItotPcGyIS4CoFC)
{% endtab %}

{% tab title=" 만료(브릿지) 화면" %}
**결제 URL 페이지 만료시각(expire\_at)이 지난 경우 표시되는 화면입니다.**

![결제 URL만료 화면](/files/5qgBf6swSPZwezwpBrsu)
{% endtab %}
{% endtabs %}

### 5.결제 URL 비활성화 방법

**응답**(**shortenedUrl**) **URL 마지막 String 을 결제 URI API 주소 뒤에 삽입하여 호출**

> \*\*HTTP Method : \*\*<mark style="color:red;">**PUT**</mark>

{% hint style="success" %}
**API 응답이 아래와 같은경우**

{

"**shortenedUrl**": "[https://dev.impay.link/<mark style="color:red;">**4bdf239e**</mark>](https://dev.impay.link/**4bdf239e**)"

}

[https://api.iamport.co/api/supplements/v1/link/payment/](https://api.iamport.co/api/supplements/v1/link/payment/%7BGUID%7D)<mark style="color:red;">**4bdf239e**</mark>

위와 같이 호출시 결제 URL 즉시 비활성화 처리됩니다.
{% endhint %}

{% hint style="danger" %}
**결제결과 획득방법**

**결제 URL API로 진행된 결제는 오직 웹훅으로만 결제 결과를 수신받을수 있습니다.**

웹훅은 결제가 성공한 경우에만 발송되기 때문에 해당 서비스를 이용하실때는 오직 승인된 결과만 받아보면문제가 없는 서비스에 한하여 해당 API를 이용하시기 바랍니다.
{% 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/etc/url.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.
