# Siparişler

> LocalSERP Proxy API: paketler ve fiyatlar, bakiyeden paket satın alma ve sipariş geçmişi. Parametreler, örnek yanıtlar, curl, Python ve Node.js kodu.

- URL: https://localserpproxy.com/tr/docs/api/orders/
- Son güncelleme: 2026-10-15
- Publisher: LocalSERP Proxy (https://localserpproxy.com)

Planları ve fiyatlarını listeleyin, bakiyenizle plan satın alın (yeni hizmet, daha fazla trafik veya port uzatma) ve geçmiş siparişlerinizi görüntüleyin.

**Bu sayfadaki uç noktalar**

- `GET /v1/catalog/products`: Ürünler, paketler ve fiyatlar
- `POST /v1/orders`: Bakiyeden paket satın al (yeni hizmet, daha fazla trafik veya port uzatma)
- `GET /v1/orders`: Siparişleri listele
- `GET /v1/orders/{orderId}`: Sipariş bilgilerini al

Temel URL `https://localserpproxy.com/api/v1`. Kimlik doğrulama, hatalar ve limitler için [API genel bakışına](https://localserpproxy.com/tr/docs/api/) bakın.

## Ürünler, paketler ve fiyatlar

`GET /v1/catalog/products`

Sipariş verirken ücretlendirildiği şekliyle tüm ürünler, paketleri ve fiyatları.

Herkese açık: API anahtarı gerekmez.

**Yanıt** `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());
```

## Bakiyeden plan satın alın (yeni hizmet, daha fazla trafik veya port süresini uzatma)

`POST /v1/orders`

Ödeme her zaman ön ödemeli bakiyeden yapılır: fiyat API tarafından hesaplanır (katalog fiyatı × `quantity`), tutar bakiyeden düşülür, hizmet oluşturulur veya süresi uzatılır ve sipariş `fulfillment` bilgisiyle birlikte `completed` olarak döner. Proxy kimlik bilgileri hemen kullanılabilir.

- **Yeni residential proxy (konut proxy) trafiği**: `{ "planId": "res-10" }`.
- **Yeni dönen 4G/5G trafiği (GB başına)**: `{ "planId": "mgb-10" }` (`productId: "mobile-gb"` içeren bir trafik aboneliği, `fulfillment.residentialSubscriptionId` içinde teslim edilir).
- **Mevcut aboneliğe trafik ekleme**: `{ "planId": "res-10", "options": { "subscriptionId": "res_9x2m4k" } }`: plan, aboneliğin ürününe ait olmalıdır.
- **Yeni mobil port(lar)**: `{ "planId": "mob-us-30d", "quantity": 1, "options": { "country": "US" } }`, isteğe bağlı olarak `carrier` ile ([Mobil portlar](https://localserpproxy.com/tr/docs/api/mobile/) bölümünde bir ülkenin operatörlerini görün). Bölge planları yalnızca kendi bölgelerindeki ülkeleri kapsar (aksi durumda `options.country` üzerinden `422`).
- **Mobil port süresini uzatma**: `{ "planId": "mob-us-7d", "options": { "portId": "mob_2v8k1q" } }`, planın süresini `expiresAt` üzerine ekler.

**Bakiye yetersiz → `402 insufficient_balance`**; eksik tutar ve önerilen bakiye yükleme miktarı `error.details` içinde gösterilir (`missing`, `suggestedTopUp`). Hata durumunda hiçbir tutar bakiyeden düşülmez. Aradaki farkı ödemek için `purchase` içinde aynı isteği içeren bir bakiye yükleme işlemi başlatın (`POST /v1/topups`): bakiye yüklendiğinde plan satın alınır.

Kimlik doğrulama: `Authorization: Bearer API_KEY` başlığında API anahtarı.

**Parametreler**

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Hayır | POST isteğini güvenle yeniden denemek için benzersiz anahtar (ör. UUID). 24 saat saklanır. — en fazla 128 karakter |

**İstek gövdesi**

| Alan | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- |
| `planId` | string | Evet | — |
| `quantity` | integer | Hayır | 1–100, varsayılan `1` |
| `options` | object | Hayır | — |

*Örnek: Residential*

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

*Örnek: Mobil Portlar*

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

*Örnek: Port Süresini Uzat*

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

*Örnek: Mobil Trafik*

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

*Örnek: Bölge Portu*

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

**Yanıt** `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());
```

## Siparişleri listele

`GET /v1/orders`

Kimlik doğrulama: `Authorization: Bearer API_KEY` başlığında API anahtarı.

**Parametreler**

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `page` | query | integer | Hayır | ≥ 1, varsayılan `1` |
| `perPage` | query | integer | Hayır | 1–100, varsayılan `20` |
| `status` | query | `completed` · `cancelled` | Hayır | Siparişler, ödemesi yapılmış (bakiyeden düşülmüş) olarak oluşturulur. `completed` — ödemesi yapılmış ve teslim edilmiş (kimlik bilgileri hemen kullanılabilir). |
| `productId` | query | string | Hayır | Katalogdaki ürün kimliği. LocalSERP Proxy değerleri: `residential` (GB), `mobile` (özel 4G/5G portları) ve `mobile-gb` (GB başına dönen 4G/5G trafiği). İstemciler bilinmeyen değerleri desteklemelidir. |

**Yanıt** `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());
```

## Sipariş al

`GET /v1/orders/{orderId}`

Kimlik doğrulama: `Authorization: Bearer API_KEY` başlığında API anahtarı.

**Parametreler**

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `orderId` | path | string | Evet | — |

**Yanıt** `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, yerel arama sonuçlarını, reklamları ve fiyatları şehir şehir kontrol etmek için kullanılan, kripto ile ödeme yapılan ve kimlik belgesi yüklemeyi gerektirmeyen bir ABD konut proxy hizmetidir.
