# 갱신 옵션

`GET /account/api/v1/renewals/options`

## 권한 인증

`Authorization: Bearer YOUR_ARNPROXY_API_KEY`

`Accept: application/json`

필요한 권한: `read`

## 매개변수

| 이름 | 유형 | 필수 / 조건부 | 기본값 | 설명 |
|---|---|---|---|---|
| `after_id` (query) | integer | 선택 | `0` | 이전 응답의 next_after_id를 사용하세요. ID 오름차순 커서이며 시작은 0입니다. |
| `limit` (query) | integer | 선택 | `25` | 1~100, 기본 25. |

## 요청 예제

### curl

```curl
printf 'Authorization: Bearer %s\n' "$ARNPROXY_API_KEY" |
  curl --silent --show-error --header @- \
    --header 'Accept: application/json' \
    --connect-timeout 10 --max-time 30 \
    'https://www.arnproxy.com/account/api/v1/renewals/options'
```

### python

```python
import os, requests

headers = {"Authorization": "Bearer " + os.environ["ARNPROXY_API_KEY"]}
response = requests.get(
    "https://www.arnproxy.com/account/api/v1/renewals/options",
    headers=headers,
    timeout=(10, 30), allow_redirects=False
)
print(response.status_code, response.text)
# No automatic write retry.
```

### javascript

```javascript
const headers = { Authorization: `Bearer ${process.env.ARNPROXY_API_KEY}` };
const response = await fetch("https://www.arnproxy.com/account/api/v1/renewals/options", {
  method: 'GET', headers, redirect: 'error',
  signal: AbortSignal.timeout(30000)
});
console.log(response.status, await response.text());
// A write timeout is ambiguous; query its saved operation.
```

### php

```php
<?php
$headers = ['Accept: application/json',
    'Authorization: Bearer '.getenv('ARNPROXY_API_KEY')];
$ch = curl_init('https://www.arnproxy.com/account/api/v1/renewals/options');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_FOLLOWLOCATION => false,
    CURLOPT_SSL_VERIFYPEER => true, CURLOPT_SSL_VERIFYHOST => 2,
    CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 30,
]);
$result = curl_exec($ch);
if ($result === false) {
    // Do not repeat a write; use the original operation key.
    throw new RuntimeException('Transport result unknown');
}
echo curl_getinfo($ch, CURLINFO_HTTP_CODE).PHP_EOL.$result;
curl_close($ch);
```

### go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "os"
  "time"
)

func main() {
  client := &http.Client{Timeout: 30*time.Second,
    CheckRedirect: func(req *http.Request, via []*http.Request) error {
      return http.ErrUseLastResponse
    }}
  var body io.Reader
  req, err := http.NewRequest("GET", "https://www.arnproxy.com/account/api/v1/renewals/options", body)
  if err != nil { panic(err) }
  req.Header.Set("Authorization", "Bearer "+os.Getenv("ARNPROXY_API_KEY"))
  res, err := client.Do(req); if err != nil { panic(err) }
  defer res.Body.Close()
  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }
  fmt.Println(res.StatusCode, string(data))
}
```

### csharp

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

using var handler = new HttpClientHandler { AllowAutoRedirect = false };
using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(30) };
using var request = new HttpRequestMessage(HttpMethod.Get,
    "https://www.arnproxy.com/account/api/v1/renewals/options");
request.Headers.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("ARNPROXY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
// Never automatically retry an ambiguous write.
```

### java

```java
import java.net.URI;
import java.net.http.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.*;

// Inside your application method:
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://www.arnproxy.com/account/api/v1/renewals/options"))
    .header("Authorization", "Bearer " + System.getenv("ARNPROXY_API_KEY"))
    .header("Accept", "application/json")
    .GET()
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
```

## 응답 · HTTP 200

```json
{
  "ok": true,
  "data": {
    "items": [
      {
        "id": 12345,
        "endpoint": "192.0.2.10:8080",
        "order_id": 10001,
        "product": {
          "id": 5,
          "name": "IPv4 Proxy"
        },
        "location": {
          "id": 10,
          "name": "Example country"
        },
        "last_service_date": "2030-02-01"
      }
    ],
    "next_after_id": null,
    "periods_by_location": [
      {
        "location_id": 10,
        "periods": [
          {
            "id": 101,
            "name": "7 days",
            "days": 7
          }
        ]
      }
    ],
    "currency": "TRY",
    "timezone": "Europe/Istanbul",
    "max_selected_proxies": 1000,
    "renewal_available": true
  },
  "meta": {
    "request_id": "000000000000000000000001",
    "phase": "public_v1",
    "source": "arnproxy_records"
  }
}
```

| 이름 | 유형 | 조건부 | 설명 |
|---|---|---|---|
| `ok` | boolean | — | 성공 여부. false이면 error.code를 확인하세요. |
| `data` | object | — | 작업별 결과이며 예제는 설명용 합성 데이터입니다. |
| `data.items` | array | — | 현재 페이지 기록 또는 형식화된 연결 문자열. 빈 목록도 유효할 수 있습니다. |
| `data.items[]` | object | — | 현재 페이지 기록 또는 형식화된 연결 문자열. 빈 목록도 유효할 수 있습니다. |
| `data.items[].id` | integer | — | 관련 ARNPROXY 기록 ID. 공급자 내부 ID 대신 사용하세요. |
| `data.items[].endpoint` | string | — | 인증 정보 없는 프록시 IP/호스트 및 선택 포트. 형식을 검증할 수 없으면 null일 수 있습니다. |
| `data.items[].order_id` | integer | — | 관련 ARNPROXY 기록 ID. 공급자 내부 ID 대신 사용하세요. |
| `data.items[].product` | object | — | product의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.items[].product.id` | integer | — | 관련 ARNPROXY 기록 ID. 공급자 내부 ID 대신 사용하세요. |
| `data.items[].product.name` | string | — | name의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.items[].location` | object | — | location의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.items[].location.id` | integer | — | 관련 ARNPROXY 기록 ID. 공급자 내부 ID 대신 사용하세요. |
| `data.items[].location.name` | string | — | name의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.items[].last_service_date` | string | — | 마지막 서비스일: 현재, 이전 또는 견적 예상일. 예상만으로 갱신되지는 않습니다. |
| `data.next_after_id` | integer|null | — | 다음 페이지 커서. null이면 이 결과에 후속 페이지가 없습니다. |
| `data.periods_by_location` | array | — | periods by location의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.periods_by_location[]` | object | — | periods by location의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.periods_by_location[].location_id` | integer | — | 로컬 카탈로그의 위치 또는 제품 유형 ID. |
| `data.periods_by_location[].periods` | array | — | periods의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.periods_by_location[].periods[]` | object | — | periods의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.periods_by_location[].periods[].id` | integer | — | 관련 ARNPROXY 기록 ID. 공급자 내부 ID 대신 사용하세요. |
| `data.periods_by_location[].periods[].name` | string | — | name의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.periods_by_location[].periods[].days` | integer | — | 요금제 기간(일). GB 요금제의 트래픽 양과 별개입니다. |
| `data.currency` | string | — | 계정 거래 통화: TRY 또는 USD. |
| `data.timezone` | string | — | 관련 날짜 필드의 시간대. null이면 검증된 시간대가 없습니다. |
| `data.max_selected_proxies` | integer | — | max selected proxies의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.renewal_available` | boolean | — | 조건/권한에 따른 사용 가능 여부이며 재고나 공급자 보장은 아닙니다. |
| `meta` | object | — | 요청 추적 및 데이터 출처 메타데이터. |
| `meta.request_id` | string | — | 이 HTTP 요청의 추적 ID이며 작업 키나 주문 ID가 아닙니다. |
| `meta.phase` | string | — | phase의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `meta.source` | string | — | 데이터 출처. 로컬 기록과 실시간 공급자 조회는 서로 다른 근거입니다. |

## 동작 및 주요 참고 사항

- 갱신은 기존 사이트 가격 및 잔액 처리를 사용합니다. 같은 renewal_quote에서 금액, 일수, 선택 해시를 복사하세요. 자동 갱신은 켜지지 않습니다.

인증 및 검증 단계에서 실행 전에 요청이 거부될 수 있습니다. 오류 문서를 확인하고 지원 문의용 request_id를 보관하세요. 키나 비밀번호를 보내지 마세요.

[오류 및 제한](https://docs.arnproxy.com/ko/api-v1/errors)
