# Get scheduled payments by billing key API

### Gets scheduled payments by billing key (customer\_uid).

## Gets scheduled payments by billing key (customer\_uid).

<mark style="color:blue;">`GET`</mark> `https://api.iamport.kr/subscribe/payments/schedule/customers/{customer_uid}`

Returns scheduled payments using pagination (up to 3 months period).

#### Path Parameters

| Name                                            | Type   | Description                                     |
| ----------------------------------------------- | ------ | ----------------------------------------------- |
| customer\_uid<mark style="color:red;">\*</mark> | String | <mark style="color:red;">**Billing key**</mark> |

#### Query Parameters

| Name                                   | Type    | Description                                                                                                                                                                 |
| -------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| page                                   | integer | <p><strong>Search result paging</strong></p><p>Starts at 1 (default: 1)</p>                                                                                                 |
| from<mark style="color:red;">\*</mark> | integer | <p><mark style="color:red;"><strong>Search start time</strong></mark> </p><p>UNIX timestamp</p>                                                                             |
| to<mark style="color:red;">\*</mark>   | integer | <p><mark style="color:red;"><strong>Search end time</strong></mark> </p><p>UNIX timestamp</p>                                                                               |
| schedule-status                        | String  | <p><strong>Schedule status</strong> </p><p>If not specified, returns for all status</p><p><code>scheduled</code></p><p><code>executed</code></p><p><code>revoked</code></p> |

{% tabs %}
{% tab title="200: OK Success" %}
{% tabs %}
{% tab title="ScheduleResponse" %}
**`code`** <mark style="color:red;">**\***</mark>**&#x20;**<mark style="color:purple;">**integer**</mark>

**Response code**

0: success, Not 0: check the message

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

**Response message**

A non-zero code includes a message like 'Invalid payment info'.

**`response`** <mark style="color:red;">**(Array\[ScheduleResultAnnotation], optional**</mark>
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="ScheduleResultAnnotation" %}
**`code`** <mark style="color:red;">**\***</mark> <mark style="color:purple;">**integer**</mark>

**Response code**

0: success, Not 0: check the message

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

**Response message**

A non-zero code includes a message like 'Invalid payment info'.

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

**Billing key**

**`merchant_uid`  \* &#x20;**<mark style="color:green;">**string**</mark>

**Order ID**

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

**i'mport transaction UID**

**`schedule_at`**  <mark style="color:red;">**\***</mark>  <mark style="color:blue;">**UNIX timestamp**</mark>&#x20;

**Payment scheduled at**

**`executed_at`** <mark style="color:red;">**\***</mark>  <mark style="color:blue;">**UNIX timestamp**</mark>

**Payment started at**

**`revoked_at`** <mark style="color:red;">**\***</mark>  <mark style="color:blue;">**UNIX timestamp**</mark>

**Payment cancelled at**&#x20;

**`amount`** <mark style="color:red;">**\***</mark> <mark style="color:purple;">**integer**</mark>

**Payment amount**

**`name`**  <mark style="color:green;">**string**</mark>

**Product name**

**`buyer_name`**  <mark style="color:green;">**string**</mark>

**Customer name**

**`buyer_email`**  <mark style="color:green;">**string**</mark>

**Customer email**<br>

**`buyer_tel`**  <mark style="color:green;">**string**</mark>

**Customer phone number**

**`buyer_addr`**  <mark style="color:green;">**string**</mark>

**Customer address**

**`buyer_postcode`**  <mark style="color:green;">**string**</mark>

**Customer zip code**

**`custom_data`**  <mark style="color:green;">**string**</mark>

**Echo data as JSON string**

**`schedule_status`**  <mark style="color:red;">**\***</mark>**&#x20;** <mark style="color:green;">**string**</mark>

**Status of scheduled payment**&#x20;

* `scheduled` (payment is scheduled for execution)
* `executed` (payment is completed)
* `revoked` (payment is cancelled)

**`payment_status`** <mark style="color:red;">**\***</mark>**&#x20;** <mark style="color:green;">**string**</mark>

**Payment approval state**&#x20;

* `null`: Scheduled payment has not executed yet (actual null value, not string)
* `paid`: Scheduled payment is approved
* `failed`: Scheduled payment approval failed
* `cancelled`: Scheduled payment is refunded (cancelled) after approval

**`fail_reason`**  <mark style="color:green;">**string**</mark>

**Reason for failure**&#x20;
{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="400: Bad Request Invalid parameter" %}

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

{% endtab %}

{% tab title="401: Unauthorized Missing or invalid access token" %}

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

{% endtab %}
{% endtabs %}

<details>

<summary>Response Model Schema</summary>

```json
{
  "code": 0,
  "message": "string",
  "response": [
    {
      "customer_uid": "string",
      "merchant_uid": "string",
      "imp_uid": "string",
      "schedule_at": "0",
      "executed_at": "0",
      "revoked_at": "0",
      "amount": 0,
      "name": "string",
      "buyer_name": "string",
      "buyer_email": "string",
      "buyer_tel": "string",
      "buyer_addr": "string",
      "buyer_postcode": "string",
      "custom_data": "string",
      "schedule_status": "scheduled",
      "payment_status": "paid",
      "fail_reason": "string"
    }
  ]
}
```

</details>

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

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