# ትዕዛዞች

> የAfricaProxies API፦ የትራፊክ እቅዶችና ዋጋዎች፣ እቅድ ከቀሪ ሂሳብ የመግዛት ሂደትና የቀድሞ ትዕዛዞች ታሪክ። የጥያቄ መለኪያዎች፣ የምላሽ ምሳሌዎችና የcurl፣ Python እና Node.js ኮድ።

- URL: https://africaproxies.com/am/docs/api/orders/
- የመጨረሻው መዘመን: 2026-10-15
- አሳቢ: AfricaProxies (https://africaproxies.com)

እቅዶችንና ዋጋዎቻቸውን ይዘርዝሩ፣ ከቀሪ ሂሳብ እቅድ ይግዙ (አዲስ አገልግሎት፣ ተጨማሪ ትራፊክ ወይም የፖርት ጊዜ ማራዘም)፣ የቀድሞ ትዕዛዞችዎንም ያንብቡ።

**በዚህ ገጽ ያሉ መዳረሻዎች**

- `GET /v1/catalog/products`: ምርቶች፣ እቅዶችና ዋጋዎች
- `POST /v1/orders`: ከቀሪ ሂሳብ እቅድ ይግዙ (አዲስ አገልግሎት፣ ተጨማሪ ትራፊክ ወይም የፖርት ጊዜ ማራዘም)
- `GET /v1/orders`: ትዕዛዞችን ይዘርዝሩ
- `GET /v1/orders/{orderId}`: ትዕዛዝ ያግኙ

መሠረታዊ URL `https://africaproxies.com/api/v1`። የመለያ ማረጋገጫ፣ ስህተቶችና ገደቦች፦ [የAPI አጠቃላይ መግለጫ](/am/docs/api/) ይመልከቱ።

## ምርቶች፣ እቅዶችና ዋጋዎች

`GET /v1/catalog/products`

እያንዳንዱ ምርት ከእቅዶቹና ከዋጋዎቹ ጋር፣ ሲያዝዙ በሚከፈለው ልክ።

የሕዝብ፡ ምንም API ቁልፍ አያስፈልግም።

**ምላሽ** `200 OK`

```json
{
  "data": [
    {
      "id": "residential",
      "name": "Residential proxies",
      "description": "Residential IPs across 49 African locations for public price research, local SEO and your application tests. Prepaid traffic, billed per GB.",
      "unit": "GB",
      "plans": [
        {
          "id": "res-10",
          "productId": "residential",
          "name": "Team",
          "quantity": 10,
          "unit": "GB",
          "durationDays": null,
          "price": "5.94",
          "pricePerUnit": "0.59",
          "popular": false,
          "features": [
            "Prepaid traffic never expires",
            "Country and city where available",
            "Project credentials and traffic caps"
          ],
          "available": true,
          "countries": null
        }
      ]
    }
  ]
}
```

*curl*

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

*Python*

```python
import os
import requests

API = "https://africaproxies.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://africaproxies.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`)፣ ከቀሪ ሂሳብ ይቀንሳል፣ አገልግሎቱ ይፈጠራል ወይም ይራዘማል፣ ትዕዛዙም ከ `fulfillment` ጋር `completed` ሆኖ ይመለሳል። የproxy መግቢያ መረጃዎች ወዲያውኑ ይገኛሉ።

- **አዲስ የመኖሪያ ኔትወርክ ትራፊክ**፦ `{ "planId": "res-10" }`።
- **አዲስ የሚለዋወጥ 4G/5G ትራፊክ (በ GB)**፦ `{ "planId": "mgb-10" }` (`productId: "mobile-gb"` ያለው የትራፊክ ምዝገባ፣ በ `fulfillment.residentialSubscriptionId` ይቀርባል)።
- **ባለ ምዝገባ ላይ ትራፊክ ይጨምሩ**፦ `{ "planId": "res-10", "options": { "subscriptionId": "res_9x2m4k" } }`፤ እቅዱ የምዝገባው ምርት መሆን አለበት።
- **አዲስ የሞባይል ፖርት/ፖርቶች**፦ `{ "planId": "mob-30d", "quantity": 1, "options": { "country": "AE" } }`፣ በአማራጭ `carrier` ሊጨመር ይችላል (የአገር ኦፕሬተሮችን በ[የሞባይል ፖርቶች](/am/docs/api/mobile/) ይመልከቱ)። የዞን እቅዶች የዞናቸውን አገሮች ብቻ ይሸፍናሉ (ካልሆነ በ `options.country` ላይ `422`)።
- **የሞባይል ፖርት ጊዜ ያራዝሙ**፦ `{ "planId": "mob-7d", "options": { "portId": "mob_2v8k1q" } }` የእቅዱን ቆይታ ወደ `expiresAt` ይጨምራል።

**ቀሪ ሂሳብ አይበቃም → `402 insufficient_balance`**፣ ከጎደለው መጠንና ከተጠቆመ መሙያ ጋር በ `error.details` (`missing`፣ `suggestedTopUp`)። በማንኛውም ስህተት ገንዘብ አይቀነስም። ልዩነቱን ለመክፈል፣ በ `purchase` ውስጥ ያንኑ ጥያቄ የያዘ መሙያ ይጀምሩ (`POST /v1/topups`)፤ መሙያው ወደ ሂሳብ እንደተጨመረ እቅዱ ይገዛል።

ማረጋገጫ፦ የAPI ቁልፍ በ`Authorization: Bearer API_KEY` ራስጌ ውስጥ።

**ፓራሜትሮች**

| ስም | በ | ዓይነት | አስፈላጊ | መግለጫ |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | አይደለም | POST በደህንነት እንደገና ለመሞከር ልዩ ቁልፍ (ለምሳሌ UUID)። ለ24 ሰዓት ይቆያል። — እስከ 128 ቁምፊዎች |

**የጥያቄ አካል**

| መስክ | ዓይነት | አስፈላጊ | መግለጫ |
| --- | --- | --- | --- |
| `planId` | string | አዎ | — |
| `quantity` | integer | አይደለም | 1–100፣ ነባሪ `1` |
| `options` | object | አይደለም | — |

*ምሳሌ: የመኖሪያ ኔትወርክ*

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

*ምሳሌ: የሞባይል ፖርቶች*

```json
{
  "planId": "mob-30d",
  "quantity": 1,
  "options": {
    "country": "AE",
    "carrier": "etisalat",
    "autoRenew": true
  }
}
```

*ምሳሌ: የፖርት ጊዜ ማራዘም*

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

*ምሳሌ: የሞባይል ትራፊክ*

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

*ምሳሌ: የዞን ፖርት*

```json
{
  "planId": "mob-30d",
  "options": {
    "country": "AE",
    "carrier": "etisalat"
  }
}
```

**ምላሽ** `201 Created`

```json
{
  "id": "ord_4f8k2m9q",
  "status": "completed",
  "productId": "residential",
  "planId": "res-10",
  "planName": "Team",
  "quantity": 1,
  "unitPrice": "5.94",
  "subtotal": "5.94",
  "discount": "0.00",
  "total": "5.94",
  "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://africaproxies.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://africaproxies.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://africaproxies.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`

ማረጋገጫ፦ የAPI ቁልፍ በ`Authorization: Bearer API_KEY` ራስጌ ውስጥ።

**ፓራሜትሮች**

| ስም | በ | ዓይነት | አስፈላጊ | መግለጫ |
| --- | --- | --- | --- | --- |
| `page` | query | integer | አይደለም | ≥ 1፣ ነባሪ `1` |
| `perPage` | query | integer | አይደለም | 1–100፣ ነባሪ `20` |
| `status` | query | `completed` · `cancelled` | አይደለም | ትዕዛዞች የተከፈሉ ሆነው ይፈጠራሉ (ከቀሪ ሂሳብ ይቀነሳሉ)። `completed` — ተከፍሏልና ቀርቧል (የመግቢያ መረጃዎች ወዲያውኑ ይገኛሉ)። |
| `productId` | query | string | አይደለም | ከካታሎጉ የምርት መለያ። ለ AfricaProxies ያሉ እሴቶች፦ `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": "Team",
      "quantity": 1,
      "unitPrice": "5.94",
      "subtotal": "5.94",
      "discount": "0.00",
      "total": "5.94",
      "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://africaproxies.com/api/v1/orders" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://africaproxies.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://africaproxies.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}`

ማረጋገጫ፦ የAPI ቁልፍ በ`Authorization: Bearer API_KEY` ራስጌ ውስጥ።

**ፓራሜትሮች**

| ስም | በ | ዓይነት | አስፈላጊ | መግለጫ |
| --- | --- | --- | --- | --- |
| `orderId` | path | string | አዎ | — |

**ምላሽ** `200 OK`

```json
{
  "id": "ord_4f8k2m9q",
  "status": "completed",
  "productId": "residential",
  "planId": "res-10",
  "planName": "Team",
  "quantity": 1,
  "unitPrice": "5.94",
  "subtotal": "5.94",
  "discount": "0.00",
  "total": "5.94",
  "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://africaproxies.com/api/v1/orders/ord_4f8k2m9q" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://africaproxies.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://africaproxies.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());
```

---

AfricaProxies: AfricaProxies በሰሃራ በታች ላለው አፍሪካ የመኖሪያ IP proxy አቅራቢ ነው፤ ክፍያው በክሪፕቶ ነው፣ መታወቂያ መጫን አያስፈልግም።
