# 주문

> LocalSERP Proxy API: 요금제와 가격, 잔액으로 요금제 구매, 주문 내역. 매개변수, 응답 예시, curl, Python 및 Node.js 코드.

- URL: https://localserpproxy.com/ko/docs/api/orders/
- 마지막 업데이트: 2026-10-15
- Publisher: LocalSERP Proxy (https://localserpproxy.com)

요금제와 가격을 확인하고, 잔액으로 요금제(신규 서비스, 트래픽 추가 또는 포트 연장)를 구매한 다음 이전 주문 내역을 확인하세요.

**이 페이지의 엔드포인트**

- `GET /v1/catalog/products`: 상품, 요금제 및 가격
- `POST /v1/orders`: 잔액으로 요금제 구매(새 서비스, 트래픽 추가 또는 포트 연장)
- `GET /v1/orders`: 주문 목록 보기
- `GET /v1/orders/{orderId}`: 주문 정보 보기

기본 URL `https://localserpproxy.com/api/v1`. 인증, 오류 및 한도는 [API 개요](https://localserpproxy.com/ko/docs/api/)를 참조하세요.

## 상품, 요금제 및 가격

`GET /v1/catalog/products`

주문 시 청구되는 금액 그대로, 모든 상품의 요금제와 가격을 확인하세요.

공개: API 키가 필요하지 않습니다.

**응답** `200 OK`

```json
{
  "data": [
    {
      "id": "residential",
      "name": "Residential proxies",
      "description": "Residential traffic for manual local search, advertising, price and application checks in US cities. State, city and ZIP selection, subject to available exits; no promise of GPS position or rankings.",
      "unit": "GB",
      "plans": [
        {
          "id": "res-10",
          "productId": "residential",
          "name": "Local team",
          "quantity": 10,
          "unit": "GB",
          "durationDays": null,
          "price": "7.50",
          "pricePerUnit": "0.75",
          "popular": false,
          "features": [
            "US city selection, subject to availability",
            "Traffic stays until used",
            "Rotating or sticky sessions"
          ],
          "available": true,
          "countries": null
        }
      ]
    }
  ]
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/catalog/products"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"

r = requests.get(f"{API}/catalog/products", timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/catalog/products`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## 잔액으로 요금제 구매(신규 서비스, 트래픽 추가 또는 포트 연장)

`POST /v1/orders`

선불 잔액으로만 결제됩니다. 가격은 API에서 계산되며(카탈로그 가격 × `quantity`), 잔액에서 차감된 후 서비스가 생성되거나 연장되고 주문이 `completed` 상태로 `fulfillment`와 함께 반환됩니다. 프록시 인증 정보는 즉시 확인할 수 있습니다.

- **신규 레지덴셜 프록시 트래픽**: `{ "planId": "res-10" }`.
- **신규 로테이팅 4G/5G 트래픽(GB당)**: `{ "planId": "mgb-10" }`(`productId: "mobile-gb"`이 포함된 트래픽 구독이며, `fulfillment.residentialSubscriptionId`로 제공됩니다).
- **기존 구독에 트래픽 추가**: `{ "planId": "res-10", "options": { "subscriptionId": "res_9x2m4k" } }`: 요금제는 해당 구독의 상품에 속해야 합니다.
- **신규 모바일 포트**: `{ "planId": "mob-us-30d", "quantity": 1, "options": { "country": "US" } }`, 선택적으로 `carrier` 포함(국가별 통신사는 [모바일 포트](https://localserpproxy.com/ko/docs/api/mobile/)에서 확인). 존 요금제는 해당 존에 속한 국가만 지원합니다(그 외 국가에서는 `options.country`의 `422`).
- **모바일 포트 연장**: `{ "planId": "mob-us-7d", "options": { "portId": "mob_2v8k1q" } }`을 구매하면 요금제 기간이 `expiresAt`에 추가됩니다.

**잔액 부족 → `402 insufficient_balance`**: 부족한 금액과 권장 충전 금액이 `error.details`에 표시됩니다(`missing`, `suggestedTopUp`). 오류가 발생하면 어떤 금액도 차감되지 않습니다. 차액을 결제하려면 `purchase`에서 동일한 요청을 포함해 충전을 시작하세요(`POST /v1/topups`). 충전 금액이 반영되는 즉시 요금제가 구매됩니다.

인증: `Authorization: Bearer API_KEY` 헤더에 API 키를 입력합니다.

**매개변수**

| 이름 | 위치 | 유형 | 필수 | 설명 |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | 아니요 | POST 요청을 안전하게 재시도하기 위한 고유 키(예: UUID). 24 h 동안 보관됩니다. — 최대 128자 |

**요청 본문**

| 필드 | 유형 | 필수 | 설명 |
| --- | --- | --- | --- |
| `planId` | string | 예 | — |
| `quantity` | integer | 아니요 | 1–100, 기본값 `1` |
| `options` | object | 아니요 | — |

*예시: 레지덴셜 프록시*

```json
{
  "planId": "res-10"
}
```

*예시: 모바일 포트*

```json
{
  "planId": "mob-us-30d",
  "quantity": 1,
  "options": {
    "country": "US",
    "carrier": "verizon",
    "autoRenew": true
  }
}
```

*예시: 포트 연장*

```json
{
  "planId": "mob-us-7d",
  "options": {
    "portId": "mob_2v8k1q"
  }
}
```

*예시: 모바일 트래픽*

```json
{
  "planId": "mgb-10"
}
```

*예시: 존 포트*

```json
{
  "planId": "mob-us-30d",
  "options": {
    "country": "US",
    "carrier": "verizon"
  }
}
```

**응답** `201 Created`

```json
{
  "id": "ord_4f8k2m9q",
  "status": "completed",
  "productId": "residential",
  "planId": "res-10",
  "planName": "Local team",
  "quantity": 1,
  "unitPrice": "7.50",
  "subtotal": "7.50",
  "discount": "0.00",
  "total": "7.50",
  "promoCode": null,
  "currency": "USD",
  "topUpId": null,
  "options": {},
  "fulfillment": {
    "residentialSubscriptionId": "res_9x2m4k",
    "mobilePortIds": []
  },
  "createdAt": "2026-10-05T14:03:11Z",
  "paidAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s -X POST "https://localserpproxy.com/api/v1/orders" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"planId":"res-10"}'
```

*Python*

```python
import os, uuid
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}

r = requests.post(f"{API}/orders", headers=HEADERS, json={"planId": "res-10"}, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
import { randomUUID } from 'node:crypto';

const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/orders`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Idempotency-Key': randomUUID(), 'Content-Type': 'application/json' },
  body: JSON.stringify({ planId: 'res-10' }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## 주문 목록

`GET /v1/orders`

인증: `Authorization: Bearer API_KEY` 헤더에 API 키를 입력합니다.

**매개변수**

| 이름 | 위치 | 유형 | 필수 | 설명 |
| --- | --- | --- | --- | --- |
| `page` | query | integer | 아니요 | ≥ 1, 기본값 `1` |
| `perPage` | query | integer | 아니요 | 1–100, 기본값 `20` |
| `status` | query | `completed` · `cancelled` | 아니요 | 주문은 결제가 완료된 상태로 생성됩니다(잔액에서 차감). `completed` — 결제 및 제공 완료(인증 정보 즉시 확인 가능). |
| `productId` | query | string | 아니요 | 카탈로그의 상품 ID입니다. LocalSERP Proxy의 값: `residential`(GB), `mobile`(전용 4G/5G 포트), `mobile-gb`(GB당 로테이팅 4G/5G 트래픽). 클라이언트는 알 수 없는 값도 처리할 수 있어야 합니다. |

**응답** `200 OK`

```json
{
  "data": [
    {
      "id": "ord_4f8k2m9q",
      "status": "completed",
      "productId": "residential",
      "planId": "res-10",
      "planName": "Local team",
      "quantity": 1,
      "unitPrice": "7.50",
      "subtotal": "7.50",
      "discount": "0.00",
      "total": "7.50",
      "promoCode": null,
      "currency": "USD",
      "topUpId": null,
      "options": {},
      "fulfillment": {
        "residentialSubscriptionId": "res_9x2m4k",
        "mobilePortIds": []
      },
      "createdAt": "2026-10-05T14:03:11Z",
      "paidAt": "2026-10-05T14:03:11Z"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 20,
    "total": 1,
    "totalPages": 1
  }
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/orders" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/orders", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/orders`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## 주문 조회

`GET /v1/orders/{orderId}`

인증: `Authorization: Bearer API_KEY` 헤더에 API 키를 입력합니다.

**매개변수**

| 이름 | 위치 | 유형 | 필수 | 설명 |
| --- | --- | --- | --- | --- |
| `orderId` | path | string | 예 | — |

**응답** `200 OK`

```json
{
  "id": "ord_4f8k2m9q",
  "status": "completed",
  "productId": "residential",
  "planId": "res-10",
  "planName": "Local team",
  "quantity": 1,
  "unitPrice": "7.50",
  "subtotal": "7.50",
  "discount": "0.00",
  "total": "7.50",
  "promoCode": null,
  "currency": "USD",
  "topUpId": null,
  "options": {},
  "fulfillment": {
    "residentialSubscriptionId": "res_9x2m4k",
    "mobilePortIds": []
  },
  "createdAt": "2026-10-05T14:03:11Z",
  "paidAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/orders/ord_4f8k2m9q" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/orders/ord_4f8k2m9q", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/orders/ord_4f8k2m9q`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

---

LocalSERP Proxy: LocalSERP Proxy는 도시별로 지역 검색 결과, 광고와 가격을 확인하는 미국 레지덴셜 프록시 서비스로, 암호화폐로 결제하며 신분증 업로드가 필요 없습니다.
