# Generate payment URL

### 1. Overview

This document describes i'mport payment URL generation API specification. i'mport Merchants can use the service without any restrictions.

### 2. API URI

Payment API is exposed as REST web service.

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

{% tabs %}
{% tab title="Development" %}
{% code title="URI" %}

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

{% endcode %}
{% endtab %}

{% tab title="Prod" %}
{% code title="URI" %}

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

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

### 3. Description

Customers can access the generated payment URL to make a payment. It supports all payment methods supported by the PG. When the link expires, payment is no longer available.

### 4. Request message specification

## Creates a payment 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;">Title of the bridge page</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| user\_code<mark style="color:red;">\*</mark>    | String  | <mark style="color:red;">Merchant ID</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| amount<mark style="color:red;">\*</mark>        | integer | <mark style="color:red;">Amount</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| merchant\_uid<mark style="color:red;">\*</mark> | String  | <mark style="color:red;">Order ID</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| name<mark style="color:red;">\*</mark>          | String  | <mark style="color:red;">Product name</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| tax\_free                                       | integer | Tax free amount                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| currency<mark style="color:red;">\*</mark>      | String  | <mark style="color:red;">Currency code</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| language                                        | String  | <p>Payment window language</p><p>-ko</p><p>-en</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| buyer\_name                                     | String  | Customer name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| buyer\_tel<mark style="color:red;">\*</mark>    | String  | <mark style="color:red;">Customer phone</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| buyer\_addr                                     | String  | Customer address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| buyer\_email                                    | String  | Customer email                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| buyer\_postcode                                 | String  | Customer zip                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| custom\_data                                    | Object  | Custom data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| notice\_url                                     | String  | Notification URL to receive payment result                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| expire\_at<mark style="color:red;">\*</mark>    | String  | <mark style="color:red;">Page expiration</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| display\_language                               | String  | <p>Bridge page language</p><p>-ko : Korean</p><p>-en : English</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| pay\_methods<mark style="color:red;">\*</mark>  | Object  | <p><strong>pg  </strong><mark style="color:red;"><strong>*</strong></mark><strong> </strong><mark style="color:green;"><strong>string</strong></mark></p><p>PG code</p><p><a data-mention href="../../sdk/javascript-sdk/rps#undefined">#undefined</a></p><hr><p><strong>pay\_method </strong><mark style="color:red;"><strong>*</strong></mark> <mark style="color:green;"><strong>string</strong></mark></p><p>Payment method code</p><p><a data-mention href="../../sdk/javascript-sdk/rps#undefined">#undefined</a></p><hr><p><strong>label  </strong><mark style="color:red;"><strong>\*</strong></mark><strong> </strong><mark style="color:green;"><strong>string</strong></mark></p><p>Payment method shown on bridge page</p> |

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

```json
{
    "shortenedUrl": "https://dev.impay.link/4bdf239e"  //Create payment link 
}
```

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

**#Sample JSON request message**

{% code title="json" %}

```
{
    "payment_info": "{\"title\":\"Test merchant\",\"user_code\":\"imp68124833\",\"amount\":10000,\"merchant_uid\":\"merchant_1630665784552\",\"name\":\"payment link test\",\"tax_free\":\"tax free amount\",\"currency\":\"KRW\",\"language\":\"ko\",\"buyer_name\":\"\",\"buyer_tel\":\"\",\"buyer_addr\":\"\",\"buyer_email\":\"\",\"buyer_postcode\":\"\",\"custom_data\":\"json_object\",\"notice_url\":\"notification url\",\"pay_methods\":[{\"pg\":\"INIpayTest\",\"pay_method\":\"card\",\"label\":\"credit/check card\"},{\"pg\":\"INIpayTest\",\"pay_method\":\"naverpay\",\"label\":\"Naver Pay\"},{\"pg\":\"INIpayTest\",\"pay_method\":\"kakaopay\",\"label\":\"Kakao Pay\"},{\"pg\":\"INIpayTest\",\"pay_method\":\"phone\",\"label\":\"mobile micropayment\"},{\"pg\":\"INIpayTest\",\"pay_method\":\"trans\",\"label\":\"account transfer\"},{\"pg\":\"INIpayTest\",\"pay_method\":\"vbank\",\"label\":\"virtual account\"}]}",
    "expired_at": 1634324016
}
```

{% endcode %}

**#Sample payment (bridge) page**

{% tabs %}
{% tab title="Payment (bridge) page" %}
**Sample response URL page displayed when payment URL API request is successful.**

![Payment URL page](https://2814812280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTv8JEzyM5h4cYcL5StH%2Fuploads%2Fr1J917SBgZjw6LdIMb46%2Fimage.png?alt=media)
{% endtab %}

{% tab title=" Expired (bridge) page" %}
**Sample page displayed for an expired payment URL page (expire\_at exceeded).**

![Payment URL expired page](https://2814812280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTv8JEzyM5h4cYcL5StH%2Fuploads%2FNGLDruy6srP7vdrVndFJ%2Fimage.png?alt=media)
{% endtab %}
{% endtabs %}

### 5. Disabling payment URL

**Append the last part of the response** (**shortenedUrl**) **URL to the payment URI API address and call it.**

> **HTTP Method :&#x20;**<mark style="color:red;">**PUT**</mark>

{% hint style="success" %}
**For the following API response**

{

&#x20;       "**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>

Call the above payment URL to disable it.
{% endhint %}
