# Ukwengeza imali nge-crypto

> I-API ye-AfricaProxies: ukwengeza i-crypto, inani eliqondile, inkokhelo ithunyelwe (TXID ayiphoqelekile), isimo, curl, Python ne-Node.js.

- URL: https://africaproxies.com/zu/docs/api/top-ups/
- Kuvini okugcwele: 2026-10-15
- UmphRhizisheli: AfricaProxies (https://africaproxies.com)

Engeza imali nge-crypto: thola ikheli lokufaka nenani eliqondile, uthumele lelo nani, ubike inkokhelo njengethunyelwe (i-ID yenkokhelo ayiphoqelekile), ulandele ukwengeza imali kuze kube imali isifakiwe. Imali esele ikhokhela noma yiliphi iphakheji lethu.

**Izindawo zokuxhumana kuleli khasi**

- `GET /v1/catalog/coins`: Izinhlobo ze-crypto namanethiwekhi amukelwayo (nekheli lawo elingaguquki lokufaka imali)
- `POST /v1/topups`: Qala ukwengeza imali nge-crypto (ikheli elingaguquki, inani eliqondile)
- `POST /v1/topups/{topUpId}/txid`: Bika inkokhelo njengethunyelwe (i-TXID ayiphoqelekile)
- `GET /v1/topups/{topUpId}`: Thola ukwengeza imali (buza isimo sakhona samanje)
- `GET /v1/topups`: Bhala uhlu lokwengezwa kwemali nge-crypto

I-URL eyisisekelo `https://africaproxies.com/api/v1`. Ukuqinisekisa ukungena, amaphutha nemikhawulo: bheka [isifinyezo se-API](/zu/docs/api/).

## Izinhlobo ze-crypto namanethiwekhi amukelwayo (nekheli lawo elingaguquki lokufaka imali)

`GET /v1/catalog/coins`

Okungagqizile: akudingi i-key ye-API.

**Impendulo** `200 OK`

```json
{
  "data": [
    {
      "code": "BTC",
      "name": "Bitcoin",
      "networks": [
        {
          "id": "bitcoin",
          "name": "Bitcoin",
          "confirmationsRequired": 2,
          "estimatedMinutes": null,
          "memoRequired": false,
          "address": "DEPOSIT_ADDRESS"
        }
      ]
    }
  ]
}
```

*curl*

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

*Python*

```python
import os
import requests

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

r = requests.get(f"{API}/catalog/coins", 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/coins`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Qala ukwengeza imali nge-crypto (ikheli elingaguquki, inani eliqondile)

`POST /v1/topups`

- I-`amountUsd` ≥ 25.00 USD futhi ≤ ubukhulu obuvunyelwe (10,000.00 ngokuzenzakalelayo): ngaphandle kwalokho `422` ku-`amountUsd`.
- I-`coin` + `network` kufanele kube kulokho okuku-`GET /v1/catalog/coins` (`409 coin_unavailable` ngaphandle kwalokho).
- Ibuyisa i-`address` yenethiwekhi **engaguquki** nenani eliqondile le-`amountCrypto` = `amountUsd` / `rate` elisondezwe **phezulu** ngokunemba kwe-crypto (BTC/LTC/ETH/SOL izindawo zedesimali 8, USDT/USDC zibe ngu-6), kufakwe nomehluko omncane ohlukile kumadijithi okugcina ukuze kungabikho ukwengezwa kwemali okubili okuvuliwe kunethiwekhi efanayo okucela inani elifanayo. I-`rate` igcinwa ingashintshi kuze kube ngu-`expiresAt` (imizuzu 30); `txidDeadline` = `expiresAt` + amahora 72.
- I-`purchase` ayiphoqelekile (umzimba ofana nowe-`POST /v1/orders`): iqinisekiswa ibekelwe nenani manje (`422` enamagama ezinkundla aqala ngo-`purchase.`, `409 plan_unavailable`…). I-`amountUsd` kufanele ihlanganise isamba se-`purchase` kususwe imali esele yamanje (`422 too_small` ku-`amountUsd`). Lapho imali eyengeziwe isifakiwe, i-oda lithengwa ngemali esele kukho lokho kuthengiselana okufanayo; i-`purchase.status` iba ngu-`completed` (no-`orderId`) noma ngu-`failed` (`failureReason`; imali ihlala ku-akhawunti).

Ukungena: isikhonkeyi API ku-header `Authorization: Bearer API_KEY`.

**Izinhinto**

| Igama | Ku- | Uhlobo | Kudingekile | Incazelo |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Cha | Ukhiye ohlukile (njenge-UUID) wokuphinda uzame i-POST ngokuphepha. Ugcinwa amahora 24. — izinhlamvu ezingadluli ku-128 |

**Umzimba wesicelo**

| Isibaya | Uhlobo | Kudingekile | Incazelo |
| --- | --- | --- | --- |
| `amountUsd` | string (USD, 2 decimals) | Yebo | Ama-USD okungezwa: ≥ 25.00, ≤ 10,000.00 ngokuzenzakalelayo. |
| `coin` | string | Yebo | — |
| `network` | string | Yebo | — |
| `purchase` | object | Cha | Iphakheji ezothengwa ngemali esele lapho imali eyengeziwe isifakiwe (umzimba ofana nowe-`POST /v1/orders`). |

*Isibonelo: Imali esele*

```json
{
  "amountUsd": "50.00",
  "coin": "USDT",
  "network": "tron"
}
```

*Isibonelo: Ukukhokha*

```json
{
  "amountUsd": "25.00",
  "coin": "BTC",
  "network": "bitcoin",
  "purchase": {
    "planId": "res-10",
    "quantity": 1
  }
}
```

**Impendulo** `201 Created`

```json
{
  "id": "top_7d2kq9x1",
  "status": "verifying",
  "final": false,
  "amountUsd": "25.00",
  "coin": "USDT",
  "network": "tron",
  "address": "DEPOSIT_ADDRESS",
  "amountCrypto": "25.000137",
  "rate": "1.00",
  "paymentUri": "PAYMENT_URI",
  "expiresAt": "2026-10-05T14:33:11Z",
  "txidDeadline": "2026-10-08T14:33:11Z",
  "confirmationsRequired": 20,
  "confirmations": 7,
  "txid": "9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "txidSubmittedAt": "2026-10-05T14:09:42Z",
  "amountReceivedCrypto": "25.000137",
  "explorerUrl": "https://tronscan.org/#/transaction/9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "creditedUsd": null,
  "creditedAt": null,
  "rejection": null,
  "purchase": {
    "planId": "res-10",
    "planName": "Team",
    "quantity": 1,
    "options": {},
    "promoCode": null,
    "total": "5.94",
    "status": "pending",
    "orderId": null,
    "failureReason": null
  },
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s -X POST "https://africaproxies.com/api/v1/topups" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"amountUsd":"50.00","coin":"USDT","network":"tron"}'
```

*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}/topups", headers=HEADERS, json={"amountUsd": "50.00", "coin": "USDT", "network": "tron"}, 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}/topups`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Idempotency-Key': randomUUID(), 'Content-Type': 'application/json' },
  body: JSON.stringify({ amountUsd: '50.00', coin: 'USDT', network: 'tron' }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Bika inkokhelo njengethunyelwe (i-TXID ayiphoqelekile)

`POST /v1/topups/{topUpId}/txid`

Bika inkokhelo njengethunyelwe lapho isiphumile esikhwameni sakho noma endaweni yokushintshana: lena inguqulo ye-API yenkinobho ethi “Ngiyithumelile inkokhelo”. I-ID yenkokhelo (TXID) ayiphoqelekile: thumela umzimba ongenalutho (`{}`), noma wengeze `txid` uma unayo. Inkokhelo ifaniswa nalokhu kwengeza imali ngenani layo eliqondile (`amountCrypto`) kunethiwekhi nasekhelini lokwengeza imali, ngakho thumela lelo nani eliqondile.

Yamukelwa ngesikhathi ukwengeza imali kungu-`awaiting_payment`, `expired` noma `rejected`, nangaphambi kuka-`txidDeadline` (`expiresAt` + amahora 72): ukubika sekwephuzile akulahli inkokhelo. Uma kunikezwe i-`txid`, ihlolwa ngefomethi yenethiwekhi (`422` ku-`txid`), futhi akufanele isetshenziswe kokunye ukwengeza imali (`409 txid_already_used`). Ukwengeza imali okuvaliwe kubuyisa `409 topup_closed`. Ukwengeza imali kube sekuba ngu-`verifying` ngesikhathi inkokhelo ihlolwa ku-blockchain, kugcine kungu-`credited` lapho inethiwekhi isiqinisekise inkokhelo, noma kube ngu-`rejected` (no-`rejection`).

Ukungena: isikhonkeyi API ku-header `Authorization: Bearer API_KEY`.

**Izinhinto**

| Igama | Ku- | Uhlobo | Kudingekile | Incazelo |
| --- | --- | --- | --- | --- |
| `topUpId` | path | string | Yebo | — |

**Umzimba wesicelo**

| Isibaya | Uhlobo | Kudingekile | Incazelo |
| --- | --- | --- | --- |
| `txid` | string | Cha | Ayiphoqelekile. I-hash yenkokhelo: izinhlamvu ze-hex ezingu-64 (bitcoin, litecoin, tron), 0x + izinhlamvu ze-hex ezingu-64 (ethereum), isiginesha ye-base58 (solana). Uma ingenalutho noma ingekho: inkokhelo ifaniswa nenani layo eliqondile. — izinhlamvu ezingadluli ku-128 |

*Isibonelo: Inkokhelo ithunyelwe*

```json
{}
```

*Isibonelo: Nge-TXID (ayiphoqelekile)*

```json
{
  "txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
}
```

**Impendulo** `200 OK`

```json
{
  "id": "top_7d2kq9x1",
  "status": "verifying",
  "final": false,
  "amountUsd": "25.00",
  "coin": "USDT",
  "network": "tron",
  "address": "DEPOSIT_ADDRESS",
  "amountCrypto": "25.000137",
  "rate": "1.00",
  "paymentUri": "PAYMENT_URI",
  "expiresAt": "2026-10-05T14:33:11Z",
  "txidDeadline": "2026-10-08T14:33:11Z",
  "confirmationsRequired": 20,
  "confirmations": 7,
  "txid": "9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "txidSubmittedAt": "2026-10-05T14:09:42Z",
  "amountReceivedCrypto": "25.000137",
  "explorerUrl": "https://tronscan.org/#/transaction/9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "creditedUsd": null,
  "creditedAt": null,
  "rejection": null,
  "purchase": {
    "planId": "res-10",
    "planName": "Team",
    "quantity": 1,
    "options": {},
    "promoCode": null,
    "total": "5.94",
    "status": "pending",
    "orderId": null,
    "failureReason": null
  },
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s -X POST "https://africaproxies.com/api/v1/topups/top_7d2kq9x1/txid" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

*Python*

```python
import os
import requests

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

r = requests.post(f"{API}/topups/top_7d2kq9x1/txid", headers=HEADERS, json={}, 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}/topups/top_7d2kq9x1/txid`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({}),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Thola ukwengeza imali (buza isimo sakhona samanje)

`GET /v1/topups/{topUpId}`

Buza le ndlela ukuze ulandele ukwengeza imali: njalo ngemizuzwana 10 uma `status = verifying`, njalo ngemizuzwana 30 uma kulindwe inkokhelo, ume uma `final = true`. Ukwengeza imali kuba ngu-`expired` uma inkokhelo ingabikwanga njengethunyelwe ngaphambi kuka-`expiresAt`; isengabikwa kuze kube ngu-`txidDeadline`.

Ukungena: isikhonkeyi API ku-header `Authorization: Bearer API_KEY`.

**Izinhinto**

| Igama | Ku- | Uhlobo | Kudingekile | Incazelo |
| --- | --- | --- | --- | --- |
| `topUpId` | path | string | Yebo | — |

**Impendulo** `200 OK`

```json
{
  "id": "top_7d2kq9x1",
  "status": "verifying",
  "final": false,
  "amountUsd": "25.00",
  "coin": "USDT",
  "network": "tron",
  "address": "DEPOSIT_ADDRESS",
  "amountCrypto": "25.000137",
  "rate": "1.00",
  "paymentUri": "PAYMENT_URI",
  "expiresAt": "2026-10-05T14:33:11Z",
  "txidDeadline": "2026-10-08T14:33:11Z",
  "confirmationsRequired": 20,
  "confirmations": 7,
  "txid": "9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "txidSubmittedAt": "2026-10-05T14:09:42Z",
  "amountReceivedCrypto": "25.000137",
  "explorerUrl": "https://tronscan.org/#/transaction/9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "creditedUsd": null,
  "creditedAt": null,
  "rejection": null,
  "purchase": {
    "planId": "res-10",
    "planName": "Team",
    "quantity": 1,
    "options": {},
    "promoCode": null,
    "total": "5.94",
    "status": "pending",
    "orderId": null,
    "failureReason": null
  },
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s "https://africaproxies.com/api/v1/topups/top_7d2kq9x1" \
  -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}/topups/top_7d2kq9x1", 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}/topups/top_7d2kq9x1`, {
  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());
```

## Bhala uhlu lokwengezwa kwemali nge-crypto

`GET /v1/topups`

Ukungena: isikhonkeyi API ku-header `Authorization: Bearer API_KEY`.

**Izinhinto**

| Igama | Ku- | Uhlobo | Kudingekile | Incazelo |
| --- | --- | --- | --- | --- |
| `page` | query | integer | Cha | ≥ 1, okuzenzakalelayo `1` |
| `perPage` | query | integer | Cha | 1–100, okuzenzakalelayo `20` |
| `status` | query | `awaiting_payment` · `verifying` · `credited` · `rejected` · `expired` | Cha | I-`final` = imali ifakiwe, noma iphelelwe isikhathi/yenqatshiwe ngemva kuka-`txidDeadline`. |

**Impendulo** `200 OK`

```json
{
  "data": [
    {
      "id": "top_7d2kq9x1",
      "status": "verifying",
      "final": false,
      "amountUsd": "25.00",
      "coin": "USDT",
      "network": "tron",
      "address": "DEPOSIT_ADDRESS",
      "amountCrypto": "25.000137",
      "rate": "1.00",
      "paymentUri": "PAYMENT_URI",
      "expiresAt": "2026-10-05T14:33:11Z",
      "txidDeadline": "2026-10-08T14:33:11Z",
      "confirmationsRequired": 20,
      "confirmations": 7,
      "txid": "9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
      "txidSubmittedAt": "2026-10-05T14:09:42Z",
      "amountReceivedCrypto": "25.000137",
      "explorerUrl": "https://tronscan.org/#/transaction/9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
      "creditedUsd": null,
      "creditedAt": null,
      "rejection": null,
      "purchase": {
        "planId": "res-10",
        "planName": "Team",
        "quantity": 1,
        "options": {},
        "promoCode": null,
        "total": "5.94",
        "status": "pending",
        "orderId": null,
        "failureReason": null
      },
      "createdAt": "2026-10-05T14:03:11Z"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 20,
    "total": 1,
    "totalPages": 1
  }
}
```

*curl*

```bash
curl -s "https://africaproxies.com/api/v1/topups" \
  -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}/topups", 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}/topups`, {
  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 ingumhlinzeki wama-proxy e-IP yasekhaya e-Afrika eseningizimu yeSahara; kukhokhwa nge-crypto ngaphandle kokulayisha umazisi.
