# Bestellungen

> AfricaProxies-API: Tarife, Preise, Kauf mit Guthaben und Bestellverlauf. Parameter, Beispielantworten und Code in curl, Python und Node.js.

- URL: https://africaproxies.com/de/docs/api/orders/
- Zuletzt aktualisiert: 2026-10-15
- Herausgeber: AfricaProxies (https://africaproxies.com)

Tarife und Preise auflisten, einen Tarif mit Guthaben kaufen (neuer Dienst, mehr Datenvolumen oder Port-Verlängerung) und bisherige Bestellungen lesen.

**Endpunkte auf dieser Seite**

- `GET /v1/catalog/products`: Produkte, Tarife und Preise
- `POST /v1/orders`: Tarif mit Guthaben kaufen (neuer Dienst, mehr Daten oder Port-Verlängerung)
- `GET /v1/orders`: Bestellungen auflisten
- `GET /v1/orders/{orderId}`: Bestellung abrufen

Basis-URL `https://africaproxies.com/api/v1`. Authentifizierung, Fehler und Limits: siehe [API-Übersicht](/de/docs/api/).

## Produkte, Tarife und Preise

`GET /v1/catalog/products`

Jedes Produkt mit seinen Tarifen und Preisen, genau wie bei der Bestellung berechnet.

Öffentlich: kein API-Schlüssel erforderlich.

**Antwort** `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());
```

## Tarif mit Guthaben kaufen (neuer Dienst, mehr Daten oder Port-Verlängerung)

`POST /v1/orders`

Die Zahlung erfolgt immer aus dem vorausbezahlten Guthaben: Die API berechnet den Preis (Katalogpreis × `quantity`), belastet das Guthaben, erstellt oder verlängert den Dienst und liefert die Bestellung als `completed` mit ihrer `fulfillment` zurück. Die Proxy-Zugangsdaten sind sofort verfügbar.

- **Neues Residential-Datenvolumen**: `{ "planId": "res-10" }`.
- **Neues rotierendes 4G/5G-Datenvolumen (pro GB)**: `{ "planId": "mgb-10" }` (Datenabo mit `productId: "mobile-gb"`, bereitgestellt in `fulfillment.residentialSubscriptionId`).
- **Daten zu einem bestehenden Abo hinzufügen**: `{ "planId": "res-10", "options": { "subscriptionId": "res_9x2m4k" } }`: Der Tarif muss zum Produkt des Abos gehören.
- **Neue mobile Ports**: `{ "planId": "mob-30d", "quantity": 1, "options": { "country": "AE" } }`, optional mit `carrier` (Mobilfunkanbieter eines Landes unter [Mobile Ports](/de/docs/api/mobile/)). Zonen-Tarife gelten nur für Länder ihrer Zone (andernfalls `422` bei `options.country`).
- **Mobilen Port verlängern**: `{ "planId": "mob-7d", "options": { "portId": "mob_2v8k1q" } }` addiert die Tarifdauer zu `expiresAt`.

**Guthaben zu niedrig → `402 insufficient_balance`**, mit fehlendem Betrag und Aufladungsvorschlag in `error.details` (`missing`, `suggestedTopUp`). Bei Fehlern erfolgt keine Abbuchung. Um die Differenz zu zahlen, starte eine Aufladung mit derselben Anfrage in `purchase` (`POST /v1/topups`): Der Tarif wird gekauft, sobald die Aufladung gutgeschrieben wird.

Authentifizierung: API Schlüssel im `Authorization: Bearer API_KEY` Header.

**Parameter**

| Name | In | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Nein | Eindeutiger Schlüssel (z. B. eine UUID) zum sicheren Wiederholen eines POST. 24 h gespeichert. — max. 128 Zeichen |

**Anfragekörper**

| Feld | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `planId` | string | Ja | — |
| `quantity` | integer | Nein | 1–100, Standard `1` |
| `options` | object | Nein | — |

*Beispiel: Residential*

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

*Beispiel: Mobile Ports*

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

*Beispiel: Port verlängern*

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

*Beispiel: Mobiles Datenvolumen*

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

*Beispiel: Zonen-Port*

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

**Antwort** `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());
```

## Bestellungen auflisten

`GET /v1/orders`

Authentifizierung: API Schlüssel im `Authorization: Bearer API_KEY` Header.

**Parameter**

| Name | In | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- | --- |
| `page` | query | integer | Nein | ≥ 1, Standard `1` |
| `perPage` | query | integer | Nein | 1–100, Standard `20` |
| `status` | query | `completed` · `cancelled` | Nein | Bestellungen werden bereits bezahlt angelegt (vom Guthaben abgezogen). `completed` — bezahlt und bereitgestellt (Zugangsdaten sofort verfügbar). |
| `productId` | query | string | Nein | Produkt-ID aus dem Katalog. Werte für AfricaProxies: `residential` (GB), `mobile` (dedizierte 4G/5G-Ports) und `mobile-gb` (rotierendes 4G/5G-Datenvolumen pro GB). Clients müssen unbekannte Werte tolerieren. |

**Antwort** `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());
```

## Bestellung abrufen

`GET /v1/orders/{orderId}`

Authentifizierung: API Schlüssel im `Authorization: Bearer API_KEY` Header.

**Parameter**

| Name | In | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- | --- |
| `orderId` | path | string | Ja | — |

**Antwort** `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 ist ein Anbieter von Residential Proxys für Subsahara-Afrika, mit Kryptozahlung und ohne Hochladen eines Ausweises.
